Unsupervised person re-identification method and device based on multi-branch network
By using the asymmetric branch supervision method of multi-branch network in unsupervised person re-identification, soft labels and hard labels are generated, which solves the problem of the influence of noisy labels and improves the accuracy and stability of pedestrian re-identification.
Patent Information
- Application Number
- CN202210333714.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-03-30
AI Technical Summary
Existing unsupervised person re-identification methods have difficulties in processing noisy labels. In particular, the hard pseudo-label noise generated by the clustering algorithm seriously affects the performance, making neural network training difficult, and existing methods fail to effectively alleviate this problem.
An unsupervised person re-identification method based on multi-branch network is adopted, by using teacher network and student network for asymmetric branch supervision in the source domain and target domain, combined with soft cross-entropy loss and soft triplet loss, to generate soft labels and hard labels. labels, enhance feature diversity and reduce the impact of noise.
It effectively reduces the influence of noise labels, improves the accuracy and stability of pedestrian re-identification, enhances the generalization ability of the model, and solves the training difficulties caused by noise labels in traditional methods.
Smart Images

Figure CN114882521B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of pedestrian re-identification, and in particular to an unsupervised pedestrian re-identification training method and device based on a multi-branch network, and also to an unsupervised pedestrian re-identification method, device, electronic device and readable storage medium based on a multi-branch network. Background Art
[0002] Person re-identification (Re-ID) is a fine-grained instance recognition problem that aims to find the query person from a set of pedestrian images or videos collected from multiple non-overlapping camera systems. Person re-identification has a wide range of real-life applications, such as criminal search, multi-camera tracking, missing person search, etc. Re-ID relies heavily on visually similar pedestrian appearances obtained from disjoint camera views. The basic task is to learn discriminative person features and associate the query with the best matching person in the gallery image or video. The illumination and geometric variations of different cameras are the biggest challenges. Most works focus on supervised learning on small to large datasets in various environments. However, they require a large amount of paired cross-camera labeled data, which limits the scalability of large-scale applications. In actual large-scale applications, only unlabeled data is available because paired labeled data requires a lot of manpower and material resources. Due to the large differences between different datasets, an unsupervised domain adaptation (UDA) model is proposed, which transfers the trained pre-trained model from the source domain with identity labels to the target image domain without labels by training on the source data domain with labels. In real life, it is easy to record unlabeled target domains, and it is intuitive to use these images to detect pedestrian re-identification models.
[0003] Unsupervised domain adaptation for person re-identification is widely used because it can save manual annotation costs. The first category of methods is to learn domain-invariant features by aligning target features. Some methods use semantic attributes to align feature distributions in the latent space. However, most of these methods rely on additional attribute annotations and require additional manual annotations. Another way is to convert labeled source domain images to the style of the target domain through style transfer. Generative adversarial networks (GANs) are used to align feature distributions. SPGAN and PTGAN transform source domain images to match the image style of the target domain while preserving the identity of the person. The style-transferred images and identity labels are used to fine-tune the model. Zhong et al. achieve cross-camera training by learning invariant features of camera transfer. This method relies heavily on the quality of image generation and does not explore the complex relationship between different samples in the target domain. The second type of pseudo-label-based adaptation is a more direct unsupervised cross-domain re-identification method that directly assigns pseudo labels to unlabeled target images and allows the pre-trained model to be fine-tuned in a supervised manner.
[0004] Due to the lack of paired labeled data to learn camera-invariant feature representations, the performance of unsupervised person re-identification is generally lower than that of supervised person re-identification. In recent years, unsupervised person re-identification has significantly narrowed the performance gap with supervised ones. Therefore, due to its scalable application, unsupervised has received increasing attention in recent years. Most existing unsupervised methods group unlabeled images using clustering algorithms and train the network with pseudo labels generated by clustering. However, the training of neural networks is hindered by label noise. The noise mainly comes from the difference between the source and target domains, the influence of illumination, and the defects of clustering algorithms. The impact of pseudo label noise has a crucial impact on the final performance. In order to deal with noisy labels, one of the most popular methods is to train paired networks so that the paired networks can correct each other, where Co-tracher uses two student networks and MMT uses two student and two teacher networks, but each network has the same structure. It is easy to converge with each other and fall into local minima. To alleviate these problems, some methods use different training samples or different initialization parameters and data augmentation. The clustering algorithm generates hard pseudo labels with a confidence of 100%. Since person re-identification is a fine-grained recognition problem, it is not uncommon to have people with similar clothes in the dataset, and the hard labels of these similar samples may be very noisy. In this case, soft pseudo labels (confidence < 100%) are more reliable. Using hard pseudo labels and soft pseudo labels for learning can effectively alleviate label noise. Ge et al. proposed adding Mean Teacher as an online soft pseudo label generator in the model, which effectively reduced the error amplification caused by noisy labels during training.
[0005] However, most existing methods ignore the noise of hard pseudo labels generated by clustering algorithms, which seriously hinders the training of neural networks. In order to alleviate the label noise based on clustering, researchers borrowed the idea of how to use unlabeled data in semi-supervised learning and noisy label learning. MMT uses two student networks and two teacher networks, and the two student networks are initialized differently in order to enhance the differences between paired teacher and student networks. Each teacher network provides pseudo labels to supervise the student network of the other network. However, despite the use of different initializations and different data augmentation techniques in paired networks, how to deal with noisy samples during training is a problem faced by clustering-based unsupervised pedestrian re-identification methods. Summary of the invention
[0006] In order to solve at least one of the above technical problems, the present disclosure provides an unsupervised pedestrian re-identification training method and device based on a multi-branch network, and also provides an unsupervised pedestrian re-identification method, device, electronic device and readable storage medium based on a multi-branch network.
[0007] According to one aspect of the present disclosure, a multi-branch network-based unsupervised person re-identification training method is provided, comprising:
[0008] Source domain training: During the source domain training phase, the labeled images are input into the pre-trained model for training to obtain a trained pre-trained model;
[0009] Target domain training: during the target domain training phase, the unlabeled images are input into the target domain training model, and after training, the target domain training model is obtained;
[0010] The label is used to identify the category of the image, the category of the image corresponds to the pedestrian contained in the image, and the target domain training model is composed of a pre-trained model obtained in the source domain training stage.
[0011] According to at least one embodiment of the present disclosure, in the unsupervised person re-identification training method based on a multi-branch network, the training process of the pre-training model includes:
[0012] Input each image in the training set and the label corresponding to the image into the pre-training model, and after being processed by the training model, output the first global feature and the first local feature of each image, wherein the label is used to identify the category of the image, and the category of the image corresponds to the pedestrian contained in the image;
[0013] Inputting the first global feature and the first local feature into a first classifier, respectively obtaining prediction values corresponding to the first global feature and the first local feature, wherein the prediction values are used to identify the categories of the images corresponding to the first global feature and the first local feature after classification by the classifier;
[0014] Constructing a pre-training loss function, and calculating the training effect through the pre-training loss function, and repeatedly training the pre-training model until the calculated value of the pre-training loss function reaches the expected index;
[0015] The pre-training loss function is obtained by weighted summation of the cross entropy loss function and the triple loss function.
[0016] According to at least one embodiment of the present disclosure, in the unsupervised person re-identification training method based on a multi-branch network, the pre-training model comprises:
[0017] A trunk network model, wherein the trunk network model is serially connected to each branch network model, receives an image input to a pre-trained model, processes the image, and then inputs the obtained image features to each branch network model;
[0018] A branch network model, wherein there are at least two branch network models, including a global branch network model and a local branch network model, wherein the global branch network model obtains global features by globally maximizing the image features, and the local branch network model obtains local features by averaging the image features of the image and then splicing them together;
[0019] Among them, the backbone network is composed of a convolutional neural network and a convolutional module attention mechanism module, and the branch network is composed of a convolutional neural network and a convolutional module attention mechanism module.
[0020] According to at least one embodiment of the present disclosure, the unsupervised person re-identification training method based on a multi-branch network comprises:
[0021] A channel attention module receives image features, where the image features are obtained after the image input to the backbone network model is processed by the backbone model, performs a global maximum pooling operation and an average pooling operation on the image features to obtain two first feature maps, performs a splicing operation on the two first feature maps, and then performs a convolution layer and a normalization operation to generate a spatial attention weight;
[0022] A spatial attention module receives the feature map output by the channel attention module, performs a global maximum pooling operation and a global average pooling operation on the feature map output by the channel attention module, obtains two second feature maps, performs a splicing operation on the two second feature maps based on the image channel, and then performs a convolution layer and a normalization operation to generate a spatial attention weight;
[0023] Among them, the channel attention module and the spatial attention module are connected in series.
[0024] According to the unsupervised person re-identification training method based on a multi-branch network in at least one embodiment of the present disclosure, the target domain training model includes:
[0025] A teacher network receives each image of the target domain training set and outputs a second global feature and a second local feature corresponding to each image;
[0026] The student network receives each image of the target domain training set and outputs a third global feature and a third local feature corresponding to each image;
[0027] A second classifier receives a second global feature and a second local feature output by the teacher network, and outputs soft labels of images corresponding to the second global feature and the second local feature, respectively, wherein the soft labels are used to identify the category of the corresponding image in the target domain training set;
[0028] A clustering model receives a concatenated feature of a second global feature and a second local feature output by a teacher network, generates a hard label through clustering, and the hard label is used to identify a category of a corresponding image in a training set of the target domain;
[0029] A third classifier receives the third global feature and the third local feature output by the student network, and outputs a prediction value of an image corresponding to the third global feature and the third local feature, wherein the prediction value is used to identify a category of a corresponding image in a target domain training set;
[0030] The structure of the teacher network and the student network is consistent with the structure of the training model in the source domain training stage, and is a pre-trained model obtained in the source domain training stage. According to the unsupervised person re-identification training method based on a multi-branch network of at least one embodiment of the present disclosure, in the training stage of the target domain training model, the teacher network and the student network are supervised by an asymmetric branch supervision method, and each student network is supervised by a different teacher network branch, including:
[0031] The soft labels generated by the global branch of the teacher network supervise the local branches of the student network;
[0032] The soft labels generated by the local branches of the teacher network supervise the global branches of the student network;
[0033] The hard labels generated by the teacher network supervise the global branch and layout branch of the student network respectively.
[0034] According to the unsupervised pedestrian re-identification training method based on a multi-branch network of at least one embodiment of the present disclosure, in the target training model stage, a pre-training loss function is constructed, and the training effect is calculated through the target training model loss function, and the target training model is repeatedly trained until the calculated value of the target training loss function reaches the expected indicator. The target training model loss function is obtained by weighted summation of the cross entropy loss function of the hard label of the student network after clustering, the soft cross entropy loss function of the asymmetric branch supervision, and the soft triplet loss function of the non-symmetrical branch supervision.
[0035] According to another aspect of the present disclosure, there is provided an unsupervised person re-identification training device based on a multi-branch network, comprising:
[0036] Source domain training module, including;
[0037] A trunk network model, wherein the trunk network model is connected in series to each branch network model;
[0038] A branch network model, wherein there are at least two branch network models, including a global branch network model and a local branch network model, wherein the global branch network model obtains global features by global maximum pooling, and the local branch network model obtains local features by averaging and pooling the features together;
[0039] Pre-training loss function calculation module, constructs a pre-training loss function, and calculates the training effect through the pre-training loss function;
[0040] Target domain training module, including:
[0041] A teacher network receives each image of the target domain training set and outputs a second global feature and a second local feature corresponding to each image;
[0042] The student network receives each image of the target domain training set and outputs a third global feature and a third local feature corresponding to each image;
[0043] A second classifier receives a second global feature and a second local feature output by the teacher network, and outputs soft labels of images corresponding to the second global feature and the second local feature, respectively, wherein the soft labels are used to identify the category of the corresponding image in the target domain training set;
[0044] A clustering model receives a concatenated feature of a second global feature and a second local feature output by a teacher network, generates a hard label through clustering, and the hard label is used to identify a category of a corresponding image in a training set of the target domain;
[0045] A third classifier receives the third global feature and the third local feature output by the student network, and outputs a prediction value of an image corresponding to the third global feature and the third local feature, wherein the prediction value is used to identify a category of a corresponding image in a target domain training set;
[0046] The target domain training loss function calculation module constructs the pre-training loss function and calculates the training effect through the target training model loss function.
[0047] According to another aspect of the present disclosure, there is provided an unsupervised person re-identification device based on a multi-branch network, comprising:
[0048] The student network and the third classifier described above, the student network receives an image containing pedestrians, and the third classifier outputs an image category, and the image category corresponds to the identity of the pedestrian contained in the image.
[0049] According to another aspect of the present disclosure, there is provided an unsupervised person re-identification method based on a multi-branch network, comprising:
[0050] An image or image sequence containing a pedestrian is input into the unsupervised pedestrian re-identification device based on a multi-branch network as described above, and the category of the pedestrian is obtained by identification by the unsupervised pedestrian re-identification device based on a multi-branch network.
[0051] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0052] A memory storing execution instructions;
[0053] A processor, wherein the processor executes the execution instruction stored in the memory, so that the processor executes any one of the methods described above.
[0054] According to another aspect of the present disclosure, a readable storage medium is provided, wherein the readable storage medium stores execution instructions, and the execution instructions are used to implement any of the above-mentioned methods when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0056] Figure 1 It is a general flowchart of an unsupervised pedestrian re-identification method based on an attention mechanism according to an embodiment of the present disclosure.
[0057] Figure 2 It is a schematic diagram of the structure of a training module on a labeled source domain according to an embodiment of the present disclosure.
[0058] Figure 3 It is a schematic diagram of the structure of an attention mechanism module according to an embodiment of the present disclosure.
[0059] Figure 4 It is a training module diagram of a teacher-student network in a target domain according to one embodiment of the present disclosure.
[0060] Figure 5 4 is a diagram of a pseudo-label joint training module according to one embodiment of the present disclosure.
[0061] Figure 6 It is a schematic diagram of EMA weight update according to one embodiment of the present disclosure.
[0062] Figure 7 It is a flowchart of an unsupervised pedestrian re-identification method based on a multi-branch network according to an embodiment of the present disclosure.
[0063] Figure 8It is a schematic diagram of the structure of an unsupervised pedestrian re-identification device based on a multi-branch network according to an embodiment of the present disclosure.
[0064] Description of Reference Numerals
[0065] 1000 Unsupervised Person Re-ID Based on Multi-branch Network
[0066] 1002 Feature map extraction module
[0067] 1004 Significant feature extraction module
[0068] 1006 Global feature extraction module
[0069] 1008 Local feature extraction module
[0070] 1010 Pedestrian Identity Judgment Module
[0071] 1100 Bus
[0072] 1200 processor
[0073] 1300 Memory
[0074] 1400 Other circuits. DETAILED DESCRIPTION
[0075] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0076] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0077] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.
[0078] The use of cross-hatching and / or shading in the accompanying drawings is generally used to make the boundaries between adjacent components clear. As such, unless otherwise specified, the presence or absence of cross-hatching or shading does not convey or indicate any preference or requirement for the specific materials, material properties, dimensions, proportions, commonalities between the components shown, and / or any other characteristics, attributes, properties, etc. of the components. In addition, in the accompanying drawings, the sizes and relative sizes of the components may be exaggerated for clarity and / or descriptive purposes. When the exemplary embodiments can be implemented differently, the specific process sequence can be performed in a different order than described. For example, two successively described processes can be performed substantially simultaneously or in an order opposite to the described order. In addition, the same figure numbers represent the same components.
[0079] When a component is referred to as being "on," "over," "connected to," or "coupled to" another component, the component may be directly on, directly connected to, or directly coupled to the other component, or intervening components may be present. However, when a component is referred to as being "directly on," "directly connected to," or "directly coupled to" another component, there are no intervening components. For this purpose, the term "connected" may refer to a physical connection, an electrical connection, etc., with or without intervening components.
[0080] The terms used herein are for the purpose of describing specific embodiments, and are not intended to be restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values and / or the values provided that will be recognized by those of ordinary skill in the art.
[0081] Figure 1 This is a flow chart of the unsupervised person re-identification training method based on a multi-branch network.
[0082] The present disclosure relates to embodiments and to training various models. It is necessary to prepare training sample data in advance. The detailed information of the training sample data is as follows. In this embodiment and other embodiments, the data sets used include Market-1501, DukeMTMC-reID and MSMT17. The Market1501 data set contains 32,668 images from 1,501 pedestrians taken by 6 cameras. 12,936 images of 751 pedestrians were selected for training, and the other images were used for testing. In the test set, 3,368 pictures were used as query images, and the remaining 19,732 were used as gallery images. The DukeMTMC-reID data set was taken by 8 cameras, of which 16,522 images of 702 pedestrians were used for training, and the other 702 pedestrians were used for testing. The test set contains 2,228 query images and 17,661 gallery images. MSMT17 contains 126,441 images, which are from 4,101 pedestrians taken by 15 cameras at Peking University. Among them, 32621 images of 1041 pedestrians are used for training, and the rest are used for testing. In the test set, 11659 images are used as query images, and the remaining 82161 images are used as gallery images. Taking the Market-1501 dataset as an example, the Market-1501 directory structure contains bounding_box_test (test set), bounding_box_train (test set) and query (query set). The naming method of the images in the Market-1501 dataset is 0342_c3s1_078792_03.jpg as an example: 0342: The label number of the person in the image. c3: Shot by the third camera (camera3). s1: The first video clip (sequence1). 078792: The 078792th frame in the video clip. 03: The third detection box on this frame.
[0083] like Figure 1 As shown, the unsupervised person re-identification training method based on a multi-branch network includes the following training process.
[0084] First, source domain training is performed. In the source domain training stage, the labeled images are input into the pre-trained model for training to obtain a trained pre-trained model. The label is used to identify the category of the image, and the category of the image corresponds to the identity of the pedestrian contained in the image. In the source domain training stage, first, a pre-trained model is constructed, and then the features of the image input into the pre-trained model are extracted through the pre-trained model. Finally, in the repeated training process, the effect of the training is judged by the calculated value of the loss function until the preset training indicators are met. Among them, the loss function is based on the cross entropy loss and the triple loss. Figure 2 It is a specific implementation of the pre-training model.
[0085] Secondly, target domain training is performed. In the target domain training stage, the unlabeled image is input into the target domain training model, and after training, the target domain training model is obtained. The target domain training model consists of the trained pre-trained model obtained in the source domain training stage. In the target domain training stage, the unlabeled image is input into the target domain training model composed of the teacher network and the student network. First, the feature map of the image is obtained by extracting features through the convolutional neural network layers of the teacher network and the student network respectively; then, the salient features of the image are extracted through the attention mechanism modules of the teacher network and the student network respectively; then, the image features based on the feature map and the salient features are respectively input into the branch network parts of the teacher network and the student network, and the global features and local features of the image are respectively extracted through the branch network; then, in the branch network part of the teacher network, soft labels and hard labels are generated through the classifier and clustering model, and at the same time, in the branch network part of the student network, the image category is predicted by the classifier to generate a prediction value. During the training process, the loss function value is calculated through the pre-constructed loss function. At the same time, the network structure parameter models of the teacher network and the student network are continuously updated, that is, to achieve the purpose of the supervision of the branch networks of the teacher network on the branch networks of the student network and the student network on the student network. The loss function value is used to judge whether the target domain training model has reached the training indicators. Figure 4 It is a specific implementation of the target domain training model.
[0086] After the above two stages of source domain training and target domain training, a recognition model for pedestrian recognition, i.e., an unsupervised pedestrian re-recognition device based on a multi-branch network, can be obtained. By outputting an image containing a pedestrian to the unsupervised pedestrian re-recognition device based on a multi-branch network, the identity of the pedestrian in the image can be obtained through recognition by the device. In the target training stage, the teacher network and the student network are obtained by transferring the trained pre-trained model obtained in the source domain training stage.
[0087] like Figure 2 As shown, the composition of the pre-trained model includes the following parts.
[0088] The backbone network model connects each branch network model in series, receives the image input to the pre-trained model, processes the image, and inputs the obtained image features to each branch network model. The backbone network consists of a convolutional neural network and a convolutional module attention mechanism module. In the specific implementation, the backbone network model uses the OSNet network combined with the CBAM attention mechanism.
[0089] Branch network model, there are at least two branch network models, including a global branch network model and a local branch network model. The global branch network model obtains global features by globally maximizing the pooling of image features, and the local branch network model obtains local features by averaging the pooling of image features and splicing them together. The branch network consists of a convolutional neural network and a convolutional module attention mechanism module. In the specific implementation, the branch network model adopts the OSNet network combined with the CBAM attention mechanism. The attention mechanism is added after the second layer of OSNet (trunk branch) and before the fourth layer (global branch and local branch).
[0090] In the specific implementation, the first three layers of the OSNet network are used as the backbone network, and the last two layers are used as the global branch network and the local branch network. The global branch features are obtained by global maximum pooling, and the local branch divides the features into 6 parts, which are average pooled and spliced together. The CBAM attention mechanism is designed in the backbone network, global branch and local branch. Figure 3 As shown in Figure 2, CBAM consists of two independent submodules: channel attention module ( Figure 3 The upper part) and the spatial attention module ( Figure 3 The lower part) are combined together in series.
[0091] like Figure 3 As shown in Figure 1, the structural diagram of the attention mechanism module. The composition of the attention module includes the following parts.
[0092] The channel attention module receives image features. The image features are obtained after the image input to the backbone network model is processed by the backbone model. The image features are subjected to global maximum pooling and average pooling operations respectively to obtain two first feature maps. The two first feature maps are concatenated and then subjected to convolutional layers and normalization operations to generate spatial attention weights. In the specific implementation, the input feature x (H×W×C) is subjected to global maximum pooling and global average pooling operations respectively to obtain two 1×1×C feature maps. The feature maps are sent to the shared connection layer, and then the final channel attention weights are generated by summing and sigmoid activation.
[0093] The spatial attention module receives the feature map output by the channel attention module, performs global maximum pooling and global average pooling on the feature map output by the channel attention module, obtains two second feature maps, concatenates the two second feature maps based on the image channel, and then performs convolution layer and normalization operation to generate spatial attention weights. In the specific implementation, the feature map output by the channel attention module is subjected to global maximum pooling and global average pooling to obtain two H×W×1 feature maps, and then the two feature maps are concat-concatenated based on the channel. The spatial attention weights are generated through convolution layer and sigmoid operation. The channel attention module is connected to the spatial attention module in a serial manner.
[0094] pass Figure 2 The method for source domain training of the pre-trained model shown includes the following steps.
[0095] Input each image in the training set and the label corresponding to the image into Figure 2 The pre-trained model shown in the figure outputs the first global feature of each image after being processed by the pre-trained model. and the first local feature The label is used to identify the category of the image, and the category of the image corresponds to the identity of the pedestrian contained in the image. In the specific implementation, the feature dimension of each branch output of the pre-trained model is 2048 dimensions. The details of the image data in the training set are as follows: Taking the Market-1501 dataset as the source domain data as an example, the input source domain data image and the true value label y′i (used to identify the identity of the pedestrian in the image). During the training process, the relevant parameters of the pre-trained model are set as follows: the maximum epoch is set to 80. For each epoch, the number of iterations Rpre=200. In each iteration, 64 images of 16 identities are resized to 256*128 and input into the network. The initial learning rate is set to 0.00035, and multiplied by 0.1 at the 40th and 70th epochs.
[0096] The first global feature and the first local feature Input to the first classifier to obtain the first global feature and the first local feature The corresponding predicted value is the maximum feature prediction of the source domain training set identity and the average feature prediction The predicted value is used to identify the category of the image corresponding to the first global feature and the first local feature after classification by the classifier. The category of the image corresponds to the identity of the pedestrian contained in the image. The number of classifications of the first classifier is determined by the number of identities of the pedestrians in the data set, that is, there are as many classification results as there are different pedestrians.
[0097] Construct a pre-training loss function, and calculate the training effect through the pre-training loss function, and repeatedly train the pre-training model until the calculated value of the pre-training loss function reaches the expected index. The pre-training loss function is obtained by the weighted summation of the cross entropy loss function and the triple loss function. In the specific implementation, the pre-training loss function is as follows:
[0098]
[0099] in, They represent the weight parameters of the source domain loss function respectively.
[0100] like Figure 4 As shown, the target domain training model includes the following components.
[0101] The teacher network (Teacher Backbone) receives each image of the target domain training set and outputs the second global feature and the second local feature corresponding to each image. In a specific implementation, the image size can be 128*64 or 256*128.
[0102] The student network (Student Backbone) receives each image of the target domain training set and outputs the third global feature and the third local feature corresponding to each image.
[0103] The second classifier (not shown in the figure) receives the second global feature and the second local feature output by the teacher network, and outputs soft labels of the image corresponding to the second global feature and the second local feature, respectively, and the soft labels are used to identify the category of the corresponding image in the target domain training set.
[0104] The clustering model receives the features after the concatenation of the second global feature and the second local feature output by the teacher network (the Contact operation shown in the figure), generates hard labels after clustering, and the hard labels are used to identify the category of the corresponding image in the target domain training set. In the specific implementation, the clustering model can be implemented by DBSCAN clustering. By setting the radius (r) and the number of points (min_samples) contained in the radius as evaluation indicators, the different points in the data set (the points here correspond to the features after the second global feature and the second local feature, and each point corresponds to an image in the data set) are classified at the density level. If the number of points contained in a certain point within an r range is greater than min_samples, the point is called a core point; if a certain point is not a core point, but is within an r domain of a certain core point, the point is called a boundary point; and if a certain point is neither a core point nor a boundary point, the point is called a noise point. After completing the above three-category division for all points in the data set, the core points within an r range are then divided into a cluster, and the boundary points are divided into a cluster to which a neighboring core point belongs, and the noise points are discarded, and finally the division of the entire data set is completed. In the specific implementation, the relevant parameter settings of the clustering method include: density radius r = 0.002, minimum cluster sample min_samples = 4. The epoch is set to 40. For each epoch, the number of iterations Rpre = 400. In each iteration, 64 images of 16 cluster-based pseudo identities are resized to 256*128 and input into the network. The fixed learning rate of the network is 0.00035.
[0105] The third classifier (not shown in the figure) receives the third global feature and the third local feature output by the student network, and outputs the prediction value of the image corresponding to the third global feature and the third local feature, and the prediction value is used to identify the category of the corresponding image in the target domain training set, and the category of the image corresponds to the identity of the pedestrian contained in the image.
[0106] The target domain training loss function calculation module constructs the target domain pre-training loss function and judges the training effect by the calculated value of the target domain training loss function. The construction process of the target domain training loss function is as follows.
[0107] The cross entropy loss function of the student network under the cluster label:
[0108]
[0109] Soft cross entropy loss function for asymmetric branch supervision:
[0110]
[0111]
[0112] Soft triplet loss function for asymmetric branch supervision:
[0113]
[0114]
[0115]
[0116] in, Representation sample The softmax triplet distance of and Represent the positive samples and negative samples of each batch respectively. The positive and negative samples are determined by pseudo labels generated based on clustering.
[0117] The target domain training loss function is expressed as:
[0118]
[0119] in, and They represent the weight coefficients of clustering loss, soft cross entropy loss and soft triplet loss respectively.
[0120] Among the above components, the structures of the teacher network and the student network are consistent with the structures of the pre-trained models in the source domain training stage. They are pre-trained models trained in the source domain training stage. The clustering algorithm used can be DBSCAN. The update of the model parameters of the teacher network and the student network is based on the EMA indicator.
[0121] When training is performed using the target domain training model, the specific implementation method includes: Input to the teacher-student network (teacher network and student network), the teacher network generates global features and local features The second classifier converts the two feature vectors into prediction values and That is, soft label. The global features and local features are concatenated and input into the clustering model (DBSCAN), and hard labels (hard labels, also called pseudo labels) are generated in the clustering. The features of the student network are and Input the third classifier classification, and obtain the predicted values respectively and New classifiers (second and third classifiers) are recreated based on the number of clusters at the beginning of each epoch. The normalized mean features of each cluster are taken from the local branch to initialize the classifier of the local branch, and the normalized maximum features are taken from the global branch to initialize the classifier of the global branch.
[0122] After the target domain training, the student network and the third classifier are combined to form an unsupervised person re-identification device. The student network receives an image containing a pedestrian to be identified, and the third classifier outputs an image category that identifies the pedestrian's identity.
[0123] Figure 5 It is a schematic diagram of a method for updating parameter models of a teacher network and a student network according to an embodiment of the present disclosure.
[0124] Create a teacher-student network model in the target domain. The network model used by the teacher network and the student network is the same as the pre-trained model. The teacher network model weight uses the student network model EMA weight, such as Figure 5 As shown. The EMA weight in the training phase is defined as:
[0125]
[0126] Among them, t represents the training stage, and α represents a smoothing coefficient that controls the self-integration speed of the weights.
[0127] Figure 6 Schematic diagram of an asymmetric branch supervision method for a student network and a teacher network according to an embodiment of the present disclosure.
[0128] like Figure 6 As shown, the present invention adopts an asymmetric branch supervision method. Each branch of the student is supervised by a teacher branch with a different structure, that is, the soft label generated by the global branch of the teacher network supervises the local branch of the student network, and the soft label generated by the local branch of the teacher network supervises the global branch of the student network. The weights between the paired teachers and students can maintain diversity.
[0129] It can be seen that the unsupervised pedestrian re-identification training method based on a multi-branch network provided by the present disclosure first has a source domain pre-training stage, in which a labeled image is input into the constructed pre-training model, features are extracted, and the cross entropy loss function and the triplet loss function are calculated to optimize the network. The parameters of the pre-training model trained in the pre-training stage are migrated to the target domain and the parameters of the teacher-student network model are initialized. In the target domain training stage, unlabeled images are input into the network structure to extract features, and then significant features are extracted based on the attention mechanism. Global features and local features are extracted respectively through the constructed teacher-student network, the teacher network model generates soft pseudo labels and hard pseudo labels based on global features and local features, and the student network model generates predicted values. The loss function training network is constructed by cross-branch supervision.
[0130] The present invention conducted two groups of experiments. One group was in the unsupervised adaptive method, and the cross-domain data sets used were Market→DukeMTMC, DukeMTMC→Market, Market→MSMT, and DukeMTMC→MSMT. The experimental results are shown in Table 1. The other group was in the completely unsupervised method, and the data sets used were Market and DukeMTMC. The experimental results are shown in Table 2. The experimental results of the unsupervised pedestrian re-identification method based on multi-branch network provided by the present invention are compared with other methods as follows.
[0131] Table 1 Comparison of unsupervised adaptive methods
[0132]
[0133] Table 2 Comparison of fully unsupervised methods
[0134]
[0135]
[0136] Compared with the prior art, the unsupervised pedestrian re-identification method, training method and device based on a multi-branch network provided by the present invention have the following technical effects.
[0137] First, in order to extract multi-scale features, the traditional deep learning method does not pay enough attention to sub-salient details. This paper uses OSNet as the backbone network to adaptively adjust the receptive field size according to the input information, capture different spatial scales and encapsulate any combination of multiple scales to learn discriminative pedestrian features. In order to obtain salient features, the attention mechanism is added and multi-scale fusion is performed.
[0138] Second, in terms of processing noisy labels, compared with the commonly used method of processing noisy labels, that is, by training paired networks so that each network helps to correct each other, paired models with the same structure are prone to converge with each other and fall into local minima, the present invention designs an asymmetric network structure in a model based on the teacher-student network structure to extract global features and local features, thereby enhancing the diversity of appearance features and obtaining better clustering-based hard labels.
[0139] Third, in deep learning, data is usually marked as hard labels, but in fact the same data contains different categories of information. Directly marking it as a hard label will result in a large amount of information loss, which will affect the effect of the final model. In order to reduce pseudo-label noise, the present invention adds soft pseudo-labels through network prediction. The global branch of the student's network is supervised by the local branch of the teacher's network, and the local branch of the student's network is supervised by the global branch of the teacher's network. This design ensures the diversity of the teacher-student network weights and can effectively solve the coupling problem.
[0140] Figure 7 It is a flowchart of an unsupervised pedestrian re-identification method based on a multi-branch network according to an embodiment of the present disclosure.
[0141] like Figure 7 As shown, the unsupervised pedestrian re-identification method S100 based on a multi-branch network includes the following steps.
[0142] In step S102, a feature map of the image is extracted based on the image containing the pedestrian to be identified.
[0143] In step S104, salient features of the image are extracted based on the image feature map.
[0144] In step S106, global features of the image are extracted based on the salient features of the image.
[0145] In step S108, local features of the image are extracted based on the salient features of the image.
[0146] In step S110 , the identity of the pedestrian contained in the image is determined based on the global features and local features of the image.
[0147] Figure 8 It is a schematic diagram of the structure of an unsupervised pedestrian re-identification device based on a multi-branch network according to an embodiment of the present disclosure.
[0148] like Figure 8 As shown, the unsupervised pedestrian re-identification device based on a multi-branch network includes the following modules.
[0149] The feature map extraction module 1002 extracts a feature map of an image based on the image containing the pedestrian to be identified.
[0150] The salient feature extraction module 1004 extracts salient features of the image based on the image feature map.
[0151] The global feature extraction module 1006 extracts the global features of the image based on the salient features of the image.
[0152] The local feature extraction module 1008 extracts local features of the image based on the salient features of the image.
[0153] The pedestrian identity determination module 1010 determines the identity of the pedestrian contained in the image based on the global features and local features of the image.
[0154] It should be noted that Figure 7 and Figure 8 The implementation details corresponding to each step or each module are consistent with the relevant implementation details involved in other embodiments of the present disclosure and will not be repeated here.
[0155] Figure 8 An example diagram of an apparatus using a hardware implementation of a processing system is shown. The apparatus may include a corresponding module that performs each or several steps in the above flowchart. Therefore, each step or several steps in the above flowchart may be performed by a corresponding module, and the apparatus may include one or more of these modules. The module may be one or more hardware modules specifically configured to perform the corresponding steps, or implemented by a processor configured to perform the corresponding steps, or stored in a computer-readable medium for implementation by a processor, or implemented by some combination.
[0156] The hardware structure can be implemented using a bus architecture. The bus architecture can include any number of interconnecting buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0157] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.
[0158] Any process or method description in the flowchart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes other implementations, in which the functions may not be performed in the order shown or discussed, including performing the functions in a substantially simultaneous manner or in a reverse order according to the functions involved, which should be understood by a person skilled in the art of the present disclosure. The processor performs the various methods and processes described above. For example, the method implementation in the present disclosure can be implemented as a software program, which is tangibly contained in a machine-readable medium, such as a memory. In some embodiments, part or all of the software program can be loaded and / or installed via a memory and / or a communication interface. When the software program is loaded into the memory and executed by the processor, one or more steps in the method described above can be performed. Alternatively, in other embodiments, the processor can be configured to perform one of the above methods in any other appropriate manner (e.g., by means of firmware).
[0159] The logic and / or steps represented in the flowchart or otherwise described herein may be embodied in any readable storage medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions on an instruction execution system, apparatus, or device), or in combination with such instruction execution systems, apparatuses, or devices.
[0160] For the purposes of this specification, a "readable storage medium" may be any device that can contain, store, communicate, propagate or transmit a program for use with or in conjunction with an instruction execution system, device or apparatus. More specific examples of readable storage media (a non-exhaustive list) include the following: an electrical connection with one or more wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), a fiber optic device, and a portable read-only memory (CDROM). In addition, the readable storage medium may even be paper or other suitable medium on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a memory.
[0161] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0162] A person skilled in the art may understand that all or part of the steps of implementing the above-mentioned implementation method may be completed by instructing related hardware through a program, and the program may be stored in a readable storage medium, which, when executed, includes one or a combination of the steps of the implementation method.
[0163] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a readable storage medium. The storage medium may be a read-only memory, a disk or an optical disk, etc.
[0164] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present application. In this specification, the schematic representations of the above terms are not necessarily the same embodiment / method or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments / methods or examples described in this specification and the features of the different embodiments / methods or examples, unless they are contradictory.
[0165] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0166] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
Claims
1. An unsupervised person re-identification training method based on a multi-branch network, characterized in that: include: Source domain training: During the source domain training phase, the labeled images are input into the pre-trained model for training to obtain a trained pre-trained model; as well as Target domain training: in the target domain training stage, the unlabeled images are input into the target domain training model, and after training, a pedestrian re-identification model is obtained; The label is used to identify the category of the image, the category of the image corresponds to the pedestrian contained in the image, and the target domain training model is composed of the pre-trained model obtained in the source domain training stage; The training process of the pre-trained model includes: Input each image in the training set and the label corresponding to the image into the pre-training model, and after being processed by the training model, output the first global feature and the first local feature of each image, wherein the label is used to identify the category of the image, and the category of the image corresponds to the pedestrian contained in the image; Inputting the first global feature and the first local feature into a first classifier to obtain prediction values corresponding to the first global feature and the first local feature, respectively, wherein the prediction values are used to identify the category of the image corresponding to the first global feature and the first local feature after classification by the first classifier; and Constructing a pre-training loss function, and calculating the training effect by using the pre-training loss function, and repeatedly training the pre-training model until the calculated value of the pre-training loss function reaches the expected index; Wherein, the pre-training loss function is obtained by weighted summation of the cross entropy loss function and the triple loss function; The pre-training model comprises: A trunk network model, wherein the trunk network model is serially connected to each branch network model, receives an image input to a pre-trained model, processes the image, and then inputs the obtained image features to each branch network model; and A branch network model, wherein there are at least two branch network models, including a global branch network model and a local branch network model, wherein the global branch network model obtains global features by globally maximizing the image features, and the local branch network model obtains local features by averaging the image features of the image and then splicing them together; The backbone network is composed of a convolutional neural network and a convolutional module attention mechanism module, and the branch network is composed of a convolutional neural network and a convolutional module attention mechanism module; Wherein, the target domain training model includes: A teacher network receives each image of the target domain training set and outputs a second global feature and a second local feature corresponding to each image; The student network receives each image of the target domain training set and outputs a third global feature and a third local feature corresponding to each image; A second classifier receives a second global feature and a second local feature output by the teacher network, and outputs soft labels of images corresponding to the second global feature and the second local feature, respectively, wherein the soft labels are used to identify the category of the corresponding image in the target domain training set; A clustering model receives a concatenated feature of the second global feature and the second local feature output by the teacher network, generates a hard label through clustering, and the hard label is used to identify a category of a corresponding image in the target domain training set; and A third classifier receives the third global feature and the third local feature output by the student network, and outputs a prediction value of an image corresponding to the third global feature and the third local feature, wherein the prediction value is used to identify a category of a corresponding image in a target domain training set; The target domain training loss function calculation module constructs the target domain training loss function and calculates the training effect through the target domain training loss function Among them, the structures of the teacher network and the student network are consistent with the structures of the pre-trained models in the source domain training stage, and are the trained pre-trained models obtained in the source domain training stage.
2. The unsupervised person re-identification training method based on a multi-branch network according to claim 1 is characterized in that: The attention mechanism module includes: A channel attention module receives image features, where the image features are obtained after the image input to the backbone network model is processed by the backbone network model, performs a global maximum pooling operation and an average pooling operation on the image features to obtain two first feature maps, performs a splicing operation on the two first feature maps, and then performs a convolution layer and a normalization operation to generate a spatial attention weight; and A spatial attention module receives the feature map output by the channel attention module, performs a global maximum pooling operation and a global average pooling operation on the feature map output by the channel attention module, obtains two second feature maps, performs a splicing operation on the two second feature maps based on the image channel, and then performs a convolution layer and a normalization operation to generate a spatial attention weight; Among them, the channel attention module and the spatial attention module are connected in series.
3. An unsupervised person re-identification training device based on a multi-branch network, characterized in that: include: Source domain training module, including; A trunk network model, wherein the trunk network model is connected in series to each branch network model; A branch network model, wherein there are at least two branch network models, including a global branch network model and a local branch network model, wherein the global branch network model obtains global features by global maximum pooling, and the local branch network model obtains local features by averaging and pooling the features together; as well as Pre-training loss function calculation module, constructs a pre-training loss function, and calculates the training effect through the pre-training loss function; Target domain training module, including: A teacher network receives each image of the target domain training set and outputs a second global feature and a second local feature corresponding to each image; The student network receives each image of the target domain training set and outputs a third global feature and a third local feature corresponding to each image; A second classifier receives a second global feature and a second local feature output by the teacher network, and outputs soft labels of images corresponding to the second global feature and the second local feature, respectively, wherein the soft labels are used to identify the category of the corresponding image in the target domain training set; A clustering model receives a concatenated feature of a second global feature and a second local feature output by a teacher network, generates a hard label through clustering, and the hard label is used to identify a category of a corresponding image in a training set of the target domain; A third classifier receives the third global feature and the third local feature output by the student network, and outputs a prediction value of an image corresponding to the third global feature and the third local feature, wherein the prediction value is used to identify a category of a corresponding image in a target domain training set; and The target domain training loss function calculation module constructs the target domain training loss function and calculates the training effect through the target domain training loss function.
4. An unsupervised person re-identification device based on a multi-branch network, characterized in that: include: The student network and the third classifier of claim 3, wherein the student network receives an image containing a pedestrian, and the third classifier outputs an image category, wherein the image category corresponds to the identity of the pedestrian contained in the image.
5. An unsupervised person re-identification method based on a multi-branch network, characterized in that: include: An image or image sequence containing a pedestrian is input into the unsupervised pedestrian re-identification device based on a multi-branch network as described in claim 4, and the category of the pedestrian is obtained by identification by the unsupervised pedestrian re-identification device based on a multi-branch network.
6. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory so that the processor executes the method according to claim 1, 2 or 5.
7. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the method according to claim 1, 2 or 5 when executed by a processor.
