A domain-generalized person re-identification method based on invariant feature extraction
By using the ResNet50 network and the invariant feature extraction module of attention perception in the pedestrian re-identification model, the domain offset problem is solved, effective pedestrian re-identification in different fields is achieved, and the generalization ability and recognition accuracy of the model are improved.
Patent Information
- Application Number
- CN202210991899.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-08-17
AI Technical Summary
The prior art has a domain offset problem in pedestrian re-identification, which leads to a degradation in performance when applied in different fields, and the acquisition of target domain data is expensive or unavailable, which limits the application of the model in practice.
The recognition model based on ResNet50 network is adopted, combined with the invariant feature extraction module of attention perception, including instance normalization, grouping whitening, spatial attention and channel attention, and extract the domain invariant features. The model is trained through multiple data sets to reduce model parameters and training time and avoid overfitting.
Effectively extracting the unchanged features of the domain improves the generalization ability of the model, reduces training time, avoids discriminative information loss and overfitting, and realizes effective re-identification in different fields.
Smart Images

Figure CN115410223B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical fields of computer vision, image processing, etc., and specifically provides a domain generalization pedestrian re-identification method based on invariant feature extraction. Background Art
[0002] Person re-identification (PDR) is the problem of retrieving pedestrians between disjoint camera views in an open-set setting. It is considered a sub-problem of image retrieval and is capable of extracting valuable information from massive amounts of surveillance video data. With the urgent need for smart city, security, and intelligent surveillance systems, and the increasing number of surveillance cameras in various scenarios, PDR is gaining increasing attention.
[0003] Early research on person re-identification focused on two aspects: how to design better pedestrian features and how to measure the similarity of features. The former is represented by traditional feature extraction methods: Histogram of Oriented Gradient (HOG) features and Local Maximum Occurrence (LOMO) features; the latter is represented by the keep simple and straightforward metric (KISSME) and cross-view feature extraction based on deep learning. Figure 2 Cross-view Quadratic Discriminant Analysis (XQDA), etc. Since the traditional handheld feature + similarity measurement method cannot cope with complex real-world environments, the development of deep learning algorithms has provided new ideas for pedestrian re-identification, leading to its widespread development.
[0004] Person re-identification (PRI) initially studied supervised methods. Supervised PRI involves training on a single labeled dataset and testing on the same dataset. While these methods have achieved significant accuracy on some public datasets, they suffer from the high labor and time costs of labeling datasets. Furthermore, the performance degradation of models trained on one dataset when directly applied to another domain—the domain shift problem—has limited their practical application. To address this issue, domain-adaptive PRI technology has emerged. By training a PRI model on one domain, it can be transferred to a new domain using only minimal target domain data, bringing it one step closer to practical application. However, due to privacy concerns and application scenarios, obtaining target domain data can sometimes be prohibitively expensive or even impossible, and its inherent limitation in not exhausting all application scenarios has limited its practical application.
[0005] Domain-generalized person re-identification (PRED) trains a model in the source domain and applies it directly to target domain data without fine-tuning, making it highly suitable for practical applications. This approach primarily involves meta-learning, which splits the source domain into a meta-training domain and a meta-testing domain to simulate the visible source domain and the unseen target domain; ensemble learning, which trains multiple models and generalizes them to a wide range of unseen domains; and extracting domain-invariant feature representations through invariance methods. This allows the model to learn the most essential characteristics of a person, enabling it to draw inferences from one instance to another, similar to a human, resulting in superior performance in unseen domains. Summary of the Invention
[0006] In view of the shortcomings of the existing technology, the technical problem to be solved by the present invention is to propose a domain-generalized pedestrian re-identification method based on invariant feature extraction.
[0007] The technical solution adopted by the present invention to solve the technical problem is:
[0008] A domain-generalized person re-identification method based on invariant feature extraction includes the following:
[0009] Constructing a recognition model, wherein the recognition model uses a ResNet50 network as a backbone network and also includes an attention-aware invariance feature extraction module. The ResNet50 network has N residual units connected in series, and the outputs of the first N-1 residual units are each connected to an attention-aware invariance feature extraction module. The output of the last residual unit is not connected to the attention-aware invariance feature extraction module, and the output of the last residual unit is connected to an average pooling layer, a batch normalization layer, and a fully connected layer.
[0010] The attention-aware invariant feature extraction module is used to extract domain-invariant features, including: an instance normalization layer, a group whitening layer, spatial attention, and channel attention. The output features of the residual unit are subjected to an instance normalization operation IN to obtain an instance normalized feature X(IN). The instance normalized feature X(IN) is subjected to a spatial attention operation SA to obtain a corresponding spatial attention weight. The spatial attention weight and the instance normalized feature are multiplied to obtain a weighted spatial attention feature X(IN)_SA. The instance normalized feature X(IN) and the weighted spatial attention feature X(IN)_SA are then multiplied. The spatial attention feature X(IN)_SA is added to obtain the stage feature; the stage feature is subjected to the group whitening operation GW by the group whitening layer to obtain the group whitened feature X(GW), the whitened feature X(GW) is subjected to the channel attention operation to obtain the corresponding channel attention weight, the group whitened feature X(GW) and the channel attention weight are multiplied to obtain the weighted channel attention feature X(GW)_CA, and then the group whitened feature X(GW) and the weighted channel attention feature X(GW)_CA are added to obtain the final feature, which is input to the next stage;
[0011] Multiple datasets are used as source domain datasets to train the recognition model. In each iteration, a batch is selected for each dataset for one iteration. The batch image inputs are input into the recognition model for training to complete domain-generalized pedestrian re-identification based on invariant feature extraction.
[0012] Furthermore, a domain-generalized person re-identification method based on invariant feature extraction is developed with the ResNet50 network as the backbone network. The ResNet50 network includes multiple residual units composed of a combination of convolutional + pooling layers and multiple residual blocks. The multiple residual units are sequentially denoted as stage1, stage2, stage3, and stage4. The specific steps are:
[0013] Step 1: Use multiple datasets as source domain datasets to train the recognition model. In each iteration, select a batch for each dataset and perform one iteration. Input the batch image inputs into the convolution + pooling layer of the ResNet50 network for processing. After processing, the feature representation x0 of the input image is obtained.
[0014] Step 2: Input the feature representation x0 into stage1 to obtain the output feature x1, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f'1;
[0015] Step 2.1: Use the instance normalization layer to process the feature x1 to obtain the instance normalized feature
[0016] Step 2.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features
[0017] Step 2.3: Normalize the instance features and spatial attention features Add up the features
[0018] Step 2.4, input feature f1 into the group whitening layer to obtain the group whitening feature
[0019] Step 2.5, and use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features
[0020] Step 2.6, group whitening features and channel attention features Add up the features
[0021] Step 3: Input the feature representation f'1 into stage2 to obtain the output feature x2, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f'2;
[0022] Step 3.1: Use the instance normalization layer to process the feature x2 to obtain the instance normalized feature
[0023] Step 3.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features
[0024] Step 3.3, normalize the instance features and spatial attention features Add up the features
[0025] Step 3.4, input feature f2 into the group whitening layer to obtain the group whitening feature
[0026] Step 3.5, use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features
[0027] Step 3.6, group whitening features and channel attention features Add up the features
[0028] Step 4: Input the feature representation f'2 into stage3 to obtain the output feature x3, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f'2;
[0029] Step 4.1: Use the instance normalization layer to process the feature x3 to obtain the instance normalized feature
[0030] Step 4.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features
[0031] Step 4.3: Normalize the instance features and spatial attention features Add up the features
[0032] Step 4.4, input feature f3 into the group whitening layer to obtain the group whitening feature
[0033] Step 4.5, use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features
[0034] Step 4.6, group whitening features and channel attention features Add up the features
[0035] Step 5: Input feature f'3 into stage4 to obtain output feature f'4, and perform generalized average pooling GeM on feature f'4 to obtain triple feature ftri , calculate triplet loss
[0036]
[0037] Where B represents the number of samples in a batch, and represents the Euclidean distance between sample b and its hardest positive sample and hardest negative sample, α = 0.3 represents the threshold, [·] + represents max(·,0);
[0038] Step 6: transform the triple feature f tri After the batch normalization layer and the fully connected layer, the classification feature f is obtained cls , calculate the classification loss
[0039]
[0040] Among them, p b represents the predicted probability, q b Indicates the true label y and label label of sample b b ∈[1,Class] are equal, Class represents the number of categories.
[0041] The example normalization layer in steps 2.1, 3.1, and 4.1 of the present invention is represented as follows:
[0042]
[0043] Among them, x i ,i∈1,2,3 represents the output features of stage1, stage2, and stage3, μ(·) and σ(·) represent the mean and standard deviation of each sample feature calculated in all channels, γ and β represent learnable parameters, is the output of the instance normalization layer.
[0044] The spatial attention module in steps 2.2, 3.2, and 4.2 of the present invention includes average pooling operation, maximum pooling operation, splicing operation, and convolution operation. The average pooling feature is obtained by performing average pooling operation and maximum pooling operation on the output of the instance normalization layer. and max pooling features After the two are concatenated and processed by convolution operation and sigmoid activation function, the output features of the spatial attention module are obtained, and finally expressed as follows:
[0045]
[0046]
[0047]
[0048] Among them, C represents the channel dimension, Represents the output of the instance normalization layer In the features on channel c, i∈1,2,3, max(·) means finding the maximum value, concat[·,·] means channel concatenation operation, conv(·) means convolution operation, turning two channels into one channel, and sigmoid(·) means sigmoid activation function.
[0049] The grouped whitening layers in steps 2.4, 3.4, and 4.4 of the present invention are represented as follows:
[0050]
[0051]
[0052]
[0053]
[0054]
[0055] in, represents the sum of instance normalization and spatial attention features corresponding to stage1, stage2, and stage3, ∏(· i ; g) represents the group division operation, dividing the channel into g groups, G represents whitening, Represents the grouped features, Calculate the whitening features; each group has c channels, H represents the image height, W represents the image width, and ∑ G Represent the mean and covariance within each group respectively, 1 represents a column vector with all numbers equal to 1, T represents transpose, ∈ represents a small positive number with a stable value, and I represents the identity matrix.
[0056] The channel attention module in steps 2.5, 3.5, and 4.5 of the present invention includes a multi-layer perceptron, a maximum pooling layer, and an average pooling layer, and a grouped whitening feature Input the maximum pooling layer and average pooling layer respectively to obtain the maximum pooling layer output features And the average pooling layer output features The results of the two are added after being processed by a multi-layer perceptron MLP, and finally processed by the sigmoid activation function to obtain the output features of the channel attention module, which is expressed as follows:
[0057]
[0058]
[0059]
[0060] Where maxpool(·) and avgpool(·) represent the maximum pooling layer and the average pooling layer respectively, i∈1,2,3, MLP(·) represents a multi-layer perceptron with the structure of conv->relu->conv. The scaling parameter ratio of the two convolutions in the multi-layer perceptron is 16.
[0061] The present invention also protects a domain-generalized pedestrian re-identification system based on invariant feature extraction, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor runs the computer program, the process of the above-mentioned domain-generalized pedestrian re-identification method based on invariant feature extraction is implemented.
[0062] Compared with the prior art, the present invention has the following beneficial effects:
[0063] (1) The present invention proposes a domain-generalized person re-identification method based on invariant feature extraction. For domain-generalized person re-identification, an attention-aware invariant feature extraction module is proposed to extract invariant features. Specifically, the instance normalization operation is used to eliminate style information such as illumination, and then the group whitening operation is used to eliminate style information such as color. In order to further eliminate style information to extract domain-invariant feature representations, spatial attention and channel attention are applied to the instance normalization operation and the group whitening operation respectively. Specifically, the input features are instance normalized, the instance normalized features are added to the features after spatial attention, and group whitening is performed on them. The group whitened features are added to the features after channel attention as output. Inserting this module in the shallow bottleneck layer of the deep network can prevent the problem of discriminant information loss caused by inserting too many invariant operations.
[0064] (2) The method of the present invention processes all source domains uniformly, reducing model parameters while ensuring that more generalized representations can be extracted, avoiding the problem of overfitting the corresponding source domain using a domain expert approach, which leads to lower performance in extracting domain-invariant feature representations.
[0065] (3) The present invention does not need to design a data augmentation strategy for a specific source domain, so it is less likely to overfit the source domain dataset, and does not need to compare multiple data augmentation strategies, thereby reducing training time and being more generalizable.
[0066] (4) The present invention is applied to the classification task of domain-generalized person re-identification. Multiple data sets are trained together, and the test data sets are completely different from the training data sets. The features of different fields are generalized to make them universal, that is, parallel instance normalization and group whitening are performed, and specific attention processing is directly performed on the two features without setting residual operations. It can remove domain-specific information and keep domain-invariant information, so that it can achieve the purpose of effective re-identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is the overall flow chart of the present invention;
[0068] Figure 2 is a flow chart of the attention-aware invariance feature extraction module of the present invention;
[0069] Figure 3 This is a structural block diagram of the attention-aware invariant feature extraction module of the present invention;
[0070] Figure 4 This is a schematic diagram of the structure of a ResNet50 network according to an embodiment of the present invention. Figure 4 In the figure, conv Block represents the residual block, stage1 represents a residual unit composed of a combination of three residual blocks, stage2 represents a residual unit composed of a combination of four residual blocks, stage3 represents a residual unit composed of a combination of seven residual blocks, and stage4 represents a residual unit composed of a combination of three residual blocks. The input image size of the ResNet50 network is (3, 384, 128), and the three dimensions represent channels, height, and width respectively. After stage0, the output size is (64, 96, 32), after stage1, the output size is (256, 96, 32), after stage2, the output size is (512, 48, 16), after stage3, the output size is (1024, 24, 8), and after stage4, the output size is (2048, 12, 4). DETAILED DESCRIPTION
[0071] The technical solution of the present invention will be further described in detail below with reference to specific embodiments and drawings, but the scope of protection of the present application is not limited thereto.
[0072] The present invention is a domain-generalized person re-identification method based on invariant feature extraction (referred to as method, see Figure 1-2), the ResNet50 network includes convolution + pooling layer (stage0), and multiple residual units (stage1, stage2, stage3, stage4) composed of a combination of several residual blocks, and uses the attention-aware invariant feature extraction module to extract domain-invariant feature representations, including: instance normalization layer, group whitening layer, spatial attention and channel attention,
[0073] The specific steps are as follows:
[0074] In step 1, multiple datasets are used as source domain datasets for model training. In each iteration, a batch is selected for each dataset for one iteration. The batch image inputs are input into the convolution + pooling layer for processing. After processing, the feature representation x0 of the input image is obtained.
[0075] x0=maxpool(ReLU(BN(conv 3×3 (input)))) (1)
[0076] Among them, maxpool(·) represents the maximum pooling layer, ReLU(·) represents the ReLU activation function, BN(·) represents the batch normalization layer, conv 3×3 (·) represents a 3×3 convolution.
[0077] Step 2: Input the feature representation x0 into stage1 to obtain the output feature x1, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f'1.
[0078] x1=stage1(x0) (2)
[0079] f′1=Module(x1) (3)
[0080] Among them, stage1 represents the first three bottleneck layers of ResNet50.
[0081] Step 2.1: Use the instance normalization layer to process the feature x1 to obtain the instance normalized feature
[0082] Step 2.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features
[0083] Step 2.3: Normalize the instance features and spatial attention features Add up the features
[0084] Step 2.4, input feature f1 into the group whitening layer to obtain the group whitening feature
[0085] Step 2.5, and use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features
[0086] Step 2.6, group whitening features and channel attention features Add up the features
[0087] Step 3: Input the feature representation f'1 into stage2 to obtain the output feature x2, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f'2.
[0088] x2=stage2(x1) (4)
[0089] f′2=Module(x2) (5)
[0090] Among them, stage2 represents the fourth to seventh bottleneck layers of ResNet50.
[0091] Step 3.1: Use the instance normalization layer to process the feature x2 to obtain the instance normalized feature
[0092] Step 3.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features
[0093] Step 3.3, normalize the instance features and spatial attention features Add up the features
[0094] Step 3.4, input feature f2 into the group whitening layer to obtain the group whitening feature
[0095] Step 3.5, use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features
[0096] Step 3.6, group whitening features and channel attention features Add up the features
[0097] Step 4: Input the feature representation f'2 into stage3 to obtain the output feature x3, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f'2.
[0098] x3=stage3(x2)#(6)
[0099] f′4=Module(x3)#(7)
[0100] Among them, stage3 represents the eighth to thirteenth bottleneck layers of ResNet50.
[0101] Step 4.1: Use the instance normalization layer to process the feature x3 to obtain the instance normalized feature
[0102] Step 4.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features
[0103] Step 4.3: Normalize the instance features and spatial attention features Add up the features
[0104] Step 4.4, input feature f3 into the group whitening layer to obtain the group whitening feature
[0105] Step 4.5, use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features
[0106] Step 4.6, group whitening features and channel attention features Add up the features
[0107] Step 5: Input feature f'3 into stage4 to obtain output feature f'4, and perform generalized average pooling on feature f'4 to obtain triple feature f tri , calculate triplet loss
[0108]
[0109] Where B represents the number of samples in a batch, and represents the Euclidean distance between sample b and its hardest positive sample and hardest negative sample, α = 0.3 represents the threshold, [·] + represents max(·,0);
[0110] Step 6: transform the triple feature f tri After the batch normalization layer and the fully connected layer, the classification feature f is obtained cls , calculate the classification loss
[0111]
[0112] Among them, p b represents the predicted probability, q b Indicates the true label y and label label of sample b b ∈[1,Class] are equal, Class represents the number of categories;
[0113] The example normalization layer in steps 2.1, 3.1, and 4.1 of the present invention is represented as follows:
[0114]
[0115] Among them, x i ,i∈1,2,3 represents the output features of stage1, stage2, and stage3, μ(·) and σ(·) represent the mean and standard deviation of each sample feature calculated in all channels, respectively, and γ and β represent learnable parameters.
[0116] The spatial attention module in steps 2.2, 3.2, and 4.2 of the present invention is expressed as follows:
[0117]
[0118]
[0119]
[0120] Among them, C represents the channel dimension, Represents the output of the instance normalization layer In the features on channel c, i∈1,2,3, max(·) means finding the maximum value, concat[·,·] means channel concatenation operation, conv(·) means convolution operation, turning two channels into one channel, and sigmoid(·) means sigmoid activation function.
[0121] The grouped whitening layers in steps 2.4, 3.4, and 4.4 of the present invention are represented as follows:
[0122]
[0123]
[0124]
[0125]
[0126]
[0127] in, represents the sum of instance normalization and spatial attention features corresponding to stage1, stage2, and stage3, ∏(· i ; g) represents the group division operation, dividing the channel into g groups, G represents whitening, Represents the grouped features, Calculate the whitening features; each group has c channels, H represents the image height, W represents the image width, and ∑ G Represent the mean and covariance within each group, 1 represents a column vector with all values equal to 1, T represents transpose, ∈ represents a small positive number with a stable value, and I represents the identity matrix. This embodiment divides the data into 64 groups to avoid the gradient explosion phenomenon.
[0128] The channel attention module in steps 2.5, 3.5, and 4.5 of the present invention is expressed as follows:
[0129]
[0130]
[0131]
[0132] Among them, maxpool(·) and avgpool(·) represent the maximum pooling layer and the average pooling layer respectively, and MLP(·) represents the multi-layer perceptron, that is, conv->relu->conv, where the scaling parameter ratio = 16.
[0133] mAP (Mean Average Precision) and Rank-1 (matching accuracy) are selected as quantitative indicators of the recognition accuracy of the neural network model; the Market-1501, Dukemtmc-reID, CUHK02, CUHK03, and CUHKSYSU-Person Search datasets are used as source domain datasets, and the average performance of the four target domain datasets ViPeR, PRID, GRID, and i-LIDS is calculated. The network models such as SNR (Style Normalization and Restitution), BoT (Bag of Tricks), RaMoE (Relevance-aware Mixture of Experts), and MDA (Meta Distribution Alignment) are used to perform experimental verification with the method of the present invention, and the experimental comparison results shown in Table 1 are obtained.
[0134] Table 1 Experimental comparison results of different methods
[0135]
[0136] Experimental results show that the mean average precision and matching accuracy of the method of the present invention are higher than those of other methods. This is because in the domain-generalized pedestrian re-identification invariant feature extraction method based on attention perception of the present invention, the two invariance operations of instance normalization and group whitening can effectively eliminate domain-specific feature representations. At the same time, the spatial attention and channel attention operations applied on them can further enhance instance normalization and group whitening, effectively extracting domain-invariant feature representations.
[0137] The above embodiment is one application of the present invention, but the embodiments of the present invention are not limited thereto. Any other technical changes that do not depart from the principles and spirit of the present invention are included in the protection scope of the present invention.
[0138] Any matters not described in the present invention are applicable to the prior art.
Claims
1. A domain-generalized person re-identification method based on invariant feature extraction, comprising the following: Constructing a recognition model, wherein the recognition model uses a ResNet50 network as a backbone network and also includes an attention-aware invariance feature extraction module. The ResNet50 network has N residual units connected in series, and the outputs of the first N-1 residual units are each connected to an attention-aware invariance feature extraction module. The output of the last residual unit is not connected to the attention-aware invariance feature extraction module, and the output of the last residual unit is connected to an average pooling layer, a batch normalization layer, and a fully connected layer. The attention-aware invariant feature extraction module is used to extract domain-invariant features, including: an instance normalization layer, a group whitening layer, spatial attention, and channel attention. The output features of the residual unit are subjected to an instance normalization operation IN to obtain an instance normalized feature X(IN). The instance normalized feature X(IN) is subjected to a spatial attention operation SA to obtain a corresponding spatial attention weight. The spatial attention weight and the instance normalized feature are multiplied to obtain a weighted spatial attention feature X(IN)_SA. The instance normalized feature X(IN) and the weighted spatial attention feature X(IN)_SA are then multiplied. The spatial attention feature X(IN)_SA is added to obtain the stage feature; the stage feature is subjected to the group whitening operation GW by the group whitening layer to obtain the group whitened feature X(GW), the whitened feature X(GW) is subjected to the channel attention operation to obtain the corresponding channel attention weight, the group whitened feature X(GW) and the channel attention weight are multiplied to obtain the weighted channel attention feature X(GW)_CA, and then the group whitened feature X(GW) and the weighted channel attention feature X(GW)_CA are added to obtain the final feature, which is input to the next stage; Multiple datasets are used as source domain datasets for recognition model training. In each iteration, a batch is selected for each dataset for one iteration, and the batch image inputs are input into the recognition model for training.
2. A domain-generalized person re-identification method based on invariant feature extraction is proposed. The backbone network is ResNet50. ResNet50 includes convolutional + pooling layers and multiple residual units composed of a combination of several residual blocks. The multiple residual units are sequentially denoted as stage1, stage2, stage3, and stage4. The specific steps are: Step 1: Use multiple datasets as source domain datasets to train the recognition model. In each iteration, select a batch for each dataset and perform one iteration. Input the batch image inputs into the convolution + pooling layer of the ResNet50 network for processing. After processing, the feature representation x0 of the input image is obtained. Step 2: Input the feature representation x0 into stage1 to obtain the output feature x1, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f'1; Step 2.1: Use the instance normalization layer to process the feature x1 to obtain the instance normalized feature Step 2.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features Step 2.3: Normalize the instance features and spatial attention features Add up the features Step 2.4, input feature f1 into the group whitening layer to obtain the group whitening feature Step 2.5, and use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features Step 2.6, group whitening features and channel attention features Add up the features Step 3: Input the feature representation f′1 into stage2 to obtain the output feature x2, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f′2; Step 3.1: Use the instance normalization layer to process the feature x2 to obtain the instance normalized feature Step 3.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features Step 3.3, normalize the instance features and spatial attention features Add up the features Step 3.4, input feature f2 into the group whitening layer to obtain the group whitening feature Step 3.5, use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features Step 3.6, group whitening features and channel attention features Add up the features Step 4: Input the feature representation f'2 into stage3 to obtain the output feature x3, and perform the attention-aware invariant feature extraction module Module(·) on the output feature to obtain the invariant feature f'2; Step 4.1: Use the instance normalization layer to process the feature x3 to obtain the instance normalized feature Step 4.2, use the spatial attention module to extract Corresponding spatial attention weights According to the spatial attention weight and instance-normalized features Get spatial attention features Step 4.3: Normalize the instance features and spatial attention features Add up the features Step 4.4, input feature f3 into the group whitening layer to obtain the group whitening feature Step 4.5, use the channel attention module to extract Corresponding channel attention weights According to the channel attention weight and group whitening features Get channel attention features Step 4.6, group whitening features and channel attention features Add up the features Step 5: Input feature f'3 into stage4 to obtain output feature f'4, and perform generalized average pooling GeM on feature f'4 to obtain triple feature f tri , calculate triplet loss in, B represents the number of samples in a batch, and represents the Euclidean distance between sample b and its hardest positive sample and hardest negative sample, α = 0.3 represents the threshold, [·] + represents max(·,0); Step 6: transform the triple feature f tri After the batch normalization layer and the fully connected layer, the classification feature f is obtained cls , calculate the classification loss Among them, p b represents the predicted probability, q b Indicates the true label y and label label of sample b b ∈[1,Class] are equal, Class represents the number of categories.
3. The domain-generalized person re-identification method based on invariant feature extraction according to claim 2 is characterized in that: The instance normalization layer is expressed as follows: Among them, x i ,i∈1,2,3, represents the output features of stage1, stage2, and stage3; μ(·) and σ(·) represent the mean and standard deviation of each sample feature calculated in all channels, respectively; γ and β represent learnable parameters. is the output of the instance normalization layer; The spatial attention module includes average pooling operation, maximum pooling operation, splicing operation and convolution operation. The output of the instance normalization layer is subjected to average pooling operation and maximum pooling operation respectively to obtain the average pooling feature. and max pooling features After the two are concatenated and processed by convolution operation and sigmoid activation function, the output features of the spatial attention module are obtained, and finally expressed as follows: Among them, C represents the channel dimension, Represents the output of the instance normalization layer For the features on channel c, i∈1,2,3, max(·) indicates finding the maximum value, concat[·,·] indicates the channel concatenation operation, conv(·) indicates the convolution operation, which turns two channels into one channel, and sigmoid(·) indicates the sigmoid activation function; The grouped whitening layer is represented as follows: in, represents the sum of instance normalization and spatial attention features corresponding to stage1, stage2, and stage3; ∏(· i ; g) represents the group division operation, dividing the channel into g groups, G represents whitening, Represents the grouped features, Calculate the whitening features; each group has c channels, H represents the image height, W represents the image width, and ∑ G Represent the mean and covariance within each group respectively, 1 represents a column vector with all numbers equal to 1, T represents transpose, ∈ represents a small positive number with a stable value, and I represents the identity matrix; The channel attention module includes a multi-layer perceptron, a maximum pooling layer and an average pooling layer, and grouped whitening features. Input the maximum pooling layer and average pooling layer respectively to obtain the maximum pooling layer output features And the average pooling layer output features The results of the two are added after being processed by a multi-layer perceptron MLP, and finally processed by the sigmoid activation function to obtain the output features of the channel attention module, which is expressed as follows: Where maxpool(·) and avgpool(·) represent the maximum pooling layer and the average pooling layer respectively, i∈1,2,3, MLP(·) represents a multi-layer perceptron with the structure of conv->relu->conv. The scaling parameter ratio of the two convolutions in the multi-layer perceptron is 16.
4. The domain-generalized person re-identification method based on invariant feature extraction according to claim 3, wherein the channel is divided into 64 groups in the group division operation, that is, g=64.
5. The domain-generalized person re-identification method based on invariant feature extraction according to any one of claims 1 to 4, characterized in that: The Market-1501, Dukemtmc-reID, CUHK02, CUHK03, and CUHKSYSU-Person Search datasets are used as source domain datasets, and ViPeR, PRID, GRID, and i-LIDS are used as four target domain datasets for domain generalization person re-identification.
6. A domain-generalized person re-identification system based on invariant feature extraction, characterized by: The invention comprises a memory, a processor, and a computer program stored in the memory and capable of being run on the processor. When the processor runs the computer program, the process of the domain-generalized pedestrian re-identification method based on invariant feature extraction as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Pedestrian re-identification method and device capable of keeping translation invariance and storage medium
CN111783624A
Novel multi-modal fusion pedestrian re-identification algorithm
CN114694089A