A cross-domain pedestrian re-identification method based on semantic perception asymmetric mark enhancement

Through a training framework based on semantic perception and asymmetric labeling enhancement, the recognition accuracy and robustness of the cross-domain pedestrian re-identification model are improved, the problems of separation of global shape features and local texture noise and insufficient robustness of local feature modeling are solved, and the effective fusion of global and local features and improvement of recognition accuracy are achieved.

CN120599705BActive Publication Date: 2025-10-10ARTIFICIAL INTELLIGENCE RES INST OF HEFEI COMPREHENSIVE NAT SCI CENT (ANHUI ARTIFICIAL INTELLIGENCE LAB)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511091051.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-05
Publication Date
2025-10-10
Estimated Expiration
2045-08-05

AI Technical Summary

Technical Problem

Existing Transformer-based cross-domain person re-identification methods face problems such as difficulty in separating global shape features from local texture noise, insufficient asymmetric learning mechanism, and insufficient robustness of local feature modeling in domain generalization scenarios, resulting in a decrease in recognition accuracy.

Method used

A training framework based on semantic perception and asymmetric label enhancement is adopted. Through multi-scale contour perception, dynamic label enhancement and adaptive feature alignment mechanism, a cross-domain pedestrian re-identification model is used to extract global shape and local texture features, and feature fusion is performed through a cross-domain alignment attention mechanism. The recognition ability of the model is improved by combining hybrid and combined enhancement modes.

Benefits of technology

It improves the accuracy and robustness of cross-domain pedestrian re-identification, enhances the model's recognition ability in complex cross-domain environments, and solves the recognition problems in global and local feature separation and occlusion scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120599705B_ABST
    Figure CN120599705B_ABST
Patent Text Reader

Abstract

The application provides a cross-domain pedestrian re-identification method based on semantic perception and asymmetric label enhancement, which can be applied to the technical field of image recognition. The method comprises the following steps: extracting global shape features and local texture features of a target pedestrian from an image to be processed by using a trained cross-domain pedestrian re-identification model, wherein the trained cross-domain pedestrian re-identification model is obtained based on a training framework of semantic perception and asymmetric label enhancement; processing the global shape features by using the trained cross-domain pedestrian re-identification model to obtain a global query vector, and processing the local texture features to obtain a local key vector and a local value vector; performing operation on the global query vector, the local key vector and the local value vector based on a cross-domain alignment attention mechanism by using the trained cross-domain pedestrian re-identification model to obtain cross attention features, and processing the cross attention features to obtain a re-identification result of the target pedestrian.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a cross-domain pedestrian re-identification method based on semantic-aware asymmetric label enhancement. Background Art

[0002] Person re-identification (ReID) technology, as a core method for cross-camera object tracking, has significant application value in the field of intelligent security. While current mainstream methods perform well in supervised learning scenarios, they face significant limitations in domain generalization (DG) scenarios. Models experience a sharp decline in recognition performance in unknown surveillance scenarios due to differences in domain distribution. Although the Transformer architecture has brought breakthroughs in computer vision thanks to its powerful cross-domain generalization capabilities, existing Transformer-based DG-ReID methods are still limited by three major technical bottlenecks: First, the global shape features (cross-domain invariance) and local texture noise (domain sensitivity) contained in pedestrian edge information are difficult to effectively separate under distribution shift, and traditional contour extraction methods are unable to filter out domain-related interference. Second, the design of key links such as asymmetric learning mechanisms in data augmentation strategies and gradient propagation paths has not been deeply integrated with the semantic decoupling requirements of ReID, limiting the enhancement of the discriminability of positive sample pairs. Finally, mainstream local feature modeling methods rely on fixed partitioning strategies, lack robustness in occluded scenes, and lack adaptive interaction mechanisms between global and local features. These shortcomings seriously restrict the accuracy of pedestrian recognition in complex cross-domain environments, and breakthroughs are urgently needed through semantically aware tag enhancement and dynamic feature alignment mechanisms. Summary of the Invention

[0003] In view of the above problems, the present invention provides a cross-domain pedestrian re-identification method, electronic device and storage medium based on semantic perception and asymmetric label enhancement.

[0004] According to a first aspect of the present invention, a cross-domain person re-identification method based on semantic perception and asymmetric label enhancement is provided, comprising:

[0005] The trained cross-domain person re-identification model is used to extract the global shape features and local texture features of the target pedestrian from the image to be processed. The trained cross-domain person re-identification model is trained based on a semantic perception and asymmetric labeling enhancement training framework.

[0006] The trained cross-domain person re-identification model is used to process the global shape features to obtain a global query vector, and the local texture features are processed to obtain a local key vector and a local value vector.

[0007] The trained cross-domain person re-identification model is used to perform operations on the global query vector, local key vector and local value vector based on the cross-domain aligned attention mechanism to obtain cross-attention features, and the cross-attention features are processed to obtain the re-identification results of the target pedestrian.

[0008] According to an embodiment of the present invention, the cross-domain person re-identification model trained above is based on a semantic perception and asymmetric labeling enhanced training framework and includes:

[0009] The cross-domain person re-identification model is used to perform segmentation, position embedding encoding, strided convolution, and bandpass filtering on the image samples in sequence to obtain multi-scale fusion features that represent the ability to perceive pedestrian contours.

[0010] The cross-domain person re-identification model is used to calculate the saliency scores of image tokens in the multi-scale fusion features. Based on the saliency scores, the image tokens are screened and binary templates are generated in each training round.

[0011] Based on binary templates, a cross-domain person re-identification model is used to asymmetrically enhance image samples using hybrid and combined enhancement modes, and the resulting positive and negative sample pairs are enhanced for contour consistency based on similarity.

[0012] The cross-domain person re-identification model is used to perform operations based on the cross-domain aligned attention mechanism on the global shape feature samples and local texture feature samples in the image samples, and the obtained cross-attention feature samples are processed to obtain the cross-domain person re-identification prediction results;

[0013] The preset loss function is used to supervise the iterative training process of the cross-domain pedestrian re-identification model, and the parameters of the cross-domain pedestrian re-identification model are iteratively updated based on the loss value to obtain the trained cross-domain pedestrian re-identification model.

[0014] According to an embodiment of the present invention, the above-mentioned cross-domain pedestrian re-identification model is used to sequentially perform segmentation operations, position embedding encoding operations, strided convolution operations, and bandpass filtering operations on image samples to obtain multi-scale fusion features that characterize the pedestrian contour perception capability, including:

[0015] The image sample is divided into multiple non-overlapping image tokens, and the multiple non-overlapping image tokens are connected with a learnable category token and then position embedding encoding is performed to obtain a sequence embedding feature map;

[0016] Perform feature reconstruction on the sequence embedding feature map to obtain the Fourier transform result of the sequence embedding feature map, and perform stride convolution processing on the Fourier transform result of the sequence embedding feature map to obtain multiple contour feature maps with different scales;

[0017] Calculating two-dimensional Fourier spectra of the plurality of contour feature maps and performing bandpass filtering to obtain a plurality of filtered contour feature maps, and reconstructing the amplitude spectra and original phases of the plurality of filtered contour feature maps to obtain a plurality of reconstructed contour feature maps;

[0018] Based on learnable weights, multiple reconstructed contour feature maps are weightedly fused to obtain a multi-scale fused contour feature map that characterizes the pedestrian contour perception ability.

[0019] According to an embodiment of the present invention, the above-mentioned calculation of the significance score of the image token in the multi-scale fusion feature using the cross-domain pedestrian re-identification model includes:

[0020] The saliency score of each image token in the multi-scale fusion feature is obtained by calculating the L2 norm of the channel aggregation, where the saliency score represents the importance of each image token in the multi-scale fusion feature.

[0021] According to an embodiment of the present invention, the screening of image tokens and generation of binary templates based on the saliency score in each training round includes:

[0022] Dynamically adjust the dynamic percentage corresponding to the current training round using the significance score and the current training round;

[0023] The image tokens are sorted in descending order according to the significance scores, and the descending sorted image tokens are filtered according to the dynamic percentage. According to the screening process of the image tokens, a preset generation formula is used to generate a binary template.

[0024] According to an embodiment of the present invention, the asymmetric enhancement of image samples using a cross-domain person re-identification model based on a binary template through a hybrid enhancement mode and a combined enhancement mode includes:

[0025] The intermediate feature activation value range binary template calculated from the image sample is operated to obtain the pedestrian key mark;

[0026] In the hybrid enhancement mode, linear interpolation is performed between pedestrian key markers and global shape feature samples in image samples based on hyperparameters to obtain label hybrid enhanced image samples;

[0027] In the combination enhancement mode, the binary template, pedestrian key mark and the image sample randomly selected in the current training round are operated to obtain the image sample with label combination enhancement;

[0028] The image samples with mixed label enhancement and the image samples with combined label enhancement are classified, and the image samples with the same label are classified as positive samples, and the image samples with different labels are classified as negative samples.

[0029] According to an embodiment of the present invention, the above-mentioned performing similarity-based contour consistency enhancement on the obtained positive and negative sample pairs includes:

[0030] Based on the contrast enhancement contour consistency loss function, the similarity between positive samples in the positive and negative sample pairs is maximized, and the similarity between negative samples in the positive and negative sample pairs is minimized.

[0031] According to an embodiment of the present invention, the above-mentioned cross-domain person re-identification model is used to perform operations based on the cross-domain alignment attention mechanism on the global shape feature samples and local texture feature samples in the image samples, including:

[0032] Performing size division and strip flattening on the local texture feature samples to obtain flattened local texture feature samples;

[0033] Perform layer normalization and linear mapping operations on the global shape feature samples to obtain global query vector samples;

[0034] The flattened local texture feature samples are subjected to layer normalization and multiple linear mapping operations to obtain local value vector samples and local key vector samples;

[0035] By calculating the similarity between the global query vector sample and the local key vector sample and performing activation processing on the similarity, a normalized attention score matrix is ​​obtained;

[0036] The normalized attention score matrix is ​​operated with the local value vector sample to obtain the cross attention feature sample.

[0037] According to an embodiment of the present invention, the above-mentioned processing of the obtained cross-attention feature samples to obtain the cross-domain pedestrian re-identification prediction result includes:

[0038] Perform a residual connection between the cross-attention feature sample and the global shape feature sample through a linear mapping operation to obtain an intermediate cross-attention feature sample;

[0039] The intermediate cross-attention feature samples are subjected to layer normalization, multiple linear mappings, activation processing and residual connection operations to obtain the cross-domain pedestrian re-identification prediction results.

[0040] According to an embodiment of the present invention, the preset loss function includes a cross entropy loss function and a triplet loss function.

[0041] A second aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0042] The third aspect of the present invention further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor.

[0043] The cross-domain pedestrian re-identification method based on semantic perception and asymmetric label enhancement provided by the present invention uses a training framework based on semantic perception and asymmetric label enhancement to obtain a trained cross-domain pedestrian re-identification model. The trained cross-domain pedestrian re-identification model effectively enhances the model's perception of pedestrian contours, solves the problem of difficulty in separating global shape features and local texture noise caused by differences between domains in traditional methods, and improves the accuracy of cross-domain pedestrian re-identification; at the same time, the above-mentioned training framework enhances the robustness of the trained cross-domain pedestrian re-identification model in complex cross-domain environments; in addition, the trained cross-domain pedestrian re-identification model fully combines fine-grained local information and global context information through the adaptive interaction between global features and local features, overcomes the problem of insufficient robustness of the fixed partitioning strategy of local feature modeling in traditional methods to occlusion scenes, realizes the effective fusion of global and local features, and thus improves the recognition accuracy in complex cross-domain scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0045] Figure 1 is a flowchart of a cross-domain person re-identification method based on semantic perception and asymmetric label enhancement according to an embodiment of the present invention;

[0046] Figure 2 2 is a pseudo code diagram of a cross-domain person re-identification model trained based on a semantic-aware asymmetric labeling enhancement training framework according to an embodiment of the present invention;

[0047] Figure 3 is a schematic diagram of a training framework based on semantic perception and asymmetric labeling enhancement according to an embodiment of the present invention;

[0048] Figure 4 is a schematic diagram of a training framework based on semantic perception and asymmetric labeling enhancement according to another embodiment of the present invention;

[0049] Figure 5 is a framework diagram of a pedestrian key contour marker selection module and an asymmetric marker enhancement module according to an embodiment of the present invention;

[0050] Figure 6 2. It is a framework diagram of a global-local alignment attention mechanism according to an embodiment of the present invention;

[0051] Figure 7is a block diagram of an electronic device suitable for implementing a cross-domain pedestrian re-identification method based on semantic perception asymmetric mark enhancement according to an embodiment of the present application. DETAILED DESCRIPTION

[0052] Embodiments of the present application will be described below with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present application. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of embodiments of the present application. However, it will be apparent to one skilled in the art that one or more embodiments can be practiced without these specific details. In other instances, well-known structures and techniques have been omitted in order to avoid unnecessarily complicating the present application.

[0053] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the present application. As used herein, the terms "comprises", "comprising", and the like are intended to mean that the features, steps, operations and / or components listed are present, but does not preclude the presence or addition of one or more other features, steps, operations, components, and / or the like.

[0054] All terms used herein, including technical and scientific terms, have the meanings commonly understood by one of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having meanings consistent with the context of the specification, and should not be interpreted in an idealized or overly formal manner.

[0055] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should be generally interpreted that the meaning of the expression is at least one of the items listed before and after the comma (e.g., "a system having at least one of A, B, and C" should include but not be limited to a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C together, etc.).

[0056] To solve the problems of insufficient semantic separation of pedestrian contours, lack of asymmetric enhancement mechanism, and fixed local feature modeling in the prior art, the present application proposes a cross-domain pedestrian re-identification method based on semantic perception and asymmetric mark enhancement, which aims to significantly improve the generalization ability of the model in unknown monitoring scenes through multi-scale contour perception, dynamic mark enhancement, and adaptive feature alignment mechanism.

[0057] Figure 1 is a flowchart of a cross-domain pedestrian re-identification method based on semantic perception and asymmetric mark enhancement according to an embodiment of the present application.

[0058] As Figure 1 shown, the cross-domain pedestrian re-identification method based on semantic perception and asymmetric mark enhancement includes operation S110 to operation S130.

[0059] In operation S110, the global shape features and local texture features of the target pedestrian are extracted from the image to be processed using the trained cross-domain pedestrian re-identification model, wherein the trained cross-domain pedestrian re-identification model is trained based on a training framework of semantic perception and asymmetric labeling enhancement.

[0060] The above-mentioned global shape features are global features, which reflect the overall features of pedestrians in the image, such as the color of their clothes, movement status, etc.; the above-mentioned local texture features are local features, which reflect the local features of pedestrians in the image, such as eye features, mouth corner features, etc.

[0061] In operation S120 , the trained cross-domain person re-identification model is used to process the global shape features to obtain a global query vector, and the local texture features are processed to obtain a local key vector and a local value vector.

[0062] In operation S130, the trained cross-domain person re-identification model is used to perform operations based on the cross-domain aligned attention mechanism on the global query vector, the local key vector, and the local value vector to obtain cross-attention features, and the cross-attention features are processed to obtain the re-identification result of the target pedestrian.

[0063] The cross-domain pedestrian re-identification method based on semantic perception and asymmetric label enhancement provided by the present invention uses a training framework based on semantic perception and asymmetric label enhancement to obtain a trained cross-domain pedestrian re-identification model. The trained cross-domain pedestrian re-identification model effectively enhances the model's perception of pedestrian contours, solves the problem of difficulty in separating global shape features and local texture noise caused by differences between domains in traditional methods, and improves the accuracy of cross-domain pedestrian re-identification; at the same time, the above-mentioned training framework enhances the robustness of the trained cross-domain pedestrian re-identification model in complex cross-domain environments; in addition, the trained cross-domain pedestrian re-identification model fully combines fine-grained local information and global context information through the adaptive interaction between global features and local features, overcomes the problem of insufficient robustness of the fixed partitioning strategy of local feature modeling in traditional methods to occlusion scenes, realizes the effective fusion of global and local features, and thus improves the recognition accuracy in complex cross-domain scenarios.

[0064] According to an embodiment of the present invention, the cross-domain pedestrian re-identification model trained above is trained based on a training framework of semantic perception and asymmetric labeling enhancement, including: using the cross-domain pedestrian re-identification model to perform segmentation operations, position embedding coding operations, stride convolution operations and bandpass filtering operations on image samples in sequence to obtain multi-scale fusion features that characterize the ability to perceive pedestrian contours; using the cross-domain pedestrian re-identification model to calculate the significance scores of image tokens in the multi-scale fusion features, and based on the significance scores, screening the image tokens in each training round and generating binary templates; based on the binary templates, using the cross-domain pedestrian re-identification model to perform hybrid enhancement The strong mode and combined enhancement mode perform asymmetrical enhancement on the image samples, and perform contour consistency enhancement on the obtained positive and negative sample pairs based on similarity; the cross-domain pedestrian re-identification model is used to perform operations based on the cross-domain aligned attention mechanism on the global shape feature samples and local texture feature samples in the image samples, and the obtained cross-attention feature samples are processed to obtain the cross-domain pedestrian re-identification prediction results; the preset loss function is used to supervise the iterative training process of the cross-domain pedestrian re-identification model, and the parameters of the cross-domain pedestrian re-identification model are iteratively updated based on the loss value to obtain the trained cross-domain pedestrian re-identification model.

[0065] The above-mentioned cross-domain pedestrian re-identification method improved by the present invention utilizes a cross-domain pedestrian re-identification model, which is trained based on a training framework based on semantic perception and asymmetric labeling enhancement. In order to facilitate those skilled in the art to understand the method provided by the present invention, the following is combined with the attached Figure 2 and 3 The process of obtaining a trained cross-domain person re-identification model based on a training framework based on semantic perception and asymmetric labeling enhancement provided by the present invention is further described in detail.

[0066] Figure 2 This is a pseudocode diagram of training a cross-domain person re-identification model based on a training framework based on semantic-aware asymmetric labeling enhancement according to an embodiment of the present invention.

[0067] Figure 3 2 is a schematic diagram of a training framework based on semantic perception and asymmetric labeling enhancement according to an embodiment of the present invention.

[0068] like Figure 2 As shown in the figure, the training framework based on semantic-aware asymmetric label enhancement mainly includes key contour label selection step, asymmetric enhancement step, global-local alignment step and optimization step. Figure 2The person re-identification model shown in the figure is the cross-domain person re-identification model mentioned above. The key contour marker selection step includes image segmentation, Fourier spectrum calculation, bandpass filtering, and feature reconstruction. The asymmetric enhancement step includes a hybrid enhancement branch and a combined enhancement branch. The global-local alignment operation includes local feature partitioning and global-local feature alignment. The optimization operation includes total loss calculation and parameter update.

[0069] like Figure 3 As shown, the present invention provides a cross-domain pedestrian re-identification method based on semantic-aware asymmetric label enhancement, which mainly includes the following steps:

[0070] (1) In the process of selecting key pedestrian contour markers, the input image is first segmented into multiple non-overlapping patches through the patch embedding module, and a learnable category token is concatenated with these image tokens and input into the Transformer encoder for feature extraction. Then, the feature map is decomposed into multiple scales through strided convolution, and a bandpass filter is applied to the Fourier spectrum of each scale to suppress redundant frequencies. Finally, the contour features of different scales are fused to obtain multi-scale fusion features, which enhances the model's ability to perceive pedestrian contours.

[0071] (2) In the asymmetric enhancement strategy, positive sample pairs with large appearance differences are generated through mixed and combined modes to enhance the model's sensitivity to contour information. During the enhancement process, a dynamic percentage adjustment mechanism is used to select the most discriminative key features. At the same time, the contour consistency loss is enhanced by contrast to improve the similarity of positive sample pairs and enhance the ability to distinguish negative samples.

[0072] (3) In the global-local alignment attention mechanism, the expressiveness of features is enhanced by adaptively interacting global and local features. Specifically, the similarity between global and local features is calculated, and the fine-grained local information is effectively integrated into the global features through the cross-attention mechanism.

[0073] (4) During the model training and inference phases, multiple loss functions are used to optimize the model, including traditional loss and contrast-enhanced contour consistency loss. During the training phase, the model parameters are updated by minimizing the total loss, and the trained model is used for person re-identification during the inference phase. Ultimately, accurate person features are generated for similarity calculation, thus achieving cross-domain person re-identification tasks.

[0074] The following is another specific embodiment and combined with the attached Figure 4 The present invention provides asymmetric markup enhancement based on semantic perception

[0075] Figure 4is a schematic diagram of a training framework based on semantic-aware asymmetric token augmentation according to another embodiment of the present application.

[0076] As shown in Figure 4 , the Contour Token Selection (CTS) module first extracts pedestrian contour information by multi-scale Fourier analysis and dynamic token filtering. The Asymmetric Token Enhancement (ATE) module then creates pairs of positive and negative samples with different appearances but consistent semantics: the mixed branch performs style perturbation on contour tokens, while the combined branch replaces non-contour regions with background tokens from auxiliary samples. Finally, the Global-Local Alignment Attention (GL-AA) module captures fine-grained pedestrian features through cross-attention between global and local representations, where, represents the 2nd positive sample in the pair of positive and negative samples, represents the 2nd negative sample in the pair of positive and negative samples, represents the 1st anchor point, represents the distance between the positive and negative samples, represents the distance between the positive and negative samples.

[0077] According to an embodiment of the present application, the above-mentioned image sample is sequentially segmented, position embedding encoded, stride convolution operated, and band-pass filtered using the cross-domain pedestrian re-identification model to obtain the multi-scale fusion feature representing the pedestrian contour perception capability, including: segmenting the image sample into a plurality of non-overlapping image tokens, connecting the plurality of non-overlapping image tokens with a learnable class token, and then performing position embedding encoding to obtain a sequence embedding feature map; performing feature reconstruction on the sequence embedding feature map to obtain a Fourier transform result of the sequence embedding feature map, and performing stride convolution processing on the Fourier transform result of the sequence embedding feature map to obtain a plurality of contour feature maps with different scales; calculating two-dimensional Fourier spectra of the plurality of contour feature maps and performing band-pass filtering processing to obtain a plurality of filtered contour feature maps, and reconstructing the amplitude spectrum and the original phase of the plurality of filtered contour feature maps to obtain a plurality of reconstructed contour feature maps; based on a learnable weight, the plurality of reconstructed contour feature maps are weighted and fused to obtain a multi-scale fusion contour feature map representing the pedestrian contour perception capability.

[0078] Figure 5 is a framework diagram of a pedestrian key contour token selection module and an asymmetric token augmentation module according to an embodiment of the present application, wherein, Figure 5 (a) in (a) represents a pedestrian key contour token selection module, Figure 5 (b) in (b) represents an asymmetric token augmentation module.

[0079] The following is a detailed description of the embodiments and the attached Figure 5 The specific operation of the pedestrian key contour mark selection module provided by the present invention is described in detail.

[0080] The pedestrian key contour mark selection module mainly completes the pedestrian key contour representation modeling operation and dynamic percentage mark selection. Among them, the pedestrian key contour representation modeling operation mainly performs Fast Fourier Transform (FFT), Inverse Fast Fourier Transform (IFFT), low-frequency filtering, application coding, and activation value calculation, such as Figure 5 shown.

[0081] During the pedestrian key contour representation modeling operation: the present invention uses a patch embedding module in a cross-domain pedestrian re-identification model to embed the input image Divide non-overlapping patches, represents the real number space (same below). Each patch is regarded as an "image token" , and a learnable “category token” Connected to these image tokens, it is input into the Transformer encoder for position embedding encoding, as shown in formula (1):

[0082] (1),

[0083] in represents the input sequence embedding (i.e., sequence embedding feature map, the same below), represents position embedding, is the channel dimension, is a natural number greater than 1.

[0084] The input sequence is then reconstructed into an embedding , where H and W are equal to , Represents the original resolution of the feature map. Then, its Fourier transform is obtained.

[0085] In actual application scenarios, the resolutions of different cameras are different. In order to enhance the model’s ability to perceive multi-scale pedestrian contours, the present invention reconstructs the obtained feature map. Decomposed into three scales by stride convolution: the original resolution of the feature map , 2x downsampling and 4x downsampling For each scale , calculate its two-dimensional Fourier spectrum, as shown in formula (2):

[0086] (2),

[0087] in, Corresponding to the coordinates of a pixel in the feature map, Corresponding to a channel in the feature map, Representation and scale The corresponding two-dimensional Fourier spectrum is, Representation and scale The corresponding feature maps, Representation and scale The corresponding height resolution, Representation and scale The corresponding width resolution.

[0088] The frequency components are decomposed into amplitude components and phase components, where the amplitude spectrum contains low-level statistical information (such as style information) and the phase spectrum encodes high-level semantics (such as the outline and shape of pedestrians). As the low-frequency components are moved to the center of the amplitude spectrum, the present invention is directed to feature maps using different scales s, using different (a binary mask with a zero value in the center area) to control the scale at which low-frequency components are discarded. Then, the present invention uses a specific bandpass filter To suppress redundant frequencies. Specifically:

[0089] 1. For the original resolution, a narrowband high-pass filter is used to preserve the main contours.

[0090] 2. For 2x downsampling, a medium bandpass filter is used to capture medium-grained contours.

[0091] 3. For 4x downsampling, a wideband pass filter is used to extract fine contour details.

[0092] The filtered amplitude spectrum is combined with the original phase to reconstruct the spectrum, as shown in formula (3):

[0093] (3),

[0094] in, represents the inverse Fourier fast transform, represents an element-wise multiplication operation, represents the phase information of the frequency of the two-dimensional Fourier spectrum corresponding to the scale 𝑠, Indicates converting the original phase information into complex form to preserve the structural information.

[0095] Multi-scale contour features via learnable weights Fusion is performed as shown in formula (4):

[0096] (4),

[0097] in, Indicates activation operation. represents the normalization operation, Represents an image resizing operation.

[0098] Finally, the multi-scale contour features ,This feature representation not only retains the global context information, but also integrates the multi-scale local contour features, which can provide richer channel information for subsequent contour feature selection.

[0099] According to an embodiment of the present invention, the above-mentioned calculation of the significance score of the image token in the multi-scale fusion feature using the cross-domain pedestrian re-identification model includes: obtaining the significance score of each image token in the multi-scale fusion feature by calculating the L2 norm of the channel aggregation, wherein the significance score represents the importance of each image token in the multi-scale fusion feature.

[0100] According to an embodiment of the present invention, the above-mentioned screening of image tokens based on the significance score in each training round and generation of binary templates includes: dynamically adjusting the dynamic percentage corresponding to the current training round using the significance score and the current training round; sorting the image tokens in descending order according to the significance score, and screening the descending sorted image tokens according to the dynamic percentage, and generating a binary template based on the screening process of the image tokens using a preset generation formula.

[0101] The above embodiment involves dynamic percentage mark selection, and the above embodiment will be further described in detail below through specific implementation methods.

[0102] During the dynamic percentage marker selection process, this paper proposes an innovative dynamic percentage marker selection method to accurately select the visual markers that best represent key semantic contours in pedestrian images. The core of this method is to directly apply the fused spatial feature map (which incorporates global contextual information and multi-scale local contour features) output by the pedestrian key contour representation modeling operation, and dynamically adjust the selection percentage based on the training phase. This ensures model robustness while gradually focusing on the most discriminative key features.

[0103] Specifically, based on the multi-scale fusion feature map To calculate the area corresponding to each mark (i.e. image token) (No. area) (e.g. a The saliency score of the patch The saliency score quantifies the importance of each tag in the multi-scale fused feature map by calculating the L2 norm of the channel aggregation, as shown in formula (5):

[0104] (5),

[0105] in represents the number of channels of the feature map, and Indicates a mark In the channel The calculation of the significance score provides a basis for subsequent marker selection.

[0106] In order to achieve dynamic screening of key features, the present invention further proposes a dynamic percentage adjustment mechanism. , dynamically adjust the percentage of marker selection , thus selecting different numbers of markers at different training stages. The calculation of the dynamic percentage is shown in formula (6):

[0107] (6),

[0108] in, Is the minimum selection percentage, used to limit the minimum percentage value, Indicates the maximum selection percentage, which is used to limit the maximum value of the percentage; Indicates the current number of training rounds, Indicates the maximum number of training rounds. In the initial stage of training, a larger percentage is used to include more feature information, which helps the model learn rich semantic features in the early stages. As training progresses, the percentage gradually decreases, forcing the model to focus on the most discriminative features. This dynamic adjustment strategy not only improves the model's ability to focus on key features, but also enhances the model's adaptability at different training stages. In actual application, Set to 0.6, Set to 0.2.

[0109] At each stage of training, we first calculate the significance score and dynamic percentages Then sort the significance scores of all the tags and select the top ones with the highest significance scores. Percentage mark. Specific binary template The generation process is as follows:

[0110] 1. Sorting: by significance score Sort all tags in descending order.

[0111] 2. Select markers: select the top markers with the highest significance score after sorting. This process generates a binary template through formula (7) :

[0112] (7),

[0113] in, Represents the total significance scores from all Select the top ranking .

[0114] Percentage mark , so that the value of these tags in the template is 1 and the rest are 0.

[0115] In this way, the model can gradually screen out the most discriminative key features based on the dynamically adjusted percentage. In each training stage, as the percentage gradually decreases, the model will gradually focus on the most discriminative markers, thereby improving its ability to extract cross-domain invariant features.

[0116] According to an embodiment of the present invention, the above-mentioned asymmetric enhancement of image samples based on binary templates and the use of a cross-domain pedestrian re-identification model through a hybrid enhancement mode and a combined enhancement mode includes: operating the intermediate feature activation value range binary template calculated from the image sample to obtain the pedestrian key marker; in the hybrid enhancement mode, linear interpolation is performed between the pedestrian key marker and the global shape feature sample in the image sample based on the hyperparameter to obtain the label hybrid enhanced image sample; in the combined enhancement mode, the binary template, the pedestrian key marker and the image sample randomly selected in the current training round are operated to obtain the label combination enhanced image sample; the label hybrid enhanced image samples and the label combination enhanced image samples are classified, and the image samples with the same labels are classified as positive samples, and the image samples with different labels are classified as negative samples.

[0117] The asymmetric tag enhancement module is divided into two branches: hybrid enhancement branch and combined enhancement branch, such as Figure 5 The upper and lower branches are shown.

[0118] During the design of the asymmetric enhancement branch, this paper constructs two asymmetric branches using two enhancement modes—blending and combining—to create positive sample pairs with significant appearance differences, thereby improving the semantic representation of people. While preserving the core semantics of pedestrians, these two enhancement modes process samples with the primary goal of enriching and diversifying the semantic representation of each sample by generating different perspectives and details.

[0119] Specifically, for the input batch middle( Represents the total number of image samples), a binary mask needs to be generated based on the activation value of the intermediate feature calculated in the previous step and the dynamic percentage , retain the previous The markers related to the contour are finally obtained according to the binary mask to obtain the required contour-focused pedestrian key marker representation , as shown in formula (8):

[0120] (8).

[0121] Then randomly select samples with the same ID in the same batch Use randomly selected Make enhancements.

[0122] In the hybrid mode, the present invention performs linear interpolation between the contour and the global features, as shown in formula (9):

[0123] (9),

[0124] in, is from the Beta distribution The random weights sampled from are used to balance the overall enhancement ratio, where are two hyperparameters. Style noise and pedestrian silhouette noise are introduced into the silhouette-related markers, thereby encouraging the model to learn the global semantic features of pedestrians from the silhouette representation.

[0125] In the combined mode, as shown in formula (10):

[0126] (10),

[0127] in, It is a key pedestrian marker that retains the contour information. are randomly selected samples from the same batch. Mask Controls which parts of the markup will be preserved ,and Indicates selecting the part that does not contain contour information so that information into these locations.

[0128] According to an embodiment of the present invention, the above-mentioned similarity-based contour consistency enhancement of the obtained positive and negative sample pairs includes: maximizing the similarity between the positive samples in the positive and negative sample pairs based on the contrast enhancement contour consistency loss function and minimizing the similarity between the negative samples in the positive and negative sample pairs.

[0129] The above-mentioned embodiments involve a contrast-enhanced contour consistency loss. Building on the asymmetric enhancement strategy, this invention introduces a contrast-enhanced contour consistency loss to further improve the model's sensitivity and generalization capabilities to pedestrian contour information. The core concept of this loss function is to construct a contrast loss between pairs of generated enhanced samples, maximizing the similarity between positive samples and increasing the distance between negative samples, thereby strengthening the model's ability to learn shape and contour features.

[0130] Specifically, the enhanced samples and From the hybrid mode and the combined mode respectively, the contour focus embeddings of these two enhanced samples extracted by the Transformer network are and , which represent the semantic information of pedestrians under different perspectives and details. In order to enhance the model's sensitivity to contour information, the CEC loss aims to achieve consistency learning by maximizing the similarity between positive sample pairs and minimizing the similarity between negative samples.

[0131] The definition of the CEC loss function is shown in formula (11):

[0132] (11),

[0133] in, represents the cosine similarity, is the temperature coefficient, is the set of negative samples, The goal of this loss is to keep the embedding representation of the same pedestrian consistent under different augmented perspectives, while pulling apart the embeddings of samples with different identities, thereby improving the model's ability to distinguish pedestrian features.

[0134] The first and second terms in the loss are maximized in a symmetrical way. and Through this contrastive learning strategy, the model can not only capture the consistency across perspectives, but also effectively push negative samples away, thereby enhancing the robustness and generalization ability of the model.

[0135] According to the embodiment of the present application, the operation of the global shape feature sample and the local texture feature sample in the image sample based on the cross-domain alignment attention mechanism by using the cross-domain pedestrian re-identification model comprises: performing size division processing and strip flattening processing on the local texture feature sample to obtain the flattened local texture feature sample; performing layer normalization operation and linear mapping operation on the global shape feature sample to obtain the global query vector sample; performing layer normalization processing and multiple linear mapping operations on the flattened local texture feature sample to obtain the local value vector sample and the local key vector sample; calculating the similarity of the global query vector sample and the local key vector sample, and performing activation processing on the similarity to obtain the normalized attention score matrix; and performing operation on the normalized attention score matrix and the local value vector sample to obtain the cross attention feature sample.

[0136] Figure 6 is a global-local alignment attention mechanism framework diagram according to the embodiment of the present application.

[0137] Based on the extracted global shape feature sample (global feature sample) and local texture feature sample (local feature sample), a global-local alignment attention mechanism (GL-AA) is used to realize the adaptive interaction between the global shape feature sample and the local texture feature sample, as shown in Figure 6 , wherein Attention map represents a tool for visualizing attention distribution, layerNorm represents layer normalization, softmax represents an activation function, Linear represents linear mapping, and MLP represents a multi-layer perception machine. The input global feature sample and the local feature sample are processed. The local feature sample is divided into 4 strips with a size of in the horizontal direction, wherein and represent the height and width of the input image, respectively. Each strip is flattened to obtain the local feature sample representation .

[0138] To realize the interaction between the global feature sample and the local feature sample, after layer normalization (LayerNorm) processing of the global feature sample , the local query vector sample is obtained through a linear layer , as shown in equation (12):

[0139] (12).

[0140] For the local feature sample , first, layer normalization (LayerNorm, LN) processing is performed, and then a linear layer Get a sample of the local key vector , as shown in formula (13):

[0141] (13).

[0142] Then perform layer normalization (LayerNorm) again and pass through the linear layer Get local value vector sample , as shown in formula (14):

[0143] (14).

[0144] By calculating the global query vector sample Sample with local key vector The similarity between them is calculated by using the softmax function to obtain the normalized attention score matrix, as shown in formula (15):

[0145] (15),

[0146] in It is a feature The channel dimension.

[0147] The attention score matrix With local value vector sample Multiply together to get the final cross-attention feature sample output , as shown in formula (16):

[0148] (16).

[0149] This process dynamically adjusts the attention paid to each region according to the similarity between global and local features, thereby enhancing the interaction between global and local features and effectively integrating fine-grained local information into global features.

[0150] According to an embodiment of the present invention, the above-mentioned processing of the obtained cross-attention feature samples to obtain the cross-domain pedestrian re-identification prediction result includes: performing a residual connection between the cross-attention feature samples and the global shape feature samples through a linear mapping operation to obtain an intermediate cross-attention feature sample; performing layer normalization processing, multiple linear mapping, activation processing and residual connection operations on the intermediate cross-attention feature samples to obtain a cross-domain pedestrian re-identification prediction result.

[0151] Then, the cross attention feature samples are output Through the linear layer , and the global features of the input Perform residual connection to generate intermediate cross-attention feature samples , as shown in formula (17):

[0152] (17).

[0153] Finally, the intermediate cross-attention feature samples After passing through the layer normalization (LayerNorm, LN) layer, it passes through a multi-layer perceptron (MLP) consisting of two linear layers and one activation layer. The processed results are connected to the Combined to form the final output of GL-AA , as shown in formula (18):

[0154] (18).

[0155] In the entire GL-AA mechanism, With four During the interaction between modules, the parameters in all modules are shared to improve computational efficiency and maintain feature consistency.

[0156] According to an embodiment of the present invention, the preset loss function includes a cross entropy loss function and a triplet loss function.

[0157] During the training process, multiple loss functions are used to guide learning. The total loss function is shown in formula (19):

[0158] (19),

[0159] in, It stands for Contrast Enhanced Contour Consistency Loss Function, which aims to further improve the robustness of the model in cross-modal tasks. is a parameter used to balance the contrast enhancement contour consistency loss and the general loss. is the traditional ID loss applied to each feature and is defined as shown in Equation (20):

[0160] (20),

[0161] in, , , , , , Represents different loss functions commonly used in ReID, which are the sum of traditional cross-entropy loss and triplet loss:

[0162] Among them, the cross entropy loss function As shown in formula (21):

[0163] (twenty one),

[0164] in, is the one-hot encoding of the true label, is the probability distribution of the model prediction. In multi-classification tasks, cross entropy loss can effectively measure the accuracy and confidence of the model prediction.

[0165] Among them, the triple loss function As shown in formula (22):

[0166] (twenty two),

[0167] Among them, for a triple ,in is the anchor sample, is a positive sample (belongs to the same category as the anchor point), are negative samples (belonging to different categories than the anchor points). and are the distances between the anchor point and the positive sample, and between the anchor point and the negative sample, respectively. Is a positive constant called margin. By minimizing the triplet loss, the model is able to learn more discriminative feature representations.

[0168] These losses are applied to the above features , , , as well as and ,in and They correspond to the different outputs of the two asymmetric branches of the GL-AA module. Represents the number of local parts obtained by feature partitioning.

[0169] In the inference phase, no feature enhancement is performed and only original features are used for inference. , , The connection features will be used as the final features for subsequent similarity calculations.

[0170] In the specific implementation, DeiT-small pre-trained on ImageNet-21k is used as the backbone network, and the drop_path rate is set to 0.1. During the training process, each batch contains 32 identities, and each identity has 2 images. The present invention uses the Adam optimizer with an initial learning rate of 0.000175 and a weight decay of 0.0005. The model is trained for a total of 80 epochs, and the learning rate increases linearly to 0.1 within the first 10 epochs, then decays to 0.1 in the 20th epoch, and then further decays to 0.01 in the 50th epoch. All input images are resized to 224×224, and the following data augmentation strategies are applied during training: random horizontal flipping, random padding, and random erasure, with an erasure probability of 0.3; in addition (Balanced regular loss and contrast-enhanced contour consistency loss) is set to 0.5.

[0171] Compared with the existing technology, the beneficial effects of the present invention are as follows: (1) Through the pedestrian key contour marker selection module, multi-scale feature fusion and Fourier transform are used to effectively enhance the model's perception of pedestrian contours, solve the problem of difficulty in separating global shape features and local texture noise caused by differences between domains in traditional methods, and improve the accuracy of cross-domain pedestrian re-identification; (2) A strategy based on semantic-aware asymmetric marker enhancement is proposed, which generates positive sample pairs with large appearance differences through hybrid and combined modes, and combines with a dynamic percentage adjustment mechanism to effectively enhance the discriminability of positive samples, and improves the discrimination ability of negative samples through contrast-enhanced contour consistency loss (CEC), further enhancing the robustness of the model in complex cross-domain environments; (3) In the global-local alignment attention mechanism, through the adaptive interaction between global features and local features, fine-grained local information and global contextual information are fully combined, overcoming the problem of insufficient robustness of the fixed partitioning strategy of local feature modeling in traditional methods to occlusion scenes, realizing the effective fusion of global and local features, and thus improving the recognition accuracy in complex cross-domain scenes.

[0172] Figure 7 4 is a block diagram of an electronic device suitable for implementing a cross-domain person re-identification method based on semantic-aware asymmetric label enhancement according to an embodiment of the present invention.

[0173] like Figure 7As shown, an electronic device 700 according to an embodiment of the present invention includes a processor 701, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 702 or programs loaded from a storage unit 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or related chipsets and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0174] Various programs and data required for the operation of the electronic device 700 are stored in the RAM 703. The processor 701, ROM 702, and RAM 703 are connected to each other via a bus 704. The processor 701 performs various operations according to the method flow of the embodiment of the present invention by executing the programs in the ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than the ROM 702 and RAM 703. The processor 701 may also perform various operations according to the method flow of the embodiment of the present invention by executing the programs stored in the one or more memories.

[0175] According to an embodiment of the present invention, electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to bus 704. Electronic device 700 may also include one or more of the following components connected to I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 708 including a hard disk; and a communication section 709 including a network interface card such as a LAN card or modem. Communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to I / O interface 705 as needed. Removable media 711, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 710 as needed, so that computer programs read from the removable media can be installed into storage section 708 as needed.

[0176] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.

[0177] According to an embodiment of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present invention, a computer-readable storage medium may include the ROM 702 and / or RAM 703 described above, and / or one or more memories other than ROM 702 and RAM 703.

[0178] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0179] It will be understood by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention may be combined and / or coupled in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or couplings fall within the scope of the present invention.

[0180] The above describes embodiments of the present invention. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.

Claims

1. A cross-domain person re-identification method based on semantic perception and asymmetric label enhancement, characterized by: The method comprises: Extracting global shape features and local texture features of a target pedestrian from an image to be processed using a trained cross-domain person re-identification model, wherein the trained cross-domain person re-identification model is trained based on a semantic perception and asymmetric labeling enhancement training framework; Using the trained cross-domain person re-identification model, the global shape features are processed to obtain a global query vector, and the local texture features are processed to obtain a local key vector and a local value vector; Using the trained cross-domain person re-identification model, the global query vector, the local key vector, and the local value vector are operated based on the cross-domain aligned attention mechanism to obtain a cross-attention feature, and the cross-attention feature is processed to obtain a re-identification result of the target person; The trained cross-domain person re-identification model is based on a semantic perception and asymmetric labeling enhanced training framework and includes: The cross-domain person re-identification model is used to perform segmentation, position embedding encoding, strided convolution, and bandpass filtering on the image samples in sequence to obtain multi-scale fusion features that represent the ability to perceive pedestrian contours. Calculating the significance scores of the image tokens in the multi-scale fusion features using the cross-domain person re-identification model, and screening the image tokens in each training round based on the significance scores and generating binary templates; Based on the binary template, the cross-domain person re-identification model is used to asymmetrically enhance the image sample through a hybrid enhancement mode and a combined enhancement mode, and the obtained positive and negative sample pairs are enhanced in contour consistency based on similarity; Using the cross-domain person re-identification model, the global shape feature samples and the local texture feature samples in the image samples are operated based on the cross-domain aligned attention mechanism, and the obtained cross-attention feature samples are processed to obtain a cross-domain person re-identification prediction result; The iterative training process of the cross-domain pedestrian re-identification model is supervised by using a preset loss function, and the parameters of the cross-domain pedestrian re-identification model are iteratively updated based on the loss value to obtain the trained cross-domain pedestrian re-identification model.

2. The method according to claim 1, characterized in that The cross-domain person re-identification model is used to perform segmentation, position embedding encoding, strided convolution, and bandpass filtering on the image samples in sequence. The multi-scale fusion features that characterize the pedestrian contour perception ability are obtained, including: Segmenting an image sample into multiple non-overlapping image tokens, concatenating the multiple non-overlapping image tokens with a learnable category token, and performing position embedding encoding to obtain a sequence embedding feature map; Performing feature reconstruction on the sequence embedding feature map to obtain a Fourier transform result of the sequence embedding feature map, and performing stride convolution processing on the Fourier transform result of the sequence embedding feature map to obtain a plurality of contour feature maps with different scales; Calculating two-dimensional Fourier spectra of the plurality of contour feature maps and performing bandpass filtering to obtain a plurality of filtered contour feature maps, and reconstructing the amplitude spectra and original phases of the plurality of filtered contour feature maps to obtain a plurality of reconstructed contour feature maps; Based on learnable weights, multiple reconstructed contour feature maps are weightedly fused to obtain a multi-scale fused contour feature map that characterizes the pedestrian contour perception capability.

3. The method according to claim 1, characterized in that Calculating the significance score of the image token in the multi-scale fusion feature using the cross-domain person re-identification model includes: A significance score of each image token in the multi-scale fusion feature is obtained by calculating the L2 norm of channel aggregation, wherein the significance score represents the importance of each image token in the multi-scale fusion feature.

4. The method according to claim 1, wherein Based on the saliency score, screening the image tokens and generating a binary template in each training round includes: Dynamically adjusting a dynamic percentage corresponding to the current training round using the significance score and the current training round; The image tokens are sorted in descending order according to the significance scores, and the descending sorted image tokens are screened according to the dynamic percentages. According to the screening process of the image tokens, the binary template is generated using a preset generation formula.

5. The method according to claim 1, wherein: Based on the binary template, using the cross-domain person re-identification model to asymmetrically enhance the image sample through a hybrid enhancement mode and a combined enhancement mode includes: The intermediate feature activation value calculated from the image sample is operated on the binary template to obtain a pedestrian key marker; In the hybrid enhancement mode, linear interpolation is performed between the pedestrian key marker and the global shape feature sample in the image sample based on the hyperparameter to obtain a label hybrid enhanced image sample; In the combination enhancement mode, the binary template, the pedestrian key mark and the image sample randomly selected in the current training round are operated to obtain the image sample enhanced by the label combination; The image samples enhanced by the mixed label and the image samples enhanced by the combined label are classified, and the image samples with the same label are classified as positive samples, and the image samples with different labels are classified as negative samples.

6. The method according to claim 1, characterized in that The contour consistency enhancement based on similarity of the obtained positive and negative sample pairs includes: Based on the contrast enhancement contour consistency loss function, the similarity between the positive samples in the positive and negative sample pairs is maximized, and the similarity between the negative samples in the positive and negative sample pairs is minimized.

7. The method according to claim 1, characterized in that Using the cross-domain person re-identification model to perform operations based on a cross-domain alignment attention mechanism on the global shape feature samples and the local texture feature samples in the image samples includes: Performing size division and strip flattening on the local texture feature samples to obtain flattened local texture feature samples; Performing layer normalization and linear mapping operations on the global shape feature samples to obtain global query vector samples; Performing layer normalization processing and multiple linear mapping operations on the flattened local texture feature samples to obtain local value vector samples and local key vector samples; By calculating the similarity between the global query vector sample and the local key vector sample and performing activation processing on the similarity, a normalized attention score matrix is ​​obtained; The normalized attention score matrix is ​​operated on the local value vector sample to obtain the cross-attention feature sample.

8. The method according to claim 7, characterized in that The obtained cross-attention feature samples are processed to obtain the cross-domain pedestrian re-identification prediction results including: Performing a residual connection between the cross attention feature sample and the global shape feature sample through a linear mapping operation to obtain an intermediate cross attention feature sample; The intermediate cross-attention feature samples are subjected to layer normalization processing, multiple linear mappings, activation processing and residual connection operations to obtain the cross-domain pedestrian re-identification prediction result.

9. The method according to claim 1, characterized in that The preset loss function includes a cross entropy loss function and a triple loss function.

10. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 9.

11. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Model training method, living body face detection method, device, equipment and medium

    CN116012959A

  • Unsupervised pedestrian re-identification method based on double cross attention mechanism

    CN116152858A