CN112381056B - A cross-domain pedestrian re-identification method and system integrating multiple source domains - Google Patents

A cross-domain pedestrian re-identification method and system integrating multiple source domains Download PDF

Info

Publication number
CN112381056B
CN112381056B CN202011399651.4A CN202011399651A CN112381056B CN 112381056 B CN112381056 B CN 112381056B CN 202011399651 A CN202011399651 A CN 202011399651A CN 112381056 B CN112381056 B CN 112381056B
Authority
CN
China
Prior art keywords
pedestrian
sample pair
cross
domain
identified
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011399651.4A
Other languages
Chinese (zh)
Other versions
CN112381056A (en
Inventor
李琳
李涛
魏巍
崔军彪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taiyuan Communication Industry Co ltd
Original Assignee
Shanxi University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanxi University filed Critical Shanxi University
Priority to CN202011399651.4A priority Critical patent/CN112381056B/en
Publication of CN112381056A publication Critical patent/CN112381056A/en
Application granted granted Critical
Publication of CN112381056B publication Critical patent/CN112381056B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种融合多个源域的跨域行人重识别方法及系统。该方法包括:在对跨域行人重识别模型进行训练时,获取多组源域数据集,采用一组源域数据集训练一个表示学习网络和度量学习网络的方法对跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型,在进行行人重识别时,将待识别的行人样本对输入训练好的跨域行人重识别模型中,得到行人重识别结果。采用本发明的方法及系统,在训练过程中融合了多个源域的数据,能够更好的学习到行人的特征表示,相比单一训练模型,能够提高行人重识别准确度,有效的解决了域间差异引起的模型性能下降的问题。

Figure 202011399651

The invention discloses a cross-domain pedestrian re-identification method and system integrating multiple source domains. The method includes: when training a cross-domain person re-identification model, acquiring multiple sets of source domain data sets, and using a set of source domain data sets to train a representation learning network and a metric learning network to perform the cross-domain person re-identification model on the cross-domain person re-identification model. After training, the trained cross-domain pedestrian re-identification model is obtained. When performing pedestrian re-identification, the pedestrian samples to be identified are input into the trained cross-domain pedestrian re-identification model, and the pedestrian re-identification result is obtained. By adopting the method and system of the present invention, the data of multiple source domains are integrated in the training process, and the feature representation of pedestrians can be better learned. Compared with a single training model, the accuracy of pedestrian re-identification can be improved, which effectively solves the problem of The problem of model performance degradation caused by differences between domains.

Figure 202011399651

Description

一种融合多个源域的跨域行人重识别方法及系统A cross-domain pedestrian re-identification method and system integrating multiple source domains

技术领域technical field

本发明涉及行人重识别技术领域,特别是涉及一种融合多个源域的跨域行人重识别方法及系统。The invention relates to the technical field of pedestrian re-identification, in particular to a cross-domain pedestrian re-identification method and system integrating multiple source domains.

背景技术Background technique

行人重识别(Person re-identification)也称行人再识别,是利用计算机视觉技术判断图像或者视频序列中是否存在特定行人的技术。近年来由于深度学习的迅速发展,行人重识别算法性能也有了前所未有的提高。在实现基于深度学习的行人重识别系统时,将单一训练集训练好的模型应用于实际场景时,性能下降非常明显,这是因为当直接将训练好的模型直接用于现实场景中时,往往因为实际场景中的行人和训练数据集存在域间差异,导致模型性能下降。Pedestrian re-identification, also known as pedestrian re-identification, is a technology that uses computer vision technology to determine whether there is a specific pedestrian in an image or video sequence. In recent years, due to the rapid development of deep learning, the performance of person re-identification algorithms has also been unprecedentedly improved. When implementing a deep learning-based person re-identification system, when the model trained by a single training set is applied to the actual scene, the performance drops very significantly. This is because when the trained model is directly used in the actual scene, it is often The performance of the model is degraded because of the inter-domain differences between the pedestrians in the actual scene and the training dataset.

发明内容SUMMARY OF THE INVENTION

本发明的目的是提供一种融合多个源域的跨域行人重识别方法及系统,能够有效解决域间差异引起的模型性能下降的问题,提高行人重识别准确度。The purpose of the present invention is to provide a cross-domain pedestrian re-identification method and system integrating multiple source domains, which can effectively solve the problem of model performance degradation caused by differences between domains and improve the accuracy of pedestrian re-identification.

为实现上述目的,本发明提供了如下方案:For achieving the above object, the present invention provides the following scheme:

一种行人重识别方法,包括:A pedestrian re-identification method, comprising:

获取待识别的行人样本对;所述待识别的行人样本对包括两个待识别的行人样本;obtaining a pedestrian sample pair to be identified; the pedestrian sample pair to be identified includes two pedestrian samples to be identified;

将所述待识别的行人样本对输入训练好的跨域行人重识别模型中,得到行人重识别结果;所述跨域行人重识别模型包括多个表示学习网络和一个度量学习网络,所述表示学习网络采用ResNet-50网络结构,所述度量学习网络采用三层全连接网络结构;The pedestrian samples to be identified are input into a trained cross-domain pedestrian re-identification model, and a pedestrian re-identification result is obtained; the cross-domain pedestrian re-identification model includes multiple representation learning networks and a metric learning network, and the representation The learning network adopts the ResNet-50 network structure, and the metric learning network adopts a three-layer fully connected network structure;

所述跨域行人重识别模型的训练方法,具体包括:The training method of the cross-domain pedestrian re-identification model specifically includes:

获取多组源域数据集;每组所述源域数据集包括多个待训练的行人样本,每个所述待训练的行人样本对应有行人标签;所述源域数据集的个数与所述表示学习网络的个数相同;Obtain multiple sets of source domain data sets; each group of said source domain data sets includes a plurality of pedestrian samples to be trained, and each said pedestrian sample to be trained corresponds to a pedestrian label; the number of said source domain data sets is the same as all The above means that the number of learning networks is the same;

采用一组源域数据集训练一个表示学习网络和度量学习网络的方法对所述跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型。A set of source domain data sets are used to train a representation learning network and a metric learning network to train the cross-domain person re-identification model, and a trained cross-domain person re-identification model is obtained.

可选的,所述将所述待识别的行人样本对输入训练好的跨域行人重识别模型中,得到行人重识别结果,具体包括:Optionally, the pedestrian sample to be identified is input into the trained cross-domain pedestrian re-identification model to obtain a pedestrian re-identification result, which specifically includes:

将所述待识别的行人样本对输入训练好的跨域行人重识别模型中,得到多个待识别的行人特征组;每个行人特征组包括两个行人特征;Inputting the pedestrian samples to be identified into the trained cross-domain pedestrian re-identification model, a plurality of pedestrian feature groups to be identified are obtained; each pedestrian feature group includes two pedestrian features;

计算每个待识别的行人特征组的两个行人特征之间的距离,得到多个待识别的行人特征距离;Calculate the distance between the two pedestrian features of each pedestrian feature group to be identified, and obtain a plurality of pedestrian feature distances to be identified;

判断所述待识别的行人特征距离小于预设距离的个数是否超过待识别的行人特征距离总数的一半;若是,则确定所述待识别的行人样本对中的行人样本相同;若否,则确定所述待识别的行人样本对中的行人样本不同。Determine whether the number of pedestrian feature distances to be identified that is less than the preset distance exceeds half of the total number of pedestrian feature distances to be identified; if so, determine that the pedestrian samples in the pair of pedestrian samples to be identified are the same; if not, then It is determined that the pedestrian samples in the pair of pedestrian samples to be identified are different.

可选的,所述采用一组源域数据集训练一个表示学习网络和度量学习网络的方法对所述跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型,具体包括:Optionally, the method of using a set of source domain data sets to train a representation learning network and a metric learning network is used to train the cross-domain pedestrian re-identification model to obtain a trained cross-domain pedestrian re-identification model, which specifically includes:

选取一组源域数据集和一个表示学习网络;所述源域数据集包括正样本对和负样本对,所述正样本对包括行人相同的两个行人样本,所述负样本对包括行人不同的两个行人样本,且所述负样本对中的一个行人样本与所述正样本对中的一个行人样本相同;Select a set of source domain data sets and a representation learning network; the source domain data set includes a positive sample pair and a negative sample pair, the positive sample pair includes two pedestrian samples with the same pedestrian, and the negative sample pair includes different pedestrians two pedestrian samples of , and one pedestrian sample in the negative sample pair is the same as one pedestrian sample in the positive sample pair;

将选取的源域数据集输入选取的表示学习网络中,得到多个第一行人特征;Input the selected source domain dataset into the selected representation learning network to obtain multiple first pedestrian features;

将多个所述第一行人特征输入所述度量学习网络中,得到多个第二行人特征;Inputting a plurality of the first pedestrian features into the metric learning network to obtain a plurality of second pedestrian features;

根据所述第二行人特征计算所述正样本对对应的行人特征距离和负样本对对应的行人特征距离;Calculate the pedestrian feature distance corresponding to the positive sample pair and the pedestrian feature distance corresponding to the negative sample pair according to the second pedestrian feature;

根据所述正样本对对应的行人特征距离和所述负样本对对应的行人特征距离计算损失值,并以损失值最小为优化目标,采用梯度下降法优化所述跨域行人重识别模型中的参数;The loss value is calculated according to the pedestrian feature distance corresponding to the positive sample pair and the pedestrian feature distance corresponding to the negative sample pair, and taking the minimum loss value as the optimization goal, the gradient descent method is used to optimize the cross-domain pedestrian re-identification model. parameter;

判断所有源域数据集是否全部选取完,若是,则得到训练好的跨域行人重识别模型,若否,则在未被选取的源域数据集中选取一个源域数据集,并在未被选取的表示学习网络中选取一个表示学习网络,然后返回步骤“将选取的源域数据集输入选取的表示学习网络中,得到多个第一行人特征”。Determine whether all source domain datasets have been selected. If so, get the trained cross-domain pedestrian re-identification model. If not, select a source domain dataset from the unselected source domain dataset, and select a source domain dataset from the unselected source domain dataset. Select a representation learning network from the selected representation learning network, and then return to the step "input the selected source domain dataset into the selected representation learning network to obtain multiple first pedestrian features".

可选的,optional,

所述行人特征距离的计算公式如下:The calculation formula of the pedestrian feature distance is as follows:

Figure BDA0002812122360000031
Figure BDA0002812122360000031

式中,

Figure BDA0002812122360000032
Figure BDA0002812122360000033
Figure BDA0002812122360000034
的行人特征距离,
Figure BDA0002812122360000035
为第t个源域数据集中第i个行人样本,
Figure BDA0002812122360000036
为第t个源域数据集中第j个行人样本,
Figure BDA0002812122360000037
Figure BDA0002812122360000038
对应的第二行人特征,
Figure BDA0002812122360000039
Figure BDA00028121223600000310
对应的第二行人特征,C为度量学习网络;In the formula,
Figure BDA0002812122360000032
for
Figure BDA0002812122360000033
and
Figure BDA0002812122360000034
The pedestrian characteristic distance of ,
Figure BDA0002812122360000035
is the i-th pedestrian sample in the t-th source domain dataset,
Figure BDA0002812122360000036
is the jth pedestrian sample in the tth source domain dataset,
Figure BDA0002812122360000037
for
Figure BDA0002812122360000038
The corresponding second pedestrian feature,
Figure BDA0002812122360000039
for
Figure BDA00028121223600000310
The corresponding second pedestrian feature, C is the metric learning network;

所述损失值的计算公式如下:The formula for calculating the loss value is as follows:

Ltriple=[dp-dn+α]+ L triple =[d p -d n +α] +

式中,Ltriple为损失值,dp为负样本对对应的行人特征距离,dn为正样本对对应的行人特征距离,α为dp和dn的预设间隔,[dp-dn+α]+表示当dn<dp+α时,损失值保持不变,当dn≥dp+α时,损失值为0。In the formula, L triple is the loss value, d p is the pedestrian feature distance corresponding to the negative sample pair, d n is the pedestrian feature distance corresponding to the positive sample pair, α is the preset interval between d p and d n , [d p -d n +α] + means that when d n <d p +α, the loss value remains unchanged, and when d n ≥ d p +α, the loss value is 0.

本发明还提供一种行人重识别系统,包括:The present invention also provides a pedestrian re-identification system, comprising:

行人重识别模块,用于获取待识别的行人样本对;所述待识别的行人样本对包括两个待识别的行人样本;还用于将所述待识别的行人样本对输入训练好的跨域行人重识别模型中,得到行人重识别结果;所述跨域行人重识别模型包括多个表示学习网络和一个度量学习网络,所述表示学习网络采用ResNet-50网络结构,所述度量学习网络采用三层全连接网络结构;A pedestrian re-identification module is used to obtain a pair of pedestrian samples to be identified; the pair of pedestrian samples to be identified includes two pedestrian samples to be identified; it is also used to input the pair of pedestrian samples to be identified into a trained cross-domain In the pedestrian re-identification model, a pedestrian re-identification result is obtained; the cross-domain pedestrian re-identification model includes a plurality of representation learning networks and a metric learning network, the representation learning network adopts the ResNet-50 network structure, and the metric learning network adopts Three-layer fully connected network structure;

训练模块,用于对跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型;训练方法,具体包括:The training module is used to train the cross-domain person re-identification model to obtain a trained cross-domain person re-identification model; the training method specifically includes:

获取多组源域数据集;每组所述源域数据集包括多个待训练的行人样本,每个所述待训练的行人样本对应有行人标签;所述源域数据集的个数与所述表示学习网络的个数相同;Obtain multiple sets of source domain data sets; each group of said source domain data sets includes a plurality of pedestrian samples to be trained, and each said pedestrian sample to be trained corresponds to a pedestrian label; the number of said source domain data sets is the same as all The above means that the number of learning networks is the same;

采用一组源域数据集训练一个表示学习网络和度量学习网络的方法对所述跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型。A set of source domain data sets are used to train a representation learning network and a metric learning network to train the cross-domain person re-identification model, and a trained cross-domain person re-identification model is obtained.

可选的,所述行人重识别模块,具体包括:Optionally, the pedestrian re-identification module specifically includes:

行人特征组生成单元,用于将所述待识别的行人样本对输入训练好的跨域行人重识别模型中,得到多个待识别的行人特征组;每个行人特征组包括两个行人特征;a pedestrian feature group generation unit, configured to input the pedestrian samples to be identified into the trained cross-domain pedestrian re-identification model to obtain a plurality of pedestrian feature groups to be identified; each pedestrian feature group includes two pedestrian features;

待识别的行人特征距离计算单元,用于计算每个待识别的行人特征组的两个行人特征之间的距离,得到多个待识别的行人特征距离;A pedestrian feature distance calculation unit to be identified, used to calculate the distance between two pedestrian features of each pedestrian feature group to be identified, to obtain a plurality of pedestrian feature distances to be identified;

第一判断单元,用于判断所述待识别的行人特征距离小于预设距离的个数是否超过待识别的行人特征距离总数的一半;若是,则确定所述待识别的行人样本对中的行人样本相同;若否,则确定所述待识别的行人样本对中的行人样本不同。The first judgment unit is used for judging whether the number of pedestrian feature distances to be identified that is less than the preset distance exceeds half of the total number of pedestrian feature distances to be identified; if so, then determine the pedestrian in the pedestrian sample pair to be identified. The samples are the same; if not, it is determined that the pedestrian samples in the pair of pedestrian samples to be identified are different.

可选的,所述训练模块,具体包括:Optionally, the training module specifically includes:

选取单元,用于选取一组源域数据集和一个表示学习网络;所述源域数据集包括正样本对和负样本对,所述正样本对包括行人相同的两个行人样本,所述负样本对包括行人不同的两个行人样本,且所述负样本对中的一个行人样本与所述正样本对中的一个行人样本相同;The selection unit is used to select a set of source domain data sets and a representation learning network; the source domain data set includes a positive sample pair and a negative sample pair, the positive sample pair includes two pedestrian samples with the same pedestrian, the negative sample pair The sample pair includes two pedestrian samples with different pedestrians, and one pedestrian sample in the negative sample pair is the same as one pedestrian sample in the positive sample pair;

第一行人特征生成单元,用于将选取的源域数据集输入选取的表示学习网络中,得到多个第一行人特征;The first pedestrian feature generation unit is used to input the selected source domain data set into the selected representation learning network to obtain a plurality of first pedestrian features;

第二行人特征生成单元,用于将多个所述第一行人特征输入所述度量学习网络中,得到多个第二行人特征;A second pedestrian feature generation unit, configured to input a plurality of the first pedestrian features into the metric learning network to obtain a plurality of second pedestrian features;

样本对的行人特征距离计算单元,用于根据所述第二行人特征计算所述正样本对对应的行人特征距离和负样本对对应的行人特征距离;a pedestrian feature distance calculation unit for the sample pair, configured to calculate the pedestrian feature distance corresponding to the positive sample pair and the pedestrian feature distance corresponding to the negative sample pair according to the second pedestrian feature;

模型优化单元,用于根据所述正样本对对应的行人特征距离和所述负样本对对应的行人特征距离计算损失值,并以损失值最小为优化目标,采用梯度下降法优化所述跨域行人重识别模型中的参数;The model optimization unit is used to calculate the loss value according to the pedestrian feature distance corresponding to the positive sample pair and the pedestrian feature distance corresponding to the negative sample pair, and take the minimum loss value as the optimization goal, and use the gradient descent method to optimize the cross-domain Parameters in the pedestrian re-identification model;

第二判断单元,用于判断所有源域数据集是否全部选取完,若是,则得到训练好的跨域行人重识别模型,若否,则在未被选取的源域数据集中选取一个源域数据集,并在未被选取的表示学习网络中选取一个表示学习网络,然后执行所述第一行人特征生成单元。The second judgment unit is used to judge whether all the source domain data sets have been selected. If so, obtain a trained cross-domain pedestrian re-identification model. If not, select a source domain data set from the unselected source domain data sets. set, and select a representation learning network from the unselected representation learning networks, and then execute the first pedestrian feature generation unit.

可选的,optional,

所述行人特征距离的计算公式如下:The calculation formula of the pedestrian feature distance is as follows:

Figure BDA0002812122360000041
Figure BDA0002812122360000041

式中,

Figure BDA0002812122360000051
Figure BDA0002812122360000052
Figure BDA0002812122360000053
的行人特征距离,
Figure BDA0002812122360000054
为第t个源域数据集中第i个行人样本,
Figure BDA0002812122360000055
为第t个源域数据集中第j个行人样本,
Figure BDA0002812122360000056
Figure BDA0002812122360000057
对应的第二行人特征,
Figure BDA0002812122360000058
Figure BDA0002812122360000059
对应的第二行人特征,C为度量学习网络;In the formula,
Figure BDA0002812122360000051
for
Figure BDA0002812122360000052
and
Figure BDA0002812122360000053
The pedestrian characteristic distance of ,
Figure BDA0002812122360000054
is the i-th pedestrian sample in the t-th source domain dataset,
Figure BDA0002812122360000055
is the jth pedestrian sample in the tth source domain dataset,
Figure BDA0002812122360000056
for
Figure BDA0002812122360000057
The corresponding second pedestrian feature,
Figure BDA0002812122360000058
for
Figure BDA0002812122360000059
The corresponding second pedestrian feature, C is the metric learning network;

所述损失值的计算公式如下:The formula for calculating the loss value is as follows:

Ltriple=[dp-dn+α]+ L triple =[d p -d n +α] +

式中,Ltriple为损失值,dp为负样本对对应的行人特征距离,dn为正样本对对应的行人特征距离,α为dp和dn的预设间隔,[dp-dn+α]+表示当dn<dp+α时,损失值保持不变,当dn≥dp+α时,损失值为0。In the formula, L triple is the loss value, d p is the pedestrian feature distance corresponding to the negative sample pair, d n is the pedestrian feature distance corresponding to the positive sample pair, α is the preset interval between d p and d n , [d p -d n +α] + means that when d n <d p +α, the loss value remains unchanged, and when d n ≥ d p +α, the loss value is 0.

与现有技术相比,本发明的有益效果是:Compared with the prior art, the beneficial effects of the present invention are:

本发明提出了一种融合多个源域的跨域行人重识别方法及系统,在对跨域行人重识别模型进行训练时,获取多组源域数据集,采用一组源域数据集训练一个表示学习网络和度量学习网络的方法对跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型,在进行行人重识别时,将待识别的行人样本对输入训练好的跨域行人重识别模型中,得到行人重识别结果。本发明在训练过程中融合了多个源域的数据,能够更好的学习到行人的特征表示,相比单一训练模型,能够提高行人重识别准确度,有效的解决了域间差异引起的模型性能下降的问题。The invention proposes a cross-domain pedestrian re-identification method and system integrating multiple source domains. When training the cross-domain pedestrian re-identification model, multiple sets of source domain data sets are obtained, and a set of source domain data sets are used to train one Representation learning network and metric learning network are used to train cross-domain pedestrian re-identification model, and a trained cross-domain pedestrian re-identification model is obtained. In the pedestrian re-identification model, the pedestrian re-identification result is obtained. The invention integrates the data of multiple source domains in the training process, and can better learn the feature representation of pedestrians. Compared with a single training model, the accuracy of pedestrian re-identification can be improved, and the model caused by differences between domains can be effectively solved. performance degradation issues.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings required in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the present invention. In the embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative labor.

图1为本发明实施例中融合多个源域的跨域行人重识别方法流程图;FIG. 1 is a flowchart of a cross-domain pedestrian re-identification method integrating multiple source domains in an embodiment of the present invention;

图2为本发明实施例中训练阶段示意图;2 is a schematic diagram of a training phase in an embodiment of the present invention;

图3为本发明实施例中测试阶段示意图。FIG. 3 is a schematic diagram of a testing stage in an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明的目的是提供一种融合多个源域的跨域行人重识别方法及系统,能够有效解决域间差异引起的模型性能下降的问题,提高行人重识别准确度。The purpose of the present invention is to provide a cross-domain pedestrian re-identification method and system integrating multiple source domains, which can effectively solve the problem of model performance degradation caused by differences between domains and improve the accuracy of pedestrian re-identification.

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.

实施例Example

图1为本发明实施例中融合多个源域的跨域行人重识别方法流程图,如图1所示,一种融合多个源域的跨域行人重识别方法,包括:FIG. 1 is a flowchart of a cross-domain pedestrian re-identification method integrating multiple source domains according to an embodiment of the present invention. As shown in FIG. 1 , a cross-domain pedestrian re-identification method integrating multiple source domains includes:

步骤101:获取待识别的行人样本对;待识别的行人样本对包括两个待识别的行人样本。其中,行人样本即为行人图片。Step 101: Obtain a pedestrian sample pair to be identified; the pedestrian sample pair to be identified includes two pedestrian samples to be identified. Among them, pedestrian samples are pedestrian pictures.

步骤102:将待识别的行人样本对输入训练好的跨域行人重识别模型中,得到行人重识别结果;跨域行人重识别模型包括多个表示学习网络和一个度量学习网络,表示学习网络采用ResNet-50网络结构,度量学习网络采用三层全连接网络结构。Step 102: Input the pedestrian samples to be identified into the trained cross-domain pedestrian re-identification model to obtain a pedestrian re-identification result; the cross-domain pedestrian re-identification model includes multiple representation learning networks and a metric learning network, and the representation learning network adopts ResNet-50 network structure, the metric learning network adopts a three-layer fully connected network structure.

步骤102,具体包括:Step 102 specifically includes:

将待识别的行人样本对输入训练好的跨域行人重识别模型中,得到多个待识别的行人特征组;每个行人特征组包括两个行人特征;Input the pedestrian samples to be identified into the trained cross-domain pedestrian re-identification model to obtain a plurality of pedestrian feature groups to be identified; each pedestrian feature group includes two pedestrian features;

计算每个待识别的行人特征组的两个行人特征之间的距离,得到多个待识别的行人特征距离;Calculate the distance between the two pedestrian features of each pedestrian feature group to be identified, and obtain a plurality of pedestrian feature distances to be identified;

判断待识别的行人特征距离小于预设距离的个数是否超过待识别的行人特征距离总数的一半;若是,则确定待识别的行人样本对中的行人样本相同;若否,则确定待识别的行人样本对中的行人样本不同。Determine whether the number of pedestrian feature distances to be identified that is less than the preset distance exceeds half of the total number of pedestrian feature distances to be identified; if so, determine that the pedestrian samples in the pair of pedestrian samples to be identified are the same; The pedestrian samples in the pedestrian sample pair are different.

其中,in,

跨域行人重识别模型的训练方法,具体包括:The training method of cross-domain person re-identification model, including:

获取多组源域数据集;每组源域数据集包括多个待训练的行人样本,每个待训练的行人样本对应有行人标签;源域数据集的个数与表示学习网络的个数相同;Obtain multiple sets of source domain datasets; each source domain dataset includes multiple pedestrian samples to be trained, and each pedestrian sample to be trained corresponds to a pedestrian label; the number of source domain datasets is the same as the number of representation learning networks ;

采用一组源域数据集训练一个表示学习网络和度量学习网络的方法对跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型,具体包括:A set of source domain datasets are used to train a representation learning network and a metric learning network to train a cross-domain person re-identification model, and a trained cross-domain person re-identification model is obtained, including:

选取一组源域数据集和一个表示学习网络;源域数据集包括正样本对和负样本对,正样本对包括行人相同的两个行人样本,负样本对包括行人不同的两个行人样本,且负样本对中的一个行人样本与正样本对中的一个行人样本相同;(即选取同一个行人的两张不同图片作为正样本,将另一个行人的图片与正样本中的一个图片作为负样本)。Select a set of source domain datasets and a representation learning network; the source domain dataset includes positive sample pairs and negative sample pairs, the positive sample pair includes two pedestrian samples with the same pedestrian, and the negative sample pair includes two pedestrian samples with different pedestrians. And one pedestrian sample in the negative sample pair is the same as one pedestrian sample in the positive sample pair; (that is, two different pictures of the same pedestrian are selected as positive samples, and the image of another pedestrian and one of the positive samples are used as negative samples. sample).

将选取的源域数据集输入选取的表示学习网络中,得到多个第一行人特征。Input the selected source domain dataset into the selected representation learning network to obtain multiple first pedestrian features.

将多个第一行人特征输入度量学习网络中,得到多个第二行人特征。A plurality of first pedestrian features are input into the metric learning network to obtain a plurality of second pedestrian features.

根据第二行人特征计算正样本对对应的行人特征距离和负样本对对应的行人特征距离。According to the second pedestrian feature, the pedestrian feature distance corresponding to the positive sample pair and the pedestrian feature distance corresponding to the negative sample pair are calculated.

根据正样本对对应的行人特征距离和负样本对对应的行人特征距离计算损失值,并以损失值最小为优化目标,采用梯度下降法优化跨域行人重识别模型中的参数。The loss value is calculated according to the corresponding pedestrian feature distance of the positive sample pair and the corresponding pedestrian feature distance of the negative sample pair, and taking the minimum loss value as the optimization goal, the gradient descent method is used to optimize the parameters in the cross-domain pedestrian re-identification model.

判断所有源域数据集是否全部选取完,若是,则得到训练好的跨域行人重识别模型,若否,则在未被选取的源域数据集中选取一个源域数据集,并在未被选取的表示学习网络中选取一个表示学习网络,然后返回步骤“将选取的源域数据集输入选取的表示学习网络中,得到多个第一行人特征”。Determine whether all source domain datasets have been selected. If so, get the trained cross-domain pedestrian re-identification model. If not, select a source domain dataset from the unselected source domain dataset, and select a source domain dataset from the unselected source domain dataset. Select a representation learning network from the selected representation learning network, and then return to the step "input the selected source domain dataset into the selected representation learning network to obtain multiple first pedestrian features".

其中,in,

行人特征距离的计算公式如下:The calculation formula of pedestrian feature distance is as follows:

Figure BDA0002812122360000071
Figure BDA0002812122360000071

式中,

Figure BDA0002812122360000072
Figure BDA0002812122360000073
Figure BDA0002812122360000074
的行人特征距离,
Figure BDA0002812122360000075
为第t个源域数据集中第i个行人样本,
Figure BDA0002812122360000076
为第t个源域数据集中第j个行人样本,
Figure BDA0002812122360000077
Figure BDA0002812122360000078
对应的第二行人特征,
Figure BDA0002812122360000079
Figure BDA00028121223600000710
对应的第二行人特征,C为度量学习网络;In the formula,
Figure BDA0002812122360000072
for
Figure BDA0002812122360000073
and
Figure BDA0002812122360000074
The pedestrian characteristic distance of ,
Figure BDA0002812122360000075
is the i-th pedestrian sample in the t-th source domain dataset,
Figure BDA0002812122360000076
is the jth pedestrian sample in the tth source domain dataset,
Figure BDA0002812122360000077
for
Figure BDA0002812122360000078
The corresponding second pedestrian feature,
Figure BDA0002812122360000079
for
Figure BDA00028121223600000710
The corresponding second pedestrian feature, C is the metric learning network;

损失值的计算公式如下:The formula for calculating the loss value is as follows:

Ltriple=[dp-dn+α]+ L triple =[d p -d n +α] +

式中,Ltriple为损失值,dp为负样本对对应的行人特征距离,dn为正样本对对应的行人特征距离,α为dp和dn的预设间隔,[dp-dn+α]+表示当dn<dp+α时,损失值保持不变,当dn≥dp+α时,损失值为0。设置α的目的是让dp和dn有一个小间隔,使得dn始终应该要大于dpIn the formula, L triple is the loss value, d p is the pedestrian feature distance corresponding to the negative sample pair, d n is the pedestrian feature distance corresponding to the positive sample pair, α is the preset interval between d p and d n , [d p -d n +α] + means that when d n <d p +α, the loss value remains unchanged, and when d n ≥ d p +α, the loss value is 0. The purpose of setting α is to have a small separation between d p and d n so that d n should always be larger than d p .

本发明还提供一种融合多个源域的跨域行人重识别系统,包括:行人重识别模块和训练模块。The present invention also provides a cross-domain pedestrian re-identification system integrating multiple source domains, including a pedestrian re-identification module and a training module.

行人重识别模块,用于获取待识别的行人样本对;待识别的行人样本对包括两个待识别的行人样本;还用于将待识别的行人样本对输入训练好的跨域行人重识别模型中,得到行人重识别结果;跨域行人重识别模型包括多个表示学习网络和一个度量学习网络,表示学习网络采用ResNet-50网络结构,度量学习网络采用三层全连接网络结构。The pedestrian re-identification module is used to obtain the pair of pedestrian samples to be identified; the pair of pedestrian samples to be identified includes two pedestrian samples to be identified; it is also used to input the pair of pedestrian samples to be identified into the trained cross-domain pedestrian re-identification model , the person re-identification results are obtained; the cross-domain person re-identification model includes multiple representation learning networks and a metric learning network, the representation learning network adopts the ResNet-50 network structure, and the metric learning network adopts a three-layer fully connected network structure.

行人重识别模块,具体包括:Pedestrian re-identification module, including:

行人特征组生成单元,用于将待识别的行人样本对输入训练好的跨域行人重识别模型中,得到多个待识别的行人特征组;每个行人特征组包括两个行人特征;The pedestrian feature group generation unit is used to input the pedestrian samples to be identified into the trained cross-domain pedestrian re-identification model to obtain a plurality of pedestrian feature groups to be identified; each pedestrian feature group includes two pedestrian features;

待识别的行人特征距离计算单元,用于计算每个待识别的行人特征组的两个行人特征之间的距离,得到多个待识别的行人特征距离;A pedestrian feature distance calculation unit to be identified, used to calculate the distance between two pedestrian features of each pedestrian feature group to be identified, to obtain a plurality of pedestrian feature distances to be identified;

第一判断单元,用于判断待识别的行人特征距离小于预设距离的个数是否超过待识别的行人特征距离总数的一半;若是,则确定待识别的行人样本对中的行人样本相同;若否,则确定待识别的行人样本对中的行人样本不同。The first judgment unit is used for judging whether the number of pedestrian feature distances to be identified that is less than the preset distance exceeds half of the total number of pedestrian feature distances to be identified; if so, determine that the pedestrian samples in the pedestrian sample pair to be identified are the same; if If not, it is determined that the pedestrian samples in the pair of pedestrian samples to be identified are different.

训练模块,用于对跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型;训练方法,具体包括:The training module is used to train the cross-domain person re-identification model to obtain a trained cross-domain person re-identification model; the training method specifically includes:

获取多组源域数据集;每组源域数据集包括多个待训练的行人样本,每个待训练的行人样本对应有行人标签;源域数据集的个数与表示学习网络的个数相同;Obtain multiple sets of source domain datasets; each source domain dataset includes multiple pedestrian samples to be trained, and each pedestrian sample to be trained corresponds to a pedestrian label; the number of source domain datasets is the same as the number of representation learning networks ;

采用一组源域数据集训练一个表示学习网络和度量学习网络的方法对跨域行人重识别模型进行训练,得到训练好的跨域行人重识别模型。A set of source domain datasets are used to train a representation learning network and a metric learning network to train the cross-domain person re-identification model, and the trained cross-domain person re-identification model is obtained.

训练模块,具体包括:Training modules, including:

选取单元,用于选取一组源域数据集和一个表示学习网络;源域数据集包括正样本对和负样本对,正样本对包括行人相同的两个行人样本,负样本对包括行人不同的两个行人样本,且负样本对中的一个行人样本与正样本对中的一个行人样本相同;The selection unit is used to select a set of source domain data sets and a representation learning network; the source domain data set includes a positive sample pair and a negative sample pair, the positive sample pair includes two pedestrian samples with the same pedestrian, and the negative sample pair includes different pedestrians. Two pedestrian samples, and one pedestrian sample in the negative sample pair is the same as one pedestrian sample in the positive sample pair;

第一行人特征生成单元,用于将选取的源域数据集输入选取的表示学习网络中,得到多个第一行人特征;The first pedestrian feature generation unit is used to input the selected source domain data set into the selected representation learning network to obtain a plurality of first pedestrian features;

第二行人特征生成单元,用于将多个第一行人特征输入度量学习网络中,得到多个第二行人特征;The second pedestrian feature generation unit is used to input a plurality of first pedestrian features into the metric learning network to obtain a plurality of second pedestrian features;

样本对的行人特征距离计算单元,用于根据第二行人特征计算正样本对对应的行人特征距离和负样本对对应的行人特征距离;The pedestrian feature distance calculation unit of the sample pair is used to calculate the pedestrian feature distance corresponding to the positive sample pair and the pedestrian feature distance corresponding to the negative sample pair according to the second pedestrian feature;

模型优化单元,用于根据正样本对对应的行人特征距离和负样本对对应的行人特征距离计算损失值,并以损失值最小为优化目标,采用梯度下降法优化跨域行人重识别模型中的参数;The model optimization unit is used to calculate the loss value according to the pedestrian feature distance corresponding to the positive sample pair and the pedestrian feature distance corresponding to the negative sample pair, and take the minimum loss value as the optimization goal, and use the gradient descent method to optimize the cross-domain pedestrian re-identification model. parameter;

第二判断单元,用于判断所有源域数据集是否全部选取完,若是,则得到训练好的跨域行人重识别模型,若否,则在未被选取的源域数据集中选取一个源域数据集,并在未被选取的表示学习网络中选取一个表示学习网络,然后执行第一行人特征生成单元。The second judgment unit is used to judge whether all the source domain data sets have been selected. If so, obtain a trained cross-domain pedestrian re-identification model. If not, select a source domain data set from the unselected source domain data sets. set, and select a representation learning network among the unselected representation learning networks, and then execute the first pedestrian feature generation unit.

其中,in,

行人特征距离的计算公式如下:The calculation formula of pedestrian feature distance is as follows:

Figure BDA0002812122360000091
Figure BDA0002812122360000091

式中,

Figure BDA0002812122360000092
Figure BDA0002812122360000093
Figure BDA0002812122360000094
的行人特征距离,
Figure BDA0002812122360000095
为第t个源域数据集中第i个行人样本,
Figure BDA0002812122360000096
为第t个源域数据集中第j个行人样本,
Figure BDA0002812122360000097
Figure BDA0002812122360000098
对应的第二行人特征,
Figure BDA0002812122360000099
Figure BDA00028121223600000910
对应的第二行人特征,C为度量学习网络;In the formula,
Figure BDA0002812122360000092
for
Figure BDA0002812122360000093
and
Figure BDA0002812122360000094
The pedestrian characteristic distance of ,
Figure BDA0002812122360000095
is the i-th pedestrian sample in the t-th source domain dataset,
Figure BDA0002812122360000096
is the jth pedestrian sample in the tth source domain dataset,
Figure BDA0002812122360000097
for
Figure BDA0002812122360000098
The corresponding second pedestrian feature,
Figure BDA0002812122360000099
for
Figure BDA00028121223600000910
The corresponding second pedestrian feature, C is the metric learning network;

损失值的计算公式如下:The formula for calculating the loss value is as follows:

Ltriple[dp-dn+α]+ L triple [d p -d n +α] +

式中,Ltriple为损失值,dp为负样本对对应的行人特征距离,dn为正样本对对应的行人特征距离,α为dp和dn的预设间隔,[dp-dn+α]+表示当dn<dp+α时,损失值保持不变,当dn≥dp+α时,损失值为0。In the formula, L triple is the loss value, d p is the pedestrian feature distance corresponding to the negative sample pair, d n is the pedestrian feature distance corresponding to the positive sample pair, α is the preset interval between d p and d n , [d p -d n +α] + means that when d n <d p +α, the loss value remains unchanged, and when d n ≥ d p +α, the loss value is 0.

本发明通过如下描述进一步说明融合多个源域的跨域行人重识别方法。The present invention further illustrates the cross-domain pedestrian re-identification method by fusing multiple source domains through the following description.

获取m个有标签的源域数据集:Get m labeled source domain datasets:

Figure BDA0002812122360000101
Figure BDA0002812122360000101

其中,St表示源域数据集;

Figure BDA0002812122360000102
表示在第t个源域数据集中行人样本
Figure BDA0002812122360000103
和对应的行人标签
Figure BDA0002812122360000104
Among them, S t represents the source domain dataset;
Figure BDA0002812122360000102
represents a sample of pedestrians in the t-th source domain dataset
Figure BDA0002812122360000103
and the corresponding pedestrian labels
Figure BDA0002812122360000104

获取测试数据(目标域):Get test data (target domain):

T={xi|i=1,2,...,n}T={x i |i=1,2,...,n}

其中,xi为在目标域数据集中行人样本。Among them, xi is the pedestrian sample in the target domain dataset.

融合多个源域的跨域行人重识别模型的目标是将目标域T中任意行人样本对xi和xj输入模型,得到对应的行人特征,通过判断行人特征间的距离是否小于阈值来确定是否是同一个行人。The goal of the cross-domain pedestrian re-identification model that fuses multiple source domains is to input any pedestrian samples in the target domain T into the model for x i and x j to obtain the corresponding pedestrian features, which are determined by judging whether the distance between the pedestrian features is less than a threshold. whether it is the same pedestrian.

融合多个源域的跨域行人重识别模型包括两个核心模块:表示学习网络和融合特征网络(即度量学习网络)。The cross-domain person re-identification model that fuses multiple source domains includes two core modules: a representation learning network and a fusion feature network (i.e., a metric learning network).

1.m个表示学习网络,用使用ResNet-50实现1.m representation learning networks, implemented using ResNet-50

对于源域数据集St,令第t个表示学习网络表示为Ht(Stt),Ht是由第t个源域数据集St在(融合多个源域的跨域行人重识别模型)上训练得到的,ωt是Ht在源域数据集St训练完成后的学习到的参数。For the source domain dataset S t , let the t-th representation learning network be denoted as H t (S tt ), and H t is determined by the t-th source domain dataset S t in (cross-domain fusion of multiple source domains Person re-identification model), ω t is the learned parameter of H t after training on the source domain dataset S t .

第t个源域中的行人样本

Figure BDA0002812122360000105
输入到表示学习网络Ht(Stt)后得到的行人特征为:
Figure BDA0002812122360000106
Pedestrian samples in the t-th source domain
Figure BDA0002812122360000105
The pedestrian features obtained after inputting to the representation learning network H t (S tt ) are:
Figure BDA0002812122360000106

2.一个融合特征网络,使用3层全连接层实现2. A fusion feature network, implemented using 3 fully connected layers

令融合特征网络表示为

Figure BDA0002812122360000107
其中
Figure BDA0002812122360000108
为第t个源域中的行人样本
Figure BDA0002812122360000109
输入表示学习网络Ht(Stt)后得到的行人特征,θ为模型完成训练后度量学习网络的参数。Let the fusion feature network be expressed as
Figure BDA0002812122360000107
in
Figure BDA0002812122360000108
is the pedestrian sample in the t-th source domain
Figure BDA0002812122360000109
The input represents the pedestrian feature obtained after learning the network H t (S tt ), and θ is the parameter of the metric learning network after the model is trained.

第t个源域中的行人样本

Figure BDA00028121223600001010
输入到融合多个源域的跨域行人重识别模型后得到的行人特征为:
Figure BDA00028121223600001011
Pedestrian samples in the t-th source domain
Figure BDA00028121223600001010
The pedestrian features obtained after inputting to the cross-domain person re-identification model that fuses multiple source domains are:
Figure BDA00028121223600001011

将目标域T中任意行人样本对xi和xj输入融合多个源域的跨域行人重识别模型后得到行人特征的距离为:After inputting any pedestrian samples in the target domain T to x i and x j , merging the cross-domain pedestrian re-identification model of multiple source domains to obtain the distance of pedestrian features:

Figure BDA00028121223600001012
Figure BDA00028121223600001012

融合多个源域的跨域行人重识别模型设计如下:The cross-domain person re-identification model integrating multiple source domains is designed as follows:

融合多个源域的跨域行人重识别模型模型主要由m个表示学习网络和1个度量学习网络组成。表示学习网络主要负责得到输入到模型的行人特征,度量学习网络来进行行人特征的距离度量。The cross-domain person re-identification model integrating multiple source domains is mainly composed of m representation learning networks and one metric learning network. The representation learning network is mainly responsible for obtaining the pedestrian features input to the model, and the metric learning network is used to measure the distance of pedestrian features.

训练阶段:Training phase:

如图2所示,m个表示学习网络均采用ResNet-50网络结构,度量学习网络采用3层全连接网络结构。利用第t个源域数据集训练模型时,将行人样本三元组

Figure BDA0002812122360000111
其中
Figure BDA0002812122360000112
为正样本对,
Figure BDA0002812122360000113
为负样本对,输入到对应的表示学习网络Ht(Stt)中会得到对应的3个行人特征
Figure BDA0002812122360000114
Figure BDA0002812122360000115
再将这些行人特征输入到度量学习网络,通过度量学习网络后会得到新的3个行人特征
Figure BDA0002812122360000116
Figure BDA0002812122360000117
损失函数采用三元组损失函数(
Figure BDA0002812122360000118
其中dn是负样本对之间的距离,dp是正样本对之间的距离),采用梯度下降策略进行融合多个源域的跨域行人重识别模型的优化训练。最后通过三元组损失函数对融合多个源域的跨域行人重识别模型进行参数学习。当m个源域数据集都输入模型后训练完成。As shown in Figure 2, the m representation learning networks all use the ResNet-50 network structure, and the metric learning network uses a 3-layer fully connected network structure. When training the model with the t-th source domain dataset, the pedestrian sample triples are
Figure BDA0002812122360000111
in
Figure BDA0002812122360000112
is a positive sample pair,
Figure BDA0002812122360000113
is a negative sample pair, and inputting it into the corresponding representation learning network H t (S tt ) will get the corresponding three pedestrian features
Figure BDA0002812122360000114
and
Figure BDA0002812122360000115
These pedestrian features are then input into the metric learning network, and three new pedestrian features will be obtained after passing through the metric learning network.
Figure BDA0002812122360000116
and
Figure BDA0002812122360000117
The loss function adopts the triple loss function (
Figure BDA0002812122360000118
where d n is the distance between pairs of negative samples and d p is the distance between pairs of positive samples), and the gradient descent strategy is used to optimize the training of cross-domain person re-identification models that fuse multiple source domains. Finally, the parameters of the cross-domain person re-identification model fused with multiple source domains are learned through the triple loss function. When the m source domain datasets are all input into the model, the training is completed.

例如,训练步骤(第1个源域数据集训练(共m个))For example, the training step (the 1st source domain dataset training (m total))

1)将第一个源域三元组行人样本输入到模型;1) Input the first source domain triple pedestrian sample into the model;

2)经过表示学习网络后得到一组行人特征;2) After the representation learning network, a set of pedestrian features are obtained;

3)经过融合特征网络后得到一组新的行人特征;3) After the fusion feature network, a new set of pedestrian features is obtained;

4)通过计算正负样本对的距离得到三元组损失;4) The triple loss is obtained by calculating the distance between the positive and negative sample pairs;

5)通过梯度下降策略更新网络权重,优化训练模型;5) Update the network weights through the gradient descent strategy to optimize the training model;

测试阶段:Test phase:

如图3所示,输入目标域两个行人样本(xi,xj),经过m个表示学习网络后输出m组行人特征,每组行人特征经过度量学习网络可以得到新的m组行人特征,通过计算可以得到两个行人特征之间的距离,人为设置一个阈值,若计算得到的距离小于设置阈值,则认为是同一个行人,否则不是同一个行人。最后通过投票机制即少数服从多数确定输入的图片是否为同一个人。As shown in Figure 3, two pedestrian samples (x i , x j ) in the target domain are input, and m groups of pedestrian features are output after m representation learning networks, and new m groups of pedestrian features can be obtained through the metric learning network for each group of pedestrian features. , the distance between two pedestrian features can be obtained by calculation, and a threshold is set artificially. If the calculated distance is less than the set threshold, it is considered to be the same pedestrian, otherwise it is not the same pedestrian. Finally, through the voting mechanism, that is, the minority obeys the majority, it is determined whether the input picture is the same person.

上述方法有效的提高了训练模型的鲁棒性,将训练好的模型直接用于实际工作中,有效提升了模型的性能。模型性能提升的主要原因是在训练过程中融合了多个源域的数据,并引入了度量网络,可以更好的学习到行人的特征表示,并且在测试过程中通过投票机制可以进一步的提升模型的性能。The above method effectively improves the robustness of the training model, and the trained model is directly used in practical work, which effectively improves the performance of the model. The main reason for the performance improvement of the model is that the data from multiple source domains is integrated in the training process, and a metric network is introduced, which can better learn the feature representation of pedestrians, and the model can be further improved through the voting mechanism during the testing process. performance.

本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上,本说明书内容不应理解为对本发明的限制。The principles and implementations of the present invention are described herein using specific examples. The descriptions of the above embodiments are only used to help understand the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the present invention There will be changes in the specific implementation and application scope. In conclusion, the contents of this specification should not be construed as limiting the present invention.

Claims (6)

1. A pedestrian re-identification method is characterized by comprising the following steps:
acquiring a pedestrian sample pair to be identified; the pedestrian sample pair to be identified comprises two pedestrian samples to be identified;
inputting the to-be-recognized pedestrian sample pair into a trained cross-domain pedestrian re-recognition model to obtain a pedestrian re-recognition result; the cross-domain pedestrian re-identification model comprises a plurality of representation learning networks and a measurement learning network, wherein the representation learning networks adopt a ResNet-50 network structure, and the measurement learning networks adopt a three-layer full-connection network structure;
the training method of the cross-domain pedestrian re-recognition model specifically comprises the following steps:
acquiring a plurality of groups of source domain data sets; each group of source domain data sets comprises a plurality of pedestrian samples to be trained, and each pedestrian sample to be trained corresponds to a pedestrian label; the number of the source domain data sets is the same as that of the representation learning networks;
training the cross-domain pedestrian re-recognition model by adopting a method of training a representation learning network and a metric learning network by adopting a group of source domain data sets to obtain a trained cross-domain pedestrian re-recognition model;
the method for training the cross-domain pedestrian re-recognition model by adopting a group of source domain data sets to train an expression learning network and a measurement learning network is used for training the cross-domain pedestrian re-recognition model to obtain the trained cross-domain pedestrian re-recognition model, and specifically comprises the following steps:
selecting a group of source domain data sets and a representation learning network; the source domain dataset comprises a positive sample pair and a negative sample pair, the positive sample pair comprising two pedestrian samples that are the same as a pedestrian, the negative sample pair comprising two pedestrian samples that are different from a pedestrian, and one pedestrian sample of the negative sample pair being the same as one pedestrian sample of the positive sample pair;
inputting the selected source domain data set into the selected representation learning network to obtain a plurality of first pedestrian characteristics;
inputting a plurality of first pedestrian features into the metric learning network to obtain a plurality of second pedestrian features;
calculating the pedestrian characteristic distance corresponding to the positive sample pair and the pedestrian characteristic distance corresponding to the negative sample pair according to the second pedestrian characteristic;
calculating a loss value according to the pedestrian characteristic distance corresponding to the positive sample pair and the pedestrian characteristic distance corresponding to the negative sample pair, and optimizing parameters in the cross-domain pedestrian re-identification model by adopting a gradient descent method with the minimum loss value as an optimization target;
and judging whether all the source domain data sets are completely selected, if so, obtaining a trained cross-domain pedestrian re-recognition model, otherwise, selecting one source domain data set from the unselected source domain data sets, selecting one representation learning network from the unselected representation learning networks, and returning to the step of inputting the selected source domain data set into the selected representation learning network to obtain a plurality of first pedestrian characteristics.
2. The method according to claim 1, wherein the step of inputting the to-be-recognized pedestrian sample pair into the trained cross-domain pedestrian re-recognition model to obtain a pedestrian re-recognition result specifically comprises:
inputting the to-be-recognized pedestrian sample pair into a trained cross-domain pedestrian re-recognition model to obtain a plurality of to-be-recognized pedestrian feature groups; each pedestrian feature group comprises two pedestrian features;
calculating the distance between two pedestrian features of each to-be-identified pedestrian feature group to obtain a plurality of to-be-identified pedestrian feature distances;
judging whether the number of the characteristic distances of the pedestrians to be identified, which is smaller than the preset distance, exceeds half of the total number of the characteristic distances of the pedestrians to be identified; if so, determining that the pedestrian samples in the to-be-identified pedestrian sample pair are the same; and if not, determining that the pedestrian samples in the to-be-identified pedestrian sample pair are different.
3. The pedestrian re-identification method according to claim 1,
the calculation formula of the pedestrian characteristic distance is as follows:
Figure FDA0003517893410000021
in the formula,
Figure FDA0003517893410000022
is composed of
Figure FDA0003517893410000023
And
Figure FDA0003517893410000024
the characteristic distance of the pedestrian is calculated,
Figure FDA0003517893410000025
for the ith pedestrian sample in the tth source domain data set,
Figure FDA0003517893410000026
for the jth pedestrian sample in the tth source domain data set,
Figure FDA0003517893410000027
is composed of
Figure FDA0003517893410000028
A corresponding second pedestrian characteristic is provided,
Figure FDA0003517893410000029
is composed of
Figure FDA00035178934100000210
Corresponding second pedestrian characteristics, C is a metric learning network;
the loss value is calculated as follows:
Ltriple=[dp-dn+α]+
in the formula, LtripleTo a loss value, dpFor the negative sample to the corresponding pedestrian characteristic distance, dnIs the positive sample to the corresponding pedestrian characteristic distance, alpha is dpAnd dnA predetermined interval of [ d ]p-dn+α]+Is shown when dn<dpAt + alpha, the loss value remains unchanged, when dn≥dpAt + α, the loss value is 0.
4. A pedestrian re-identification system, comprising:
the pedestrian re-identification module is used for acquiring a pedestrian sample pair to be identified; the pedestrian sample pair to be identified comprises two pedestrian samples to be identified; the pedestrian re-recognition method is also used for inputting the to-be-recognized pedestrian sample pair into a trained cross-domain pedestrian re-recognition model to obtain a pedestrian re-recognition result; the cross-domain pedestrian re-identification model comprises a plurality of representation learning networks and a measurement learning network, wherein the representation learning networks adopt a ResNet-50 network structure, and the measurement learning networks adopt a three-layer full-connection network structure;
the training module is used for training the cross-domain pedestrian re-recognition model to obtain a trained cross-domain pedestrian re-recognition model; the training method specifically comprises the following steps:
acquiring a plurality of groups of source domain data sets; each group of source domain data sets comprises a plurality of pedestrian samples to be trained, and each pedestrian sample to be trained corresponds to a pedestrian label; the number of the source domain data sets is the same as that of the representation learning networks;
training the cross-domain pedestrian re-recognition model by adopting a method of training a representation learning network and a metric learning network by adopting a group of source domain data sets to obtain a trained cross-domain pedestrian re-recognition model;
the training module specifically comprises:
a selecting unit for selecting a group of source domain data sets and a representation learning network; the source domain dataset comprises a positive sample pair and a negative sample pair, the positive sample pair comprising two pedestrian samples that are the same as a pedestrian, the negative sample pair comprising two pedestrian samples that are different from a pedestrian, and one pedestrian sample of the negative sample pair being the same as one pedestrian sample of the positive sample pair;
the first pedestrian characteristic generation unit is used for inputting the selected source domain data set into the selected representation learning network to obtain a plurality of first pedestrian characteristics;
the second pedestrian characteristic generating unit is used for inputting a plurality of first pedestrian characteristics into the metric learning network to obtain a plurality of second pedestrian characteristics;
the pedestrian characteristic distance calculation unit of the sample pair is used for calculating the pedestrian characteristic distance corresponding to the positive sample pair and the pedestrian characteristic distance corresponding to the negative sample pair according to the second pedestrian characteristic;
the model optimization unit is used for calculating a loss value according to the pedestrian characteristic distance corresponding to the positive sample pair and the pedestrian characteristic distance corresponding to the negative sample pair, and optimizing parameters in the cross-domain pedestrian re-identification model by adopting a gradient descent method with the minimum loss value as an optimization target;
and the second judgment unit is used for judging whether all the source domain data sets are completely selected, if so, obtaining a trained cross-domain pedestrian re-recognition model, otherwise, selecting one source domain data set from the unselected source domain data sets, selecting one representation learning network from the unselected representation learning networks, and then executing the first pedestrian feature generation unit.
5. The pedestrian re-identification system according to claim 4, wherein the pedestrian re-identification module specifically comprises:
the pedestrian feature group generation unit is used for inputting the to-be-identified pedestrian sample pair into a trained cross-domain pedestrian re-identification model to obtain a plurality of to-be-identified pedestrian feature groups; each pedestrian feature group comprises two pedestrian features;
the pedestrian feature distance calculation unit is used for calculating the distance between two pedestrian features of each pedestrian feature group to be recognized to obtain a plurality of pedestrian feature distances to be recognized;
the first judging unit is used for judging whether the number of the characteristic distances of the pedestrians to be identified, which is smaller than the preset distance, exceeds half of the total number of the characteristic distances of the pedestrians to be identified; if so, determining that the pedestrian samples in the to-be-identified pedestrian sample pair are the same; and if not, determining that the pedestrian samples in the to-be-identified pedestrian sample pair are different.
6. The pedestrian re-identification system according to claim 4,
the calculation formula of the pedestrian characteristic distance is as follows:
Figure FDA0003517893410000041
in the formula,
Figure FDA0003517893410000042
is composed of
Figure FDA0003517893410000043
And
Figure FDA0003517893410000044
the characteristic distance of the pedestrian is calculated,
Figure FDA0003517893410000045
for the ith pedestrian sample in the tth source domain data set,
Figure FDA0003517893410000046
for the jth pedestrian sample in the tth source domain data set,
Figure FDA0003517893410000047
is composed of
Figure FDA0003517893410000048
A corresponding second pedestrian characteristic is provided,
Figure FDA0003517893410000049
is composed of
Figure FDA00035178934100000410
Corresponding second pedestrian characteristics, C is a metric learning network;
the loss value is calculated as follows:
Ltriple=[dp-dn+α]+
in the formula, LtripleTo a loss value, dpFor the negative sample to the corresponding pedestrian characteristic distance, dnIs the positive sample to the corresponding pedestrian characteristic distance, alpha is dpAnd dnA predetermined interval of [ d ]p-dn+α]+Is shown when dn<dpAt + alpha, the loss value remains unchanged, when dn≥dpAt + α, the loss value is 0.
CN202011399651.4A 2020-12-02 2020-12-02 A cross-domain pedestrian re-identification method and system integrating multiple source domains Active CN112381056B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011399651.4A CN112381056B (en) 2020-12-02 2020-12-02 A cross-domain pedestrian re-identification method and system integrating multiple source domains

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011399651.4A CN112381056B (en) 2020-12-02 2020-12-02 A cross-domain pedestrian re-identification method and system integrating multiple source domains

Publications (2)

Publication Number Publication Date
CN112381056A CN112381056A (en) 2021-02-19
CN112381056B true CN112381056B (en) 2022-04-01

Family

ID=74590207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011399651.4A Active CN112381056B (en) 2020-12-02 2020-12-02 A cross-domain pedestrian re-identification method and system integrating multiple source domains

Country Status (1)

Country Link
CN (1) CN112381056B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113221770B (en) * 2021-05-18 2024-06-04 青岛根尖智能科技有限公司 Cross-domain pedestrian re-recognition method and system based on multi-feature hybrid learning

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109977893A (en) * 2019-04-01 2019-07-05 厦门大学 Depth multitask pedestrian recognition methods again based on the study of level conspicuousness channel
CN110110642A (en) * 2019-04-29 2019-08-09 华南理工大学 A kind of pedestrian's recognition methods again based on multichannel attention feature
CN111126360A (en) * 2019-11-15 2020-05-08 西安电子科技大学 Cross-domain person re-identification method based on unsupervised joint multi-loss model
CN111476168A (en) * 2020-04-08 2020-07-31 山东师范大学 A three-stage cross-domain pedestrian re-identification method and system
CN111695531A (en) * 2020-06-16 2020-09-22 天津师范大学 Cross-domain pedestrian re-identification method based on heterogeneous convolutional network
CN111738039A (en) * 2019-05-10 2020-10-02 北京京东尚科信息技术有限公司 Pedestrian re-identification method, terminal and storage medium
CN111860678A (en) * 2020-07-29 2020-10-30 中国矿业大学 An unsupervised cross-domain person re-identification method based on clustering
CN111967294A (en) * 2020-06-23 2020-11-20 南昌大学 Unsupervised domain self-adaptive pedestrian re-identification method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105989369B (en) * 2015-02-15 2020-07-31 中国科学院西安光学精密机械研究所 Pedestrian re-identification method based on metric learning
WO2018119411A1 (en) * 2016-12-23 2018-06-28 Trustees Of Boston University Classification of diffuse large b-cell lymphoma
CN107145827A (en) * 2017-04-01 2017-09-08 浙江大学 Cross-camera person re-identification method based on adaptive distance metric learning
US20200076833A1 (en) * 2018-08-31 2020-03-05 Sophos Limited Dynamic filtering of endpoint event streams
CN110796057A (en) * 2019-10-22 2020-02-14 上海交通大学 Pedestrian re-identification method and device and computer equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109977893A (en) * 2019-04-01 2019-07-05 厦门大学 Depth multitask pedestrian recognition methods again based on the study of level conspicuousness channel
CN110110642A (en) * 2019-04-29 2019-08-09 华南理工大学 A kind of pedestrian's recognition methods again based on multichannel attention feature
CN111738039A (en) * 2019-05-10 2020-10-02 北京京东尚科信息技术有限公司 Pedestrian re-identification method, terminal and storage medium
CN111126360A (en) * 2019-11-15 2020-05-08 西安电子科技大学 Cross-domain person re-identification method based on unsupervised joint multi-loss model
CN111476168A (en) * 2020-04-08 2020-07-31 山东师范大学 A three-stage cross-domain pedestrian re-identification method and system
CN111695531A (en) * 2020-06-16 2020-09-22 天津师范大学 Cross-domain pedestrian re-identification method based on heterogeneous convolutional network
CN111967294A (en) * 2020-06-23 2020-11-20 南昌大学 Unsupervised domain self-adaptive pedestrian re-identification method
CN111860678A (en) * 2020-07-29 2020-10-30 中国矿业大学 An unsupervised cross-domain person re-identification method based on clustering

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Unsupervised Cross-Dataset Person Re-identification by Transfer Learning of Spatial-Temporal Patterns;Jianming Lv等;《2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition》;20180623;第7948页-7956页 *
弱监督场景下的行人重识别研究综述;祁磊等;《软件学报》;20200915;第2883-2902页 *

Also Published As

Publication number Publication date
CN112381056A (en) 2021-02-19

Similar Documents

Publication Publication Date Title
JP7018135B2 (en) Battery detection method and equipment
CN106650699B (en) A kind of method for detecting human face and device based on convolutional neural networks
WO2021052159A1 (en) Adversarial transfer learning-based face beauty prediction method and device
CN110276264B (en) Crowd density estimation method based on foreground segmentation graph
CN102163280B (en) Method for identifying, tracking and converting target based on confidence degree and multi-frame judgement
CN115690542B (en) Aerial insulator orientation identification method based on improvement yolov5
CN110851491A (en) Network link prediction method based on multiple semantic influences of multiple neighbor nodes
CN117173096A (en) Door surface defect detection method based on improved YOLOv8 network
CN110008789A (en) Multiclass object detection and knowledge method for distinguishing, equipment and computer readable storage medium
CN117333845A (en) Real-time detection method for small target traffic sign based on improved YOLOv5s
CN112381056B (en) A cross-domain pedestrian re-identification method and system integrating multiple source domains
CN117710792A (en) Knowledge distillation method, greening region detection method, electronic device, and storage medium
CN115661597B (en) A Visible and Infrared Fusion Object Detection Method Based on Dynamic Weight Localization Distillation
CN115829983B (en) A high-speed industrial scene visual quality inspection method based on knowledge distillation
CN117011563A (en) Road damage inspection cross-domain detection method and system based on semi-supervised federal learning
CN114937311A (en) Time sequence action detection method based on accurate boundary prediction
CN113486718B (en) Fingertip detection method based on deep multitask learning
CN118823736A (en) A wildlife target detection method based on improved yolov8 and knowledge distillation
CN114037052A (en) Training method and device for detection model, electronic equipment and storage medium
CN113792751A (en) A kind of cross-domain behavior identification method, device, device and readable storage medium
CN117058398A (en) Three-dimensional target detection method, system and storage medium based on central point
CN117495881A (en) A retinal image blood vessel segmentation method, system, equipment and medium
CN117671265A (en) Multimodal transducer semantic segmentation algorithm for dealing with RGB-D modal deletion
CN111310611A (en) Cell field map detection method and storage medium
CN112102399B (en) Visual mileage calculation method based on generative antagonistic network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230316

Address after: 030000 Communication Industry Building, No. 273, Changzhi Road, Taiyuan Xuefu Park, Shanxi Comprehensive Reform Demonstration Zone, Taiyuan City, Shanxi Province

Patentee after: Taiyuan Communication Industry Co.,Ltd.

Address before: 030006 No. 92, Hollywood Road, Taiyuan, Shanxi

Patentee before: SHANXI University

TR01 Transfer of patent right