您的位置:首页 > Web前端

1604.Joint Detection and Identification Feature Learning for Person Search论文阅读笔记

2017-12-28 15:35 911 查看
前言:

Li et al. 和Ahmed et al. 提出方法:一对裁剪图像输入+binary verification loss 训练参数

Ding et al. 和Cheng et al. 提出方法:三图像输入(triplet sample)+binary triplet loss 训练参数,minimize the feature distance between the same person and maximize the

distance between different people

Xiao et al. 提出方法:单输入+classifying identities,Multiple datasets are combined together and a domain guided dropout technique is proposed to improve the feature learning.

Xiao et al. 和Zheng et al.各自在统一时期提出detection+reid,前者侧重end-to-end的联合优化框架设计,后者考虑现有的detector+reid方法的组合来做一些性能评价。

检测+reid的研究还相对较少,但可以发现在2017年两篇检测+reid的文章都是spotlight,所以这个方向很值得关注,其更符合实际场景应用,具有很好研究价值。例如:

港中文大学 xiaotong在其预印版1604.End-to-End Deep Learning for Person Search之上做了进一步loss改进和detector改进,得到了一个很好的end-to-end框架论文:1604.Joint Detection and Identification Feature Learning for Person Search,(OIM) Loss,用于更好地解决一个人的类别太多但一个mini-batch里面样本不够多样,导致没法训练分类器的问题;

LiangZheng在https://arxiv.org/abs/1604.02531 中提出对于行人检测框和重识别关系的讨论,在论文中他们采用了各种detector+各种recogniser的组合,比如最常见dpm+CNN,来探索那种组合更能提高重识别结果。

1604.Joint Detection and Identification Feature Learning for Person Search论文阅读笔记

作者用fast-rcnn框架,直接将行人检测和再识别整合到一个卷积神经网络上,减少了行人检测框错行人导致的误差,实验准确率达到了60%以上。另外,在论文中也把提出的OIM Loss应用在了传统的Person ReID问题(基于crop好的照片)上,效果比直接用Softmax训练分类器要好,代码放到了这个新写的库里面:Cysu/open-reid,另外补充一些OpenReID这个库的介绍,其功能主要有:

为常用的数据集提供一个统一的接口,方便做实验实现了一些评价指标(发现CUHK03和Market1501用的CMC算法还不太一样,详见 Evaluation Metrics)

实现了一些常用的训练方法和模型(Softmax分类,Triplet Loss,OIM等

总结了实验中发现的一些trick在 Training Identification Nets。OpenReID这个库还在不断完善中,作者欢迎各种建议和GitHub PR。

下面是对论文的详细分析

作者的贡献:

1.提出一种更符合实际场景的检测+reid端到端的新框架,实现从整张视频图像搜索到target/query/probe对应的行人图像块,并对应一种联合优化的训练模型参数的方法。

2.提供更大规模,更多场景,更多视角切视角不固定下的未经人工裁剪的,但有人工标注框和ID编号的reid数据集,标注主要用于监督训练和评价,作者提供了实验用的protocols,并有一个基本的baselines。

3.联合优化中设计了一种OIM损失函数训练易过拟合的框架,解决稀疏和不平衡的标签数据样本带来的难训练问题。

4.做了丰富的实验对比,在不是人工裁剪下,采用作者设计的detector和loss及框架可以实现最好的性能表现,另外重点考虑了检测器的recall,galleries size对最终识别结果的影响。

5.现存的其他数据集仍可以指导设计更好的特征表达

6.首次做实验验证了不同detectors及相应的recall设置对reid任务的影响,以及在同一reid方法下,与GT理想手工detector的对比。

数据集:



数据集的一个简单对比:

CHUK03由DPM产生,但false alarms都被手工移除了;Market-1501也是由DPM产生,包含一些false alarms,但仍没提供原始的包含行人的图像。另外,因为原有采用DPM的数据集,固定将DPM得到的行人块假设为理想的行人块,而不是人工更精细的标注,所以无法采用他们去比较采用不同detector会对reid算法产生什么样的影响,常识上应该为人工精细的标注比采用设计的detector应该得到的reid性能效果要好。



数据集主要由街拍图像和电影/电视抠图,并经标注组成。

数据集不再是裁剪好的行人框,而是整张包含行人图像和标注信息的数据集;



总共18184 images,所有图像中总共有8432 persons,99809个标注的bounding boxes;

For street snaps, 12490 images and 6057 query persons ;

For movie/TV,5694 images and 2375 query persons ;

training set:11206 images and 5532 query persons ;

test set:6978 images and 2900 query persons ;

every query至少有与query同一ID的图片,不同的query有不同的gallery set且training and test sets have no overlap on images or query persons,以保证用测试集评价的合理性.

评价标准:

1.mAP,把行人重检索当成是检测问题,A candidate window is considered as positive if its overlap with the ground truth is larger than 0.5. 每个query有一个AP值,从PR曲线计算得到,而mAP是所有query的AP值的平均

2.the top-k matching rate on bounding boxes:视行人重检索为ranking和localization问题,A matching is counted if a bounding box among:the top-k predicted boxes overlaps with the ground truth larger than the threshold.

数据集的image中行人高度大于50像素才标注,且遮挡过大,姿态太不正常和坐着或蹲着的行人不标注,

Query来自于数据集中的某一ID对应实例标注的随机采样,Gallery由包含该ID其他实例的图像和一些随机采样的图像组成,随机采样的图像不含有ID对应的所有实例,所以里面带标注的行人可称为负样本。

端到端实现的优势:

可以分析不同detector对reid识别性能的影响;

多样的视角和背景可以得到具有更好泛化能力的模型,有助于模型场景迁移中取得更好的效果(domain transfer)

detction和re-id共享特征提取的初阶段可以加速搜索过程

联合训练可以trade-off 或减轻人工设计的detector的false alarms的影响,更多地聚焦应样本;

使检测和产生区分性特征分享全卷积初网络可减弱检测器错对齐的影响,加速重检索识别过程,简化算法工作流程

端到端实现会遇到的新的问题:

pedestrian detectors will unavoidably produce false alarms,misdetections, and misalignments, which could harm the re-id result.

若采用联合优化方法,怎样用一个网络既可以检测行人又可以产生区分性的用于reid识别的特征?loss该怎么设计?

场景和视角太多样性,会造成算法对particular scenes, camera views, or gallery sets的过拟合

detectors:

DPM,ACF(依靠手工特征和线性分类器),CCF;

基于CNN的及一些改进型,如ResNet+fasterRCNN,inception v2等

作者的method

原框架:

End-to-End Deep Learning for Person Search论文分析



Three parts:FCN全卷积网络,pedestrian proposal network和 ROI pooling+全连接层的IDnet

Sharing the FCN for pedestrian detection and re-id feature extraction, we could accelerate the person search process.

Three fully connected layers are utilized to produce the final feature vector (fc8) 缩减特征维度到256用于特征距离或相似度计算。fc8很重要,降维和正则化更利于模型的训练,且被要求能区分大量的训练集中的ID。取256是由实验决定,gallery取100也是由实验确定。

VGG16的conv1 to conv5 in FCN,fc6 and fc7 in re-id 行人ROI feature extraction,another fully connected layer (fc8)。

another bounding box regression layer is employed on the top of fc7 to further improve the localization ability for better box alignments.

针对框架,把false alarms当做是背景类

loss有:

2个smooth-L1 loss for two bounding box regression layer

1个softmax loss for pedestrian proposal module用于分类判别是否为行人

1个随机采样的a softmax loss layer on the top of fc8 aims at classifying the person identities。这是一个 identity softmax classification loss

The overall loss is the sum of the previous four loss functions!!

训练时,In practice we did not backpropagate the losses of the re-id parts to the pedestrian proposal module through the ROI pooling layer.

又因为一个image最多标注有5/6个行人,作者说训练代价大,而minibatch只能最多为2个image图像,图像对应最多有10个IDquery及对应的gallery,因为样本稀疏和标签分布不均及样本多样性不够,不能直接finetune网络和梯度反传,因为这样loss不会明显下降!

作者采用的方法:

set a good initial point for the ID softmax classifier

裁剪GT框周围IOU值大于0.7的一定数量的行人图像for each training person and randomly sample the same number of background boxes.再进行finetune,这样可得到丰富的label diversity inside each minibatch,这样在数据集上微调后的VGG参数当做是下一步框架训练的初始点。

下一步作者replace the traditional softmax layer with the proposed RSS layer

每个data表示为{x,t},x为C+1维长度的向量,,表示该data属各ID类的分类器得分,即作为softmax输入(C+1表示含有背景类),t是监督信息,为C+1长度的二值向量取值为最大对应的维度下标,即真实的one-hot对应的ID标号值,yi是data x得分向量属于第i个ID类的似然概率,l为原始的softmax loss,对应一个data会产生的loss值,改进后的loss中K代表取data x向量的K维数据和t的K维数据,假设x的query真实标签是c,则分c=切片索引的第一个i1,及c=C+1背景类,及c不等于C+1三种情况,采样data,目的是让采样后的x和t包含背景类得分和对应的是否为属于背景类的标记监督信息

原softmaxloss:



改进的RSS loss



测试:对于query对应的each gallery image,可通过VGG加提议网络+区分性特征提取一次性得到该张图片的后选框fc8特征矩阵

对于query,我们把真实的bounding box替代由提议网络得到的一个gallery image图像的候选框s(the pedestrian proposals ),query框进行前向计算得到它的fc8特征向量,然后计算 the query features and those of the gallery candidates的距离或者相似度,并进行mAP和topK评估,注意提取的每个galley特征是可以重用的被其他的query,这能够加速搜索重识别过程

在该数据集下,作者baseline:联合框架方法,跟检测与reid独立组合方法的比较



以上ours方法为VGG的FCN+pedestrian proposal network+VGG后几个全连接层+自己设计的一个全连接层+RSS loss

ours联合框架对应的组合是Deep+IDNet

Deep为VGG的FCN+pedestrian proposal network

IDNet为discarding the pedestrian proposal network in our framework and training the remaining net 来分类ID,从裁剪的行人块,注意用的是RSS losss

a better pedestrian detector generates fewer false alarms, fewer misdetections, and more accurate boxes, it makes the re-id subtask much easier.

detector remains to be one of the major factors that affect the person search performance

由表知, 联合框架比对应的Deep+IDNet组合方法有约3%的性能提升即except for those utilizing ground truth

bounding boxes,with joint optimization, detector and reid feature extractor could better fit to each other.

Re-id could better adapt to the boxes generated by the detector and help reduce the false alarms and misalignments.

且联合框架比组合方法更快,因为联合框架共享特征图,且后面的区分性特征提取特征可以被保存下来到数据库。

其他控制变量法实验

1.比较训练中直接用VGG参数,+fintune得到一个好的初始点,+finetune和RSS的比较



This phenomenon shows that if the softmax target is very sparse and the minibatch contains only a few label classes, the gradients would be biased on these classes at each SGD iteration.

2.Detection Recall的设置和Gallery Size设置



when the recall rate is 70%, which indicates that both the false alarms and misdetections could affect person search. We should find a best trade-off in real applications.

gellery size的增大会导致性能的减小,而在其他的试验中Gallery Size被作者设置为100,即较小的数较合理。

3.Occlusion and Resolution.



resolution is not a major factor that affects there-id methods with hand-crafted features

总结:

This phenomenon indicates that our method can still be improved to better handle small pedestrians(低分辨率行人)

改进后的如下:带OIM

Joint Detection and Identification Feature Learning for Person Search论文分析

主要内容:

不再聚焦于匹配裁剪好的行人图像between queries and candidates,而是目标行人从包含行人的图像中搜索出来,另外设计了OIM loss可以使模型更快地收敛,比传统的softmax loss。

检测行人挑战:虚报,错检和不对齐,这些因素对行人搜索性能有重要的影响。

提出一个框架:CNN提议网络 + 识别网络,这两个网络训练时进行联合的优化,前者可以有更高的recall,但会产生更多的虚报框,而后者可消除虚报框通过特征区分性提取,候选框的不对齐在输入区分性特征提取的识别网络后也可以减弱其影响,两个网络共享底层的卷积特征图,可加速推断进程和提升网络可扩展性

训练的优化:在传统的reid特征学习中minibatch下可采用pairwise或triplet距离 loss学习一个verification 函数,要训练一个verification函数,而每次一个minibatch中就几个data样本用于被比较,当然,他们可应用一定的采样策略,其对训练效果有很重要的影响,然而随着ID亮的增大和images的增大,则找到有效的采样策略是困难的。

但是在单图像输入的CNN网络下,要训练的是一个多分类函数,要用softmax classifier,则随着ID的增加,大的softmax loss 矩阵必然会很稀疏,而每次一个minibatch中就几个data样本,这无法有效的训练和梯度反传,不同的采样策略对收敛率和质量有重要的影响,如未改进前的预印版论文采用的RSS loss就是应用了随机采样来降维分类阵,从而学习分类矩阵参数,但参数量仍然稀疏且多。在本论文中,作者进行了进一步改进loss,设计了无参数的OIM loss(Online Instance Matching),它被如下辅助训练:

维持一个所有ID的lookup tabel: 存储的是ID号和对应的特征,特征来自all the labeled identities,可用于比较compare distances between mini-batch samples and all the registered entries

维持一个循环队列: 存储many unlabeled identities的特征,他们被认为是有ID的负样本,可用于比较compare distances between mini-batch samples and all the registered unlabeled identities

OIMloss比RSS loss训练的效果更好,更快!



具体的方法:

stem CNN把原始image像素变换为特征图,提取candidate person ,再被RoI-Pooling处理并提取L2正则化的256-d特征,在模型推断阶段,依据特征距离或相似度对gallery people排序,越靠前的越匹配target person ,在训练阶段,IOM loss用于训练识别网络部分的参数,而其他的几个loss训练提议网络,这几个loss以多任务方式训练。

用ResNet-50做基CNN,输入一个图像得到1024个通道的特征图,分辨率为原始图像的1/16.提议网络用512*3*3的卷基层变换特征图,再在每个特征图上用9个anchors定位,用softmax classifier预测每个anchor处是否为一个行人,最后只保留前128个经极大值抑制得到的提议窗口,为了从这些提议窗口得到与query匹配的目标图像,将这些提议窗口送入识别网络,提取每个窗口的特征,具体是先对每个proposal用RoI-Polling层从stem feature map采样得到1024* 14*14的区域,他们再被送入ResNet-50的剩余网络部分,最后由一个global average pooling层把每个proposal归结为2048-d的特征向量。另外,同预印版论文,识别网络最后部分会再用softmax classifier和线性回归得到精挑的提议窗口特征向量并排斥非行人的提议特征向量。

we project the features into a L2-normalized 256 dimensional subspace (id-feat)

同预印版,共四个Loss, jointly trained in a multi-task learning manner, rather than using the alternative optimizations

OIM设计:

联合训练中,训练一个detector产生的提议窗口,再经识别网络会形成三类提议窗口:

假设训练集有L个不同ID的query人

1.labeled identity的实例,即与GT IOU交叠满足阈值的proposals为labeled identity的实例,对应的GT 标准框的ID即为该proposals的ID;

2.识别为训练集中满足 与GT IOU交叠阈值的提议窗口(定义为unlabeled identity的实例),但对应的GT 框标准的行人无ID信息标注,所以为背景行人,and thus they can be safely served as negative samples for identification,且实际数据制作时只标注像素高大于50的背景行人(因为人类也很难对他们进行标注),原images图像标注中背景行人有标准框信息,但无ID信息;

3.背景干扰项窗口(Other proposals are just false alarms on other objects or background regions.)。

一下提出的OIM只考虑labeled identity的实例和unlabeled identity的实例

前向时minibatch的图像得到的proposals与LUT的ID匹配的是labeled identity的实例,minibatch的图像得到的proposals与CQ匹配的是unlabeled identity的实例,且不是新的unlabeled identity的实例,后向传播时,把与LUT相匹配的proposals特征更新到LUT表中,不匹配的是proposals且是与CQ不匹配的prosal特征的加入到CQ队列中,并弹出失效的老的proposals特征。

为最小化同一ID的person,最大化不同ID的行人差异性,我们要存储所有person的特征,这可以通过前向计算所有训练图像得到,但无法用SGD优化参数,因此选择一个在线近似Loss来优化,与GT IOU交叠满足阈值的proposals为labeled identity的实例,所以用LUT存储每个minibatch中labeled identity的实例,proposals,每一列为一个ID实例,前向计算时,会计算minibatch sample 与所有LUT中labeled identity的实例的cosine 相似度,通过矩阵乘法,后向传播时,如果query的ID为t,则更新LUT的第t列与之ID对应的labeled identity实例特征,如下:







我们用循环队列存储最近几个minibatch的unlabeled identities的proposals实例,同样,前向的时候,计算minibatch sample 与所有CQ中labeled identity的实例的cosine 相似度,通过矩阵乘法,后向传播时,把没能匹配的sample proposal 特征放入到队列中,移除过时的,保证队里的长度不变。

OIM loss effectively compares the mini-batch sample with all the labeled and unlabeled identities, driving the underlying feature vector to be similar with the target one, while pushing it away from the others.

为什么不用传统的softmax+SGD?

因为每个ID太少的实例,每个图像仅几个ID,对很多的ID分类,分类阵会稀疏,每次SGD迭代因计算容量的限制,只能为几张image,这样正样本和负样本极不均匀,反向传播会有很大的方差离散,不可以有效学习,另外,softmax loss无法利用unlabeled identities信息,因为他们没有对应监督的ID的号。

采用OIM loss更容易过拟合,所以作者采取将特征投影到L2正则化的256d的低维子空间,以减弱过拟合的影响。

Evaluation Protocols and Metrics:

split the dataset into a training and a test subset, ensuring no overlapped images or labeled identities between

them. 如下表:



随机选择一张test image中有ID标注的一个实例作为query,包含该ID其他实例的所有图像,和一些随机采样得到的images组合成该query对应的gallery。

不同的queries有不同的galleries,they cover all the 6; 978 test images。

评价evaluation metrics:采用mAP和Top-K

注—测试集的GT框标注和ID标注只用于评价预测和真实之间的差别,并不用于作为监督信息训练模型!!!

实验比较:

框架的实现基于Caffe 和py-faster-rcnn,用ImageNet-预训练模型参数对框架的ResNet-50做参数初始化。

circular queue is set to 5000

temperature scalar被设置为0.1

Each mini-batch consists of two scene images

learning rate is initialized to 0:001, dropped to 0:0001 after 40K iterations。kept unchanged until the model converges at 50K iterations

compare our joint framework with the baselines of using separate pedestrian detection and person re-identification,Three pedestrian detection and five person re-id methods are used in our experiments。其中CCF detector(Hand-crafted features)直接用,没有finetune,其他两个ACF和Faster-RCNN (CNN) with

ResNet-50在该数据集下做了finetune。

GT 标准框作为理想检测器的检测结果!!!

分框架为CNN+IDNet两部分组合,而整体框架为CNN +IDNet+OIM

gallery size equal to 100



training IDNet with detector boxes, we found that adding background clutter as a unique class improves the result, while adding unlabeled identities does not

OIM loss的优势:不需要学习一个大的分类矩阵,只需要直接学习特征



Open-ReID benchmarks for more details。

Sub-sampling the identities

As the number of identities increases, the computation time of the OIM loss could become the bottleneck of the whole system.sub-sampling a small number of identities relaxes the training objective, which leads to slightly inferior performance but much faster convergence rate.如下图:



Low-dimensional subspace

下采样维度的设置:



projecting the features into a proper low-rank subspace is very important to regularize the network training.and we choose 256-d to accelerate the computation of feature distances

Factors for Person Search:Detection Recall和Gallery size的设置



说明联合训练的重要性和硬样本挖掘的重要性。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐