Caffe CNN:用于分层分类的多个分层损失 [英] Caffe CNN: multiple hierarchical losses for hierarchical classification

查看:146
本文介绍了Caffe CNN:用于分层分类的多个分层损失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am familiar with how to use multiple loss in a CNN while all the labels of these loss are identical.

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

My case here is handling hierarchical labels using multiple losses, as shown in figure bellow:

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

loss1 is responsible for labelset1:{Sport, Food}. loss2 for labelset2:{volley, soccer}, loss3 for labelset3:{Pizza, Pasta, burger}. For example, Sample A∈{sport, soccer}, sample B∈{food,burger}.

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

Any ideas how to do this?

推荐答案

添加无关"标签,每个样本应具有三个标签.例如:{sports, volleyball, don't care}.
然后,您可以得到类型"SoftmaxWithLoss"的三个损失.对于这两个特定的损失,您应该在不在乎"标签上添加ignore_label.

Adding "don't care" lables, you should have three labels for each sample. For example: {sports, volleyball, don't care}.
Then you can have the three losses of type "SoftmaxWithLoss". For the two specific losses you should add ignore_label for the don't care labels.

这篇关于Caffe CNN:用于分层分类的多个分层损失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆