【Person Re-ID】In Defense of the Triplet Loss for Person Re-Identification
来源:互联网 发布:angular tooltips.js 编辑:程序博客网 时间:2024/05/29 03:18
paper下载地址:https://arxiv.org/abs/1703.07737
code下载地址:https://github.com/VisualComputingInstitute/triplet-reid
Introduction
本文主要是针对triplet loss做的改进:triplet loss最重要的步骤就是hard-mining,而在选择hard-example过程中存在几个问题:
- 耗时且无法明确定义什么是“good”hard triplets
- 选择太难的example会导致训练不稳定
- 当训练数据很大时,无法覆盖足够多的triplets
Learning Metric Embeddings
这一节主要介绍集中metric learning方法
Large Margin Nearest Neighbor loss
其中,
Triplet loss
Triplet loss是人脸识别与认证中最常用的loss,其形式为
其中
而在标准的triplet loss实现当中,经常是一个三元组输入到网络中,假设batchsize=3B,则最终产生B个triplets。但这种组合最多可能达到
Batch Hard Triplet loss
改进之一是在一个batch里面随机选取P类,每类随机选取K张图片,并且按照类别顺序排好,然后对每个sample,选取最难的同一类的正例(距离最大的)和最难的不同类的负例(距离最小的)组成一个triplet来计算loss,最终产生PK个有效的loss。
Batch All Triplet loss
另外一种改进是将一个batch中所有的positive pairs都考虑进来,最终产生
但是这种改进考虑了一个batch里面的所有anchor-positive pair,因此是非常耗时的。而当训练到后期时,由于许多样例已经被正确分类,导致很多“冗余”,从而覆盖了很“宝贵”的hard exam。
Lifted Embedding loss
这种形式的loss是将positive pair之外所有的负例均会考虑,然后优化Loss的平滑边界。
可想而知,这个loss的计算也是非常耗时的。
作者对这个loss的推广是
这个loss不仅考虑了所有的负例,属于同一类的所有的anchor-positive pair也会考虑。
Distance Measure
在本文中,作者的所有的度量方式均为未平方的都是距离,即
Soft-margin
在hinge loss function中,
Experiments
作者的实验分为两部分:一,评估各种不同变种triplet loss的性能;二,选择性能好的变种triplet loss在person-ReID任务中进行实验。第二部分中使用了pretrained model 和 trained from scrach。
Training
pritrained model :作者将已经在imageNet上训练好的resnet-50的最后一层换为两个全连接层,第一个全连接层有1024个输出,后面接BN和ReLU,第二个全连接层有128个输出,作者称之为TriNet。
Trained from Scratch :作者称之为LuNet。
- 没有Hard Mining的
Ltri 往往模型效果不好,如果加上简单的offline hard-mining(OHM),则效果很不稳定,有时候很好有时候完全崩掉 - Batch Hard形式的
LBH 整体表现好于 Batch All形式的LBA 。作者猜测,训练后期很多三元组loss都是0,然后平均处理时会把仅剩的有用的信息给稀释掉。为了证明该猜想,作者计算平均loss时只考虑那些不为0的,用LBA ≠0表示,发现效果确实会变好。 - 在作者的Re-ID实验中,Batch Hard + soft-margin的效果最好,但是不能保证在其他任务中这种组合依然是最好的,这需要更多的实验验证。
- 在Market-1501数据集上,pritrained model 获得了rank-1=84.92%的好成绩,经过re-ranking之后,更是达到了86.67%。而trained from scrach比pretrained要低2%~3%。但是pretrained model要受限于base model的输入大小,如果修改其输入很可能会得到相反的效果,如下表。trained from scrach则没有任何限制,因此trained from scrach通用性更强。
参考
【1】http://blog.csdn.net/shuzfan/article/details/70069822#experiments
- 【Person Re-ID】In Defense of the Triplet Loss for Person Re-Identification
- 【论文笔记】In Defense of the Triplet Loss for Person Re-Identification
- 【Person Re-ID】Margin Sample Mining Loss: A Deep Learning Based Method for Person Re-identification
- 行人检索--Beyond triplet loss: a deep quadruplet network for person re-identification
- 论文阅读:Multi-Scale Triplet CNN for Person Re-Identification
- 【Person Re-ID】Person Re-identification: Past, Present and Future
- 【Person Re-id】A Discriminatively Learned CNN Embedding for Person Re-identification
- Person Re-identification Datasets
- Person Re-identification Datasets
- Person Re-identification Overview
- Person Re-identification Overview
- Person Re-identification Datasets
- [paper note] Human-In-The-Loop Person Re-Identification
- 论文笔记之---Person Re-identification in the Wild
- dataset for person re-id
- Deep Metric Learning for Person Re-Identification
- Re-ID:AlignedReID: Surpassing Human-Level Performance in Person Re-Identification 论文解析
- 【论文笔记】Margin Sample Mining Loss: A Deep Learning Based Method for Person Re-identification
- El和JSTL
- 领先的H5、WebGL和WebVR作品分享平台,以虚拟魔力升华真实体验。
- Linux IO复用--select()和poll()
- js导出文件保存在本地
- spark-streaming
- 【Person Re-ID】In Defense of the Triplet Loss for Person Re-Identification
- CSS基础(7.初识margin)
- 5种语言的callback实现
- 字符串的交错组成 动态规划
- 为什么使用redis
- Gilde加载网络图片到TextView的DrawableTop
- SparkWordCount源码原理
- iOS UIView设置背景图片4种方式
- glup 构建一个完整的jquery项目