Method, device and computer storage medium for re-identifying pedestrians

By employing fine-grained semantic selection and masking techniques, and utilizing HRNet and ViT-B/16 networks to extract local and global features of pedestrians while masking clothing information, the performance degradation problem in pedestrian re-identification during clothing changes is resolved, resulting in more stable recognition performance.

CN115482508BActive Publication Date: 2026-01-02TIANJIN UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211171601.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2026-01-02
Estimated Expiration
2042-09-26

AI Technical Summary

Technical Problem

Existing pedestrian re-identification technologies suffer from performance degradation when pedestrians change their clothing, and additional auxiliary information needs to be introduced to address the clothing change issue.

Method used

We employ a fine-grained semantic selection and masking approach. We obtain pixel labels and local semantic features of various parts of a pedestrian through the HRNet network, mask clothing area information using an attention module, extract global features using the ViT-B/16 Transformer network, and constrain feature representation through a loss function to achieve local enhancement and global matching.

Benefits of technology

Without introducing additional auxiliary information, the robustness and stability of pedestrian re-identification in clothing changes are improved, a more powerful pedestrian feature description is obtained, and the recognition effect is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115482508B_ABST
    Figure CN115482508B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of computer vision, and in particular relates to a method and system for re-identifying a person in disguise based on fine-grained semantic selection and shielding, an electronic device and a storage medium. The present application comprises two feature extraction networks, which respectively obtain a pixel-level label of a person, a corresponding part pixel prediction vector and a global feature of an image. Through an input person image and a corresponding pixel-level label, an image feature of the person, a part region feature and a foreground feature can be obtained. Through the pixel-level label, a semantic part other than clothes is selectively selected to learn a human body representation, and the part representation is input into an attention module to highlight part information such as limbs of the person in the original image feature and suppress information such as clothes, so that the re-identification model for the person in disguise learns more clothes-irrelevant information to extract a more discriminative and more robust feature representation for the person. The present application is particularly suitable for the field of public security.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of computer vision and pattern recognition, and relates to a dressing pedestrian re-identification method and system based on fine-grained semantic selection and shielding, an electronic device and a storage medium. BACKGROUND

[0002] Pedestrian re-identification is also known as pedestrian re-recognition, and is regarded as a key sub-problem of image retrieval. It is to match pedestrian images or videos across devices by using a computer vision algorithm, that is, given a query image, to search for the same pedestrian in the image library of different monitoring devices. It aims to make up for the visual limitations of fixed cameras and can be combined with pedestrian detection / pedestrian tracking technology, and can be widely applied to the fields of intelligent video monitoring and intelligent security.

[0003] In recent years, pedestrian re-identification technology has developed rapidly, and researchers have proposed many methods to improve the performance of the technology, such as representation learning, local feature learning, metric learning, and deep learning. And with the development of deep networks and the emergence of related large-scale data sets, pedestrian re-identification technology has made breakthroughs. However, existing researches are all based on the assumption that the appearance of pedestrians does not change in a short period of time. However, in practical applications, people often change or add clothes, especially in a long period of time.

[0004] Dressing pedestrian re-identification is a new branch of research direction in the field of pedestrian re-identification in recent two years. Its task is mainly to determine whether the dressed pedestrian appears under other cameras. Some existing methods to solve the dressing problem all need to introduce some auxiliary information, such as Yang et al. using pedestrian contour sketches, introducing spatial polar coordinate transformation on the contour sketch to learn shape features (PRCC), Qian et al. using human key points to eliminate the influence of appearance (LTCC), Shu et al. using a trained human parsing model to obtain human semantic segmentation data set of related dressing pedestrian re-identification data set, etc. In video monitoring, the face of a person may be blurred, which provides little effective identification information, and if only the shape of the body, the body contour map, etc. are used to extract features, the features unrelated to the clothes on the original image will be ignored. SUMMARY

[0005] In view of the deficiencies of the prior art, the application aims to provide a dressing pedestrian re-identification method and storage medium based on fine-grained semantic selection and shielding, which can provide a new idea for solving the dressing pedestrian re-identification problem without introducing additional auxiliary information.

[0006] The method specifically comprises the following steps:

[0007] 1) Obtain the original image, and perform data enhancement, including random cropping, horizontal flipping, and random erasing, etc.

[0008] 2) Input the original image into the network to obtain the pixel label corresponding to the pedestrian image, and the corresponding part feature and the global feature of the image;

[0009] 3) Select the part feature of the human body except the clothes through the pixel label, and splice it by channel to input into the attention module to obtain the corresponding local enhanced feature representation;

[0010] 4) In the test stage, the global feature of the image is used for similarity matching, and the ranking result is output as the re-identification result;

[0011] The local enhanced feature representation, the global feature representation, and the pixel label classification are trained and constrained by using a loss function.

[0012] It should be noted that the step 1) of pre-processing and data enhancement operation on the input original image includes: adjusting the picture pixel size to 256*128, and randomly performing random cropping, horizontal flipping, and random erasing, with a probability of 50%;

[0013] It should be noted that the network of step 2) is composed of two branches; the feature extraction network A adopts the HRNet network structure; the feature extraction network B adopts the TransReID model structure based on ViT-B / 16; wherein the pixel label of each part of the pedestrian and the five local semantic features of the human body can be obtained through the feature extraction network A, wherein the pixel label is represented by 0-5 to represent six parts of background, head, upper body, lower body, arm and leg; the five local semantic features are head feature, upper body feature, lower body feature, arm feature and leg feature; the global feature of the pedestrian is extracted through the feature extraction network B.

[0014] It should be noted that the step 3) of learning semantic features except the clothes region through the pixel label and splicing by channel to input into the attention module for feature enhancement includes the following steps:

[0015] 3-1) Input a small batch of images B represents the size of the input batch; X i represents the input image, which has a shape of C*H*W, C represents the number of channels, H represents the height, and W represents the width; the human semantic segmentation prediction map of the input image is obtained through the feature extraction network A, which has a shape of B*k*1 / 4h*1 / 4w, wherein B represents the batch size of the input image, h and w represent the height and width of the input image respectively, and k represents the number of pixel label categories predicted by the feature extraction network A; the softmax function is used to obtain the prediction vector of each pixel category, which has a shape of k*1 / 4h*1 / 4w;

[0016] 3-2) The global feature f_global extracted by the feature extraction network B is multiplied by the prediction vector of pixel categories 1, 4 and 5 pixel by pixel to obtain the local features f_1, f_4 and f_5 of the corresponding categories. In order to mask the semantic information of the clothing area, the prediction vectors of the pixel categories of the upper body pixel label 2 and the lower body pixel label 3 are multiplied by a 0 vector to obtain the local features f_2 of the upper body and the local features f_3 of the lower body. After global pooling of these local features, they are sequentially spliced by channel to obtain a feature representation f_part excluding clothing;

[0017] 3-3) The feature f_part obtained in step 3-2) is input into an attention module to learn a weighted feature vector and reweight the channel features of the feature map, and a semantic enhanced feature representation excluding clothing is obtained through a global pooling operation; wherein the attention module is composed of a global average pooling and two fully connected layers, and its formula is represented as F_w = F_C2(F_c1(F_GAP(f_part))), wherein f_part represents the feature map; F_GAP represents global pooling; F_c1 and F_c2 represent the weight matrices of the two fully connected layers, respectively.

[0018] It should be noted that the step 4) test stage includes;

[0019] 4-1) Load the trained model, input the test image, and obtain the image features after image preprocessing by the trained model;

[0020] 4-2) Calculate the similarity of the test features and the image features of each pedestrian in the retrieval library and sort them in descending order, and output the result with the highest similarity as the re-identification result.

[0021] It should be noted that the loss function is realized by the following formula;

[0022] L = L global + L mse + L part + λL parsing

[0023] Wherein, L global represents the classification loss and the triplet loss for constraining the global feature representation, L mse is the mean square error loss for constraining the global feature representation and the locally enhanced feature representation, L part is the classification loss for constraining the local feature representation, L parsing is the classification loss for constraining the pixel prediction vector; λ is the balance weight;

[0024] It should be noted that the mean square error loss is realized by the following formula:

[0025]

[0026] Where B is the input batch size, ||·|| represents the L2 norm, f global is the global feature of X, f′ vvvvvl refers to the local enhanced feature after the image global feature and local feature are weighted by the attention module.

[0027] To solve the above problems, the application further provides a refitting pedestrian re-identification device, comprising:

[0028] A human semantic segmentation unit is configured to obtain a to-be-processed pedestrian image, and train a feature extraction network A to obtain a pixel prediction vector corresponding to each part of the pedestrian image and a semantic feature corresponding to each part.

[0029] A local feature enhancement acquisition unit is configured to select and obtain human semantic information excluding the clothing area, and obtain a human semantic enhanced feature representation excluding the clothing through an attention module according to the human semantic information.

[0030] A result identification unit is configured to perform similarity matching on the to-be-searched image and images in a search library, sort the images in the to-be-searched image library in descending order of similarity, and take the pedestrian image with the highest similarity as the identification result of the to-be-processed pedestrian image.

[0031] To solve the above problems, the application further provides a refitting pedestrian re-identification device, comprising: at least one processor; and a memory in communication connection with the at least one processor; wherein

[0032] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the above-mentioned refitting pedestrian re-identification method.

[0033] The application also protects a computer-readable storage medium storing a computer program, which is executed by a processor to implement the steps of the above-mentioned refitting pedestrian re-identification method.

[0034] This invention relates to a method, system, electronic device, and storage medium for pedestrian re-identification in disguise, based on fine-grained semantic selection and masking technology. The method involves acquiring a pedestrian image to be processed, preprocessing it, training a feature extraction network A to obtain pixel labels and local feature representations corresponding to each semantic region of the pedestrian image, training a feature extraction network B to obtain global feature representations of the pedestrian image, selecting semantic features (excluding clothing regions) from the pixel labels for concatenation, and using an attention module to obtain locally enhanced feature representations, acquiring a pedestrian image to be retrieved based on the locally enhanced feature representations and global feature representations, matching the pedestrian image to be retrieved with each pedestrian image in the retrieval database and calculating the similarity, sorting them in descending order of similarity, and using the pedestrian image with the highest similarity as the recognition result of the pedestrian image to be processed. The beneficial effects are as follows: the entire network architecture is a two-stream structure, including feature extraction network A (Human Semantic Segmentation Network HRNet) and feature extraction network B (ViT-based person re-identification network). It can utilize the person pixel labels from human semantic segmentation to obtain enhanced feature representations of local pedestrians, resulting in more robust and stable pedestrian feature descriptions. Furthermore, an attention module is integrated into the network, allowing it to learn regions more relevant to identity features. The person re-identification method for disguised individuals in this invention achieves good results on relevant person re-identification datasets for disguised individuals. Attached Figure Description

[0035] Figure 1 This is a system flowchart of the present invention;

[0036] Figure 2 This is a structural framework diagram of the present invention. Detailed Implementation

[0037] The present invention will now be further described with reference to the accompanying drawings;

[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the following embodiments are provided for further details. Figure 1 The system flowchart shown provides a more detailed explanation of the present invention. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0039] Example 1

[0040] like Figure 2As shown, it is a framework diagram of a reloading pedestrian re-identification method of the application, the overall framework contains two branches: pixel prediction vector and local feature extraction network A image global feature extraction network B; during training, first obtain the pedestrian image to be processed, and pretreat the image; specifically including; adjust the picture pixel size to 256*128, and randomly take random cropping, horizontal flip and random erasing on the picture, and the probability is 50%;

[0041] The processed image is input into two networks for training. In this case, the feature extraction network A is preferably Sun K, Xiao B, Liu D, et al. Deep High-Resolution Representation Learning for Human Pose Estimation [J]. 2019. The HRNet network proposed by HRNet contains multi-scale semantic information, which is more suitable for human semantic analysis. The feature extraction network B adopts a Transformer based on ViT-B / 16. The pixel label of each part of the pedestrian and the 5 local semantic features of the human body can be obtained through the feature extraction network A, wherein the pixel label is represented by 0-5 to represent six parts such as background, head, upper garment, lower garment, arm and leg. The 5 local semantic features are head feature, upper garment feature, lower garment feature, arm feature and leg feature. The image global feature is obtained through the feature extraction network B. Specifically including;

[0042] A batch of pedestrian images to be processed is input into the network, and the human semantic segmentation prediction map of the input image is obtained through the feature extraction network A, which has a shape of B*k*1 / 4h*1 / 4w, wherein B represents the batch size of the input image, h and w represent the height and width of the input image respectively, and k represents the number of pixel label categories predicted by the feature extraction network A. The prediction vector of each pixel category is obtained using a softmax function, which has a shape of k*1 / 4h*1 / 4w. The global feature f_global of the input image is obtained through the feature extraction network B.

[0043] The global feature f_global extracted by the feature extraction network B is multiplied with the prediction vectors of pixel categories 1, 4 and 5 pixel by pixel to obtain the local features f_1, f_4 and f_5 of the corresponding categories. In order to shield the semantic information of the clothing area, the prediction vectors of pixel categories 2 and 3, which are the pixel labels of the upper garment and the lower garment, are multiplied with a 0 vector to obtain the local features f_2 and f_3 of the upper garment and the lower garment, respectively. Then, after global pooling of these local features, they are sequentially spliced by channel to obtain a feature representation f_part excluding clothing.

[0044] The f_part is input into an attention module to learn a weighted feature vector, and the channel features of the feature map are reweighted to highlight the significant human semantic features and suppress irrelevant semantic features. Then, a global pooling operation is performed to obtain a locally enhanced feature representation excluding the clothing region. The attention module is composed of a global average pooling and two fully connected layers, and its formula is represented as F_w=F_C2(F_C1(F_GAP(f_part))), wherein f_part represents the feature map, F_GAP represents the global pooling, and F_C1 and F_C2 represent the weight matrices of the two fully connected layers. In the specific implementation process, the Sigmod activation function and the ReLU function are used to connect the two fully connected layers.

[0045] After receiving the global feature f_global, the channel features are reweighted by the weighted feature vector F_w to selectively emphasize the feature channels to which the local information belongs, while suppressing less useful features (such as clothing semantic information). The weighting process is as follows:

[0046]

[0047] wherein, represents the channel multiplication between the weight vector F_w emphasizing the local information and the global image feature f_global. Finally, a global average pooling operation is performed to obtain a feature representation that can describe the pedestrian and is irrelevant to the clothing semantic. In this way, the clothing semantic and other semantic information are fully separated and repositioned, which helps to optimize the final feature representation.

[0048] During the training of the entire model, the cross-entropy loss is used to calculate the loss between the pixel label output by the feature extraction network A and the pixel prediction map output by the feature extraction network A, denoted as L parsing ; the cross-entropy loss is used to calculate the loss between the human part feature and the real human label, denoted as L part ; the cross-entropy loss and the triplet loss are used to calculate the loss between the global feature of the image and the real human label, denoted as L global ; in this embodiment, the loss function of the entire network is;

[0049] L=L global +L mse +L parnt +0.1L parsing

[0050] In order to constrain the model to learn more pedestrian features irrelevant to the clothing semantic, the mean square error loss is used to constrain the learning, and the specific formula is as follows:

[0051]

[0052] where B is the input batch size, ||·|| denotes the L2 norm, f global is the global feature of the pedestrian image, f′ global is the feature of the image global feature and local feature after the attention module is weighted

[0053] The challenge of the dressed pedestrian re-identification lies in that the appearance change caused by the change of clothes of the pedestrian is large, so that the performance of the general pedestrian re-identification model is sharply reduced. This is because the general pedestrian re-identification mainly learns the appearance features of the pedestrian to distinguish different pedestrians. In the dressed pedestrian re-identification, the clothing appearance information is unreliable. Therefore, the HRNet human parsing network is selected to learn the different semantics of the human body, so that the semantic information of the clothing region can be selectively shielded, and the mean square error loss is used to constrain the network to learn the identity features irrelevant to the cloth. Through the attention network, the model can pay more attention to the local information irrelevant to the human body and the clothing. The fusion of these features into a system architecture can obtain more powerful feature representation. Specifically, the following steps are included:

[0054] 1) First, the pedestrian image to be processed is obtained, and the image is preprocessed. Specifically, the pixel size of the picture is adjusted to 256x128, and the picture is randomly cropped, horizontally flipped and randomly erased with a probability of 50%;

[0055] 2) The processed image is input into two networks for training. In this case, the feature extraction network A is preferably Sun K, Xiao B, Liu D, et al. Deep High-Resolution Representation Learning for Human Pose Estimation [J]. 2019. The HRNet network proposed in the paper contains multi-scale semantic information, which is more suitable for human semantic parsing. The feature extraction network B adopts the Transformer based on ViT-B / 16; wherein the pixel label of each part of the pedestrian and the 5 local semantic features of the human body can be obtained through the feature extraction network A, wherein the pixel label is represented by 0-5 to represent the background, head, upper body, lower body, arm and leg, etc. The 5 local semantic features are head feature, upper body feature, lower body feature, arm feature and leg feature. The image global feature is obtained through the feature extraction network B.

[0056] 3) input a batch of pedestrian images to be processed into the network, obtain the human semantic segmentation prediction map of the input image through the feature extraction network A, the shape is B*k*1 / 4h*1 / 4w, wherein B represents the batch size of the input image, h and w represent the height and width of the input image respectively, and k represents the number of pixel label categories predicted by the feature extraction network A; the prediction vector of each pixel category is obtained by using the softmax function, and the shape is k*1 / 4h*1 / 4w; the global feature f_global of the input image is obtained through the feature extraction network B;

[0057] 4) multiply the global feature f_global extracted by the feature extraction network B with the prediction vectors of the pixel categories 1, 4 and 5 pixel by pixel to obtain the local features f_1, f_4 and f_5 of the corresponding categories, in order to shield the semantic information of the clothing area, select the prediction vectors of the pixel categories 2 and 3 (upper and lower clothing labels) to multiply with a 0 vector to obtain the local features f_2 of the upper clothing and the local features f_3 of the lower clothing, then sequentially splice them in the order of channels after global pooling to obtain a feature representation f_part excluding clothing;

[0058] Input f_part into the attention module to learn a weighted feature vector, and reweight the channel features of the feature map to highlight the significant human semantic features and suppress irrelevant semantic features; then obtain the local enhanced feature representation excluding the clothing area through the global pooling operation; wherein the attention module is composed of a global average pooling and two fully connected layers, and the formula is represented as F_w=F_C2(F_C1(F_GAP(f_part))), wherein f_part represents the feature map; F_GAP represents global pooling; F_C1 and F_C2 represent the weight matrices of the two fully connected layers respectively. In the specific implementation process, the Sigmod activation function and the ReLU function are used to connect between the two fully connected layers.

[0059] After receiving the global feature f_global, the channel features are reweighted by the weighted feature vector F_w to selectively emphasize the feature channels to which the local information belongs, while suppressing less useful features (such as clothing semantic information). The weighting process is as follows:

[0060]

[0061] wherein, indicates the channel multiplication between the weight vector F_w emphasizing the local information and the global image feature f_global. Finally, the feature representation of the pedestrian which is irrelevant to the clothing semantics is obtained through the global average pooling operation. In this way, the clothing semantics and other semantic information are fully separated and repositioned, which helps to optimize the final feature representation.

[0062] During the training of the whole model, the loss between the pixel label output by the feature extraction network A and the pixel prediction map output by the feature extraction network A is calculated using the cross-entropy loss, denoted as L parsing ; the loss between the human part feature and the real pedestrian label is calculated using the cross-entropy loss, denoted as L part ; the loss between the image global feature and the real pedestrian label is calculated using the cross-entropy loss and the triplet loss, denoted as L global ; in this embodiment, the loss function of the whole network is;

[0063] L = L global + L mse + L part + 0.1L parsing

[0064] In order to constrain the model to learn more pedestrian features irrelevant to the semantic of clothes, the mean square error loss is used to constrain the learning, and the specific formula is as follows.

[0065]

[0066] Where B is the input batch size, ||·|| represents the L2 norm, f global is the global feature of the pedestrian image, f′ global is the feature obtained by weighting the image global feature and the local feature through the attention module

[0067] The cross-entropy loss is expressed as follows:

[0068]

[0069] L i represents a classification loss, y i represents the real label of the sample x i , P(x i ) represents the predicted label of the sample x i . B represents the number of samples.

[0070] In the test stage, the image to be searched is obtained, the trained model is loaded, the test image is input, and the global feature of the image is obtained after the trained model is used after image preprocessing; the cosine distance between the test feature and the features of each pedestrian image in the search library is calculated and sorted, and the sorting result is output as the re-identification result.

[0071] The model of the final clothes-changing pedestrian re-identification method based on fine-grained semantic selection and shielding is formed through the above steps; the process of the model is as follows: the relevant semantic pixel labels and the corresponding semantic pixel prediction vectors of the to-be-processed pedestrian image are obtained through steps 1, 2 and 3; the local features and the global features of the image except the clothing semantics can be obtained through step 4; with the help of the attention module, a local information enhanced feature representation except the clothing semantics is obtained, and finally the loss function is used to constrain the whole model to learn the cloth-independent human semantic features. In order to verify the effectiveness of the present application, experiments are carried out on the clothes-changing pedestrian re-identification dataset PRCC, and the final results show that the problem of pedestrian re-identification caused by clothes-changing can be alleviated to a certain extent.

[0072] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for relabeling pedestrian re-identification; characterized in that, The method specifically comprises the following steps: 1) obtaining an original image and performing data enhancement, random cropping, horizontal flipping and random erasing operations; 2) inputting the original image into the network to obtain pixel labels corresponding to the pedestrian image, and corresponding part features and global features of the image; 3) selecting part features of the human body excluding clothes through the pixel labels and sequentially splicing them by channel to input them into an attention module to obtain corresponding part enhanced feature representations; 4) using global features of the image to perform similarity matching in the test stage, and outputting the ranking results as the re-identification results; training and constraining the local enhanced feature representations, the global feature representations and the pixel label classification by using a loss function; Step 2) The network comprises two branches; feature extraction network A adopts an HRNet network structure; feature extraction network B adopts a TransReID model structure based on ViT-B / 16; wherein the pixel labels of each part of the pedestrian and the five local semantic features of the human body can be obtained through the feature extraction network A, wherein the pixel labels are represented by 0-5 to represent the background, head, upper garment, lower garment, arm and leg six parts; the five local semantic features are head feature, upper garment feature, lower garment feature, arm feature and leg feature; the global feature of the pedestrian is extracted through the feature extraction network B; Step 3) The selection of the semantic features excluding the clothing area through the pixel labels and the channel splicing are implemented according to the following steps; 3-1) Input a small batch of images B represents the size of the input batch; represents the input image, which has a shape of C * H * W, C represents the number of channels, H represents the height, and W represents the width; obtain a human semantic segmentation prediction map of the input image through the feature extraction network A, which has a shape of B * k * 1 / 4 h * 1 / 4 w, where B represents the batch size of the input image, h and w represent the height and width of the input image respectively, and k represents the number of classes of the pixel label predicted by the feature extraction network A; use the softmax function to obtain a prediction vector for each pixel class, which has a shape of k * 1 / 4 h * 1 / 4 w; 3-2) multiply the global feature f_global extracted by the feature extraction network B with the prediction vectors of the pixel categories 1, 4 and 5 pixel by pixel to obtain the local features f_1, f_4 and f_5 of the corresponding categories, in order to shield the semantic information of the clothing area, multiply the prediction vectors of the upper garment pixel label 2 and the lower garment pixel label 3 with a 0 vector to obtain the local features f_2 and f_3 of the upper garment and the lower garment, sequentially splice these local features by channel after global pooling to obtain a feature representation f_part excluding the clothing; 3-3) input the feature f_part obtained in step 3-2) into the attention module to learn a weighted feature vector and reweight the channel features of the feature map, and obtain the semantic enhanced feature representation excluding the clothing through the global pooling operation; wherein the attention module comprises a global average pooling and two fully connected layers, and its formula is represented as F_w=F_C2 (F_C1 (F_GAP (f_part))), wherein f_part represents the feature map; F_GAP represents global pooling; F_C1 and F_C2 represent the weight matrices of the two fully connected layers respectively.

2. The refitting pedestrian re-identification method according to claim 1, characterized in that, Step 1) The data enhancement operation on the input original image includes: adjusting the picture pixel size to 256×128, and randomly taking random cropping, horizontal flipping and random erasing on the picture, and the probability is 50%.

3. The refitting pedestrian re-identification method according to claim 1, characterized in that, Step 4) The test stage is performed according to the following steps: 4-1) Load the trained model, input the test image, and after image preprocessing, get the image global feature through the trained model; 4-2) Calculate the similarity of the test feature and the features of each pedestrian image in the retrieval library, and sort them in descending order, and output the result with the highest similarity as the re-identification result.

4. The method of refitting pedestrian re-identification according to claim 1, characterized in that, The loss function includes cross-entropy loss, mean square error loss and triple loss function, which is expressed as follows: , where the loss between the pixel label output by the feature extraction network A and the pixel prediction map output by the feature extraction network A is calculated using a cross-entropy loss, denoted as ; the loss between the human part feature and the real human label is calculated using a cross-entropy loss, denoted as ; is the mean square error loss for constraining the global feature representation and the locally enhanced feature representation; the loss between the image global feature and the real human label is calculated using a cross-entropy loss and a triplet loss, denoted as , is a balance weight.

5. The method of refitting pedestrian re-identification according to claim 4, characterized in that, The mean square error constraint is used to make the model learn the cloth-independent feature information; wherein the mean square error constraint is calculated as follows: = , where B is the input batch size, and ||•|| denotes the L2 norm, is a global feature of X, denotes the local enhanced feature of the image global feature and the local feature after the attention module weighting.

6. A refitting pedestrian re-identification device, characterized in that, including; The human semantic segmentation unit is used to obtain a to-be-processed pedestrian image; the network used is composed of two branches; the feature extraction network A adopts the HRNet network structure; the feature extraction network B adopts the TransReID model structure based on ViT-B / 16; wherein the pixel label of each part of the pedestrian and the 5 local semantic features of the human body can be obtained through the feature extraction network A, wherein the pixel label is represented by 0-5, which represents the background, head, upper body, lower body, arm and leg; the 5 local semantic features are head feature, upper body feature, lower body feature, arm feature and leg feature; the global feature of the pedestrian is extracted through the feature extraction network B; The human semantic segmentation unit trains the feature extraction network A to obtain the pixel prediction vector corresponding to each part of the pedestrian image and the semantic feature corresponding to each part; The local feature enhancement acquisition unit is used to select and obtain the human semantic information except the clothing area, and through the attention module, the human semantic enhanced feature representation except the clothing is obtained according to the human semantic information; the global feature representation of the to-be-processed pedestrian image is obtained through the feature extraction network B, and the to-be-retrieved image is obtained according to the feature after fusion with the global feature; The result recognition unit matches the to-be-retrieved image with the images in the retrieval library, sorts the images in the retrieval library in descending order of similarity, and takes the pedestrian image with the highest similarity as the recognition result of the to-be-processed pedestrian image.

7. A refitting pedestrian re-identification device, characterized in that, The device includes; At least one processor; and a memory connected in communication with the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps in the refitting pedestrian re-identification method of any one of claims 1-5.

8. A computer readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the steps in the refitting pedestrian re-identification method of any one of claims 1-5.

Citation Information

Patent Citations

  • Dressing pedestrian re-identification method based on semantic perception attention and visual shielding

    CN114758362A

  • Occluded pedestrian re-identification and retrieval method based on multi-feature collaboration and semantic perception

    CN114842512A