2. 上海理工大学 机械工程学院,上海 200093;
3. 杭州亿美实业有限公司,浙江 杭州 310000;
4. 杭州亿美光电科技有限公司,浙江 杭州 310000
2. School of Mechanical Engineering, University of Shanghai for Science and Technology, Shanghai 200093, China;
3. Hangzhou Yimei Enterprise Co., Ltd., Hangzhou 310000, China;
4. Hangzhou Yimei Photoelectric Technology Co., Ltd., Hangzhou 310000, China
行人再识别技术是指在非重叠摄像头的场景给定一张行人图片,检索该行人在另一摄像头出现的所有图像。随着视频监控和图片检索的普及,行人再识别技术得到越来越多的关注和研究。由于受到光照变化、被物遮挡、视角和姿态的变化,视频中的行人外观会发生改变,这对行人再识别带来很大的技术挑战。
在目前工作中,行人再识别的研究主要集中在特征提取和度量学习这两个方面[1]。前者主要研究如何提取更具有代表性的特征,使特征表达更加鲁棒和具有辨别性;后者则是优化行人特征空间距离,提高空间距离判别性。随着卷积神经网络(ConvNets)在计算机视觉方面取得越来越多的成果,端到端的学习方法也被运用到行人再识别任务中。Li等[2]利用卷积神经网络对两张输入图片进行特征提取,并针对特征图水平条纹进行相似度比较。Ahmed等[3]提出将图片分为不同的块,利用一个浅层网络比较相邻块的差异,再利用一个网络层总结上层网络的差异。Gray等[4]提出将行人再识别视为一个二分类问题,利用孪生网络分别提取图片的特征并进行匹配。这些方法通过利用CNN(convolutional network)提取特征并结合空间对应关系来进行相似度比较。然而这些方法只是针对完整的行人图片,没有考虑光照、遮挡、姿态引起的空间信息的变化,也忽略了行人各部位的辨别性信息。卷积神经网络算法取得良好效果的同时也带来了大量的模型参数,应用到行人再识别任务时由于较小的数据集会产生过拟合现象。为了解决这个问题,Yi等[5]提出将行人图片分割为重叠的三部分,然后利用孪生网络比较对应两部分的相似度。然而该方法在特征层进行相似度比较时容易带来大量参数,从而引起过拟合现象。为了解决这个问题,通过充分利用局部部位的空间信息,Amores等[6]提出了将行人特征映射到距离空间的一种MIL算法,这样可以减少背景噪声的干扰并减轻过拟合的产生。
为了在行人外观发生显著变化的情况下进一步提高行人再识别的准确性,本文提出了一种基于孪生网络和多距离融合的行人再识别算法。先利用孪生网络提取行人子空间特征,同时采用改进的inception模块提取具有辨识性的行人特征,计算获取行人局部特征空间距离,然后采取Chamfer距离变换进行距离融合,并对获取的行人空间距离进行重排序,从而进行行人再识别。
1 网络结构 1.1 整体网络结构本文采用的整体网络结构是孪生网络结构,孪生网络由完全相同的两个网络分支组成,每个分支用来提取判别性特征,并且融合了contrastive loss(对比损失),其网络结构如图1所示。对于输入图像
|
图 1 本文网络结构示意图 Figure 1 Network structure diagram of this paper |
对于输入的局部块对
| ${D_W}({x_{p,i,j}},{x_{{q},i,k}}) = ||{E_W}({x_{p,i,j}}) - {E_W}({x_{{q,i,k}}})|{|_2}$ | (1) |
式中:
本文采取了inception模块来提取特征,Inception模块是2014年在GoogleNet中首先使用的一个模块[7],具有增加特征表达和减少计算的优点。由于其采用了多个尺寸的卷积核,可以增强网络的适应力,处理更多、更丰富的空间特性,增加特征提取多样性。模块加入了池化层和BN(batch norm),池化层主要用来降低空间维度,BN则是一种很有效的正则化方法,这样可以加快网络的训练速度。batch norm批处理化这种方式在ReLU层之前使用,可以大大加快收敛过程。由于摄像头的视角转换和行人姿态不同导致图像差异,我们采用Max pooling池化方式取局部最大激活并作为接下来层的输入,可以保持局部变形的不变性质。由于原始的inception卷积核较大导致收敛速度变慢而影响算法性能,我们在原来inception模块基础上做了改进,将原来5×5的卷积核用两个3×3卷积核替代,这样可以节约大量的参数,加速计算并且减轻过拟合。每个全连接组包含了一个全连接层、一个BN层以及激活函数ReLU层。改进的inception模块如图2所示,基本网络结构如表1所示。
|
|
表 1 基本网络结构 Table 1 Basic network structure |
|
图 2 本文所采用的inception模块 Figure 2 Basic structure of inception module of this paper |
由于行人图片受到光照、视角和姿态的差异,外观变化显著,整体特征无法描述一个人的局部信息,而且在训练的过程中由于数据集较小会出现过拟合等问题。为了获得更好的行人局部空间特征信息,提高跨摄像头行人再识别的准确率并减少过拟合现象,本文提出一种多距离融合的方法,利用孪生网络提取图片子空间特征,并将其映射到一个距离空间,这样我们就能得到比整张图片更有判别性的空间融合距离。本文距离融合网络由三部分组成,分别为特征提取部分,距离融合部分和重排序部分。多距离融合算法可以更充分利用行人局部空间信息,并在映射的距离空间度量其相似度,减少了过拟合现象。其算法框架如图3所示。
通过孪生网络,我们对每个查询图片(probe image)和候选图片(gallery image)提取特征,然后计算每个局部块之间空间距离,其L2规范化特征空间距离我们可以通过式(1)求得。
2.2 Chamfer距离变换和多距离融合由于采取了多距离融合算法,为了增强跨摄像头下的行人距离度量的鲁棒性。本文采用Chamfer距离变换。Chamfer距离变换具有对称性,被运用在边缘检测方面可以减少奇异距离对融合距离的影响,有效增强融合距离的鲁棒性。对于每个局部块对的空间距离,其空间距离如下:
| $\begin{split} & {{D}_{W,\text{sub}}}({{x}_{p,i,j}},{{x}_{q,i}})= \\ & \min \{{{D}_{W,\text{sub}}}({{x}_{p,i,j}},{{x}_{q,i,k}})|k=1,2,\cdots ,6\} \end{split} $ | (2) |
| $\begin{split} & {{D}_{W,\text{sub}}}({{x}_{q,i,j}},{{x}_{p,i}})= \\ & \min \{{{D}_{W,\text{sub}}}({{x}_{q,i,j}},{{x}_{p,i,k}})|k=1,2,\cdots ,6\} \end{split} $ | (3) |
|
图 3 本文所提多距离融合算法框架 Figure 3 The framework of multi-distance fusion algorithms |
式中:
为了提高空间距离鲁棒性,行人空间距离使用Chamfer变换式,即
| $ \begin{split}& {D_{\rm{ch}}}({x_{p,i}},{x_{q,i}}) = \frac{1}{{2 \times 6}}* \\[-5pt] & \left( {\sum\limits_{j = 1}^6 {{D_{W,{\rm{sub}}}}({x_{p,i,j}},{x_{q,i}})} + \sum\limits_{j = 1}^6 {{D_{W,{\rm{sub}}}}({x_{q,i,j}},{x_{p,i}})} } \right) \end{split}$ | (4) |
为了得到最终融合距离,我们将每个图像块的空间融合距离表示如下:
| $D({x_p},{x_q}) = \sum\limits_{i = 1}^6 {{D_{\rm{ch}}}({x_{p,i}},{x_{q,i}})} $ | (5) |
由此我们可以计算行人图片的空间距离,可以对候选图片进行重排序,最终得到排序的结果。
3 实验结果与分析我们使用了Windows10操作系统和GPU1080的电脑,应用Pytorch框架进行编程,在最具有挑战性的两个公开数据集VIPeR和CUHK03上进行实验,并且每个数据集在同等条件下训练10次,最后取平均值作为测试结果。采用累积匹配特性(CMC)曲线和平均精度均值mAP作为算法框架评价指标。
3.1 数据库介绍与设置我们在当前广泛使用的两个公开数据集VIPeR[8]和CUHK03[2]上测试了我们所提算法的有效性。VIPeR数据集是行人再识别领域最受欢迎和富有挑战性的数据集。它包含了632个行人的1264张图片,这些图片是由两个相互独立的摄像头在室外环境下采集得到,如果单个行人在其中一个摄像头下出现,则在另一个摄像头下会采集到该行人相应的人像。由于其具有丰富的视角变换、姿态转换和不同的光照条件,VIPeR数据集充满了挑战性。CUHK03数据集是一个由5对摄像头采集于香港科技大学的数据集,它包含了1 467个行人的共计超过14 000张图片,每个行人都会在非重叠摄像头下被采集并平均拥有4.8张图片。CUHK03数据集应用手工标注和自动标注两种标注方式,本文在这两种标注方式下分别做了实验。CUHK03是当前比较大的一个行人再识别数据集。
3.2 单一距离与多距离融合算法比较采取相同结构的孪生网络提取特征,在VIPeR和CUHK03两个数据集上测试我们所提多距离融合算法的有效性,结果如图4所示。由此得到,在VIPeR和CUHK03数据集(Labeled)下采取多距离融合算法达到的排序1的识别率分别为43.2%和62.3%,而未采取多距离融合算法的识别率分别为35.1%和48.4%。采用CUHK03数据集对不同的滑框尺度进行性能比较,得到结果如表2所示。通过表2可以看出,当局部块数量L=6时,在Labeled和Detected两种标注方式下的rank-1和mAP都最高,即效果最好。由此可见,本文提出的基于孪生网络和多距离融合的行人再识别算法能够有效提高行人再识别准确率。
|
图 4 采用不同空间距离在VIPeR和CUHK03数据集(Labeled)上的CMC性能比较 Figure 4 CMC performance comparison on VIPeR and CUHK03(Labeled)data sets using different spatial distances |
本文分别在VIPeR和CUHK03两个数据集下,与近几年行人再识别的其他先进算法进行性能比较。在VIPeR数据集上我们和当今的先进算法比较,本文网络结构更深并且包含了更多的网络参数,但取得了更好的再识别准确率,这表明本文算法有效地减轻了过拟合现象。表3、表4分别给出了相应的CMC性能比较结果,其中rank-n表示前n张图片至少有一个正确检索行人的概率,rank-1通常代表算法性能的好坏。由表3和表4可知,本文提出的算法在VIPeR和CUHK03两个数据集下,性能都高于近几年所提的行人再识别算法,说明本文基于孪生网络和多距离融合算法有助于提高行人再识别算法的准确率。
|
|
表 2 采用不同滑框尺度的性能对比 Table 2 The Performance comparison of different scales of sliding windows |
|
|
表 3 在VIPeR数据集上本文算法和先进算法对比 Table 3 Comparisons between the proposed algorithm and the advanced algorithm on VIPeR dataset |
|
|
表 4 在CUHK03数据集本文算法和先进算法对比 Table 4 Comparisons between the proposed algorithm and the advanced algorithm on CUHK03 dataset |
本文提出了基于孪生网络和多距离融合的行人再识别算法。利用孪生网路提取行人局部块特征,比传统手工特征更具有辨识性和鲁棒性。在度量学习方面,采用将多个局部块距离融合的多距离融合方法,并应用于行人再识别方面,减轻了过拟合现象。在当前流行的VIPeR和CUHK03两个公开行人再识别数据集上进行实验,实验结果表明了本文所提算法能有效提高行人再设别的准确率。
| [1] | ZHENG W S, GONG S G, XIANG T. Reidentification by relative distance comparison[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2013, 35(3): 653–668. DOI:10.1109/TPAMI.2012.138 |
| [2] | LI W, ZHAO R, XIAO T, et al. DeepReID: deep filter pairing neural network for person re-identification[C]//Proceedings of 2014 IEEE conference on computer vision and pattern recognition. Columbus: IEEE, 2014: 152 – 159. |
| [3] | AHMED E, JONES M, MARKS T K. An improved deep learning architecture for person re-identification[C]//Proceedings of 2015 IEEE conference on computer vision and pattern recognition. Boston: IEEE, 2015: 3908 – 3916. |
| [4] | GRAY D, HAI T. Viewpoint Invariant Pedestrian Recognition with an Ensemble of Localized Features[C]//Proceedings of the 10th European conference on computer vision: part I. Marseille: Springer, 2008: 262 – 275. |
| [5] | YI D, LEI Z, LIAO S C, et al. Deep metric learning for person re-identification[C]//Proceedings of the 2014 22nd international conference on pattern recognition. Stockholm: IEEE, 2014: 34 – 39. |
| [6] | AMORES J. Multiple instance classification: review, taxonomy and comparative study[J]. Artificial Intelligence, 2013, 201: 81–105. DOI:10.1016/j.artint.2013.06.003 |
| [7] | SZEGEDY C, LIU W, JIA Y Q, et al. Going deeper with convolutions[C]//Proceedings of 2015 IEEE conference on computer vision and pattern recognition. Boston: IEEE, 2015: 1 – 9. |
| [8] | THEOBALD B J, MATTHEWS I, BAKER S. Evaluating error functions for robust active appearance models[C]//Proceedings of the 7th international conference on automatic face and gesture recognition. Southampton: IEEE, 2006: 149 – 154. |
| [9] | KÖSTINGER M, HIRZER M, WOHLHART P, et al. Large scale metric learning from equivalence constraints[C]//Proceedings of 2012 IEEE conference on computer vision and pattern recognition. Providence: IEEE, 2012: 2288 – 2295. |
| [10] | ZHAO R, OUYANG W L, WANG X G. Learning mid-level filters for person re-identification[C]//Proceedings of 2014 IEEE conference on computer vision and pattern recognition. Columbus: IEEE, 2014: 144 – 151. |
| [11] | LI W, WANG X G. Locally aligned feature transforms across views[C]//Proceedings of 2013 IEEE conference on computer vision and pattern recognition. Portland: IEEE, 2013: 3594 – 3601. |
| [12] | LI Z, CHANG S Y, LIANG F, et al. Learning locally-adaptive decision functions for person verification[C]//Proceedings of 2013 IEEE conference on computer vision and pattern recognition. Portland: IEEE, 2013: 3610 – 3617. |
| [13] | YANG Y, YANG J M, YAN J J, et al. Salient color names for person re-identification[C]//Proceedings of the 13th European conference on computer vision. Zurich, Switzerland: Springer, 2014: 536 – 551. |
| [14] | LIAO S C, HU Y, ZHU X Y, et al. Person re-identification by local maximal occurrence representation and metric learning[C]//Proceedings of 2015 IEEE conference on computer vision and pattern recognition. Boston: IEEE, 2015: 2197 – 2206. |
| [15] | ZHENG L, SHEN L Y, TIAN L, et al. Scalable person re-identification: a benchmark[C]//Proceedings of 2015 IEEE international conference on computer vision. Santiago: IEEE, 2015: 1116 – 1124. |
| [16] | YU R, ZHOU Z C, BAI S, et al. Divide and fuse: a re-ranking approach for person re-identification[J]. arXiv: 1708.04169, 2017. |
| [17] | ZHENG Z D, ZHENG L, YANG Y. Pedestrian alignment network for large-scale person re-identification[J]. IEEE Transactions on Circuits and Systems for Video Technology, 2017, 29(10): 3037–3045. |
| [18] | ZHONG Z, ZHENG L, CAO D L, et al. Re-ranking person re-identification with k-reciprocal encoding[C]//Proceedings of 2017 IEEE conference on computer vision and pattern recognition. Honolulu: IEEE, 2017: 3652 – 3661. |
| [19] | SUN Y F, ZHENG L, DENG W J, et al. SVDNet for pedestrian retrieval[C]//Proceedings of 2017 IEEE international conference on computer vision. Venice: IEEE, 2017: 3820 – 3828. |
| [20] | CHEN Y B, ZHU X T, GONG S G. Person re-identification by deep learning multi-scale representations[C]//Proceedings of 2017 IEEE international conference on computer vision workshops. Venice: IEEE, 2017: 2590 – 2600. |
2020, Vol. 42
Issue (1): 7-13

