«上一篇 下一篇»
  计算机工程  2022, Vol. 48 Issue (3): 229-235, 243  DOI: 10.19678/j.issn.1000-3428.0060943
0

引用本文  

汪荣贵, 李懂, 杨娟, 等. 基于跨域特征关联与聚类的无监督行人重识别[J]. 计算机工程, 2022, 48(3), 229-235, 243. DOI: 10.19678/j.issn.1000-3428.0060943.
WANG Ronggui, LI Dong, YANG Juan, et al. Unsupervised Pedestrian Re-Identification Based on Cross-Domain Feature Association and Clustering[J]. Computer Engineering, 2022, 48(3), 229-235, 243. DOI: 10.19678/j.issn.1000-3428.0060943.

基金项目

国家自然科学基金(61672202)

作者简介

汪荣贵(1966-), 男, 教授、博士, 主研方向为深度学习、智能视频处理;
李懂, 硕士研究生;
杨娟, 讲师、博士;
薛丽霞, 副教授、博士

文章历史

收稿日期:2021-02-25
修回日期:2021-03-26
基于跨域特征关联与聚类的无监督行人重识别
汪荣贵 , 李懂 , 杨娟 , 薛丽霞     
合肥工业大学 计算机与信息学院, 合肥 230601
摘要:行人重识别的目标是利用计算机视觉技术在多个摄像头采集的图像序列或视频中识别目标行人,基于监督学习的行人重识别算法虽然提高了目标的识别性能,但难以解决行人重识别中无标注目标域的域内变化问题,从而导致无标注数据检索准确度低。提出一种基于域自适应的无监督行人重识别算法,其主要由ResNet-50骨干网络、跨域特征提取器和用以存储目标域特征的特征库组成。通过跨域特征提取器融合行人样本在特征图与通道方向的特征,以挖掘不同行人重识别数据集间潜在的特征关联关系,同时为无标注目标数据集样本内的特征关联构建特征库,在无任何标注信息的情况下从一个未知数据集学习判别性特征。实验结果表明,该算法在源域DukeMTMC-reID/Market-1501和目标域Market-1501/DukeMTMC-reID的首位命中率相较于ECN算法分别提高8.9和6.8个百分点,能够提高模型在未知数据集上的泛化能力和无监督跨域行人重识别的准确度。
关键词行人重识别    跨镜头    域自适应    特征提取器    特征库    
Unsupervised Pedestrian Re-Identification Based on Cross-Domain Feature Association and Clustering
WANG Ronggui , LI Dong , YANG Juan , XUE Lixia     
School of Computer Science and Information Engineering, Hefei University of Technology, Hefei 230601, China
Abstract: The objective of pedestrian re-identification is to use computer vision technology to identify the target pedestrian in image sequence or video collected by multiple cameras.Although the pedestrian re-identification algorithm based on supervised learning improves the target re-identification performance, it is difficult to solve the problem of intra domain variation of unlabeled attention domain in pedestrian re-identification, resulting in low retrieval accuracy of unlabeled data.To solve this problem, this paper proposes an unsupervised pedestrian re-identification algorithm based on a domain adaptive method, which is mainly composed of ResNet-50 backbone network, cross-domain feature extractor and feature database to store the characteristics of the target domain.The cross-domain feature extractor is used to fuse the features of pedestrian samples in the feature map and channel direction, to mine the potential feature association between different pedestrian re-identification datasets.A feature database is constructed for the feature association in the unlabeled target dataset, and the discriminant features are learned from an unknown dataset without any labeling information.The experimental results show that the Rank-1 of the algorithm is 8.9 and 6.8 percentage points higher than that of the ECN algorithm in the source domain DukeMTMC-reID/Market-1501 and target domain Market-1501/DukeMTMC-reID, respectively, effectively improving the generalization ability of the model on unknown datasets and the accuracy of unsupervised cross domain pedestrian re-identification.
Key words: pedestrian re-identification    cross-camera    domain-adaptive    feature extractor    Feature Base(FB)    

开放科学(资源服务)标志码(OSID):

0 概述

随着深度学习的发展,行人重识别已成为计算机视觉领域的研究热点,因其在行人行为分析[1]、行人追踪[2-4]等方面的广泛应用而备受关注。行人重识别技术与行人检测算法相结合,普遍适用于智能视频监控系统[5]

行人重识别的研究面临行人姿态变化、图像分辨率低、行人遮挡姿态不完整以及由镜头切换导致行人视角转变、光照和背景变化等诸多挑战。由于拍摄场景的多样性,即使同一行人在不重叠视域的多摄像机或不同环境条件下表现的体貌特征也可能存在较大的差异,而不同行人可能因体型或衣着相似导致特征区分度低。此外,行人重识别数据获取难度较大,虽然通过目标检测方法[6]或基于深度学习的行人跟踪算法能够自动提取图像中的行人区域,但仍需人工标注行人身份ID。文献[7]根据已标注行人数据,采用生成对抗网络(Generative Adversarial Network,GAN)[8]快速生成行人样本,然而生成的图像分辨率较低,且模型性能提升有限。文献[9]提出结合行人外观和结构空间特征,通过GAN生成高质量的图像样本,进一步提高模型性能。

虽然数据集规模的扩充能够提高行人重识别模型的准确率,在一定程度上解决数据集规模过小的问题,但是GAN网络在训练过程中仍需标注大量样本。此外,不同行人重识别数据集在样本量和图像风格上存在较大差异,使得在一个数据集上训练的模型直接应用到未知数据时,会出现准确率显著下降的情况。针对该问题,无监督行人重识别方法[10-12]将无标注或仅部分标注的目标数据集加入到训练中,模型能够学习到目标数据集的样本特征,在一定程度上解决行人重识别的跨域问题。然而无监督行人重识别方法缺乏足够的标注信息,其与监督学习模型在准确率上存在较大差距。为进一步提升无监督行人重识别的准确度,文献[13]利用聚类方法将具有相似视觉特征的图像分配相同的伪标签,并用此方式获得的数据作为标注样本。文献[14]通过迭代选择聚类无标记的目标域以生成弱标签。文献[15]提出深度软多标签参考学习网络,将每张无标注行人图像与一组辅助参照样本进行对比,使得软多标签在不同视角相机下保持一致性。文献[16]提出一种基于软化相似度学习的无监督行人重识别框架,采用重新分配软标签分布的分类网络对约束平滑的相似图像进行学习。以上方法未能同时利用已有的标注数据来探索无标注数据内部特征关联。行人重识别域自适应的目标是利用有标记的源域与未标记的目标域学习一个具有较高泛化能力的行人重识别模型。当前主流方法多为减小源域和目标域之间的特征分布差异,而忽略了无标注目标域的域内变化。

以上行人重识别算法的无标注数据检索准确度低,为此,本文提出一种域自适应无监督行人重识别算法。利用跨域特征提取器(CSTE)挖掘不同行人重识别数据集间潜在的特征关联,在无任何标注信息的情况下,特征库从一个未知数据集中学习判别性特征,建立无标注目标域潜在的内部样本关联,从而提高行人重识别模型在无标注目标域的泛化能力。

1 域自适应无监督行人重识别网络结构 1.1 模型架构

源域和目标域分别代表已标注与无标注的行人重识别数据集,给定包括$ {N}_{\mathrm{s}} $张行人图像的源域数据集$ \left\{{X}_{\mathrm{s}}, {Y}_{\mathrm{s}}\right\} $,每张行人图像$ {x}_{i}^{\mathrm{s}} $标注有ID信息$ {y}_{i}^{\mathrm{s}} $;目标域数据集$ \left\{{X}_{\mathrm{t}}\right\} $包含$ {N}_{\mathrm{t}} $张行人图像,所有行人$ {x}_{i}^{\mathrm{t}} $无ID标注信息,其中$ \mathrm{s} $$ \mathrm{t} $分别表示源域与目标域。本文将已标注源域与无标注的目标域行人样本加入训练,学习一个在目标域具有较强泛化能力的特征表示。

本文所提的域自适应无监督行人重识别模型架构如图 1所示。

Download:
图 1 本文模型架构 Fig. 1 Framework of the proposed model

本文模型架构由ResNet-50骨干网络、跨域特征提取器(CSTE)和存储目标域特征的特征库3个模块构成。ResNet-50作为模型骨干网络,初步提取输入图像特征。CSTE通过学习源域与目标域行人的迁移不变性特征以挖掘不同行人重识别数据集间潜在的特征关联。特征库是利用无监督学习聚类算法从目标域中挖掘潜在的内部样本关联,以保存无标注目标域的样本特征。

模型的输入包括标注的源域行人数据集$ \{{X}_{\mathrm{s}}, {Y}_{\mathrm{s}}\} $与无标注的目标域行人数据集$ \left\{{X}_{\mathrm{t}}\right\} $。对于行人样本$ {x}_{i} $,ResNet-50骨干网络提取中间卷积层Layer 3与Layer 4的特征,并对Layer 4卷积层的输出用全局平均池化(Global Average Pooling,GAP)提取2 048维特征向量。模型训练过程分为有监督学习过程和无监督学习过程2个阶段,主要包括:1)在ResNet-50骨干网络的分类模块与CSTE分类模块,应用ID分类损失函数对输入的已标注源域样更新模型参数;2)对于无标注的目标数据集,CSTE模块对ResNet-50 Layer 3层的输出提取2 048维的特征向量,并与ResNet-50输出的同维向量相连,以得到4 096维特征向量作为训练阶段目标域行人特征,并将其存入在训练过程中实时更新的特征库,同时依据特征库计算目标域损失$ {L}_{\mathrm{t}\mathrm{g}\mathrm{t}} $以更新网络模型。评估阶段是对所有目标域输入图像进行提取,得到4 096维Eval特征向量,并作为模型的输出,将计算得到各行人Eval特征向量的余弦距离作为其相似度,对相似度进行排序并作为行人检索结果以评估模型性能。

1.1.1 跨域特征提取器

监督行人重识别算法无法利用无标注的目标域行人样本来更新模型参数,使得模型难以有效学习目标域的行人特征。本文所提CSTE可以挖掘不同行人重识别数据集间潜在的特征关联。CSTE提取输入的源域行人样本的特征向量,通过全连接分类层输出对应于源域行人ID数维度的向量,使用分类损失函数对输入的源域图像更新模型参数。同时,CSTE提取无标注的目标域行人样本的提取2 048维特征向量,将其与ResNet-50输出的同维向量相连并作为训练阶段目标域行人特征,并将该特征存储到特征库的对应位置。CSTE结构如图 2所示。

Download:
图 2 跨域特征提取器结构 Fig. 2 CSTE structure

给定输入特征$ \boldsymbol{X}\in {\mathbb{R}}^{C\times H\times W} $,其中$ C $表示输入特征通道数,$ H $$ W $分别表示特征图高与宽,CSTE模块提取流程主要有5个步骤。

步骤1    保持输入特征图$ \boldsymbol{X} $通道数$ C $不变,并在宽和高两个方向上展开得到矩阵$ \boldsymbol{A}=[C\times N],{\boldsymbol{A}}^{\mathrm{T}}=[N\times C] $,如式(1)所示:

$ \begin{array}{l}\boldsymbol{A}\left[c\right]\left[n\right]\leftarrow \boldsymbol{X}\left[c\right]\left[h\right]\left[w\right], \forall c\in \{\mathrm{1, 2}, \cdots , C\}, \\ h\in \{\mathrm{1, 2}, \cdots , H\}, w\in \{\mathrm{1, 2}, \cdots , W\}\end{array} $ (1)

其中:$ n\in \{\mathrm{1, 2}, \cdots , H\times W\} $$ w+h\times W=n $$ N=H\times W $,即将二维特征图在宽和高两个维度上展开为特征向量,方便后续计算。

步骤2    将Softmax函数应用于矩阵$ \boldsymbol{A}\times {\boldsymbol{A}}^{\mathrm{T}} $$ {\boldsymbol{A}}^{\mathrm{T}}\times \boldsymbol{A} $以更新参数,从图 2可以看出,通过上下两个通路提取通道与特征图宽和高两个方向对应的特征矩阵,如式(2)、式(3)所示:

$ \begin{array}{l}{x}_{ij}^{1}=\frac{\mathrm{e}\mathrm{x}\mathrm{p}({a}_{ik}\times {a}_{kj})}{\sum\limits_{j=1}^{N}\sum\limits_{k=1}^{N}\sum\limits_{i=1}^{C}\mathrm{e}\mathrm{x}\mathrm{p}({a}_{ik}\times {a}_{kj})}, \\ \forall i, j\in \{\mathrm{1, 2}, \cdots , C\}, k\in \{\mathrm{1, 2}, \cdots , N\}\end{array} $ (2)
$ \begin{array}{l}{x}_{ij}^{2}=\frac{\mathrm{e}\mathrm{x}\mathrm{p}({a}_{ik}\times {a}_{kj})}{\sum\limits_{j=1}^{N}\sum\limits_{k=1}^{N}\sum\limits_{i=1}^{C}\mathrm{e}\mathrm{x}\mathrm{p}({a}_{ik}\times {a}_{kj})}, \\ \forall i, j\in \{\mathrm{1, 2}, \cdots , N\}, k\in \{\mathrm{1, 2}, \cdots , C\}\end{array} $ (3)

其中:$ {a}_{ij} $为矩阵$ \boldsymbol{A} $的第$ i $行、第$ j $列元素。在步骤2中分别提取了源域与目标域在通道与特征图方向的共性特征,并将其融合以挖掘两个数据域间潜在的特征关联。

步骤3    将原始特征图$ \boldsymbol{A} $分别与第2步得到的矩阵相乘,如式(4)、式(5)所示:

$ \begin{array}{l}{x}_{ij}^{\mathrm{o}\mathrm{u}\mathrm{t}1}={x}_{ik}\times {a}_{kj}, \\ \forall i, k\in \{\mathrm{1, 2}, \cdots , C\}, j\in \{\mathrm{1, 2}, \cdots , N\}\end{array} $ (4)
$ \begin{array}{l}{x}_{ij}^{\mathrm{o}\mathrm{u}\mathrm{t}2}={a}_{ik}\times {x}_{kj}, \\ \forall i\in \{\mathrm{1, 2}, \cdots , C\}, k, j\in \{\mathrm{1, 2}, \cdots , N\}\end{array} $ (5)

步骤4    将步骤3的输出恢复为原始输入特征图$ \boldsymbol{X} $的大小,如式(6)、式(7)所示:

$ \begin{array}{l}{\boldsymbol{X}}^{\mathrm{o}\mathrm{u}\mathrm{t}1}\left[c\right]\left[h\right]\left[w\right]\leftarrow {x}_{cn}^{\mathrm{o}\mathrm{u}\mathrm{t}1}, \\ \forall c\in \{\mathrm{1, 2}, \cdots , C\}, n\in \{\mathrm{1, 2}, \cdots , N\}, w+h\times W=n\end{array} $ (6)
$ \begin{array}{l}{\boldsymbol{X}}^{\mathrm{o}\mathrm{u}\mathrm{t}2}\left[c\right]\left[h\right]\left[w\right]\leftarrow {x}_{cn}^{\mathrm{o}\mathrm{u}\mathrm{t}2}, \\ \forall c\in \{\mathrm{1, 2}, \cdots , C\}, n\in \{\mathrm{1, 2}, \cdots , N\}, w+h\times W=n\end{array} $ (7)

步骤5    将$ {\boldsymbol{X}}^{\mathrm{o}\mathrm{u}\mathrm{t}1} $$ {\boldsymbol{X}}^{\mathrm{o}\mathrm{u}\mathrm{t}2} $分别与原输入特征图$ \boldsymbol{X} $对应的元素相加,再经全局平均池化(GAP)得到2个大小为1 024的特征向量,最后将2个向量直接相连作为CSTE模块的最终输出,如式(8)所示:

$ {O}_{\mathrm{C}\mathrm{S}\mathrm{T}\mathrm{E}}^{\mathrm{o}\mathrm{u}\mathrm{t}}{}_{}=\mathrm{C}\mathrm{o}\mathrm{n}\mathrm{c}\mathrm{a}\mathrm{t}\left({G}_{\mathrm{G}\mathrm{A}\mathrm{P}}\right({\boldsymbol{X}}^{\mathrm{o}\mathrm{u}\mathrm{t}1}\mathrm{⊕}\boldsymbol{X}), {G}_{\mathrm{G}\mathrm{A}\mathrm{P}}({\boldsymbol{X}}^{\mathrm{o}\mathrm{u}\mathrm{t}2}\mathrm{⊕}\boldsymbol{X}\left)\right) $ (8)

其中:$ \mathrm{⊕} $为特征按元素求和操作;GGAP为全局平均池化。在无监督学习设置下,将2 048维的特征$ {O}_{\mathrm{C}\mathrm{S}\mathrm{T}\mathrm{E}}^{\mathrm{O}\mathrm{u}\mathrm{t}} $与ResNet-50输出的同维向量相连接,作为目标域的样本特征并存储在特征库的相应位置。CSTE利用ID分类损失对源域行人样本进行监督学习。

1.1.2 特征库

为提高行人重识别算法在实际应用场景下的准确度,本文将无标注的目标域行人样本加入进行训练。由于有监督学习方法无法将分类损失函数应用于无标注数据中,本文提出FB模块以存放目标域行人的特征向量,并在模型训练阶段实时更新特征库,在目标域中通过无监督学习聚类算法挖掘潜在的内部样本关联。本文定义特征库$ \boldsymbol{V}=\{{\boldsymbol{v}}_{i}{\}}_{i=1}^{{N}_{\mathrm{t}}} $,其中$ \boldsymbol{V}\in {\mathbb{R}}^{D\times {N}_{t}} $,索引$ i $表示目标域第$ i $个样本,$ {N}_{\mathrm{t}} $表示目标域样本总数,$ {\boldsymbol{v}}_{\boldsymbol{i}} $为维度$ D $(4 096)的特征向量,分别对应于目标域各样本的实时特征。特征库初始化为$ \boldsymbol{V}={\left\{0\right\}}_{i=1}^{{N}_{\mathrm{t}}} $,以$ \boldsymbol{f}\left({x}_{i}^{t}\right) $表示模型提取目标域样本$ {x}_{i}^{\mathrm{t}} $的特征向量,在模型训练过程中通过式(9)实时更新特征库:

$ \begin{array}{c}{\boldsymbol{v}}_{i}\leftarrow \end{array}\left|\right|\alpha \cdot {\boldsymbol{v}}_{i}+(1-\alpha )\cdot \boldsymbol{f}\left({x}_{i}^{t}\right)|{|}_{{}_{2}} $ (9)

其中:$ \left|\right|\mathrm{ }\cdot \mathrm{ }|{|}_{2} $为L2正则化;参数$ \alpha $为控制特征库更新率,并随着模型轮回数的增加而减小,$ \alpha $越大表示当前阶段特征更新越缓慢。

在模型训练过程中,特征库存储所有目标域样本的特征向量,通过计算样本间特征余弦距离以搜索与目标域中具有相似特征的行人。定义$ \boldsymbol{{E}}\in {\mathbb{R}}^{{N}_{\mathrm{t}}\times {N}_{\mathrm{t}}} $为目标域所有行人余弦距离矩阵,如式(10)所示:

$ \begin{array}{c}{ {\boldsymbol{E}}}\left[i\right]\left[j\right]={\boldsymbol{V}}{\left[j\right]}^{\mathrm{T}}\times {\boldsymbol{f}}\left({x}^{\mathrm{t}}i\right), \forall i, j\in \{\mathrm{1, 2}, \cdots , {N}_{t}\}\end{array} $ (10)

其中:$ \boldsymbol{{ E}}\left[i\right]\left[j\right]\in \left[\mathrm{0, 1}\right] $$ \boldsymbol{V}\left[j\right] $为特征库中图像$ {x}_{j}^{\mathrm{t}} $的特征向量。若两个样本的余弦距离大于一定的阈值$ \theta $(0.5)时,则表示该样本对为同一行人,否则将其视为不同的ID。式(11)定义的$ \boldsymbol{{ K}}\left[i\right]\left[j\right] $表示输入图像$ {x}_{i}^{\mathrm{t}} $$ {x}_{j}^{\mathrm{t}} $是否为同一行人。$ \boldsymbol{{ K}}\left[i\right]\left[j\right]=1 $表示输入样本$ {x}_{i}^{\mathrm{t}} $$ {x}_{j}^{\mathrm{t}} $属于同一行人,相反$ \boldsymbol{{ K}}\left[i\right]\left[j\right]=0 $表示两个行人身份ID不同。

$ \begin{array}{c}{{\boldsymbol{ K}}}\left[i\right]\left[j\right]=\left\{\begin{array}{c}1, \boldsymbol{{ E}}\left[i\right]\left[j\right] > \theta \\ 0, \boldsymbol{{ E}}\left[i\right]\left[j\right] < \theta \end{array}\right., \forall i, j\in \{\mathrm{1, 2}, \cdots , {N}_{t}\}\end{array} $ (11)

本文利用无标注样本间的潜在特征关联选择目标域中特征相近的样本作为同一聚类,通过最小化目标域相似样本间的距离来拉近正样本对,定义如下损失函数,如式(12)所示:

$ \begin{array}{c}{\mathcal{L}}_{\mathrm{p}\mathrm{u}\mathrm{l}\mathrm{l}}=-\frac{1}{{N}_{t}}\sum\limits_{i=1}^{{N}_{\mathrm{t}}}\sum\limits_{j=1}^{{N}_{\mathrm{t}}}\frac{\boldsymbol{K}\left[i\right]\left[j\right]\times \mathrm{I}\mathrm{n}\ p\left(j\right|{x}_{i}^{\mathrm{t}})}{\left|\right|\boldsymbol{K}\left[i\right]\left|\right|\times \mathrm{I}\mathrm{n}\ p\left(\right|\left|\boldsymbol{K}\right[i\left]\right|\left|\right)}\end{array} $ (12)

其中:$ \left|\right|\mathrm{ }\cdot \mathrm{ }\left|\right| $为对所有元素求和;利用Softmax函数计算行人$ {x}^{\mathrm{t}} $身份ID为$ i $的概率,如式(13)所示:

$ \begin{array}{c}p\left(i\right|{x}^{\mathrm{t}})=\frac{\mathrm{e}\mathrm{x}\mathrm{p}(\boldsymbol{V}{\left[i\right]}^{\mathrm{T}}\times \boldsymbol{f}({x}^{\mathrm{t}})/\eta )}{\sum\limits_{j=1}^{{N}_{\mathrm{t}}}\mathrm{e}\mathrm{x}\mathrm{p}(\boldsymbol{V}{\left[j\right]}^{\mathrm{T}}\times \boldsymbol{f}({x}^{\mathrm{t}})/\eta )}\end{array} $ (13)

其中:$ \eta $为Softmax函数的温度参数,$ \eta $越大则函数结果越平滑,反之越尖锐,本文取值为0.1;$ \boldsymbol{V}\left[j\right] $表示特征库第$ j $列,即$ {\boldsymbol{v}}_{j} $

在训练过程中将目标域中所有样本视为不同的行人,$ {\mathcal{L}}_{\mathrm{p}\mathrm{u}\mathrm{s}\mathrm{h}} $损失函数使得不同行人之间的距离最大化,从而提高模型挖掘无标注样本潜在区别性特征的能力,如式(14)所示:

$ \begin{array}{c}{\mathcal{L}}_{\mathrm{p}\mathrm{u}\mathrm{s}\mathrm{h}}=-\sum\limits_{i=1}^{{N}_{\mathrm{t}}}\mathrm{l}\mathrm{n}p\left(i\right|{x}_{i}^{\mathrm{t}})\end{array} $ (14)

本文通过无监督学习挖掘目标域中的特征关联,设计$ {\mathcal{L}}_{\mathrm{p}\mathrm{u}\mathrm{s}\mathrm{h}} $$ {\mathcal{L}}_{\mathrm{p}\mathrm{u}\mathrm{l}\mathrm{l}} $损失函数以拉近特征相似的正样本对,从而推远特征相差较大的负样本对。本文用$ {\mathcal{L}}_{\mathrm{t}\mathrm{g}\mathrm{t}} $表示上述两个损失函数之和,如式(15)所示:

$ \begin{array}{c}{\mathcal{L}}_{\mathrm{t}\mathrm{g}\mathrm{t}}={\mathcal{L}}_{\mathrm{p}\mathrm{u}\mathrm{s}\mathrm{h}}+{\mathcal{L}}_{\mathrm{p}\mathrm{u}\mathrm{l}\mathrm{l}}\end{array} $ (15)
1.1.3 多损失函数学习

本文利用源域与目标域行人数据来更新模型,将训练过程分为监督和无监督2个阶段。在监督学习阶段,本文采用分类交叉熵损失函数$ {\mathcal{L}}_{\mathrm{s}\mathrm{r}\mathrm{c}} $更新ResNet-50骨干网络,如式(16)所示:

$ \begin{array}{c}{\mathcal{L}}_{\mathrm{s}\mathrm{r}\mathrm{c}}=-\frac{1}{{N}_{\mathrm{s}}}\sum\limits_{i=1}^{{N}_{\mathrm{s}}}\mathrm{l}\mathrm{n}\ p\left({y}_{i}^{\mathrm{s}}\right|{x}_{i}^{\mathrm{s}})\end{array} $ (16)

其中:$ p\left({y}_{i}^{\mathrm{s}}\right|{x}_{i}^{\mathrm{s}}) $为源域样本$ {x}_{i}^{\mathrm{s}} $与身份ID $ {y}_{i}^{s} $的概率。类似地,将交叉熵损失函数应用于CSTE模块,分类损失函数如式(17)所示:

$ \begin{array}{c}{\mathcal{L}}_{\mathrm{C}\mathrm{S}\mathrm{T}\mathrm{E}}=-\frac{1}{{N}_{\mathrm{s}}}\sum\limits_{i=1}^{{N}_{\mathrm{s}}}\mathrm{l}\mathrm{n}\ p\end{array}\left({y}_{i}^{\mathrm{s}}\right|{x}_{i}^{\mathrm{s}}) $ (17)

用于模型训练的总损失函数如式(18)所示:

$ \begin{array}{c}{\mathcal{L}}_{\mathrm{t}\mathrm{o}\mathrm{t}\mathrm{a}\mathrm{l}}=\lambda \times {\mathcal{L}}_{\mathrm{s}\mathrm{r}\mathrm{c}}+\beta \times {\mathcal{L}}_{\mathrm{t}\mathrm{g}\mathrm{t}}+\zeta \times {\mathcal{L}}_{\mathrm{C}\mathrm{S}\mathrm{T}\mathrm{E}}\end{array} $ (18)

其中:参数$ \lambda \mathrm{、}\beta \mathrm{、}\zeta $为控制上述3种损失函数的相对权重,在实验中分别设置为0.3、0.7、0.5。最小化$ {\mathcal{L}}_{\mathrm{C}\mathrm{S}\mathrm{T}\mathrm{E}} $能够提高模型有效挖掘源域与目标域之间特征关联的能力。

2 实验结果分析 2.1 实验数据与评价准则

为验证所提算法的有效性,本文在行人重识别三大公开数据集Market-1501[17]、DukeMTMC-reID[2]与MSMT17[18]上进行实验,采用平均精度均值(mAP)[17]和累积匹配特性曲线(CMC)[19]作为算法性能的评估指标。Market-1501数据集包括在6个摄像头视角下的1 501个行人,其中751个行人的12 936幅图像用作训练,750个行人的19 732幅图像用于评估模型性能。DukeMTMC-reID作为DukeMTMC数据集的子集,包括在8个摄像头下采集的1 812个行人的16 522个样本,2 228幅检索图像。MSMT17数据集包括在12个室外和3个室内共15个摄像头采集的4 101个行人的126 441幅图像,是目前规模最大的行人重识别数据集。

2.2 实验环境

本文使用ImageNet数据集[20]预训练ResNet-50模型[21]作为骨干网络。实验采用Linux环境下开源Pytorch框架[22],在NVIDIA GeForce RTX 2080Ti GPU上进行80个轮回数,将所有输入的图像尺寸调整为256×128,并以0.5的概率进行随机水平翻转和随机擦除[23],采用随机梯度下降(SGD)优化器[24],学习率为0.1,动量因子为0.9。

2.3 其他先进算法对比

近年来,其他先进跨域行人重识别算法主要有PTGAN[18]、CamStyle[25]、SPGAN[10]、MMFA[26]、TJ-AIDL[27]、HHL[28]、ECN[29]等,其中PTGAN[18]、CamStyle[25]通过扩充样本提高模型的泛化能力,SPGAN[10]、MMFA[26]、TJ-AIDL[27]、HHL[28]与ECN[29]为域自适应无监督行人重识别算法。本文在三大公开行人重识别数据集上对本文算法与其他算法进行性能对比,以验证本文所提算法各模块在不同实验设置下的有效性。在Market-1501/DukeMTMC-reID数据集上不同算法的性能指标对比如表 1所示。当DukeMTMC-reID为源域,Market-1501为目标域时(DukeMTMC-reID to Market-1501),本文算法的mAP指标和Rank-1指标相较于ECN算法分别提高20.1和8.9个百分点。当DukeMTMC-reID为目标域,Market-1501为源域时(Market-1501 to DukeMTMC-reID),本文算法mAP和Rank-1指标相较于ECN算法分别提高8.7和6.8个百分点。在Market-1501/DukeMTMC-reID数据集,本文所提算法的CMC与mAP指标均优于近年来无监督行人重识别算法。

下载CSV 表 1 在Market-1501和DukeMTMC-reID数据集上不同算法的性能指标对比 Table 1 Performance indexs comparison among different algorithms on Market-1501 and DukeMTMC-reID datasets  

为进一步验证本文算法的有效性,表 2表示MSMT17为目标域时不同算法的性能指标对比。当Market-1501为源域时,相比ECN算法,本文算法的Rank-1和mAP分别提高了6.1和2.9个百分点。当DukeMTMC-reID为源域时,相比ECN算法,本文算法的Rank-1和mAP指标分别提高4.5和2.8个百分点,说明本文算法在大规模行人重识别数据集具有通用性与适应性。

下载CSV 表 2 在MSMT17数据集上不同算法的性能指标对比 Table 2 Performance indexs comparison among different algorithms on MSMT17 dataset  

本文模型经过80个轮回数训练后的性能测试用时如表 3所示。实验数据集规模由小到大依次为:Market-1501、DukeMTMC-reID与MSMT17。从表 3可以看出,模型训练和测试用时与数据集包括的图像数量成正相关。

下载CSV 表 3 训练与测试各数据集时间对比 Table 3 Comparison of training and testing time of each dataset
2.4 消融实验

在Market-1501/DukeMTMC-reID数据集上,本文算法有无Ltgt的准确率对比如图 3所示。从图 3可以看出,模型在约70个轮回数时出现收敛的情况。为验证本文算法中各模块的有效性,在本文算法中加入FB模块和同时加入FB和CSTE模块的性能指标对比如表 4所示。在以DukeMTMC-reID作为源域的Market-1501数据集上,同时加入FB和CSTE模块相较于只加入FB模块算法的Rank-1和mAP分别提升了1.9和2.6个百分点,在以Market-1501作为源域的DukeMTMC-reID数据集上,Rank-1和mAP分别提升1.9和2.3个百分点。因此,同时加入FB和CSTE模块能够高效地利用源域与目标域的特征属性,有助于提升算法提取行人特征的能力,从而提高算法的准确性。

Download:
图 3 本文算法有无Ltgt的准确率对比 Fig. 3 Accuracy comparison of the proposed algorithm with and without Ltgt
下载CSV 表 4 本文算法有无CSTE/FB模块的性能指标对比 Table 4 Performance indexs comparison of the proposed algorithm with and without CSTE/FB modules  

图 4展示了在Market-1501与DukeMTMC-reID数据集上本文算法有无FB/FB+CSTE模块的部分行人检索结果,输出与查询图像最相似的10张行人检索图片。图中空心矩形框包围的图像检索结果与查询图像属于不同的行人,即错误的检索结果。其他图像表示检索结果与查询图像属于同一行人,具有相同标签为正确的检索结果。从图 4可以看出,在Market-1501与DukeMTMC-reID数据集上引入CSTE模块均能改进模型的检索效果。

Download:
图 4 本文算法有无FB/(FB+CSTE)模块的部分行人检索结果 Fig. 4 Part of pedestrian search results of the proposed algorithm with and without FB/(FB+CSTE) modules
3 结束语

本文提出一种域自适应的无监督行人重识别算法,利用跨域特征提取器挖掘不同行人重识别数据集间潜在的特征关联关系,以提高算法在未知数据集上的泛化能力,同时通过特征库存储的无标注样本属性特征从未知数据集中学习判别性特征,建立目标域潜在的内部样本关联关系。实验结果表明,相比ECN、PTGAN等算法,本文算法具有较强的可扩展性和识别性能,能够显著提高无监督跨域行人重识别的准确度。下一步将利用现有数据改进模型泛化能力,研究适用于多源域多目标域应用场景的行人重识别算法。

参考文献
[1]
CHEN C L, TAO X, GONG S G. Multi-camera activity correlation analysis[C]//Proceedings of IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Miami, Florida, USA: IEEE Press, 2009: 1988-1995.
[2]
RISTANI E, SOLERA F, ZOU R S, et al. Performance measures and a data set for multi-target, multicamera tracking[C]//Proceedings of European Conference on Computer Vision. Berlin, Germany: Springer, 2016: 17-35.
[3]
YU S I, YI Y, HAUPTMANN A. Harry potter's marauder's map: localizing and tracking multiple persons-of-interest by nonnegative discretization[C]//Proceedings of Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2013: 3714-3720.
[4]
MAZZON R, CAVALLARO A. Multi-camera tracking using a multi-goal social force model[J]. Neurocomputing, 2013, 100(1): 41-50.
[5]
VEZZANI R, BALTIERI D, CUCCHIARA R. People reidentification in surveillance and forensics[J]. ACM Computing Surveys, 2013, 46(2): 1-37.
[6]
DAI J F, LI Y, HE K, et al. R-FCN: object detection via region-based fully convolutional networks[C]//Proceedings of the 30th International Conference on Neural Information Processing Systems. New York, USA: ACM Press, 2016: 379-387.
[7]
ZHENG Z D, ZHENG L, YANG Y. Unlabeled samples generated by GAN improve the person re-identification baseline in vitro[C]//Proceedings of IEEE International Conference on Computer Vision. Washington D.C., USA: IEEE Press, 2017: 3774-3782.
[8]
GOODFELLOW I J, POUGET-ABADIE J, MIRZA M, et al. Generative adversarial nets[C]//Proceedings of Neural Information Processing Systems. Cambridge, USA: MIT Press, 2014: 2672-2680.
[9]
ZHENG Z D, YANG X D, YU Z D, et al. Joint discriminative and generative learning for person re-identification[C]//Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2019: 2138-2147.
[10]
DENG W J, ZHENG L, YE Q X, et al. Image-image domain adaptation with preserved self-similarity and domain-dissimilarity for person re-identification[C]//Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 994-1003.
[11]
BAK S, CARR P, LALONDE J F. Domain adaptation through synthesis for unsupervised personre-identification[C]//Proceedings of European Conference on Computer Vision. Berlin, Germany: Springer, 2018: 193-209.
[12]
KODIROV E, XIANG T, FU Z Y, et al. Person re-identification by unsupervised ℓ1 graph learning[J]. Hydrobiologia, 2016, 415(11): 178-195.
[13]
YU H X, WU A C, ZHENG W S. Cross-view asymmetric metric learning for unsupervised person re-identification[C]//Proceedings of IEEE International Conference on Computer Vision. Washington D.C., USA: IEEE Press, 2017: 994-1002.
[14]
FAN H H, ZHENG L, YAN C G, et al. Unsupervised person re-identification: clustering and fine-tuning[J]. ACM Transactions on Multimedia Computing Communications and Applications, 2018, 14(4): 1-18.
[15]
YU H X, ZHENG W S, WU A C, et al. Unsupervised person re-identification by soft multilabel learning[C]//Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2019: 2143-2152.
[16]
LIN Y T, XIE L X, WU Y, et al. Unsupervised person re-identification via softened similarity learning[C]//Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2020: 3390-3399.
[17]
ZHENG L, SHEN L Y, TIAN L, et al. Scalable person re-identification: a benchmark[C]//Proceedings of IEEE International Conference on Computer Vision. Washington D.C., USA: IEEE Press, 2015: 1116-1124.
[18]
WEI L H, ZHANG S L, GAO W, et al. Person transfer GAN to bridge domain gap for person re-identification[C]//Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 79-88.
[19]
MOON H, PHILLIPS P J. Computational and performance aspects of PCA-based face-recognition algorithms[J]. Perception, 2001, 30(3): 303-321. DOI:10.1068/p2896
[20]
JIA D, WEI D, SOCHER R, et al. ImageNet: a large-scale hierarchical image database[C]//Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2009: 248-255.
[21]
HE K M, ZHANG X Y, REN S Q, et al. Deep residual learning for image recognition[C]//Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2016: 770-778.
[22]
Pytorch[EB/OL]. [2021-01-20] https://pytorch.org/.
[23]
ZHONG Z, ZHENG L, KANG G L, et al. Random erasing data augmentation[EB/OL]. [2021-01-23]. https://arxiv.org/pdf/1708.04896.pdf.
[24]
BOTTOU L. Large-scale machine learning with stochastic gradient descent[C]//Proceedings of the 19th International Conference on Computational Statistics. Berlin, Germany: Springer, 2010: 177-186.
[25]
ZHONG Z, ZHENG L, ZHENG Z D, et al. Camstyle: a novel data augmentation method for person re-identification[J]. IEEE Transactions on Image Processing, 2019, 28(3): 1176-1190.
[26]
LIN S, LI H L, LI C T, et al. Multi-task mid-level feature alignment network for unsupervised cross-dataset person re-identification[EB/OL]. [2021-01-23]. https://arxiv.org/pdf/1807.01440.pdf.
[27]
WANG J Y, ZHU X T, GONG S G, et al. Transferable joint attribute-identity deep learning for unsupervised person re-identification[C]//Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2018: 2275-2284.
[28]
ZHONG Z, ZHENG L, LI S Z, et al. Generalizing a person retrieval model hetero- and homogeneously[C]//Proceedings of European Conference on Computer Vision. New York, USA: ACM Press, 2018: 176-192.
[29]
ZHONG Z, ZHENG L, LUO Z M, et al. Invariance matters: exemplar memory for domain adaptive person re-identification[C]//Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2019: 598-607.
[30]
ZHOU J H, SU B, WU Y. Online joint multi-metric adaptation from frequent sharing-subset mining for person re-identification[C]//Proceedings of IEEE/CVF Conference on Compunter Vision and Pattern Recognition. Washington D.C., USA: IEEE Press, 2020: 2909-2918.