Attribute-based double-branch pedestrian re-identification method

By introducing an attribute-based dual-branch model and self-attention layer in pedestrian re-identification technology, the global and local characteristics of pedestrians are extracted, and the problem of insufficient accuracy of pedestrian recognition is solved, and higher recognition accuracy and robustness are achieved.

CN119600649APending Publication Date: 2025-03-11SHANDONG UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411642848.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

Existing pedestrian re-identification technology is difficult to effectively distinguish the subtle differences of pedestrians with similar appearances, resulting in insufficient recognition accuracy.

Method used

The attribute-based dual-branch pedestrian re-identification method is adopted to extract the global and local features of pedestrians through identity branches and attribute branches, and combine the self-attention layer and attribute area weight layer to enhance the robustness and distinction ability of features, and improve the recognition accuracy through the consistency re-ordering strategy of the number of attributes.

Benefits of technology

It significantly improves the accuracy and robustness of pedestrian re-identification, and can maintain a high recognition rate under the influence of factors such as camera angle, distance, lighting, occlusion and complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600649A_ABST
    Figure CN119600649A_ABST
Patent Text Reader

Abstract

The invention discloses an attribute-based double-branch pedestrian re-identification method, which belongs to the technical field of pedestrian re-identification, and comprises the following steps: preparing a data set, and setting pedestrian attributes; the constructed attribute-based double-branch pedestrian re-identification model comprises a backbone network, an identity branch and an attribute branch, the identity branch outputs a global pedestrian feature vector, and the attribute branch network outputs a pedestrian attribute and an attribute enhanced pedestrian feature vector; constructing a loss function; dividing a training set, a query set and a gallery set, and performing pedestrian re-identification model training on the training set; extracting the features of the query set image and the image library set image, calculating the similarity between the two images, and sorting to obtain an initial retrieval result; and reordering the initial retrieval result to obtain a pedestrian re-identification result. According to the method, the robustness of pedestrian features is improved, and the accuracy of pedestrian re-identification in a complex scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of pedestrian re-identification, and in particular relates to an attribute-based dual-branch pedestrian re-identification method. Background Art

[0002] Pedestrian re-identification is a sub-problem of the image retrieval task. It aims to correctly retrieve pedestrian images with the same identity as the target pedestrian from a pedestrian image database composed of images obtained from multiple non-overlapping camera perspectives. It is of great significance in smart security, criminal investigation, and pedestrian behavior analysis. Since objective factors such as the camera's angle, distance, lighting, occlusion, and complex environment affect the effectiveness of face recognition, pedestrian re-identification technology supplements the shortcomings of traditional face recognition in intelligent monitoring.

[0003] At present, most of the convolutional neural network (CNN)-based methods for pedestrian re-identification use global descriptions to extract global features of pedestrians. However, most pedestrians have highly similar appearances. Pedestrian re-identification technology must focus on more detailed individual differences in the feature extraction stage, such as unique clothing patterns, personalized accessories, subtle differences in hairstyles, and body features, to distinguish similar pedestrians. Global descriptions have poor ability to describe local details of pedestrians and cannot distinguish subtle differences between two similar pedestrians.

[0004] Different pedestrian attributes correspond to different pedestrian areas in space. Therefore, the attribute features used in the attribute-based method can represent the local characteristics of pedestrians. The attribute-enhanced pedestrian features are used to supplement the detailed information of the global pedestrian features, so that the model pays more attention to local details, which can help the pedestrian re-identification model make more accurate decisions. Summary of the invention

[0005] In order to overcome the deficiencies in the prior art, the present invention provides an attribute-based dual-branch pedestrian re-identification method.

[0006] The present invention provides an attribute-based dual-branch pedestrian re-identification method, comprising the following steps:

[0007] Step S1, prepare a pedestrian re-identification dataset and label pedestrian attributes in the pedestrian identity dimension;

[0008] Step S2, constructing an attribute-based dual-branch person re-identification model;

[0009] Step S3, constructing a loss function;

[0010] Step S4, dividing the pedestrian samples into a training set, a query set and a gallery set, and performing attribute-based dual-branch pedestrian re-identification model training on the training set;

[0011] Step S5, extracting features of the query set images and the gallery set images;

[0012] Step S6, calculating the similarity between the features of the query set images and the gallery set images and sorting them to obtain an initial search result;

[0013] Step S7, reordering the initial search results to obtain a final pedestrian re-identification result.

[0014] Furthermore, the attribute-based dual-branch pedestrian re-identification model includes: a backbone network, an identity branch and an attribute branch, the input of the backbone network is image data, the output of the backbone network is used as the input of the identity branch and the attribute branch, wherein the identity branch outputs a global pedestrian feature vector, and the attribute branch outputs pedestrian attributes and attribute enhanced pedestrian feature vectors.

[0015] Furthermore, the attribute branch includes a first attribute branch and a second attribute branch, the first attribute branch adds pedestrian attribute supervision, and the second attribute branch adds pedestrian identity supervision.

[0016] Furthermore, the loss function includes the identity classification loss of the identity branch, the attribute classification loss of the first attribute branch, and the identity classification loss of the second attribute branch.

[0017] The identity classification loss L1 of the identity branch includes the cross entropy loss L id and the hard sample triplet loss L tri , the expression is as follows:

[0018]

[0019] L1=L id +L tri

[0020] in, represents the pedestrian identity label value of the i-th sample after label smoothing, represents the pedestrian identity prediction value output by the first softmax classification layer for the i-th sample, N is the number of pedestrians in the training set, batch represents the pedestrian sample batch, and d a,p represents the set of Euclidean distances between benchmark samples and positive samples in a batch, d a,n represents the set of Euclidean distances between benchmark samples and negative samples in a batch; λ is the interval threshold;

[0021] The attribute classification loss L of the first attribute branch attr Including weighted Focal loss L attr,m , the expression is as follows:

[0022]

[0023]

[0024] Among them, y i,m represents the pedestrian attribute label value of the mth attribute of the ith sample after label smoothing, p i,m N represents the pedestrian attribute prediction value output by the sigmoid classification layer for the mth attribute of the ith sample. all Represents the total number of samples in the training set, N m represents the number of positive samples of the mth pedestrian attribute in the training set; γ represents the balance coefficient of difficult and easy samples; N represents the number of pedestrians in the training set, and M represents the number of pedestrian sample attributes;

[0025] The identity classification loss L2 of the second attribute branch is trained in the same way as the identity classification loss L1 of the identity branch, i.e.: L2 = L i ' d +L t ' ri Among them, L i ' d represents the cross entropy loss of the identity classification loss of the second attribute branch, L t ' ri The hard triplet loss representing the identity classification loss of the second attribute branch.

[0026] The 512-dimensional global pedestrian feature vector and the 512-dimensional attribute-enhanced pedestrian feature vector are concatenated into a pedestrian feature vector.

[0027] Further, the step S6 comprises:

[0028] Step S61, obtaining the pedestrian feature vector;

[0029] Step S62, calculating a cosine distance set between the pedestrian feature vector and the pedestrian feature map;

[0030] Step S63, sorting according to the cosine distance set to obtain the initial search result.

[0031] The re-ranking is to re-rank the initial retrieval results by comparing the consistency of the number of the same pedestrian attributes of each image in the initial retrieval results and the query set image.

[0032] Further, the step S7 comprises:

[0033] Step S71, taking the first 50 items of the initial search results as the results to be sorted;

[0034] Step S72, dividing the results to be sorted into batches, calculating the number of identical pedestrian attribute consistency in each batch, sorting each batch, and obtaining a set of matching results;

[0035] Step S73, defining an intermediate variable set, and updating the matching result set;

[0036] Step S74, repeating the step S72 and the step S73 until each image in the to-be-sorted result is re-sorted once, and a final re-sorted result is obtained;

[0037] Step S75, replacing the initial search result with the final re-ranking result to obtain a final person re-identification result.

[0038] The present invention provides an attribute-based dual-branch pedestrian re-identification method, which extracts pedestrian identity features through an identity branch to identify and distinguish the unique identities of different individuals; simultaneously obtains attribute features and pedestrian features under a multi-task learning framework through the attribute branch to achieve more accurate attribute recognition and pedestrian recognition; by fusing the pedestrian features of the two branches, the robustness of the pedestrian re-identification model for pedestrian image extraction features is enhanced, and a high recognition rate can be maintained even under the influence of objective factors such as camera angle, distance, lighting, occlusion and complex environment; a re-ranking strategy based on the consistency of the number of attributes significantly improves the accuracy of pedestrian re-identification.

[0039] In order to make the above features and advantages of the invention more obvious and easy to understand, embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 The present invention is a flowchart of an attribute-based dual-branch pedestrian re-identification method.

[0041] Figure 2 This is an attribute-based dual-branch pedestrian re-identification model of the present invention.

[0042] Figure 3 For the present invention Figure 2 Schematic diagram of the structure of the self-attention layer in .

[0043] Figure 4 For the present invention Figure 2 Schematic diagram of the structure of the attribute region weight layer.

[0044] Figure 5 Flow chart of the reordering strategy of the present invention.

[0045] Figure 6 Schematic diagram of recognition results of the attribute-based dual-branch person re-identification method of the present invention.

[0046] 1-backbone network; 2-identity branch; 21-first identity classification network; 3-attribute branch; 31-attribute classification network; 311-first attribute classification network module; 312-second attribute classification network module; 31M-Mth attribute classification network module; 32-second identity classification network. DETAILED DESCRIPTION

[0047] In order to make the purpose and technical solution of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] like Figure 1 FIG. 1 is a flow chart of a dual-branch pedestrian re-identification method based on attributes of the present invention. The dual-branch pedestrian re-identification method based on attributes comprises the following steps:

[0049] Step S1: prepare a pedestrian re-identification dataset and label pedestrian attributes in the pedestrian identity dimension.

[0050] Among them, the pedestrian attributes include gender (male / female), age group (children / teenagers / adults / elderly), whether wearing a hat (wearing / not wearing), hair length (short hair / long hair), top sleeve length (short sleeve / long sleeve), top color (black / white / pink / red / yellow / green / blue / purple / gray / brown), bottom type (pants / skirt), bottom length (short / long), bottom color (black / white / pink / red / yellow / green / blue / purple / gray / brown), carrying bag type (handbag / backpack / tote bag / none) and other attribute categories. Each pedestrian attribute represents a label. Converting multi-label pedestrian attributes into binary label attributes is to regard each attribute as an independent binary classification problem, and mark it as 1 if the attribute exists and mark it as 0 if it does not exist.

[0051] Step S2: construct an attribute-based dual-branch person re-identification model.

[0052] like Figure 2 As shown, the attribute-based dual-branch pedestrian re-identification model includes: a backbone network 1, an identity branch 2 and an attribute branch 3, the input of the backbone network 1 is image data, and the output of the backbone network 1 is used as the input of the identity branch 2 and the attribute branch 3, wherein the identity branch 2 outputs a global pedestrian feature vector, and the attribute branch 3 outputs pedestrian attributes and attribute enhanced pedestrian feature vectors.

[0053] Optionally, the backbone network 1 adopts a ResNet50 structure.

[0054] The backbone network 1 includes conv1~4_x layers, the input of the conv1~4_x layers is the image data, and the output of the conv1~4_x layers is the input of the identity branch 2 and the attribute branch 3.

[0055] More specifically, the identity branch 2 includes a self-attention layer, a first conv5_x layer, a global average pooling layer, and a first identity classification network 21. The first identity classification network 21 includes a first fully connected layer, a first BatchNorm layer, and a first softmax classification layer. The input of the self-attention layer is the conv5_x layer, the output of the self-attention layer is used as the input of the first conv5_x layer, the output of the first conv5_x layer is used as the input of the first global average pooling layer, the output of the first global average pooling layer is used as the input of the first fully connected layer, the first fully connected layer outputs the global pedestrian feature vector, the output of the first fully connected layer is used as the input of the first BatchNorm layer, the output of the first BatchNorm layer is used as the input of the first softmax classification layer, and the first softmax classification layer predicts the identity of the pedestrian.

[0056] The structure of the self-attention layer is as follows Figure 3 As shown, optionally, to simplify the calculation, the self-attention layer input feature map F∈R 5×3×2 , through 1×1 convolution, the dimension is R 5×3×2 Tensor, and then flatten it to get the two-dimensional tensor R 5×6 , the same operation is repeated three times to generate three two-dimensional tensors Z1, Z2, and Z3 of the feature map F. The two-dimensional tensor Z2 is transposed to obtain a two-dimensional tensor Z4. The two-dimensional tensor Z4 is multiplied by the two-dimensional tensor Z3 and processed by the softmax function to obtain an attention weight map Z5. The attention weight map Z5 is multiplied by the two-dimensional tensor Z1 to obtain a two-dimensional tensor Z6. The two-dimensional tensor Z6 is reconstructed to obtain a feature map E. Finally, the result of adding the feature map F to the feature map E is used as the output of the self-attention layer.

[0057] Furthermore, the attribute branch 3 includes a first attribute branch and a second attribute branch, the first attribute branch adds pedestrian attribute supervision, the second attribute branch adds pedestrian identity supervision, and the first attribute branch and the second attribute branch share the second conv5_x layer.

[0058] More specifically, the first attribute branch also includes an attribute area weight layer, a second global average pooling layer, and an attribute classification network 31. The attribute classification network 31 includes multiple attribute classification network modules, specifically a first attribute classification network module 311, a second attribute classification network module 312, until the Mth attribute classification network module 31M, and each of the attribute classification network modules corresponds to processing information of one of the pedestrian attributes.

[0059] Each of the attribute classification network modules includes a second fully connected layer, a second BatchNorm layer, and a sigmoid classification layer. The output of the second conv5_x layer is used as the input of the attribute area weight layer, the output of the attribute area weight layer is used as the input of the second global average pooling layer, the output of the second global average pooling layer is used as the input of the second fully connected layer, the output of the second fully connected layer is used as the input of the second BatchNorm layer, the output of the second BatchNorm layer is used as the input of the sigmoid classification layer, and the sigmoid classification layer predicts the pedestrian attributes.

[0060] Furthermore, the structure of the attribute region weight layer is as follows: Figure 4 As shown, the attribute region weight layer takes the feature map A as input, locates the region associated with each attribute, and generates a corresponding attribute region weight map for each attribute. The feature map A is recalibrated using the weight map, that is, the features related to the attribute are enhanced by performing element-by-element multiplication of the weight map and the feature map, while irrelevant features are suppressed.

[0061] More specifically, the second attribute branch also includes a third global average pooling layer and a second identity classification network 32. The second identity classification network 32 includes a third fully connected layer, a third BatchNorm layer, and a second softmax classification layer. The output of the second conv5_x layer is used as the input of the third global average pooling layer. The output of the third global average pooling layer is used as the input of the third fully connected layer. The third fully connected layer outputs the attribute enhanced pedestrian feature vector. The output of the third fully connected layer is used as the input of the second BatchNorm layer. The output of the second BatchNorm layer is used as the input of the second softmax classification layer. The second softmax classification layer predicts the identity of the pedestrian.

[0062] Convolutional neural networks achieve the same receptive field as large convolution kernels by stacking multiple layers of small convolution kernels, and multiple layers of small convolution kernels can capture finer features and help learn more complex image patterns; although the receptive field of ResNet50 can theoretically cover the entire pedestrian image, the residual structure helps to retain information, but it also limits the effective depth of the network, which in turn leads to the network's receptive field being not large enough; each element of the output feature map of the attribute-based dual-branch pedestrian re-identification model can be represented as a feature extracted from the image region, and the overall input data is considered when processing each element using the self-attention layer, so that it can focus on different parts of each region in the pedestrian image, thereby better capturing the internal dependencies between the various regions of the pedestrian image; local features are extracted using convolution, and then self-attention is used to integrate the local features into global information, thereby directly increasing the receptive field of the attribute-based dual-branch pedestrian re-identification model to the overall image, which enables the model to better capture and understand the characteristics of image data and improve the model's feature extraction capability for global features.

[0063] Pedestrian attributes contain a lot of high-dimensional semantic information, which will be of great help to the pedestrian re-identification task. Pedestrian attributes are highly robust and can effectively solve the problem of pedestrian re-identification task failure caused by pedestrian occlusion and other reasons. Pedestrian attributes can be divided into two categories: global attributes and local attributes. When identifying pedestrian attributes, local features and global features are independent of each other. Age and gender are global attributes of pedestrians, which can only be obtained by observing the pedestrian as a whole; while local attributes of pedestrians such as clothing type, color, backpack, etc. are only related to a part of the pedestrian, and can only be judged by the features of some areas. If the overall features are considered, misjudgment is likely to occur.

[0064] Step S3, constructing a loss function.

[0065] More specifically, the loss function includes the identity classification loss L1 of the identity branch 2, the attribute classification loss L attr , the identity classification loss L2 of the second attribute branch, the total loss L is: L = L1 + αL2 + βL attr , where α and β are weight factors for balancing the loss.

[0066] The identity classification loss L1 of the identity branch 2 adopts the cross entropy loss L id and the hard sample triplet loss L tri For training, the expression is as follows:

[0067]

[0068]

[0069] L1=L id +Ltri

[0070] in, represents the pedestrian identity label value of the i-th sample after label smoothing, represents the pedestrian identity prediction value output by the first softmax classification layer for the i-th sample, N is the number of pedestrians in the training set, batch represents the pedestrian sample batch, and d a,p represents the set of Euclidean distances between benchmark samples and positive samples in a batch, d a,n Represents the set of Euclidean distances between benchmark samples and negative samples in a batch; λ is the interval threshold, which can be set to 0.3.

[0071] The attribute classification loss L of the first attribute branch attr Using weighted Focal loss L attr,m For training, the expression is as follows:

[0072]

[0073] Among them, y i,m represents the pedestrian attribute label value of the mth attribute of the ith sample after label smoothing, p i,m N represents the pedestrian attribute prediction value output by the sigmoid classification layer for the mth attribute of the ith sample. all Represents the total number of samples in the training set, N m represents the number of positive samples of the mth pedestrian attribute in the training set; γ represents the balance coefficient of difficult and easy samples, which can be set to 1; N represents the number of pedestrians in the training set, and M represents the number of pedestrian sample attributes.

[0074] The identity classification loss L2 of the second attribute branch is trained in the same way as the identity classification loss L1 of the identity branch 2, i.e.: L2 = L i ' d +L t ' ri Among them, L i ' d represents the cross entropy loss of the identity classification loss of the second attribute branch, L t ' ri The hard triplet loss representing the identity classification loss of the second attribute branch.

[0075] Step S4, dividing the pedestrian samples into a training set, a query set and a gallery set, and performing attribute-based dual-branch pedestrian re-identification model training on the training set.

[0076] Step S5, extracting features of the query set images and the gallery set images.

[0077] The trained person re-identification model is used to extract features from the query set images and the gallery set images, and the output 512-dimensional global pedestrian feature vector f g_id The pedestrian feature vector f is enhanced with the 512-dimensional attribute output of the attribute branch 3. a_id Concatenate to construct the final pedestrian feature vector f id .

[0078] Step S6, calculating the similarity between the features of the query set images and the gallery set images and sorting them to obtain initial retrieval results.

[0079] By using the extracted pedestrian feature vectors of the query set images and the gallery set images, the cosine distance is used to calculate the similarity and the corresponding query set images are sorted from small to large according to the distance to obtain the initial search results. The specific steps include:

[0080] Step S61, obtaining the pedestrian feature vector.

[0081] The query set image x of the pedestrian q to be retrieved q Input into the trained attribute-based dual-branch person re-identification model to obtain the pedestrian feature vector f q and pedestrian attributes All pedestrian image sample sets X={x1,x2,…,x g ,…,x G} Input the attribute-based dual-branch person re-identification model to obtain the pedestrian feature set F of the image library set = {f1, f2, ..., f g ,…,f G} and the corresponding pedestrian attribute set A={A1,A2,…,A g ,…,A G}, where G represents the number of images in the gallery set. The attribute of the g-th pedestrian sample in the gallery set is M represents the number of pedestrian attributes. When the predicted value of the mth attribute is greater than 0.5 Otherwise 0.

[0082] Step S62, calculating a cosine distance set between the pedestrian feature vector and the pedestrian feature map.

[0083] Calculate the pedestrian feature vector f of the query set q and the pedestrian feature vector f of the g-th image in the gallery g The cosine distance d q,g , the calculation formula is:

[0084] According to the pedestrian feature vector f of the query set qCalculate the cosine distances with the pedestrian feature maps F of all images in the image library to obtain the cosine distance set D q ={d q,1 ,d q,2 ,…,d q,g ,…,d q,G}.

[0085] Step S63, sorting according to the cosine distance set to obtain the initial search result.

[0086] The cosine distance set D q Sort from small to large to get the sorted cosine distance set D q ′, and retain the cosine distance set D q The index value corresponding to each element in ′ The corresponding relationship is expressed as: D q ′,I q =argsort(D q ).

[0087] All pedestrian image sample sets X in the gallery are sorted according to the index value I q Re-sort, the sorting formula is Get the query set image x q The search result S = {s1,s2,…,s g ,…,s G}, the pedestrian attributes should correspond to the pedestrian images one by one, and the pedestrian attribute set A is mapped according to the index value I q Re-rank to obtain the initial search results in

[0088] Step S7, reordering the initial search results to obtain a final pedestrian re-identification result.

[0089] Due to the similarity between pedestrians, the initial retrieval results may contain erroneous images. The re-ranking is to re-rank the initial retrieval results by comparing the consistency of the number of the same pedestrian attributes of each image in the initial retrieval results and the query set image, and finally complete the pedestrian re-identification task.

[0090] like Figure 5 As shown, the reordering includes the following steps:

[0091] Step S71, taking the first 50 items of the initial search results as the results to be sorted.

[0092] Preferably, considering that the number of correct retrieval images corresponding to the query set images in the gallery set is usually small, for example, 10-30 images, the first 50 retrieval images in the initial retrieval results already contain the vast majority of the correct retrieval images in the gallery set. In order to reduce the impact of the remaining erroneous images on the retrieval, the first 50 initial retrieval results S are selected. 50 , the corresponding pedestrian attribute vector is Calculate the number of corresponding attribute consistency, the calculation formula is:

[0093]

[0094] The symbol ≡ represents the XOR operation, k g represents the number of attributes that the g-th image has in common with the query set images.

[0095] Step S72, dividing the results to be sorted into batches, calculating the number of identical pedestrian attribute consistency in each batch, sorting each batch, and obtaining a set of matching results.

[0096] The first 50 initial retrieval results are re-ranked by taking 2L images as a batch every L images. This method can process the ranking results more finely and reduce the interference of erroneous images in the last sequence, thereby possibly obtaining better retrieval accuracy.

[0097] First, the first 50 initial search results S 50 Divide the images into batches of 2L and obtain the matching result S r , the calculation formula is:

[0098]

[0099] Among them, S 1+L(r-1),L(r+1) Represents the set consisting of the 1+L(r-1)th element to the L(r+1)th element.

[0100] The matching result S r The corresponding set of attribute consistency numbers is K r Sort from large to small to obtain the number set K′ of attribute consistency after sorting r , and keep the number set K of attribute consistency r The index value of each element in the sorted The corresponding relationship is expressed as:

[0101] K′ r ,I r =argsort(K r )

[0102] According to the index value I r The matching result S r Reorder to get a reordered set of matching results based on the number of attributes

[0103] Step S73, define an intermediate variable set, and update the matching result set.

[0104] Define the intermediate variable set C 50 =S 50 , according to the reordering results of each batch, the intermediate variable set C 50 ={c1,c2,…,c i ,…,c 50} to update, the update method is:

[0105]

[0106] Step S74, repeating the step S72 and the step S73 until each image in the to-be-sorted result is re-sorted once, to obtain a final re-sorted result.

[0107] More specifically, the operations of step S72 and step S73 are repeated for reordering every L images until That is, S 50 Each image in is reordered once.

[0108] Step S75, replacing the initial search result with the final re-ranking result to obtain a final person re-identification result.

[0109] More specifically, the top 50 search results C are finally re-ranked. 50 The first 50 search results S of the initial search results are 50 Replace and get the final pedestrian re-identification result.

[0110] like Figure 6 The figure shows the recognition result of the dual-branch pedestrian re-identification method based on attributes of the present invention. The pedestrian with the identity number 66 in the Market-1501 dataset is retrieved using the baseline model, the dual-branch pedestrian re-identification model based on attributes, and the dual-branch pedestrian re-identification model based on attributes with re-ranking. From the retrieval results, it can be seen that the dual-branch pedestrian re-identification model based on attributes and the re-ranking strategy have significantly improved the accuracy and robustness of the pedestrian re-identification task.

[0111] The dual-branch pedestrian re-identification method based on attributes of the present invention captures the correlation of each area on the pedestrian feature map by introducing a self-attention layer, thereby improving the robustness of the model in complex scenes; in view of the differences in the attention weights of pedestrian regions in different attribute recognition tasks, the attention area is generated through the feature map to reduce redundant information, thereby improving the accuracy of attribute recognition; adding pedestrian identity supervision enhances the ability to distinguish pedestrians with similar appearances and improves the discriminative power of features; and can maintain a high recognition rate under the influence of objective factors such as camera angle, distance, lighting, occlusion and complex environment. In order to make full use of the pedestrian attributes identified by the model, a re-ranking strategy based on the number of attributes is used, which significantly improves the accuracy of pedestrian re-identification.

[0112] It can be understood that the above specific description of the present invention is only used to illustrate the present invention and is not limited to the technical solutions described in the embodiments of the present invention. Those skilled in the art should understand that the present invention can still be modified or replaced by equivalents to achieve the same technical effects; as long as the use requirements are met, they are within the protection scope of the present invention.

Claims

1. A dual-branch attribute-based person re-identification method, characterized in that: The steps include: Step S1, prepare a pedestrian re-identification dataset and label pedestrian attributes in the pedestrian identity dimension; Step S2, constructing an attribute-based dual-branch person re-identification model; Step S3, constructing a loss function; Step S4, dividing the pedestrian samples into a training set, a query set and a gallery set, and performing attribute-based dual-branch pedestrian re-identification model training on the training set; Step S5, extracting features of the query set images and the gallery set images; Step S6, calculating the similarity between the features of the query set image and the gallery set image and sorting them to obtain an initial search result; Step S7, reordering the initial search results to obtain a final pedestrian re-identification result.

2. The attribute-based dual-branch person re-identification method according to claim 1, characterized in that: The attribute-based dual-branch pedestrian re-identification model includes: a backbone network, an identity branch and an attribute branch, the input of the backbone network is image data, the output of the backbone network is used as the input of the identity branch and the attribute branch, wherein the identity branch outputs a global pedestrian feature vector, and the attribute branch outputs pedestrian attributes and attribute enhanced pedestrian feature vectors.

3. The attribute-based dual-branch person re-identification method according to claim 2, characterized in that: The attribute branch includes a first attribute branch and a second attribute branch, the first attribute branch adds pedestrian attribute supervision, and the second attribute branch adds pedestrian identity supervision.

4. The attribute-based dual-branch person re-identification method according to claim 3, characterized in that: The loss function includes the identity classification loss of the identity branch, the attribute classification loss of the first attribute branch, and the identity classification loss of the second attribute branch. The identity classification loss L1 of the identity branch includes the cross entropy loss L id and the hard sample triplet loss L tri , the expression is as follows: L1=L id +L tri in, represents the pedestrian identity label value of the i-th sample after label smoothing, represents the pedestrian identity prediction value output by the first softmax classification layer for the i-th sample, N is the number of pedestrians in the training set, batch represents the pedestrian sample batch, and d a,p represents the set of Euclidean distances between benchmark samples and positive samples in a batch, d a,n represents the set of Euclidean distances between benchmark samples and negative samples in a batch; λ is the interval threshold; The attribute classification loss L of the first attribute branch attr Including weighted Focal loss L attr,m , the expression is as follows: Among them, y i,m represents the pedestrian attribute label value of the mth attribute of the ith sample after label smoothing, p i,m N represents the pedestrian attribute prediction value output by the sigmoid classification layer for the mth attribute of the ith sample. all Represents the total number of samples in the training set, N m represents the number of positive samples of the mth pedestrian attribute in the training set; γ represents the balance coefficient of difficult and easy samples; N represents the number of pedestrians in the training set, and M represents the number of pedestrian sample attributes; The identity classification loss L2 of the second attribute branch is trained in the same way as the identity classification loss L1 of the identity branch, i.e.: L2 = L i ' d +L t ' ri Among them, L i ' d represents the cross entropy loss of the identity classification loss of the second attribute branch, L t ' ri The hard triplet loss representing the identity classification loss of the second attribute branch.

5. The attribute-based dual-branch person re-identification method according to claim 4, characterized in that: The 512-dimensional global pedestrian feature vector and the 512-dimensional attribute-enhanced pedestrian feature vector are concatenated into a pedestrian feature vector.

6. The attribute-based dual-branch person re-identification method according to claim 5, characterized in that: The step S6 comprises: Step S61, obtaining the pedestrian feature vector; Step S62, calculating a cosine distance set between the pedestrian feature vector and the pedestrian feature map; Step S63, sorting according to the cosine distance set to obtain the initial search result.

7. The attribute-based dual-branch person re-identification method according to claim 6, characterized in that: The re-ranking is to re-rank the initial retrieval results by comparing the consistency of the number of the same pedestrian attributes of each image in the initial retrieval results and the query set image.

8. The attribute-based dual-branch person re-identification method according to claim 7, characterized in that: The step S7 comprises: Step S71, taking the first 50 items of the initial search results as the results to be sorted; Step S72, dividing the results to be sorted into batches, calculating the number of identical pedestrian attribute consistency in each batch, sorting each batch, and obtaining a set of matching results; Step S73, defining an intermediate variable set, and updating the matching result set; Step S74, repeating the step S72 and the step S73 until each image in the to-be-sorted result is re-sorted once, and a final re-sorted result is obtained; Step S75, replacing the initial search result with the final re-ranking result to obtain a final person re-identification result.

Citation Information

Cited By

  • Single-mode pedestrian re-identification method, device and system based on attribute fusion

    CN120976971A