2. 桂林电子科技大学 计算机与信息安全学院, 广西 桂林 541006
2. School of Computer and Information Security, Guilin University of Electronic Science and Technology, Guilin, Guangxi 541006, China
开放科学(资源服务)标志码(OSID):
行人再识别是指判断不同摄像头下出现的行人是否属于同一行人,属于图像检索的子问题,广泛应用于智能视频监控、安保、刑侦等领域[1-2]。由于行人图像的分辨率变化大、拍摄角度不统一、光照条件差、环境变化大、行人姿态不断变化等原因,使得行人再识别成为目前计算机视觉领域的研究热点和难点问题。
传统的行人再识别方法侧重于颜色、形状等低级特征。随着深度学习技术的快速发展,以端到端的方式学习图像特征,然后进行三元组损失、对比损失、改进的三元组损失等[3-4]的度量与计算。该方式能够很好地学习图像的全局特征,但是并没有考虑图像的局部特征和空间结构。行人在不同的摄像头下由于低分辨率、光照条件、部分遮挡、姿态变化等诸多因素使得视觉外观发生显著变化,主要表现为行人部分特征被遮挡导致不相关上下文被学习到特征图中,姿态变化或者非刚性变换使得度量学习[5]变得困难,高相似度的外貌特征在基于全局特征学习的模型中不能得到有效识别,区域推荐网络所产生的不精确的检测框会影响特征学习等方面。为解决上述问题,研究人员开始关注图像的局部特征,通过图像的局部差异性分辨不同的行人。对于行人的局部特征进行提取,主要是通过手工的方式将图像分成若干块。文献[6]提出对图像进行分块,将行人图像平均分成6份大小相同的区域,对每个区域施加标签约束,然后分别提取图像的局部特征进行学习。文献[7]在全局特征的辨识模型中引入局部特征损失来影响全局特征表达,在局部网络中使用无监督训练自动检测局部人体部件,增加了模型对于未见过的行人图像的判别能力。但是,已有研究主要将注意力集中在人体的局部特征学习上,忽略了非人体部件的上下文线索对整体辨识的重要影响,因此模型在不同数据集中的鲁棒性较差。本文使用行人语义分割代替手工设计的分块框,快速提取图像的局部特征。首先训练一个行人语义分割模型,该模型通过学习将行人分成多个语义区域,将非人体部分作为背景。然后通过局部语义区域进行分块,分块后再进行辨识比对。在此基础上提出一种局部注意力机制,计算非人体部分潜在部件的相似度,依据输入图像和查询图像像素之间的差异来辨识是否属于同一行人,以解决非人体部分潜在的原始信息辨识问题。
1 行人再识别模型本文提出一种基于局部对齐网络(Partial Alignment Network,PAN)的行人再识别模型,通过行人解析模型对齐人体部分特征以及使用局部注意力机制对齐非人体部分的上下文线索[8]。局部对齐网络结构如图 1所示,通过将分块后的行人语义特征与注意力特征相融合得到最终的辨识特征,其中:
![]() |
Download:
|
图 1 局部对齐网络结构 Fig. 1 Structure of partial alignment network |
输入一张行人图片
$ {\boldsymbol{f}}_{k, i}=\left\{\begin{array}{l}1, \forall {\delta }_{i}\in \left({i}_{t, h}, \boldsymbol{V}\right)\\ 0, \forall {\delta }_{i}\notin \left({i}_{t, h}, \boldsymbol{V}\right)\end{array}\right. $ | (1) |
在得到第
$ J(\boldsymbol{w};{\boldsymbol{r}}_{i}, \boldsymbol{y})={\boldsymbol{L}}_{\mathrm{e}\mathrm{m}\mathrm{p}}(\boldsymbol{w};{\boldsymbol{r}}_{i}, \boldsymbol{y})+\lambda {‖\boldsymbol{w}‖}_{1} $ | (2) |
其中:
$ {\boldsymbol{h}}_{i}=\sum\limits _{i=1}^{N}{\boldsymbol{f}}_{k, i}{\boldsymbol{r}}_{i} $ | (3) |
其中:
$ {\boldsymbol{L}}_{\mathrm{p}\mathrm{a}\mathrm{r}}=\sum\limits _{i=1}^{N}\left[{\delta }_{i}\equiv N\right]\cdot {\boldsymbol{h}}_{i} $ | (4) |
其中:
将ResNet50提取到的特征图
$ {\boldsymbol{p}}_{i}={T}_{i}\cdot \left({\boldsymbol{r}}_{i}\mathrm{t}\mathrm{a}\mathrm{n}\mathrm{h}\left({\boldsymbol{W}}_{\mathrm{P}}{\boldsymbol{Q}}_{k}\right)\right) $ | (5) |
其中:
$ {a}_{i, j}=\mathrm{a}\mathrm{l}\mathrm{i}\mathrm{g}\mathrm{n}\left({\boldsymbol{Q}}_{j}, {\boldsymbol{Q}}_{i}\right)\mathrm{e}\mathrm{x}\mathrm{p}\left(-\frac{{\left(s-{\boldsymbol{p}}_{i}\right)}^{2}}{2{\sigma }^{2}}\right) $ | (6) |
其中:
潜在的局部注意力特征图可表示如下:
$ {\boldsymbol{L}}_{\mathrm{a}\mathrm{t}\mathrm{t}}=\sum\limits _{j=1}^{N}{a}_{i, j}\psi \left({\boldsymbol{p}}_{i}\right) $ | (7) |
其中:
将潜在的局部注意力网络对齐表示和人体语义解析网络对齐表示进行融合,得到最终的辨识特征
$ \boldsymbol{X}={\boldsymbol{L}}_{\mathrm{p}\mathrm{a}\mathrm{r}}+{\boldsymbol{L}}_{\mathrm{a}\mathrm{t}\mathrm{t}}+\boldsymbol{V} $ | (8) |
使用3个公开的大规模行人再识别领域的Market-1501[17]、DukeMTMC-reID[18]和CUHK03[19]数据集评估本文模型的性能。Market-1501数据集有1 501个行人,共32 688张图片。DukeMTMC-reID数据集有1 404个行人,共36 411张图片。CUHK03数据集有1 467个行人,共14 096张图片。这些图片由5个高分辨率的摄像头和1个低分辨率的摄像头拍摄,且每个行人至少出现在2个不同的摄像头中。CUHK03数据集的数据格式和另外两种数据集格式稍有不同,提供了两种类型的数据,包括手工注释的标签(Labeled)和DPM检测的边界框(Detected)[20],其中第二种类型的数据检测更困难,因为DMP检测的边界框存在比例失调、杂乱背景等现象的发生。利用累计匹配特征(Cumulated Matching Characteristic,CMC)和平均精度均值(mean Average Presicion,mAP)两种评价指标来评估PAN模型。所有实验均使用单查询设置。
2.2 参数设置模型基于PyTorch框架,在开始训练前将数据集中图片大小调整至384像素×128像素,通过随机遮挡进行数据增强。实验中使用的3个数据集预先使用CE2P模型进行人体语义解析[21],每张图片定义20个语义类别,其中,19个行人类别,1个背景类别。实验共训练100个批次,每个批次的大小设置为128。初始学习率设置为0.02,在经过60个批次后学习率降为0.002。
2.3 定量比较与分析将PAN模型与基于注意力的行人再识别模型(RGA[22]、HOA[23])、基于行人语义解析的行人再识别模型(SSM[24])和基于局部对齐方法的行人再识别模型(SCSN[25]、GSRW[26]和DSA[27])进行性能评价测试与对比,对应的实验结果如表 1所示,其中,在Market-1501和DukeMTMC数据集中分别测试了Rank-1、Rank-5、Rank-10和mAP评价指标,在CUHK03数据集中测试了Rank-1和mAP评价指标。实验结果表明:PAN模型在3个数据集中均取得较好的结果,通过观察可以发现,本文构建的人体语义解析网络有效地解决了分块后特征不对齐导致的匹配失败问题;将PAN模型与HOA模型在没有使用多分类Softmax损失函数[28]的条件下进行比较,可以发现PAN模型的Rank-1和mAP评价指标上有明显提升,分别提高了5.4和6.8个百分点。
![]() |
下载CSV 表 1 在单查询设置下PAN模型和其他模型在Market-1501、DukeMTMC和CUHK03数据集上的实验结果对比 Table 1 Comparison of experimental results of PAN model and other models on Market-1501, DukeMTMC and CUHK03 datasets under the single query setting |
本文探究了不同的行人部件分割数量N对PAN模型的影响,实验结果如图 2所示。由图 2可以看出,当N=5时,行人部件被分为头部、上部分、下部分、脚部、背景等5个部分,整个模型的再识别成功率最高,这表明精细的行人部件分割有效地克服了行人姿态变化的差异性问题,通过上下文信息对行人再识别产生了重要影响。考虑到计算时间开销和硬件支持[29],本文默认将N设置为5,即每张图片的行人部分分割为5个小区域。
![]() |
Download:
|
图 2 PAN模型选取不同行人部件分割数量时的实验结果对比 Fig. 2 Comparison of experimental results when the PAN model selects different number of pedestrian components |
在使用三元组损失的基础上[30],通过消融实验来深入研究PAN模型中各分支的贡献,其中:Baseline表示基线模型,在此基础上进行改进;PAN/Lpar表示仅使用人体语义解析网络分支的模型;PAN/Latt表示仅使用局部注意力网络分支的模型;PAN/Lpar+Latt代表同时使用局部注意力网络和人体语义解析网络分支的模型。实验结果如表 2所示:联合人体语义解析和局部注意力网络可以提升3个主流数据集的整体性能;PAN/Lpar和Baseline模型相比可以发现,Baseline模型只是将图像进行分块提取特征,当出现姿态变化过大和高相似度外貌特征时并不能取得良好的实验结果;PAN/Latt和Baseline模型相比可以发现,局部注意力网络在出现遮挡情况时,显示出了非行人部件上下文线索的重要性。
![]() |
下载CSV 表 2 行人再识别模型消融实验结果 Table 2 Results of ablation experiment for pedestrian re-identification models |
本文提出一种基于行人语义分割和局部注意力机制的行人再识别模型。使用行人语义分割模型对行人的局部特征进行更精细的分割,避免了对图像进行分块后局部特征不匹配现象的产生。利用局部注意力机制,解决了行人语义分割模型将非人体部件识别为图像背景的问题。通过行人部件信息和背景遮挡信息的互补,增强了模型的可迁移性。实验结果表明,该模型能充分利用行人部件信息和局部视觉线索中隐藏的语义信息,有效解决了行人姿态变化过大、特征分块后不对齐等问题。后续将研究PAN模型在基于视频序列的行人再识别中的应用,通过将视频中的每一帧图像进行分割得到行人部件特征,根据行人部件特征之间的比对增加识别粒度,并设计图卷积网络挖掘视频序列中行人潜在的语义信息,进一步提高识别精度。
[1] |
RISTANI E, TOMASI C. Features for multi-target multi-camera tracking and re-identification[C]//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 6036-6046.
|
[2] |
KALAYEH M M, BASARAN E, GÖKMEN M, et al. Human semantic parsing for person re-identification[C]//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 1062-1071.
|
[3] |
郑伟诗, 吴岸聪. 非对称行人重识别: 跨摄像机持续行人追踪[J]. 中国科学: 信息科学, 2018, 48(5): 545-563. ZHENG W S, WU A C. Asymmetric person re-identification: cross-view person tracking in a large camera network[J]. Scientia Sinica: Information Sciences, 2018, 48(5): 545-563. (in Chinese) |
[4] |
杨婉香, 严严, 陈思, 等. 基于多尺度生成对抗网络的遮挡行人重识别方法[J]. 软件学报, 2020, 31(7): 1943-1958. YANG W X, YAN Y, CHEN S, et al. Multi-scale generative adversarial network for person re-identification under occlusion[J]. Journal of Software, 2020, 31(7): 1943-1958. (in Chinese) |
[5] |
FU J, LIU J, TIAN H, et al. Dual attention network for scene segmentation[C]//Proceedings of 2019 IEEE Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2019: 3146-3154.
|
[6] |
SUN Y, ZHENG L, YANG Y, et al. Beyond part models: person retrieval with refined part pooling[C]//Proceedings of 2018 European Conference on Computer Vision. Berlin, Germany: Springer, 2018: 480-496.
|
[7] |
YAO H T, ZHANG S L, HONG R C, et al. Deep representation learning with part loss for person re-identification[J]. IEEE Transactions on Image Processing, 2019, 28(6): 2860-2871. DOI:10.1109/TIP.2019.2891888 |
[8] |
SARFRAZ M S, SCHUMANN A, EBERLE A, et al. A pose-sensitive embedding for person re-identification with expanded cross neighborhood re-ranking[C]//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 420-429.
|
[9] |
徐龙壮, 彭力, 朱凤增. 多任务金字塔重叠匹配的行人重识别方法[J]. 计算机工程, 2021, 47(1): 239-245, 254. XU L Z, PENG L, ZHU F Z. Pedestrian re-identification method based on multi-task pyramid overlapping matching[J]. Computer Engineering, 2021, 47(1): 239-245, 254. (in Chinese) |
[10] |
ZHENG M, KARANAM S, WU Z Y, et al. Re-identification with consistent attentive Siamese networks[C]//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2019: 5728-5737.
|
[11] |
RUAN T, LIU T, HUANG Z L, et al. Devil in the details: towards accurate single and multiple human parsing[C]//Proceedings of 2019 AAAI Conference on Artificial Intelligence. Palo Alto, USA: AAAI Press, 2019: 4814-4821.
|
[12] |
WANG X, GIRSHICK R, GUPTA A, et al. Non-local neural networks[C]//Proceedings of 2018 IEEE Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 7794-7803.
|
[13] |
周林勇, 谢晓尧, 刘志杰, 等. 卷积神经网络池化方法研究[J]. 计算机工程, 2019, 45(4): 211-216. ZHOU L Y, XIE X Y, LIU Z J, et al. Research on pooling method of convolution neural network[J]. Computer Engineering, 2019, 45(4): 211-216. (in Chinese) |
[14] |
夏胡云, 叶学义, 罗宵晗, 等. 多尺度空间金字塔池化PCANet的行人检测[J]. 计算机工程, 2019, 45(2): 270-277. XIA H Y, YE X Y, LUO X H, et al. Pedestrian detection using multi-scale principal component analysis network of spatial pyramid pooling[J]. Computer Engineering, 2019, 45(2): 270-277. (in Chinese) |
[15] |
LI W, ZHU X T, GONG S G. Harmonious attention network for person re-identification[C]//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 2285-2294.
|
[16] |
HAN K, GUO J Y, ZHANG C, et al. Attribute-aware attention model for fine-grained representation learning[C]//Proceedings of the 26th ACM International Conference on Multimedia. New York, USA: ACM Press, 2018: 2040-2048.
|
[17] |
祁磊, 于沛泽, 高阳. 弱监督场景下的行人重识别研究综述[J]. 软件学报, 2020, 31(9): 2883-2902. QI L, YU P Z, GAO Y. Research on weak-supervised person re-identification[J]. Journal of Software, 2020, 31(9): 2883-2902. (in Chinese) |
[18] |
张玉康, 谭磊, 陈靓影. 基于图像和特征联合约束的跨模态行人重识别[J]. 自动化学报, 2021, 47(8): 1943-1950. ZHANG Y K, TAN L, CHEN J Y. Cross-modality person re-identification based on joint constraints of image and feature[J]. Acta Automatica Sinica, 2021, 47(8): 1943-1950. (in Chinese) |
[19] |
戴臣超, 王洪元, 倪彤光, 等. 基于深度卷积生成对抗网络和拓展近邻重排序的行人重识别[J]. 计算机研究与发展, 2019, 56(8): 1632-1641. DAI C C, WANG H Y, NI T G, et al. Person re-identification based on deep convolutional generative adversarial network and expanded neighbor reranking[J]. Journal of Computer Research and Development, 2019, 56(8): 1632-1641. (in Chinese) |
[20] |
LIU H, FENG J S, QI M B, et al. End-to-end comparative attention networks for person re-identification[J]. IEEE Transactions on Image Processing, 2017, 26(7): 3492-3506. |
[21] |
SU Y H, FAN K, BACH N, et al. Unsupervised multi-modal neural machine translation[C]//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2019: 10474-10483.
|
[22] |
ZHANG Z Z, LAN C L, ZENG W J, et al. Relation-aware global attention for person re-identification[C]//Proceedings of 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2020: 3183-3192.
|
[23] |
CHEN B H, DENG W H, HU J N. Mixed high-order attention network for person re-identification[C]//Proceedings of 2019 IEEE/CVF International Conference on Computer Vision. Washington D.C., USA: IEEE Press, 2019: 371-381.
|
[24] |
BAI S, BAI X, TIAN Q. Scalable person re-identification on supervised smoothed manifold[C]//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2017: 3356-3365.
|
[25] |
CHEN X S, FU C M, ZHAO Y, et al. Salience-guided cascaded suppression network for person re-identification[C]//Proceedings of 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2020: 3297-3307.
|
[26] |
SHEN Y T, LI H S, XIAO T, et al. Deep group-shuffling random walk for person re-identification[C]//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 2265-2274.
|
[27] |
ZHANG Z Z, LAN C L, ZENG W J, et al. Densely semantically aligned person re-identification[C]//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2019: 667-676.
|
[28] |
HE K M, ZHANG X Y, REN S Q, et al. Deep residual learning for image recognition[C]//Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2016: 770-778.
|
[29] |
蒋芸, 谭宁, 张海, 等. 基于条件生成对抗网络的咬翼片图像分割[J]. 计算机工程, 2019, 45(4): 223-227. JIANG Y, TAN N, ZHANG H, et al. Bitewing radiography image segmentation based on conditional generative adversarial network[J]. Computer Engineering, 2019, 45(4): 223-227. (in Chinese) |
[30] |
WANG Q Z, CHAN A B. Describing like humans: on diversity in image captioning[C]//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2019: 4190-4198.
|