Transform and adversarial learning-based cross-modal pedestrian re-identification method

Through methods based on Transformer and adversarial learning, modality-invariant features are extracted and the differences between visible and infrared images are solved, which solves the problem of difficult-to-solve modal differences in cross-modal pedestrian re-identification in the existing technology, significantly improving Recognition accuracy and robustness.

CN118736485AActive Publication Date: 2024-10-01XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410781684.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-10-01
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

Existing cross-modal person re-identification technology is difficult to effectively reduce the modal differences between visible and infrared images. Especially when generating visible light images from infrared images, noise information is easily introduced, affecting the recognition accuracy.

Method used

Using methods based on Transformer and adversarial learning, through modality-specific feature extraction, cross-modal feature alignment, multi-scale feature fusion and adversarial learning strategies, modality-invariant features are extracted, modal differences are reduced, and modal differences are reduced through preprocessing and auxiliary models. Dynamic training enhances the robustness of the model.

Benefits of technology

It significantly improves the accuracy and robustness of cross-modal pedestrian re-identification, enhances the model's adaptability to color transformation and lighting conditions, and improves the discrimination ability in multi-modal scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736485A_ABST
    Figure CN118736485A_ABST
Patent Text Reader

Abstract

The invention discloses a trans-modal pedestrian re-identification method based on Transform and adversarial learning. The method comprises the following steps: firstly, extracting features from a visible light image and an infrared image by using a modal specific feature extractor; then, the extracted modal specific features are adjusted through a cross-modal feature alignment module, so that feature differences in the modals and between the modals are reduced; then, a weight sharing shared feature extractor is used for extracting modal sharing features, and a multi-scale feature fusion method is adopted, and context information of the modal sharing features is supplemented into the modal specific features through an attention mechanism by utilizing Transform, so that the defect of the modal specific features in global semantics is made up; in the adversarial learning process, a classifier and a feature extractor are alternately trained, so that modal invariant features are better extracted. The method effectively reduces the modal difference between the visible light image and the infrared image, remarkably improves the precision and robustness of cross-modal pedestrian re-recognition, and is suitable for the fields of security and protection monitoring, intelligent transportation and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision, and in particular relates to a cross-modal pedestrian re-identification method based on Transformer and adversarial learning. Background Art

[0002] Person re-identification is a technology that uses computer vision technology to detect whether a specific pedestrian exists in an image or video sequence. Due to the growing demand for public safety and the increase in the number of surveillance cameras, pedestrian re-identification technology has received increasing attention.

[0003] In the field of public safety monitoring, pedestrian re-identification technology can help monitoring systems track and identify people more effectively. Once a surveillance camera captures the whereabouts of a suspect, pedestrian re-identification technology can assist in identifying the suspect in other cameras, and can accurately identify specific pedestrians even in a busy crowd, thereby greatly improving the ability of public safety monitoring. In addition, most cameras in modern monitoring systems have the function of automatically switching between visible light and infrared modes under different lighting conditions. The research on cross-modal pedestrian re-identification technology makes it possible to effectively identify the whereabouts of suspects at night, thereby expanding the application scope and effect of monitoring systems.

[0004] However, there are significant differences in imaging mechanisms and characteristics between visible light images and infrared images. The contrast of infrared images is usually low because it represents the temperature distribution of the scene and reflects the difference in outward radiation energy between the target and the background. In addition, the infrared band is affected by the long transmission distance, atmospheric absorption and scattering, resulting in blurred edges. The contrast of visible light images is usually high, which can show the difference between the target and the background more clearly. In addition, infrared images are imaged based on the temperature of the object, so they cannot reflect the texture information of the surface of the object. Visible light images are imaged based on the reflection of the surface of the object, which can better reflect the texture information of the surface of the object and have a strong ability to reflect the details of the surface of the object. Therefore, the research on cross-modal pedestrian re-identification is mainly committed to solving the problem of modal differences between the two images. Existing visible light infrared pedestrian re-identification models can be divided into models based on modality shared feature learning and models based on modality specific information compensation.

[0005] Models based on modality-shared feature learning aim to embed features from different modalities into the same feature space and reduce the cross-modal differences by using some feature-level constraints. However, due to the large modality gap between visible and infrared images, it is difficult to directly project cross-modal images into a common space.

[0006] Models based on modality-specific information compensation attempt to compensate for the missing modality-specific information in the existing modality. That is, visible light images are converted into infrared images, or infrared images are converted into visible light images, thereby reducing the appearance difference. However, there are significant modality differences between visible and infrared images, so it is challenging to generate high-quality images from one modality to another. Especially when generating visible light images from infrared images, cross-modal person re-identification may introduce more noise information, such as color inconsistency, rather than discriminative person features. Summary of the invention

[0007] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a cross-modal pedestrian re-identification method based on Transformer and adversarial learning, which uses Transformer to aggregate modality shared features and modality specific features, and better extracts modality invariant features through adversarial learning, more effectively reduces the modal differences between visible light and infrared images, and improves the accuracy of cross-modal pedestrian re-identification.

[0008] In order to achieve the above object, the technical solution adopted by the present invention is:

[0009] A cross-modal person re-identification method based on Transformer and adversarial learning includes the following steps:

[0010] Step 1, obtain a visible light-infrared image dataset of pedestrians, and extract modality-specific features from the visible light image and the infrared image respectively through a modality-specific feature extractor;

[0011] Step 2, adjusting the modality-specific features through a cross-modality feature alignment module to reduce feature differences within and between modalities;

[0012] Step 3, using a weight-sharing shared feature extractor to extract modality shared features from modality specific features, and combining the modality shared features and modality specific features through a multi-scale feature fusion module to enrich the final feature representation; the modality specific feature extractor and the shared feature extractor together constitute a feature extractor;

[0013] Step 4: Adopt an adversarial learning strategy to alternately train the classifier and the feature extractor; the classifier attempts to distinguish between visible light and infrared features, while the feature extractor attempts to extract features of modal confusion, making it difficult for the classifier to distinguish, thereby better extracting modal invariant features, and the training is terminated when the preset training rounds are reached;

[0014] Step 5: Use the trained feature extractor to perform cross-modal pedestrian re-identification with visible light or infrared pedestrian images as input.

[0015] Furthermore, in step 1 of the present invention, the visible light images and infrared images in the data set are first subjected to preprocessing strategies including random channel erasing and horizontal flipping to enrich the diversity of training samples and further increase the generalization ability of the model; at the same time, the camera label information in the data set is read, and the differences between cameras are alleviated by introducing the camera label information to strengthen the learning of modality-invariant features; then, channel exchange enhancement is used to generate new training images as auxiliary modalities to improve the robustness to color transformation. Then, features are extracted from the preprocessed visible light images and infrared images respectively through two modality-specific feature extractors, wherein the feature extractor adopts the first two residual module structures of ResNet-50.

[0016] Furthermore, the introduction of camera label information alleviates the differences between cameras and strengthens the learning of modality-invariant features. The implementation method is as follows: during the training process, the image and its corresponding camera label are input into the network together, and an auxiliary branch for predicting the camera label is added to the network. Through the camera label prediction loss, the model can notice the image differences between different cameras, thereby extracting more discriminative features.

[0017] Furthermore, the use of channel exchange enhancement to generate a new training image as an auxiliary modality improves the robustness to color changes. The implementation method is: randomly select a channel (R, G or B) of the original visible light image to replace other channels to generate a new image. The generated image is input as an auxiliary modality together with the original visible light image into the visible light modality specific feature extractor for joint training, thereby enhancing the robustness of the model to color changes.

[0018] Furthermore, in step 3 of the present invention, the shared feature extractor adopts the last three residual module structures of ResNet-50. The multi-scale feature fusion module consists of a 1×1 convolutional layer and a Transformer. The convolutional layer makes the features more compact. The Transformer supplements the contextual information of the modality-shared features to the modality-specific features through the attention mechanism to make up for the deficiencies of the modality-specific features in global semantics.

[0019] Furthermore, in step 4 of the present invention, during the adversarial learning process, the true modality label of the visible light image is set to [1, 0, 0], the true modality label of the infrared image is set to [0, 1, 0], and the modality confusion label of all samples from the two modalities is set to [0, 0, 1]. The input features are converted into predicted probability distributions using a classifier, and then the classifier and the feature extractor are alternately trained, so that the optimization process explicitly focuses on the modality-independent perspective and better extracts modality-invariant features.

[0020] Compared with the prior art, the present invention has the following beneficial effects:

[0021] The present invention aligns features from different modalities through a cross-modal feature alignment module, reducing feature differences within and between modalities, thereby making cross-modal feature matching more accurate. The cross-modal feature alignment module uses channel consistency loss to shorten the distance between each channel feature in each modality and its corresponding channel feature center, thereby making the features of each channel more concentrated and reducing feature differences within the modality. At the same time, by increasing the distance between the feature centers of different channels, the features of different channels are prevented from being too similar, ensuring that the features of each channel have sufficient differences, and improving the model's discrimination ability. Finally, the modal consistency loss is used to reduce the distance between the feature centers of the visible light modality and the infrared modality of the same identity, thereby improving the alignment effect of cross-modal features and enhancing the performance of the model in multimodal scenarios.

[0022] The multi-scale feature fusion module of the present invention uses 1×1 convolutional layers and Transformer to effectively fuse features at different levels. The 1×1 convolutional layer makes the features more compact, while the Transformer supplements the contextual information of the modality-shared features to the modality-specific features through the attention mechanism, making up for the lack of modality-specific features in global semantics. Finally, the enhanced modality-specific features are fused with the modality-shared features, making the final feature representation richer and more comprehensive, significantly improving the effect of cross-modal pedestrian re-identification.

[0023] The adversarial learning of the present invention sets a true modality label and a modality confusion label for each image. In the adversarial learning process, the classifier is first trained with the true modality label so that it can correctly distinguish between visible light and infrared images, and then the feature extractor is trained with the modality confusion label. The goal is to extract modality-independent features so that the classifier classifies all samples as modality confusion labels on this feature. In this way, the optimization process explicitly focuses on modality-independent perspectives, thereby better extracting modality-invariant features and improving the accuracy of cross-modal pedestrian re-identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is the network structure diagram of the cross-modal pedestrian re-identification method based on Transformer and adversarial learning in the present invention.

[0025] Figure 2 Schematic diagram of the cross-modal feature alignment module structure of the present invention.

[0026] Figure 3 Schematic diagram of the structure of the multi-scale feature fusion module of the present invention.

[0027] Figure 4 The Rank-10 search results of the present invention are used.

[0028] Figure 5A heat map of features extracted using the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solution of the solution of the present invention will be clearly and completely described below in conjunction with the drawings in the accompanying drawings of the present invention specification. Based on the solution of the present invention, all other achievements obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present invention.

[0030] Existing cross-modal pedestrian re-identification algorithms cannot solve the modality difference problem between visible light images and infrared images. In order to solve the above technical problems, the present invention provides a cross-modal pedestrian re-identification method based on Transformer and adversarial learning.

[0031] Combination Figure 1 As shown, the method of the present invention relies on a feature extractor, a cross-modal feature alignment module, a multi-scale feature fusion module, an adversarial learning module, etc., and the above modules constitute the main part of the present invention.

[0032] refer to Figure 1 The cross-modal person re-identification method based on Transformer and adversarial learning of the present invention mainly includes the following main steps:

[0033] Step 1: Obtain a visible light-infrared image dataset of pedestrians as a training sample set. The training sample set contains multiple pedestrians with different identities, and each pedestrian has several infrared images and visible light images. In addition, the images in the sample set are taken by multiple cameras at different angles and lighting conditions. These cameras cover different scenes and backgrounds, thus ensuring the diversity and generalization ability of the data.

[0034] Step 2: Preprocess the data in the training sample set.

[0035] In this example, the image is first cropped to a size of 288×144, and then the image is horizontally flipped with a probability of 0.5 to enhance the generalization ability of the model and reduce overfitting. The image is then normalized with mean=[0.485, 0.456, 0.406] and std=[0.229, 0.224, 0.225] to speed up the convergence of the model. Then, channel random erasing is used to improve the robustness to image noise:

[0036]

[0037] Where m and n represent the coordinate position of the pixel, α is a fixed value, and S eis a randomly selected rectangular erased area. Then, channel swapping is used to enhance the visible light image, randomly selecting one channel (R, G or B) to replace other channels, and generating new training images as auxiliary modalities by focusing on one channel to improve the robustness to color transformation.

[0038]

[0039]

[0040]

[0041] Step 3: Extract modality-specific features from visible light images and infrared images respectively through modality-specific feature extractors.

[0042] The modality-specific feature extractor of the present invention comprises an infrared feature extractor E r and visible light feature extractor E v , infrared feature extractor E r Extracting modality-specific features from infrared images, visible light feature extractor E v Extracting modality-specific features from visible light images. Figure 1 , infrared feature extractor E r and visible light feature extractor E v They are composed of the first two residual modules of ResNet-50 and use E r and E v Extract the infrared modality specific features F r and the visible light modality-specific feature F v ,Right now:

[0043] F r =E r (X r ),F v =E v (X v )

[0044] Step 4: The modality-specific features are adjusted through a cross-modality feature alignment module to reduce feature differences within and between modalities.

[0045] refer to Figure 2The cross-modal feature alignment module uses channel consistency loss to shorten the distance between each channel feature in each modality and the center of its corresponding channel feature, thereby making the features of each channel more concentrated and reducing the feature differences within the modality. At the same time, by increasing the distance between the feature centers of different channels, the features of different channels are prevented from being too similar, ensuring that the features of each channel have sufficient differences and improving the model's discrimination ability. Subsequently, the modal consistency loss is used to shorten the distance between the feature centers of the visible light modality and the infrared modality of the same identity, thereby improving the alignment effect of cross-modal features and enhancing the performance of the model in multimodal scenarios.

[0046] In this embodiment, the modality-specific features are adjusted through a cross-modality feature alignment module, and the implementation process is as follows:

[0047] Step 41, input Among them, F r and F v are the infrared modality-specific features and visible light modality-specific features obtained by the modality-specific feature extractor, respectively. B represents the batch size, C represents the number of channels, and H and W represent height and width, respectively.

[0048] Step 42: Use the equalization channel to divide F r and F v Decomposed into three channel features of R, G, and B, that is, in C'=C / 3. It can be expressed as m∈[r,v],j∈[R,G,B]. Then calculate the feature center of each channel of the modality-specific feature:

[0049]

[0050]

[0051] in, and Respectively represent the feature centers of the red, green, and blue channels of the infrared modality of the i-th identity, and Respectively represent the feature centers of the red, green, and blue channels of the visible light modality of the i-th identity, and denote the modality-specific features of the i-th identity k-th infrared sample in the red, green, and blue channels, respectively. and They represent the modal specific features of the kth visible light sample of the ith identity in the red, green, and blue channels, respectively, and K is the number of samples of the ith identity.

[0052] In order to alleviate the intra-modality differences, a channel consistency loss L is proposedccl , which is expressed as follows:

[0053]

[0054]

[0055] L ccl =L cn +L sp

[0056] Among them, L cn is the channel center loss, which shortens the distance from each channel to the center in the mode. sp is the channel separation loss, which increases the distance between different channels. τ represents the corresponding boundary, which is usually set to 0.6, and N is the number of identities.

[0057] Step 43, calculate the feature centers of the infrared modality specific features and the visible light modality specific features:

[0058]

[0059] Among them, C r,i is the infrared modal feature center of the i-th identity, C v,i is the visible light modal feature center of the ith identity, is the modality-specific feature of the kth infrared sample of the ith identity, is the modality-specific feature of the kth visible light sample of the ith identity. Finally, the modality consistency loss L is proposed mcl To reduce the distance between the specific feature center of the visible light modality and the specific feature center of the infrared modality with the same identity, it is expressed as follows:

[0060]

[0061] Step 5: Extract modality shared features from modality specific features using a weight-sharing shared feature extractor. The modality specific feature extractor and the shared feature extractor of the present invention together constitute a feature extractor.

[0062] refer to Figure 1 , the present invention shares the feature extractor E s It consists of the last three residual modules of ResNet-50 and uses E s Extract modality shared features F s,r and F s,v ,Right now:

[0063] F s,r =E s (F r ),F s,v =E s (Fv )

[0064] Step 6: Combine the modality-shared features and modality-specific features through a multi-scale feature fusion module.

[0065] refer to Figure 3 The multi-scale feature fusion module of the present invention consists of a 1×1 convolutional layer and a Transformer. The 1×1 convolutional layer makes the features more compact, while the Transformer supplements the contextual information of the modality-shared features to the modality-specific features through the attention mechanism, making up for the lack of modality-specific features in global semantics. Finally, the enhanced modality-specific features are fused with the modality-shared features, reducing the loss of information and making the final feature representation richer and more comprehensive, thereby significantly improving the effect of cross-modal person re-identification.

[0066] The present invention combines modality-shared features and modality-specific features through a multi-scale feature fusion module, and the implementation process is as follows:

[0067] Step 61, input is F l and F h , where F l represents the modality-specific features to be incorporated, i.e., the infrared feature extractor E r and visible light feature extractor E v The extracted modality-specific features F r or F v , F h Represents the modal shared features to be incorporated, that is, the shared feature extractor E s The extracted modal shared feature F s,r or F s,v , through a 1×1 convolutional layer, F l and F h Convert to compact representation F l ′ and F h ′. For example, there are two 1×1 convolutional layers, represented as and but:

[0068]

[0069] Step 62: The modal specific feature F l ′ as the query, and the modal shared feature F h ′ as keys and values, we can generate query, key and value matrices:

[0070] Q=W q F l ′,K=W k F h ′,V=W v Fh '

[0071] Among them, W q ,W k ,W v are the weight matrices used to generate the query, key, and value matrices respectively. The attention score is then calculated:

[0072]

[0073] Among them, d k is the dimension of the key matrix, used to scale the dot product.

[0074] Step 63, use the obtained attention score to obtain the updated low-level features:

[0075] F l ″=AV

[0076] The updated modality-specific features F l ″ and modal shared features F h ′Add together to get the final feature:

[0077] F u =F l ″+F h '

[0078] Step 7: Adopt an adversarial learning strategy to alternately train the classifier and feature extractor; the classifier attempts to distinguish between visible light and infrared features, while the feature extractor attempts to extract features of modal confusion, making it difficult for the classifier to distinguish, thereby better extracting modal invariant features. The training is terminated when the preset training rounds are reached.

[0079] The process of alternating training of the classifier and feature extractor in this step can be described as follows:

[0080] Step 71, the visible light feature F obtained in the previous step v and infrared signature F r As input, the true modality label t of the visible light image v Set to [1,0,0], the true modality label t of the infrared image r Set to [0,1,0] to confuse the modality labels of all images t o All are set to [0,0,1].

[0081] Step 72, reference Figure 1 , use the classifier W to transform the input features into the predicted modal probability distribution, and then alternately train the classifier W and the feature extractor E:

[0082]

[0083]

[0084] Where CE(·) represents the cross entropy loss function, N v Represents the number of visible light image samples, N r Represents the number of infrared image samples.

[0085] Step 8: Using the trained feature extractor, cross-modal pedestrian re-identification can be performed with visible light or infrared pedestrian images as input.

[0086] The present invention can effectively reduce the modal differences between visible light and infrared images, significantly improve the accuracy and robustness of cross-modal pedestrian re-identification, and is applicable to security monitoring, intelligent transportation and other fields. Below, in order to further demonstrate the advantages of a cross-modal pedestrian re-identification method based on Transformer and adversarial learning proposed in the present invention, the present invention conducted extensive comparative experiments, trained and evaluated separately on the SYSU-MM01 and RegDB datasets, and compared them with existing cross-modal pedestrian re-identification methods.

[0087] Table 1 Comparison of the proposed method with existing methods on the SYSU-MM01 dataset

[0088]

[0089] Table 2 Comparison of the proposed method with existing methods on the RegDB dataset

[0090]

[0091] Dataset:

[0092] SYSU-MM01: SYSU-MM01 is an image dataset for visible-infrared pedestrian re-identification. The images are collected by 4 RGB cameras (for bright scenes) and 2 infrared cameras (for dim scenes). These 6 cameras collect a total of 289,145 RGB images and 16,579 infrared images of 491 pedestrians.

[0093] RegDB: RegDB is also an image dataset for visible-infrared person re-identification. The dataset contains 412 different person identities, with a total of 8,240 person images, including 4,120 visible images and 4,120 infrared images, using a dual-mode camera (visible mode and infrared mode respectively). Among these identities, 254 are female and 158 are male.

[0094] Metrics:

[0095] Rank-n accuracy: This metric indicates whether the true match of the query image appears in the first n matches. Rank-1 accuracy refers to whether the first position in the match list is a true match.

[0096] Average precision (mAP): By calculating the accuracy under different thresholds and taking the average, mAP can more comprehensively reflect the performance of the algorithm under different conditions.

[0097] It can be seen from Tables 1 and 2 that the cross-modal pedestrian re-identification method based on Transformer and adversarial learning proposed in the present invention can effectively reduce the modal difference between visible light and infrared images, and improve the accuracy and effect of cross-modal pedestrian re-identification. Figure 4 The figure shows some retrieval results of the proposed method on the dataset. For each retrieval case, the green box indicates the correct match corresponding to the given query, while the red box indicates an incorrect match. From the retrieval results, the proposed method can effectively distinguish identities, and the correct results usually have a high degree of match with the image to be retrieved. Figure 5 As shown, the heat map generated by the method proposed in the present invention focuses more on identity-related features and has a strong anti-interference ability to factors such as illumination and occlusion.

[0098] The present invention is disclosed in more detail above, but it is not intended to limit the present invention. Any technical solutions obtained by adopting equivalent replacement or equivalent transformation solutions fall within the protection scope of the present invention.

Claims

1. A cross-modal person re-identification method based on Transformer and adversarial learning, characterized in that: The steps include: Step (1), obtaining a visible light-infrared image dataset of pedestrians, and extracting modality-specific features from the visible light image and the infrared image respectively by a modality-specific feature extractor; Step (2), adjusting the modality-specific features through a cross-modality feature alignment module to reduce feature differences within and between modalities; Step (3), extracting modality shared features from modality specific features using a weight-sharing shared feature extractor, and combining the modality shared features and the modality specific features through a multi-scale feature fusion module; wherein the modality specific feature extractor and the shared feature extractor together constitute a feature extractor; Step (4), using an adversarial learning strategy, alternately training the classifier and the feature extractor; wherein the classifier attempts to distinguish between visible light and infrared features, while the feature extractor attempts to extract features of modal confusion, making it difficult for the classifier to distinguish, thereby better extracting modal invariant features, and the training is terminated when a preset training round is reached; Step (5) uses the trained feature extractor to perform cross-modal pedestrian re-identification with visible light or infrared pedestrian images as input.

2. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 1, characterized in that: In the step (1), in the data set, a preprocessing strategy including random channel erasing and horizontal flipping is used for visible light images and infrared images; at the same time, camera label information is introduced to alleviate the differences between cameras and strengthen the learning of modality invariant features; and channel exchange enhancement is used to generate new training images as auxiliary modalities to improve the robustness to color changes.

3. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 2, characterized in that: The introduction of camera label information alleviates the differences between cameras and strengthens the learning of modality-invariant features. The implementation method is as follows: during the training process, the image and its corresponding camera label are input into the network together, and an auxiliary branch for predicting the camera label is added to the network. Through the camera label prediction loss, the model can notice the image differences between different cameras. The method of using channel exchange enhancement to generate a new training image as an auxiliary modality to improve the robustness to color transformation is as follows: randomly select a channel of the original visible light image to replace other channels to generate a new image, and the generated image is input as an auxiliary modality together with the original visible light image into a visible light modality specific feature extractor for joint training.

4. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 1, characterized in that: In step (1), the modality-specific feature extractor includes an infrared feature extractor E r and visible light feature extractor E v , infrared feature extractor E r Extracting modality-specific features from infrared images, visible light feature extractor E v Extracting modality-specific features from visible light images, E r and E v Both are composed of the first two residual modules of ResNet-50; in step (3), the shared feature extractor E s Extracting modality shared features, E s It consists of the last three residual modules of ResNet-50.

5. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 1, characterized in that: The step (2) is to adjust the modality-specific features through a cross-modality feature alignment module, and the process is as follows: Step (21), input is where F r and F v They are infrared modality-specific features and visible light modality-specific features obtained by the modality-specific feature extractor, B represents the batch size, C represents the number of channels, H and W represent the height and width respectively; Step (22), by averaging the channels, r and F v Decomposed into RGB three-channel features, namely in Calculate the feature center of each channel of the modality-specific features; Step (23), calculate the feature centers of the infrared modality specific features and the visible light modality specific features: Among them, C r,i is the infrared modal feature center of the ith identity, C v,i is the visible light modal feature center of the ith identity, is the modality-specific feature of the kth infrared sample of the ith identity, is the modality-specific feature of the kth visible light sample of the ith identity, and K is the number of samples of the ith identity.

6. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 5, characterized in that: The process of calculating the feature center of each channel of the modality-specific feature is as follows: in, and Respectively represent the feature centers of the red, green, and blue channels of the infrared modality of the i-th identity, and Respectively represent the feature centers of the red, green, and blue channels of the visible light modality of the i-th identity, and denote the modality-specific features of the i-th identity k-th infrared sample in the red, green, and blue channels, respectively. and denote the modality-specific features of the kth visible light sample of the ith identity in the red, green, and blue channels, respectively.

7. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 6, characterized in that: Adopt channel consistency loss L ccl To alleviate the intra-modal differences, it is expressed as follows: L ccl =L cn +L sp Adopting the modality consistency loss L mcl To reduce the distance between the feature center of the visible light modality and the feature center of the infrared modality with the same identity, it is expressed as follows: Where L cn is the channel center loss, which shortens the distance from each channel to the center in the mode. sp is the channel separation loss, which increases the distance between different channels, τ represents the corresponding boundary, m∈[r,v], and N is the number of identities.

8. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 5, 6 or 7, characterized in that: The multi-scale feature fusion module consists of a 1×1 convolutional layer and a Transformer, wherein the Transformer supplements the contextual information of the modality-shared features to the modality-specific features through the attention mechanism to make up for the deficiency of the modality-specific features in global semantics; the modality-shared features and the modality-specific features are combined through the multi-scale feature fusion module, and the process is as follows: Step (31), input is F l and F h , where F l represents the modality-specific features to be incorporated, F h Represents the modality shared features to be integrated, and F is transformed into l and F h Convert to compact representation F l ′ and F h ′; Step (32), F l ′ as the query, and F h ′ as the key and value, generate the query, key and value matrix, and then calculate the attention score; Step (33), use the obtained attention score to obtain the updated low-level feature F l ″, the updated low-level features F l ″ and F h ′ is added to get the final feature F u .

9. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 8, characterized in that: The step (32) generates query, key and value matrices as follows: Q=W q F l ′,K=W k F h ′,V=W v F h ′ The calculated attention scores are as follows: In step (33), the updated low-level feature F l The expression is as follows: F l ″=OFF Final feature F u The expression is as follows: F u =F l ″+F h ′ Among them, W q ,W k ,W v are the weight matrices used to generate query, key, and value matrices, respectively, d k is the dimension of the key matrix, used to scale the dot product.

10. The cross-modal person re-identification method based on Transformer and adversarial learning according to claim 1, characterized in that: In step (4), an adversarial learning strategy is adopted to alternately train the classifier and the feature extractor. The process is as follows: Step (41), using the visible light feature F obtained in step (3) v and infrared signature F r As input, the true modality label t of the visible light image v Set to [1,0,0], the true modality label t of the infrared image r Set to [0,1,0] to confuse the modality labels of all images t o All are set to [0,0,1]; Step (42), use the classifier W to transform the input features into the predicted modal probability distribution, and then alternately train the classifier W and the feature extractor E: Where CE(·) represents the cross entropy loss function, N v Represents the number of visible light image samples, N r Represents the number of infrared image samples.