Caffe CNN:用于分层分类的多个分层损失

时间:2018-07-28 18:34:08

标签: neural-network deep-learning conv-neural-network caffe pycaffe

我熟悉如何在CNN中使用多重损失,而这些损失的所有标签都是相同的。

我的情况是使用多个损失处理层次结构标签,如下图所示:

enter image description here

loss1负责labelset1:{Sport,Food}。标签2的损失2:{排球,足球},标签3的损失3:{比萨,面食,汉堡}。例如,样本A∈{运动,足球},样本B∈{食品,汉堡}。

任何想法如何做到这一点?

1 个答案:

答案 0 :(得分:1)

添加“无关”标签,每个样品应具有三个标签。例如://don't need to declare anything just: #include <Windows.h> //insert this in the main function HWND handle = GetConsoleWindow(); // Hide ShowWindow(handle, SW_HIDE); // Show ShowWindow(handle, SW_SHOW);
然后,您可以得到{sports, volleyball, don't care}类型的三个损失。对于这两个特定的损失,您应该为无关标签添加"SoftmaxWithLoss"