如何使用Caffe暹罗CNN强制执行代表标签概率的特征向量? [英] How to enforce feature vector representing label probability with Caffe siamese CNN?

查看:86
本文介绍了如何使用Caffe暹罗CNN强制执行代表标签概率的特征向量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关在映像目录外为暹罗网络创建CaffeDB培训数据

如果我有N标签.如何强制在对比损失层之前大小为N的特征向量代表每种类别的某种概率?还是自动采用暹罗网络设计的?

If I have N labels. How can I enforce, that the feature vector of size N right before the contrastive loss layer represents some kind of probability for each class? Or comes that automatically with the siamese net design?

推荐答案

如果仅在暹罗网络中使用对比损失,则无法强制将网络分类为正确的标签-因为仅使用相同/不相同"信息,并且不知道不同类的语义.

If you only use contrastive loss in a Siamese network, there is no way of forcing the net to classify into the correct label - because the net is only trained using "same/not same" information and does not know the semantics of the different classes.

您可以做的是训练多个损失层.
您应该着眼于训练足以在您的域中使用的特征表示,以便查看某些输入(在某些高维度上)的训练过的特征向量,您应该能够轻松地将该输入分类为正确的类.而且,考虑到两个输入的特征表示,一个输入应该能够轻松地说出它们是相同"还是不同".
因此,我建议您使用"bottom"作为两个"InnerProduct"层之一的输出来训练具有两个损耗层的深度网络.一种损失是对比损失.另一个损耗应该具有num_output: N的另一个"InnerProduct"层和一个"SoftmaxWithLoss"层.

What you can do is train with multiple loss layers.
You should aim at training a feature representation that is reach enough for your domain, so that looking at the trained feature vector of some input (in some high dimension) you should be able to easily classify that input to the correct class. Moreover, given that feature representation of two inputs one should be able to easily say if they are "same" or "not same".
Therefore, I recommend that you train your deep network with two loss layer with "bottom" as the output of one of the "InnerProduct" layers. One loss is the contrastive loss. The other loss should have another "InnerProduct" layer with num_output: N and a "SoftmaxWithLoss" layer.

在这项工作中使用了类似的概念: 孙,陈,王和唐通过联合身份验证进行深度学习人脸表示 NIPS 2014 .

A similar concept was used in this work: Sun, Chen, Wang and Tang Deep Learning Face Representation by Joint Identification-Verification NIPS 2014.

这篇关于如何使用Caffe暹罗CNN强制执行代表标签概率的特征向量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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