An Occlusion-Based Person Re-identification Method
By using single-scale feature extraction and improved triplet loss, combined with spatial memory module and data augmentation, the accuracy and efficiency issues of occluded pedestrian re-identification are solved, making it suitable for real-time video surveillance.
Patent Information
- Application Number
- CN202211429327.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-11-15
AI Technical Summary
Existing pedestrian re-identification methods struggle to achieve good results under occlusion conditions, and using additional models increases computational and memory requirements, making it difficult to meet the requirements of real-time video surveillance. Furthermore, multi-scale and multi-granular feature fusion suffers from mismatch issues and increased training time.
We employ single-scale feature extraction, combined with a spatial memory module and an improved triplet loss. Through data augmentation, embedding the feature extraction network with the spatial memory module, multi-head attention mechanism and key-pair memory network to reduce interfering features, and introducing a camera information penalty term, we improve robustness and recognition accuracy.
It reduces training and inference time, improves the accuracy and robustness of occluded pedestrian re-identification, and is suitable for real-time video surveillance systems.
Smart Images

Figure CN115690852B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of pattern recognition and computer vision, specifically relating to a method for re-identifying occluded pedestrians based on single-scale features. Background Technology
[0002] Pedestrian re-identification is a computer vision task aimed at retrieving the same pedestrian captured by different cameras. Due to its crucial role in public safety and its high theoretical and practical value, this technology is widely used in platforms such as activity analysis, security, video surveillance, and smart cities. Most current pedestrian re-identification methods are designed to solve the overall pedestrian re-identification task and have achieved high accuracy on full-body datasets such as Market-1501 and DukeMTMC-reID. However, in real-world scenarios, obtaining ideal full-body images of people is difficult, as pedestrians are easily occluded by other objects or pedestrians, resulting in the loss of some pedestrian information. Existing conventional pedestrian re-identification methods struggle to achieve good results on occluded pedestrian re-identification datasets.
[0003] Current methods for re-identifying occluded pedestrians mostly employ additional keypoint detection models, pose estimation models, or graph matching models to match partial pedestrian features. Then, the feature maps obtained from feature extraction networks are weighted to acquire more discriminative pedestrian features. This approach greatly alleviates the interference caused by occlusion information; however, using additional models undoubtedly increases computational and memory requirements, which cannot meet the demands of real-time video surveillance. Furthermore, when faced with multiple pedestrians in an image, the keypoint or pose estimation models struggle to focus on the target pedestrian, leading to identification errors.
[0004] Another approach is to address the occlusion problem using multi-scale, multi-granularity feature fusion. Multi-scale specifically involves extracting feature information from different levels of the feature extraction network and training them separately, or scaling features from different scales to the same scale and then adding or concatenating them for training. Multi-granularity involves dividing the feature map output by the feature extraction network into blocks and training each block separately. This training method can effectively utilize the detailed features of pedestrians; however, if there are many misalignments in the pedestrian image, using segmented pedestrian features for feature matching will result in mismatches, leading to decreased accuracy. Furthermore, training multiple features simultaneously significantly increases training time. Summary of the Invention
[0005] This invention provides a pedestrian re-identification method based on single-scale features, with the aim of providing a simple, easy-to-train, and efficient pedestrian re-identification method.
[0006] The technical solution adopted by this invention includes the following steps:
[0007] Step A: First, preprocess the training pedestrian images and perform data augmentation. Adjust the image pixel size to 256×128, and randomly crop, flip horizontally, and erase the images with a probability of 50%. Then, input the data-augmented pedestrian images into the feature extraction network to obtain intermediate feature maps.
[0008] Step B: Embed the spatial memory module into the feature extraction network. The intermediate feature maps pass through the spatial memory module to obtain more discriminative pedestrian feature maps.
[0009] Step C: Perform a global adaptive pooling (GAP) operation on the pedestrian feature map to obtain a single-scale pedestrian feature vector. Then, use a batch normalization module to normalize the single-scale pedestrian feature vector. Calculate the improved triplet loss for the pedestrian feature vector before batch normalization, and calculate the classification loss for the normalized pedestrian feature vector. Calculate the gradients of the network parameters based on the two loss functions, and then update the parameters of the feature extraction network and the spatial memory module to complete the training.
[0010] Step D: Input the query pedestrian image and the pedestrian images in the test image library into the trained network to obtain the features of all test pedestrian images. Calculate the Euclidean distance between the query pedestrian features and the pedestrian features in the image library. Sort them in ascending order according to the distance to obtain the nearest neighbor list of the query pedestrian, and complete the pedestrian re-identification.
[0011] Step A of this invention specifically includes the following steps:
[0012] Step A1: Perform data augmentation on the training data of the Occluded-DukeMTMC public occlusion pedestrian re-identification dataset. Specifically, (1) scale the image pixels to 256 and 128 pixels, and then use random flipping and random cropping with a probability of 0.5 on the scaled image; (2) normalize the image with a mean of [0.5, 0.5, 0.5] and a standard deviation of [0.5, 0.5, 0.5] to reduce the influence of affine transformation, thereby improving the convergence speed and model accuracy; (3) use random erasure with a probability of 0.5 to generate a rectangular box on the image to form an occlusion, thereby alleviating the overfitting of the network to the image information.
[0013] Step A2: Input pedestrian images from the training set into the feature extraction network to obtain an intermediate feature map of size H*W*d, where H, W, and d represent its height, width, and number of channels, respectively. The feature extraction network is ConvNeXt, composed of several depthwise separable convolutions with 7*7 kernels and 1*1 kernels, GeLU activation function, LayerNorm regularization, etc. See [link to specific structure] for details. Figure 3 As shown;
[0014] Step B of this invention specifically includes the following steps:
[0015] Step B1: As Figure 2 As shown, the spatial memory module first reshapes the intermediate feature map of input size H*W*d into two-dimensional feature information F of size HW*d. in F in = [f1; f2; ...; f Hw ], where f i ∈R 1*d F in As a probe (query) in a multi-head attention mechanism, f represents two-dimensional feature information. i The feature representing the pixel at position i;
[0016] Step B2: Generate two sets of learnable parameters based on a Gaussian distribution, which will serve as the key and value for the multi-head attention mechanism, respectively, where key∈R. M*d and value∈R M*d M is a manually set hyperparameter;
[0017] Step B3: Calculate the query and key using the dot product operation. The formula is as follows:
[0018]
[0019]
[0020] Where, k n It is the value of the nth key, where T represents the matrix transpose operation. It is a scaling factor, p i,n Here, it serves as the matching probability between background features and occluded objects;
[0021] Step B4: The memory network uses the corresponding probability p i,n Output v n The weighted average is calculated using the following formula:
[0022]
[0023] Where v nIt is the value of the nth value.
[0024] Step B5: Obtaining o i As interfering features, o should be eliminated first. i Reshape to the input feature map F in Same size, F atten Then, the pedestrian feature map F is obtained. out The formula is as follows:
[0025] F out =F in -α*F atten
[0026] Where α is a learnable scalar used to dynamically adjust the weights of the interfering features, due to the output pedestrian feature map F out Intermediate feature map F of the input in Since they have the same shape, the spatial memory module proposed in this invention can be embedded in any layer of the feature extraction network. In this invention, it is only embedded in the last layer of the feature extraction network.
[0027] Step C of this invention specifically includes the following steps:
[0028] Step C1: For the output pedestrian feature map F out Global adaptive pooling (GAP) is used to obtain a feature vector f with global information. t ;
[0029] Step C2: For the feature vector f t The improved triplet loss is calculated using the original triplet formula as follows:
[0030]
[0031] Where L trp Represents the loss of the triplet. Represents anchor sample features f t,a and positive sample features f t,p The Euclidean distance between them Represents anchor sample features f t,a and negative sample features f t,n The Euclidean distance between them, margin is the margin of the triplet loss, [Z] + =max(0,Z);
[0032] The improved triplet loss formula is as follows:
[0033]
[0034] Where λ is a weight hyperparameter, c is a constant, and ft,cam-n Is and f t,a Features of different samples from the same camera f t,cam-n and f t,a The Euclidean distance;
[0035] Step C3: For feature f t Adding a batch normalization (BN) layer operation yields the feature f. i , for f i The classification vector c is obtained by performing Softmax. y For the classification vector c y Calculate the classification loss L ID The formula is as follows:
[0036] L ID =CE(c y,i ,y i )
[0037] Where CE is the cross-entropy loss, c y,i Let represent the classifier's prediction result for pedestrian i, and y represent the prediction result for pedestrian i. i L is the class label corresponding to pedestrian i. ID For classification loss;
[0038] The formula for joint loss is as follows:
[0039] L = L cam-T +L ID
[0040] Step C4: Based on the joint loss, the backpropagation operator within the PyTorch deep learning framework is used to automatically calculate the gradients of each network parameter. Then, based on these gradients, stochastic gradient descent is used to update the parameters of the feature extraction network and the spatial memory module. Training is complete when the joint loss reaches convergence. After training, pedestrian detection is performed on test images, and the detection results are shown in the image. Figure 4 The last line.
[0041] Step D of the present invention specifically includes the following steps:
[0042] Step D1: For the already trained feature extraction network and spatial memory module, keep their parameters unchanged. Scale the image pixels of the test data from the Occluded-DukeMTMC pedestrian re-identification dataset with exposed occlusion. The scaled length and width are 256 and 128 respectively. Input the test data into the feature extraction network and spatial memory module to obtain the pedestrian feature map. Then, perform global average pooling and batch normalization on the pedestrian feature map to obtain the batch normalized feature f of the corresponding query pedestrian image. i,q And the batch normalized features f in the pedestrian image databasei,g ;
[0043] Step D2: Calculate the batch normalized features f of the query pedestrian images i,q Batch normalized features f from pedestrian image database i,g The Euclidean distance dist is given by the formula:
[0044] dist=f i,q *f i,g T
[0045] Where T represents the matrix transpose operation;
[0046] Step D3: Using the obtained Euclidean distance dist, sort the samples in ascending order according to the magnitude of the Euclidean distance, take the first few pedestrian samples as the nearest neighbor list of the queried pedestrian, and obtain the final result to complete the pedestrian re-identification.
[0047] First, considering the real-time requirements of this model in practical applications, this method does not utilize additional keypoint detection models, pose estimation models, or graph matching models. Second, to reduce training difficulty and avoid the impact of pedestrian misalignment, this invention uses single-scale features for training and prediction. To improve the robustness of single-scale pedestrian features, this invention designs a spatial memory module. This module mainly includes a multi-head self-attention mechanism and a key-value memory network. First, the key and value in the multi-head self-attention mechanism are replaced by the key-value memory network. Then, the input feature map and the key-value memory network are modeled to obtain noise information in the pedestrian feature map. Finally, the noise information is subtracted from the input features to obtain more discriminative pedestrian features, thereby improving the robustness and recognition performance of the model. Furthermore, this invention improves upon the triplet loss method. Addressing its shortcomings in occluded datasets, it incorporates camera information into the triplet loss. By adding a penalty term to negative samples from the same camera, it maintains the relative distance between positive and negative samples while simultaneously distancing negative samples from the same camera, thus mitigating occlusion interference from the same camera. Based on these two studies, single-scale features can also achieve excellent results in occluded pedestrian re-identification.
[0048] The advantages of this invention are:
[0049] This invention does not utilize additional models, such as pose estimation, feature pyramids, and graph matching models. It only uses single-scale pedestrian features to solve the occlusion problem of pedestrian re-identification, which not only reduces training time and model complexity but also reduces inference time, and can be better applied to re-identification systems.
[0050] The spatial memory module proposed in this invention first utilizes the ability of key-pair memory networks to store feature information, serving as an extractor of interference features. Then, it uses a multi-head attention mechanism to model the input feature map and the key-pair memory network, enabling the key-pair memory network to better extract information from the input feature map. Furthermore, the input and output shapes of the spatial memory network are exactly the same, allowing it to be inserted into any layer of a convolutional neural network as an intermediate module, or embedded into other pedestrian re-identification models.
[0051] The improved triplet loss proposed in this invention adds a penalty for negative pedestrian samples from the same camera to the original triplet loss. This not only ensures the relative distance between positive and negative samples, but also reduces the distance between negative samples from the same camera, thus mitigating occlusion interference from the same camera. Attached Figure Description
[0052] Figure 1 This is a structural block diagram of the identification method according to an embodiment of the present invention;
[0053] Figure 2 This is a structural diagram of the spatial memory module according to an embodiment of the present invention;
[0054] Figure 3 This is a block structure diagram of the feature extraction network in an embodiment of the present invention;
[0055] Figure 4 This is an image showing the result of pedestrian re-identification under occlusion according to an embodiment of the present invention;
[0056] Figure 5 This is a heatmap of pedestrian re-identification under occlusion according to an embodiment of the present invention. Detailed Implementation
[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0058] Figure 1 This is a structural block diagram of the occluded pedestrian re-identification method based on single-scale features implemented in this invention, which includes the following steps:
[0059] Step A: First, preprocess the training pedestrian images and perform data augmentation. Adjust the image pixel size to 256×128, and randomly crop, flip horizontally, and erase the images with a probability of 50%. Then, input the data-augmented pedestrian images into the feature extraction network to obtain intermediate feature maps.
[0060] Step A1: Perform data augmentation on the training data of the Occluded-DukeMTMC public occlusion pedestrian re-identification dataset. Specifically, (1) scale the image pixels to 256 and 128 pixels, and then use random flipping and random cropping with a probability of 0.5 on the scaled image; (2) normalize the image with a mean of [0.5, 0.5, 0.5] and a standard deviation of [0.5, 0.5, 0.5] to reduce the influence of affine transformation, thereby improving the convergence speed and model accuracy; (3) use random erasure with a probability of 0.5 to generate a rectangular box on the image to form an occlusion, thereby alleviating the overfitting of the network to the image information.
[0061] Step A2: Input pedestrian images from the training set into the feature extraction network to obtain an intermediate feature map of size H*W*d, where H, W, and d represent its height, width, and number of channels, respectively. The feature extraction network is ConvNeXt, composed of several depthwise separable convolutions with 7*7 kernels and 1*1 kernels, GeLU activation function, LayerNorm regularization, etc. See [link to specific structure] for details. Figure 3 As shown;
[0062] Step B: Embed the spatial memory module into the feature extraction network. The intermediate feature maps pass through the spatial memory module to obtain more discriminative pedestrian feature maps.
[0063] Step B1: As Figure 2 As shown, the spatial memory module first reshapes the intermediate feature map of input size H*W*d into two-dimensional feature information F of size HW*d. in F in = [f1; f2; ...; f HW ], where f i ∈R 1*d F in As a probe (query) in a multi-head attention mechanism, f represents two-dimensional feature information. i The feature representing the pixel at position i;
[0064] Step B2: Generate two sets of learnable parameters based on a Gaussian distribution, which will serve as the key and value for the multi-head attention mechanism, respectively, where key ∈ R. M*d and value∈R M*d M is a manually set hyperparameter.
[0065] Step B3: Calculate the query and key using the dot product operation. The formula is as follows:
[0066]
[0067]
[0068] Where, k n It is the value of the nth key, where T represents the matrix transpose operation. It is a scaling factor, p i,n Here, it serves as the matching probability between background features and occluded objects;
[0069] Step B4: The memory network uses the corresponding probability p i,n Output v n The weighted average is calculated using the following formula:
[0070]
[0071] Where v n It is the value of the nth value;
[0072] Step B5: Obtaining o i As interfering features, o should be eliminated first. i Reshape to the input feature map F in Same size, F atten Then, the pedestrian feature map F is obtained. out The formula is as follows:
[0073] F out =F in -α*F atten
[0074] Where α is a learnable scalar used to dynamically adjust the weights of the interfering features, due to the output pedestrian feature map F out Intermediate feature map F of the input in Since they have the same shape, the spatial memory module proposed in this invention can be embedded in any layer of the feature extraction network. In this invention, it is only embedded in the last layer of the feature extraction network.
[0075] Step C: Perform Global Adaptive Pooling (GAP) on the pedestrian feature map to obtain a single-scale pedestrian feature vector. Then, use a batch normalization module to normalize the single-scale pedestrian feature vector. Calculate the improved triplet loss for the pedestrian feature vector before batch normalization, and calculate the classification loss for the normalized pedestrian feature vector. Calculate the gradients of the network parameters based on the two loss functions, and then update the parameters of the feature extraction network and the spatial memory module to complete the training.
[0076] Step C1: For the output pedestrian feature map F out Global adaptive pooling (GAP) is used to obtain a feature vector f with global information. t ;
[0077] Step C2: For the feature vector f t The improved triplet loss is calculated using the original triplet formula as follows:
[0078]
[0079] Where L trp Represents the loss of the triplet. Represents anchor sample features f t,a and positive sample features f t,p The Euclidean distance between them Represents anchor sample features f t,a and negative sample features f t,n The Euclidean distance between them, margin is the margin of the triplet loss, [Z] + =max(0,Z);
[0080] The improved triplet loss formula is as follows:
[0081]
[0082] Where λ is a weight hyperparameter, c is a constant, and f t,cam-n Is and f t,a Features of different samples from the same camera f t,cam-n and f t,a The Euclidean distance;
[0083] Step C3: For feature f t Adding a batch normalization (BN) layer operation yields the feature f. i , for f i The classification vector c is obtained by performing Softmax. y For the classification vector c y Calculate the classification loss L ID The formula is as follows:
[0084] L ID =CE(c y,i ,y i )
[0085] Where CE is the cross-entropy loss, c y,i Let represent the classifier's prediction result for pedestrian i, and y represent the prediction result for pedestrian i. i L is the class label corresponding to pedestrian i. ID For classification loss;
[0086] The formula for joint loss is as follows:
[0087] L = L cam-T +LID
[0088] Step C4: Based on the joint loss, the backpropagation operator within the PyTorch deep learning framework is used to automatically calculate the gradients of each network parameter. Then, based on these gradients, stochastic gradient descent is used to update the parameters of the feature extraction network and the spatial memory module. Training is complete when the joint loss reaches convergence. After training, pedestrian detection is performed on test images, and the detection results are shown in the image. Figure 4 The last line;
[0089] Step D: Input the query pedestrian image and the pedestrian images in the test image library into the trained network to obtain the features of all test pedestrian images. Calculate the Euclidean distance between the query pedestrian features and the pedestrian features in the image library. Sort them in ascending order according to the distance to obtain the nearest neighbor list of the query pedestrian, and complete the pedestrian re-identification.
[0090] Step D1: For the already trained feature extraction network and spatial memory module, keep their parameters unchanged. Scale the image pixels of the test data from the Occluded-DukeMTMC pedestrian re-identification dataset with exposed occlusion. The scaled length and width are 256 and 128 respectively. Input the test data into the feature extraction network and spatial memory module to obtain the pedestrian feature map. Then, perform global average pooling and batch normalization on the pedestrian feature map to obtain the batch normalized feature f of the corresponding query pedestrian image. i,q And the batch normalized features f in the pedestrian image database i,g ;
[0091] Step D2: Calculate the batch normalized features f of the query pedestrian images i,q Batch normalized features f from pedestrian image database i,g The Euclidean distance dist is given by the formula:
[0092] dist=f i,q *f i,g T
[0093] Where T represents the matrix transpose operation;
[0094] Step D3: Using the obtained Euclidean distance dist, sort the samples in ascending order according to the magnitude of the Euclidean distance, take the first few pedestrian samples as the nearest neighbor list of the queried pedestrian, obtain the final result, and complete the pedestrian re-identification.
[0095] The following experimental examples will further illustrate the effects of the present invention.
[0096] Figure 4The image provided is an example of the retrieval results for occluded pedestrian re-identification. The test data used is the test data from the Occluded-DukeMTMC dataset of occluded pedestrians. Figure 4 The dataset is divided into three columns. The leftmost image in each column is the query image, and the remaining images in each column are 10 pedestrian images from the test image library that the model considers most similar to the query pedestrian image. Each pedestrian image is labeled with information: `query_cam` indicates which camera captured the query image, and `cam` indicates which camera captured the pedestrian image from the image library. A checkmark or cross mark follows the camera information, indicating whether the retrieval was correct, i.e., whether the retrieved pedestrian is the same pedestrian as the query pedestrian. The first row of the feature extraction network and spatial memory module only uses classification loss, i.e., L0. ID The training retrieval results show that only three images were correctly identified, indicating that classification loss alone cannot effectively solve the task of re-identifying occluded pedestrians. Furthermore, it can be observed that the incorrectly retrieved pedestrian images all originated from the same camera used for the query images, as these images share the same occlusions. The second row shows the feature extraction network and spatial memory module using classification loss L. ID and triplet loss L trp The joint training significantly improved the recognition accuracy, but three pedestrian images were still incorrectly retrieved. Similarly, these three incorrectly retrieved pedestrian images came from the same camera as the query pedestrian image. The third row shows the feature extraction network and spatial memory module using classification loss L. ID And improved triplet loss L cam-T The retrieval results from the joint training show that all retrieval results are correct, indicating that the triplet loss improved by introducing camera information has successfully improved the accuracy of recognition.
[0097] Figure 5 Visualizing heatmaps to prevent pedestrian re-identification from being obscured. Figure 5 There are eight pairs of pedestrian images. For each pair, the left side is the original pedestrian image, and the right side is a visualization of the heatmap of the original image. The heatmap visualization uses color intensity to reflect which part of the image the model focuses on more. According to the visualization, the feature information of the pedestrian portion is darker, indicating that the model proposed in this invention can accurately focus on the pedestrian portion information in the occluded image even when the pedestrian is occluded by different obstacles. This further confirms that the model can effectively solve the problem of occluded pedestrian re-identification using only single-scale pedestrian features.
[0098] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for re-identifying occluded pedestrians based on single-scale feature representation, characterized in that: Includes the following steps: Step A: First, preprocess the training pedestrian images and perform data augmentation. Adjust the image pixel size to 256×128, and randomly crop, flip horizontally, and erase the images with a probability of 50%. Then, input the data-augmented pedestrian images into the feature extraction network to obtain intermediate feature maps. Step B: Embed the spatial memory module into the feature extraction network. The intermediate feature maps pass through the spatial memory module to obtain more discriminative pedestrian feature maps; specifically, this includes the following steps: Step B1: The spatial memory module first reshapes the intermediate feature map of input size H*W*d into two-dimensional feature information of size HW*d. , ,in , As a multi-head attention mechanism, the probe query represents two-dimensional feature information. Representing the Features of each pixel location; Step B2: Generate two sets of learnable parameters based on a Gaussian distribution, which will serve as the key and value for the multi-head attention mechanism, respectively. and , Hyperparameters set manually; Step B3: Calculate the query and key using the dot product operation. The formula is as follows: ; ; in, It is the first indivual The value, This represents the transpose operation of a matrix. It is a scaling factor. Here, it serves as the matching probability between background features and occluded objects; Step B4: The memory network uses the corresponding probabilities Output The weighted average is calculated using the following formula: ; in It is the first indivual The value; Step B5: Obtained As interfering features, they should be eliminated, therefore, firstly... Reshape to the input feature map Same size, Then, pedestrian feature maps are obtained. The formula is as follows: ; in It is a learnable scalar used to dynamically adjust the weights of interfering features, due to the output pedestrian feature map. Intermediate feature maps of the input Because they have the same shape, they were only embedded in the last layer of the feature extraction network; Step C: Perform global adaptive pooling (GAP) on the pedestrian feature map to obtain a single-scale pedestrian feature vector, and use the batch normalization module to normalize the single-scale pedestrian feature vector. Calculate the improved triplet loss for the pedestrian feature vector before batch normalization, and calculate the classification loss for the normalized pedestrian feature vector. Calculate the gradient of the network parameters based on the two loss functions, and then update the parameters of the feature extraction network and the spatial memory module to complete the training. Step D: Input the query pedestrian image and the pedestrian images in the test image library into the trained network to obtain the features of all test pedestrian images. Calculate the Euclidean distance between the query pedestrian features and the pedestrian features in the image library. Sort them in ascending order according to the distance to obtain the nearest neighbor list of the query pedestrian, and complete the pedestrian re-identification.
2. The occluded pedestrian re-identification method based on single-scale feature representation according to claim 1, characterized in that, Step A specifically includes the following steps: Step A1: Perform data augmentation on the training data of the Occluded-DukeMTMC public occlusion pedestrian re-identification dataset. Specifically, (1) scale the image pixels to 256 and 128 pixels, and then use random flipping and random cropping with a probability of 0.5 on the scaled image; (2) normalize the image with a mean of [0.5, 0.5, 0.5] and a standard deviation of [0.5, 0.5, 0.5] to reduce the influence of affine transformation, thereby improving the convergence speed and model accuracy; (3) use random erasure with a probability of 0.5 to generate a rectangular box on the image to form an occlusion, thereby alleviating the overfitting of the network to the image information. Step A2: Input pedestrian images from the training set into the feature extraction network to obtain an intermediate feature map of size H*W*d, where H, W, and d represent its height, width, and number of channels, respectively. The feature extraction network is ConvNeXt, which consists of several depthwise separable convolutions with 7*7 kernels and 1*1 kernels, GeLU activation function, and LayerNorm regularization.
3. The occluded person re-identification method based on single-scale feature representation according to claim 1, characterized in that, Step C specifically includes the following steps: Step C1: For the output pedestrian feature map Global adaptive pooling (GAP) is used to obtain feature vectors with global information. ; Step C2: For the feature vector The improved triplet loss is calculated using the original triplet formula as follows: ; in Represents the loss of the triplet. Indicate anchor sample features and positive sample features The Euclidean distance between them Indicate anchor sample features and negative sample features The Euclidean distance between them The margin of the triplet loss. ; The improved triplet loss formula is as follows: ; in It is a weight hyperparameter. It is a constant. Is and Features of different samples from the same camera express and The Euclidean distance; Step C3: For features The feature is obtained by adding a batch normalization (BN) layer. ,right conduct Obtain the classification vector For classification vectors Calculate classification loss The formula is as follows: ; in, For cross-entropy loss, pedestrian The prediction results of the classifier, and For pedestrians Corresponding class tags; Joint losses The formula is shown below: ; Step C4: Based on the joint loss, use the backpropagation operator in the PyTorch deep learning framework to automatically calculate the gradient of each network parameter. Then, based on the gradient, use stochastic gradient descent to update the parameters of the feature extraction network and spatial memory module. When the joint loss reaches the convergence condition, the training is complete. After training, detect pedestrian images on the test.
4. The occluded person re-identification method based on single-scale feature representation according to claim 1, characterized in that, Step D specifically includes the following steps: Step D1: For the already trained feature extraction network and spatial memory module, keep their parameters unchanged. Scale the image pixels of the test data from the Occluded-DukeMTMC pedestrian re-identification dataset with exposed occlusion. The scaled length and width are 256 and 128 respectively. Input the test data into the feature extraction network and spatial memory module to obtain the pedestrian feature map. Then, perform global average pooling and batch normalization on the pedestrian feature map to obtain the batch normalized features of the corresponding query pedestrian image. and batch normalized features in pedestrian image database ; Step D2: Calculate the batch normalized features of the query pedestrian images Batch normalized features from pedestrian image database Euclidean distance The formula is: ; in Represents the transpose operation of a matrix; Step D3: Use the obtained Euclidean distance The pedestrian samples are sorted in ascending order according to their Euclidean distance, and the top few pedestrian samples are taken as the nearest neighbor list of the queried pedestrian to obtain the final result, thus completing the pedestrian re-identification.
Citation Information
Patent Citations
Pedestrian re-identification method fusing random batch masks and multi-scale representation learning
CN111259850A
Person re-identification method combining reverse attention and multi-scale deep supervision
US20210232813A1