An unsupervised domain adaptation pedestrian re-identification method based on multi-granularity decoupling and dynamic pure memory
By employing multi-granularity decoupling and dynamic pure memory methods, the problems of pseudo-text noise and historical error accumulation in unsupervised adaptive pedestrian re-identification are solved, achieving improved stability and accuracy in cross-domain scenarios, and making it suitable for security and retrieval systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUILIN UNIV OF AEROSPACE TECH
- Filing Date
- 2026-06-17
- Publication Date
- 2026-07-31
AI Technical Summary
Existing unsupervised adaptive pedestrian re-identification methods suffer from problems such as noise introduced by pseudo-text prompts, ignoring differences between multiple granular domains, and the accumulation of historical errors in cross-domain scenarios, leading to a decline in model performance and insufficient stability in the target domain.
We employ a method based on multi-granularity decoupling and dynamic pure memory. This method mitigates macroscopic distribution shifts through a textless visual knowledge adaptation module, suppresses microscopic hardware biases through a camera adversarial decoupling module, and reduces noise accumulation through high-confidence pseudo-label screening and a dynamic pure prototype memory library. We also construct a teacher-student dual-branch network for end-to-end training.
It effectively reduces training noise and error accumulation, improves the stability and retrieval accuracy of the model in cross-domain scenarios, enhances the model's generalization ability and computational efficiency, and is suitable for practical security and retrieval systems.
Smart Images

Figure CN122493494A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision technology, and in particular relates to an unsupervised adaptive person re-identification method based on multi-granularity decoupling and dynamic pure memory. Background Technology
[0002] Pedestrian re-identification aims to extract pedestrian features with identity-distinguishing capabilities from surveillance images or video frames, and to retrieve and match the same pedestrian across images captured by different cameras, in different scenes, or at different times based on these features. With the development of smart security, urban governance, and video structured analysis, pedestrian re-identification technology plays a significant role in applications such as public safety, trajectory analysis, and cross-camera target search.
[0003] Existing pedestrian re-identification methods typically rely on supervised training using large-scale manually labeled identity tags. Due to differences in lighting, background, resolution, camera viewpoint, and imaging style across different surveillance scenarios, models trained in one data domain (source domain) often experience significant performance degradation when directly applied to an unlabeled target domain. To reduce the cost of manual labeling in the target domain, researchers have proposed an unsupervised adaptive pedestrian re-identification method. This method utilizes both labeled samples from the source domain and unlabeled samples from the target domain to jointly train the model, enabling it to transfer identity discrimination capabilities from the source domain to the target domain.
[0004] Existing unsupervised adaptive person re-identification methods typically employ techniques such as clustering pseudo-labels, self-training, contrastive learning, memory updates, domain alignment, or visual-language model-assisted learning for model optimization. However, these methods still suffer from the following problems:
[0005] Relying on pseudo-text hints introduces noise: Some methods rely on pseudo-text hints or learnable text hints for cross-modal semantic alignment, but the target domain usually lacks real text descriptions. Pseudo-text hints are prone to introducing semantic noise and adding extra text encoding overhead.
[0006] Ignoring multi-granularity domain differences: Some methods only perform global domain alignment in a unified feature space, ignoring the multi-granularity characteristics of cross-domain differences, which include both macroscopic distribution offsets between the source and target domains and microscopic hardware deviations caused by different camera devices.
[0007] Historical errors continue to accumulate: Existing methods based on momentum memory or historical prototype updates tend to retain early clustering errors. When the target domain samples are unevenly distributed or there are boundary samples, false label errors will continue to accumulate during training, forming confirmation bias and affecting the model's convergence stability and retrieval accuracy.
[0008] Therefore, there is an urgent need for an unsupervised adaptive pedestrian re-identification method that does not rely on target domain text prompts, can simultaneously suppress macro-domain offset and micro-camera bias, and can reduce the accumulation of false label noise. Summary of the Invention
[0009] To address the shortcomings of existing technologies, this invention provides an unsupervised adaptive pedestrian re-identification method based on multi-granularity decoupling and dynamic pure memory.
[0010] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows:
[0011] An unsupervised adaptive person re-identification method based on multi-granularity decoupling and dynamic pure memory includes the following steps:
[0012] Step S1: Obtain labeled pedestrian images in the source domain and unlabeled pedestrian images in the target domain, construct a pedestrian re-identification network including student and teacher branches, and extract normalized pedestrian image features using a pre-trained visual encoder;
[0013] Step S2: After the pre-trained visual encoder, a textless visual knowledge adaptation module is constructed. The normalized pedestrian image features are adaptively mapped through a lightweight residual adapter to obtain domain-adaptive pedestrian features, so as to alleviate the macroscopic distribution offset between the source domain and the target domain.
[0014] Step S3: Construct a camera adversarial decoupling module based on a gradient inversion layer, use a camera classifier to predict the camera category corresponding to the sample, and suppress camera-related information in the domain adaptive pedestrian features through camera adversarial loss to obtain camera-insensitive identity discrimination features, so as to suppress the micro-hardware bias introduced by different camera devices.
[0015] Step S4: At the beginning of each training round, cluster the identity discrimination features of unlabeled samples in the target domain, calculate the cluster centers, and calculate the sample reliability score based on the similarity between the sample features and the corresponding cluster centers. Filter out low-confidence samples to obtain high-confidence pseudo-labels.
[0016] Step S5: Construct a dynamic pure prototype memory based on the high-confidence pseudo-labels and corresponding sample features, reconstruct the category prototype using a cover-up update method without historical momentum accumulation, and calculate the contrastive learning loss based on the dynamic pure prototype memory.
[0017] Step S6: Construct a joint optimization objective based on the contrastive learning loss and the camera adversarial loss, train the pedestrian re-identification network end-to-end, and use the trained network to extract pedestrian image features in the target domain to complete pedestrian image retrieval and identity matching.
[0018] Further, step S1 includes:
[0019] Obtain a source domain training set and a target domain training set. The source domain training set includes source domain pedestrian images and their corresponding identity labels, and the target domain training set includes target domain pedestrian images but does not include human identity labels. Perform unified preprocessing on the source domain pedestrian images and the target domain pedestrian images. The preprocessing includes at least one of image size normalization, random horizontal flipping, random cropping, random erasing, random grayscale conversion, and pixel normalization.
[0020] Furthermore, the student branch is used to perform backpropagation updates based on the source domain identity label, the target domain pseudo label, the dynamic pure prototype memory, and the camera adversarial loss; the teacher branch is used to extract features of unlabeled samples in the target domain and provide a basis for pseudo label generation, and the parameters of the teacher branch are updated by the parameters of the student branch through an exponential moving average.
[0021] Furthermore, the pre-trained visual encoder is a ViT-B / 16 visual encoder based on the CLIP visual branch. During training, all or part of the parameters of the pre-trained visual encoder are frozen, and the text encoder or text prompt branch is discarded, so that the model can adapt to the target domain using the pre-trained visual semantic prior under the condition of no text.
[0022] Furthermore, the lightweight residual adapter consists of a dimensionality reduction mapping, a nonlinear activation function, and a dimensionality increase mapping. First, a low-dimensional bottleneck transformation is performed on the input features, and then the bottleneck transformation result is used as residual information to perform weighted fusion and L2 normalization with the basic visual features. The lightweight residual adapter satisfies the low-rank constraint that the bottleneck dimension is smaller than the original feature dimension.
[0023] Furthermore, the camera adversarial decoupling module includes a gradient inversion layer and a camera classifier. The gradient inversion layer performs an identity mapping during forward propagation and inverts the gradient of the feature extraction part during backward propagation and multiplies it by a preset coefficient, so that the camera classifier tends to improve the camera category prediction ability, while the feature extraction part tends to generate identity discrimination features that are difficult to distinguish the source of the camera.
[0024] Furthermore, the clustering in step S4 is density clustering or distance-based clustering; the cluster center is calculated for each cluster, and a reliability score is obtained based on the cosine similarity between the target domain sample features and its corresponding cluster center. If the reliability score is lower than a preset threshold, the corresponding sample is removed from the subsequent pseudo-label supervision as a low-confidence sample.
[0025] Furthermore, the dynamic pure prototype memory is used to store the feature prototypes corresponding to each pseudo-identity category in the target domain; in each training round, the feature prototypes of the corresponding categories are directly reconstructed based on the selected high-confidence samples and their reliability weights, and the reconstructed feature prototypes are used to cover the corresponding prototypes in the previous training round, without using the historical momentum accumulation method to update the prototypes.
[0026] Furthermore, the contrastive learning loss calculates the class probability based on the similarity between the sample features and the prototypes of each class in the dynamic pure prototype memory, and is calculated only on the high-confidence sample set, so that low-confidence pseudo-labels and outliers do not participate in the contrastive supervision of the dynamic pure memory.
[0027] Further, step S6 includes: weighted summing of the source domain supervision loss, the target domain dynamic clean memory contrastive learning loss, and the source and target domain camera adversarial losses to obtain a total loss function; updating the student branch based on the total loss function, and updating the teacher branch based on the student branch parameters; during the inference phase, removing or disabling the camera adversarial decoupling module, clustering module, and dynamic clean prototype memory, retaining only the visual encoder and lightweight residual adapter to extract pedestrian features from the query image and candidate images, and outputting identity matching results according to feature similarity.
[0028] Compared with the prior art, the advantages of the present invention are as follows:
[0029] 1. Effectively reduce training noise and error accumulation: By using a high-confidence pseudo-label screening mechanism based on sample reliability and a dynamic pure prototype memory reconstructed by a cover-up update method without historical momentum accumulation, low-quality pseudo-labels can be significantly filtered out, and early clustering errors are prevented from being remembered and amplified during training. This reduces the interference of pseudo-label noise on model training and improves the stability of model training and the final retrieval accuracy.
[0030] 2. Decoupling and Suppression of Multi-Granularity Domain Differences: By introducing a textless visual knowledge adaptation module, the target domain is adapted using the powerful priors of the pre-trained visual model without relying on pseudo-text prompts that may introduce noise, thus mitigating the macroscopic distribution shift between the source and target domains. Simultaneously, a camera adversarial decoupling module actively suppresses microscopic hardware bias information related to the camera in pedestrian features through adversarial learning. This multi-granularity decoupling mechanism collectively improves the consistency and generalization ability of the identity discrimination features learned by the model in cross-domain scenarios.
[0031] 3. Improved Model Efficiency and Practicality: The entire solution is based on a frozen or partially frozen pre-trained visual encoder and uses a lightweight residual adapter for fine-tuning, resulting in high parameter efficiency and stable training. During the inference phase, only the visual encoder and adapter need to be retained, resulting in a simple model structure, low computational overhead, and easy deployment in practical security, retrieval, and other systems. Attached Figure Description
[0032] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is the overall training flowchart of the unsupervised domain adaptive person re-identification method based on multi-granularity decoupling and dynamic pure memory in the embodiments of the present invention;
[0034] Figure 2 This is a diagram of the teacher-student dual-branch training framework in an embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of the structure of the textless visual knowledge adaptation module in an embodiment of the present invention;
[0036] Figure 4 This is a schematic diagram of the camera adversarial decoupling module structure in an embodiment of the present invention;
[0037] Figure 5 This is a schematic diagram illustrating the construction of a dynamic pure prototype memory and pseudo-tag filtering in an embodiment of the present invention.
[0038] Figure 6 This is a graph showing the statistical results of mAP and Rank-1 values on the datasets (a) Market1501 to CUHK03 and (b) Market1501 to MSMT17 in this embodiment of the invention.
[0039] Figure 7 These are image feature distribution maps in this embodiment of the invention, where (a) is the initial model and (b) is the trained model. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] like Figure 1 and Figure 2 As shown in the figure, an unsupervised adaptive pedestrian re-identification method based on multi-granularity decoupling and dynamic pure memory provided by an embodiment of the present invention includes the following steps.
[0042] Step S1: Obtain training data and construct a teacher-student two-branch person re-identification network
[0043] In step S1, labeled pedestrian images in the source domain and unlabeled pedestrian images in the target domain are obtained, a pedestrian re-identification network including student and teacher branches is constructed, and normalized pedestrian image features are extracted using a pre-trained visual encoder.
[0044] Step S101: Obtain the source domain training set and the target domain training set. The source domain training set includes source domain pedestrian images and their corresponding identity labels, while the target domain training set includes target domain pedestrian images but excludes human identity labels.
[0045] Step S102: Perform unified preprocessing on the source domain pedestrian image and the target domain pedestrian image. The preprocessing includes at least one of image size normalization, random horizontal flipping, random cropping, random erasing, random grayscale conversion, and pixel normalization. This preprocessing enhances the model's robustness to changes in viewpoint, pose, occlusion, and color interference.
[0046] Step S103: Construct a teacher-student dual-branch person re-identification network. The student branch is used for backpropagation updates based on the source domain supervision signal and the target domain pseudo-label signal, while the teacher branch is used to process unlabeled samples in the target domain and provide stable pseudo-label guidance. The parameters of the teacher branch can be updated by the student branch parameters using an exponential moving average method.
[0047] Step S104: Set up a pre-trained visual encoder as the basic visual backbone network. In one embodiment, the pre-trained visual encoder is the ViT-B / 16 structure in the CLIP visual encoder, and all or part of the parameters of the pre-trained visual encoder are frozen during training to maintain its stable general visual representation capability.
[0048] In this embodiment, unsupervised learning of the target domain can be expressed as an optimization objective constrained by the following:
[0049]
[0050] in, This represents the model parameters to be optimized in the pedestrian re-identification network; Represents the first in the target domain Individual pedestrian image samples; Indicates the distribution of data in the target domain; This indicates the loss in identity determination based on pseudo-labels; This represents the pedestrian image features extracted by the model; Indicates the camera category corresponding to the sample; This represents the mutual information between pedestrian image features and camera category. Equation (1) indicates that while improving the ability to identify individuals, the amount of camera-related information contained in the features is reduced.
[0051] Step S2: Construct a textless visual knowledge adaptation module ( Figure 3 )
[0052] In step S2, a textless visual knowledge adaptation module is constructed after the pre-trained visual encoder. The normalized pedestrian image features are adaptively mapped through a lightweight residual adapter to obtain domain-adaptive pedestrian features.
[0053] Step S201: Input the pedestrian image in the target domain into the frozen pre-trained visual encoder to obtain initial visual features, and perform L2 normalization on the initial visual features:
[0054]
[0055] in, This represents a pre-trained visual encoder; This represents the input target domain pedestrian image; This represents the initial visual features after normalization. This represents the L2 norm.
[0056] Step S202: A lightweight residual adapter is set after the pre-trained visual encoder. The lightweight residual adapter is used to introduce discriminative information adapted to the distribution of pedestrian images in the target domain without destroying the pre-trained visual feature space structure.
[0057] Step S203: Input the basic visual features into the lightweight residual adapter to generate residual adaptation features, and perform weighted fusion and normalization processing on the basic visual features and residual adaptation features to obtain domain-adaptive pedestrian features:
[0058] (3)
[0059] in, This represents the domain-adaptive pedestrian features after processing by a lightweight residual adapter. Represents basic visual features; Indicates a lightweight residual adapter; This represents the learnable residual scaling factor, used to control the extent to which adaptation information is introduced; This represents the L2 norm.
[0060] Step S204: The lightweight residual adapter consists of a dimension reduction mapping, a nonlinear activation function, and a dimension increase mapping, and its expression is as follows:
[0061]
[0062] in, Represents the dimension reduction mapping matrix; Represents an up-dimensional mapping matrix; Represents a nonlinear activation function; This represents the normalized visual features input to the adapter.
[0063] Step S205: By setting the bottleneck dimension to be smaller than the original feature dimension, the lightweight residual adapter satisfies the following low-rank constraint:
[0064]
[0065] in, This represents the rank of the feature transformation corresponding to the lightweight residual adapter; The bottleneck layer dimension is represented by Equation (5). Equation (5) indicates that the adapter uses a low-rank transformation method to achieve feature correction, thereby completing the target domain visual knowledge adaptation with lower parameter overhead.
[0066] Step S3: Construct the camera adversarial decoupling module ( Figure 4 )
[0067] In step S3, a camera adversarial decoupling module based on a gradient inversion layer is constructed. The camera classifier is used to predict the camera category corresponding to the sample, and the camera-related information in the domain adaptive pedestrian features is suppressed by the camera adversarial loss to obtain camera-insensitive identity discrimination features.
[0068] Step S301: After the adaptive pedestrian features in the domain, a gradient inversion layer and a camera classifier are set. The gradient inversion layer performs an identity mapping during forward propagation and inverts the gradient sign and multiplies it by a preset coefficient during backward propagation.
[0069] Step S302: Input the sample features into the gradient inversion layer and the camera classifier to predict the probability distribution of the sample belonging to different camera categories:
[0070]
[0071] in, Indicates the first The sample belongs to the first Predicted probabilities for each camera category; This represents a camera classifier; This represents the gradient reversal operation; This represents the pedestrian image features input to the camera's adversarial decoupling module; This represents the normalized exponential function.
[0072] Step S303: Calculate the camera adversarial loss based on the camera's true class and predicted class probabilities:
[0073]
[0074] in, Indicates camera resistance loss; Indicates the number of samples in a batch; Indicates the total number of camera categories; Indicates the first The sample belongs to the first Unique hot-coded labels for each camera category; This represents the probability of the class predicted by the camera classifier.
[0075] Step S304: During backpropagation, the gradient reversal layer reverses the gradient direction of the camera adversarial loss for the feature extraction part:
[0076]
[0077] in, This represents the camera adversarial loss with respect to the feature extraction parameters. The gradient; represents the gradient reversal coefficient. Equation (8) indicates that an adversarial optimization relationship is formed between the camera classifier and the feature extractor, which makes the camera classifier tend to improve the camera category prediction ability, while the feature extractor tends to generate pedestrian features that are difficult to distinguish from the camera source.
[0078] Step S305: From the perspective of information theory, the above camera adversarial decoupling process can be approximated as:
[0079]
[0080] in, Indicate pedestrian characteristics With camera variables Mutual information between them; Indicates that given pedestrian features Camera variables under conditions The conditional entropy. Equation (9) represents reducing camera-related information in pedestrian features by maximizing the uncertainty of camera category under feature conditions.
[0081] Step S4: Generate and filter high-confidence pseudo-labels for the target domain
[0082] In step S4, at the beginning of each training round, the identity discrimination features of unlabeled samples in the target domain are clustered, the cluster centers are calculated, and the sample reliability score is calculated based on the similarity between the sample features and the corresponding cluster centers. Low-confidence samples are filtered out to obtain high-confidence pseudo-labels.
[0083] Step S401: At the beginning of each training round, extract the feature set of unlabeled pedestrian images in the target domain using the current teacher branch or student branch, and perform density clustering on the feature set to obtain initial pseudo-labels and corresponding clusters.
[0084] Step S402: For each cluster, calculate the cluster center:
[0085]
[0086] in, Indicates the first The cluster center of each cluster; Indicates the first The set of samples contained in each cluster; This indicates the number of samples in the sample set; Indicates the first Pedestrian image features of a sample.
[0087] Step S403: Calculate the cosine similarity between the target domain sample features and their corresponding cluster centers, and construct a sample reliability score based on the cosine similarity:
[0088]
[0089] in, Indicates the first The reliability score of each sample; Indicates the first The cluster center corresponding to the current pseudo-label of each sample; This represents a temperature parameter used to adjust the smoothness of the reliability score distribution. Indicates sample features and the first Cosine similarity between cluster centers; express The transpose of .
[0090] Step S404: Filter the initial pseudo-labels based on a preset reliability threshold to obtain the final pseudo-labels:
[0091]
[0092] in, Indicates the first The final pseudo-label for each sample; This represents the initial pseudo-labels obtained from clustering; Indicates the reliability threshold; This indicates that the sample is considered a low-confidence sample and is removed from subsequent pseudo-label supervision.
[0093] Step S405: Assign reliability weights to the retained high-confidence samples. The reliability weights can be determined based on the reliability scores, so that samples with higher reliability can make a greater contribution in subsequent optimization.
[0094] Step S5: Construct a dynamic, pure prototype memory and calculate the contrastive learning loss. Figure 5 )
[0095] In step S5, a dynamic pure prototype memory is constructed based on the high-confidence pseudo-labels and corresponding sample features. The category prototype is reconstructed using a cover-up update method without historical momentum accumulation, and the contrastive learning loss is calculated based on the dynamic pure prototype memory.
[0096] Step S501: Construct a global prototype memory library, which is used to store the feature prototypes corresponding to each pseudo-identity category in the target domain.
[0097] Step S502: After each round of target domain clustering and high-confidence sample screening, based on the screened clean samples and their reliability weights, directly reconstruct the feature prototypes of the corresponding categories:
[0098]
[0099] in, Indicates the number of training rounds in the current training round. The initial prototype of a pseudo-identity category; Indicates the first Reliability weights for each sample; Indicates the first Pedestrian image features of a sample; Indicates the first A set of high-confidence samples corresponding to each pseudo-identity category; This represents the L2 norm.
[0100] Step S503: Based on the dynamic pure prototype memory, calculate the sample belonging to the first... The probability of each pseudo-identity category:
[0101]
[0102] in, Representing the features of a given sample When the sample belongs to the first The probability of each pseudo-identity category; Indicates the first The feature prototype of each pseudo-identity category; This indicates the number of categories in the current dynamic pure prototype memory; This indicates the temperature parameter for comparison and learning.
[0103] Step S504: Calculate the dynamic pure memory contrastive learning loss only on the selected pure sample set:
[0104]
[0105] in, This represents the contrast learning loss between dynamic pure memory and learning. Indicates the number of pure samples; Indicates the first The final pseudo-label of a pure sample; Representing the features of a given sample The sample was then predicted to be its pseudo-label category. The probability of.
[0106] Step S505: Reconstruct the dynamic pure prototype memory in each training round instead of updating the prototype using historical momentum accumulation, thereby avoiding the continuous retention of historical erroneous pseudo-labels in the memory.
[0107] Step S6: Jointly optimize and complete pedestrian re-identification retrieval
[0108] In step S6, a joint optimization objective is constructed based on the contrastive learning loss and the camera adversarial loss. The pedestrian re-identification network is trained end-to-end, and the trained network is used to extract pedestrian image features in the target domain to complete pedestrian image retrieval and identity matching.
[0109] Step S601: Construct the total loss function based on the source domain supervision loss, the target domain dynamic pure memory contrastive learning loss, and the camera adversarial loss:
[0110]
[0111] in, Represents the total loss function; This represents the dynamic pure memory versus learning loss; Indicates camera resistance loss; This represents the weighting coefficient used to balance the two losses.
[0112] Step S602: Backpropagation update the student branch based on the total loss function, so that the model can simultaneously enhance the identity discrimination ability and suppress camera-related bias information.
[0113] Step S603: Update the teacher branch parameters according to the student branch parameters, so that the teacher branch can provide more stable feature representation and clustering basis in the process of generating pseudo-labels in the target domain.
[0114] Step S604: Repeat steps S1 to S6 until the preset training rounds or model convergence conditions are reached to obtain the trained pedestrian re-identification model.
[0115] Step S605: During the inference phase, remove or disable the camera adversarial decoupling module and the dynamic clean prototype memory, retaining only the visual encoder and the lightweight residual adapter as the deployment model; input the query pedestrian image and candidate image into the deployment model to obtain the corresponding pedestrian features; calculate the feature similarity between the query image and the candidate image based on Euclidean distance or cosine distance, and output the retrieval results in descending order of similarity.
[0116] The following specific embodiment further illustrates the unsupervised adaptive pedestrian re-identification method based on multi-granularity decoupling and dynamic pure memory proposed in this invention.
[0117] In this embodiment, as Figure 6 As shown, the publicly available pedestrian re-identification datasets Market-1501, CUHK03, and MSMT17 are used to train and validate the method of this invention. Market-1501 is used as the source domain dataset, while CUHK03 and MSMT17 are used as the target domain datasets, respectively. Two unsupervised adaptive pedestrian re-identification tasks are constructed: Market1501→CUHK03 and Market1501→MSMT17. The source domain data includes identity labels, while the target domain data does not use identity labels and is only used for unsupervised clustering and self-training optimization.
[0118] In this embodiment, the image encoder employs a ViT-B / 16 visual backbone network based on the CLIP pre-trained model. During training, the text encoder and part of the image encoder backbone layers are frozen, and a lightweight visual adapter module is introduced at the back end of the visual features to enhance the model's adaptability to the distribution of pedestrian images in the target domain while maintaining the stability of the pre-trained visual feature space. To further reduce the interference of cross-camera differences on identity feature representation, this invention introduces a camera adversarial decoupling module based on a gradient inversion layer during feature learning, enabling the image encoder to suppress camera-related bias information while maintaining its identity discrimination capability.
[0119] During the training phase, labeled samples from the source domain and unlabeled samples from the target domain are used for one-stage synchronous training. For the target domain data, the target domain image features are first extracted using the current image encoder, and pseudo-labels are generated using the DBSCAN clustering algorithm, with the clustering distance threshold eps set to 0.6. Subsequently, the reliability of the pseudo-label samples is evaluated based on the similarity between the cluster centers and the sample features, and low-confidence samples are filtered out, thereby constructing a high-purity pseudo-label set. Based on this high-purity sample set, this invention uses a dynamic pure memory module to construct a category prototype memory bank; unlike the traditional momentum memory update method, this invention recalculates and overwrites the updated memory prototype based on the current high-confidence samples in each training round to avoid the continuous accumulation of historical erroneous pseudo-labels during training.
[0120] The Adam optimizer was used during training. The batch size was set to 64 for both training and testing. Data augmentation techniques were employed, including random horizontal flipping, random padding and cropping, random erasure, and random grayscale conversion. Random grayscale conversion was used to reduce the model's over-reliance on color information, allowing it to learn more about non-color identity cues such as clothing structure, texture, and contours. The learning rate was increased from 5×10⁻⁶ in the first 10 epochs. -7 Linear preheating to 5×10 -6 The loss function decays at a rate of 0.1 at the 30th and 50th epochs. The total number of training epochs is set to 50, with each epoch containing 400 iterations. The loss function consists of a dynamic clean memory contrastive learning loss and a camera adversarial decoupling loss. During the testing phase, no post-processing operations such as reordering are used. Only the trained image encoder is used to extract feature representations of the query image and candidate images, and cross-domain person re-identification retrieval is performed based on feature distance.
[0121] Table 1 compares the results with existing methods on the unsupervised adaptive person re-identification task. Where M represents the Market-1501 dataset, C represents the CUHK03 dataset, and MS represents the MSMT17 dataset. "M→C" indicates an unsupervised adaptive task with Market-1501 as the source domain and CUHK03 as the target domain, and "M→MS" indicates an unsupervised adaptive task with Market-1501 as the source domain and MSMT17 as the target domain. The best-performing results under the unsupervised setting are highlighted in bold.
[0122] method M→CmAP M→CRank-1 M→MSmAP M→MSRank-1 SNR 17.5 17.1 — — UDAR 20.9 20.3 12.0 30.5 QAConv50 32.9 33.3 — — M3L 35.7 36.5 — — MetaBIN 43.0 43.1 — — DFH 27.2 30.5 — — META 47.1 46.2 — — ACL 49.4 50.1 — — PAOA+ 50.3 50.9 — — CLEPR 31.3 29.4 — — CORE-ReID 62.9 61.0 41.9 69.5 CORE-ReIDV2 66.4 66.9 44.1 71.3 CaCL — — 36.5 66.6 IDM — — 33.5 61.3 DAML — — 41.4 65.4 TF-Bridged — — 36.1 66.2 Method of the present invention 67.6 69.8 50.2 75.0
[0123] As shown in Table 1, in the Market1501→CUHK03 task, the method of this invention achieved a mAP of 67.6% and a Rank-1 accuracy of 69.8%, which is better than the existing comparative methods. This indicates that the present invention can effectively improve the discrimination ability of cross-domain pedestrian features under the condition that the target domain has no identity label. In the larger-scale and more complex Market1501→MSMT17 task, the method of this invention achieved a mAP of 50.2% and a Rank-1 accuracy of 75.0%, which is a further improvement compared to CORE-ReIDV2's 44.1% mAP and 71.3% Rank-1. This shows that the present invention can still maintain strong generalization ability and stable retrieval performance under complex monitoring scenarios, significant differences across cameras, and complex target domain sample distribution.
[0124] like Figure 7 As shown, further analysis from a qualitative perspective of feature distribution reveals that after adaptive training using this method, the features of the test samples in the target domain exhibit a clear clustering structure in the low-dimensional space, with similar samples clustered tightly and dissimilar samples having distinct boundaries. This qualitative visualization result corroborates the aforementioned quantitative indicators, jointly demonstrating that this method effectively improves the model's feature discrimination capability in the target domain after mitigating domain shift and purifying the training signal.
[0125] In summary, this invention introduces a multi-granularity feature decoupling mechanism and a dynamic clean memory mechanism into the unsupervised adaptive pedestrian re-identification process. At the feature space level, it utilizes a visual adapter to achieve macroscopic distribution adaptation between the source and target domains, and suppresses microscopic camera bias information through camera adversarial learning. At the label space level, it employs high-confidence pseudo-label filtering and a covering-based dynamic memory update strategy to reduce the historical accumulation of erroneous pseudo-labels. Experimental results show that the method of this invention can effectively enhance the image encoder's ability to represent domain-invariant and identity-related pedestrian features, and achieves good recognition performance on multiple unsupervised cross-domain pedestrian re-identification tasks.
[0126] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0127] In another embodiment, an unsupervised adaptive person re-identification system based on multi-granularity decoupling and dynamic pure memory is provided. This system corresponds one-to-one with the unsupervised adaptive person re-identification method based on multi-granularity decoupling and dynamic pure memory in the above embodiments. Specifically, it includes:
[0128] The data acquisition and processing module is used to acquire labeled pedestrian images in the source domain and unlabeled pedestrian images in the target domain, and to perform unified preprocessing on the images;
[0129] The feature extraction module includes a pre-trained visual encoder for extracting normalized visual features from the pedestrian image.
[0130] A textless visual knowledge adaptation module is connected to the feature extraction module. It includes a lightweight residual adapter for adaptively mapping the normalized visual features to obtain domain-adaptive pedestrian features to alleviate macroscopic distribution shift.
[0131] A camera adversarial decoupling module, connected to the textless visual knowledge adaptation module, includes a gradient inversion layer and a camera classifier, used to suppress camera-related information in the domain adaptive pedestrian features through adversarial learning, and obtain camera-insensitive identity discrimination features to suppress micro-hardware biases.
[0132] The pseudo-label generation and filtering module is used to cluster the identity discrimination features of the target domain samples in each training round, calculate the cluster center, and filter low-confidence samples based on the similarity between the sample features and the cluster center to generate high-confidence pseudo-labels.
[0133] The dynamic pure prototype memory module is used to store and reconstruct the feature prototypes of each category in the target domain based on the high-confidence pseudo-labels and corresponding sample features in a covering update manner.
[0134] A loss calculation and optimization module is used to construct a joint optimization objective based at least on the contrastive learning loss calculated by the dynamic pure prototype memory module and the camera adversarial loss calculated by the camera adversarial decoupling module, in order to train the pedestrian re-identification network end-to-end; and
[0135] The pedestrian retrieval module is used to extract pedestrian image features using a trained network during the inference phase and to perform identity matching based on feature similarity.
[0136] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0137] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0138] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An unsupervised domain adaptation pedestrian re-identification method based on multi-granularity decoupling and dynamic clean memory, characterized in that, Includes the following steps: Step S1: Obtain labeled pedestrian images in the source domain and unlabeled pedestrian images in the target domain, construct a pedestrian re-identification network including student and teacher branches, and extract normalized pedestrian image features using a pre-trained visual encoder; Step S2: After the pre-trained visual encoder, a textless visual knowledge adaptation module is constructed. The normalized pedestrian image features are adaptively mapped through a lightweight residual adapter to obtain domain-adaptive pedestrian features, so as to alleviate the macroscopic distribution offset between the source domain and the target domain. Step S3: Construct a camera adversarial decoupling module based on a gradient inversion layer, use a camera classifier to predict the camera category corresponding to the sample, and suppress camera-related information in the domain adaptive pedestrian features through camera adversarial loss to obtain camera-insensitive identity discrimination features, so as to suppress the micro-hardware bias introduced by different camera devices. Step S4: At the beginning of each training round, cluster the identity discrimination features of unlabeled samples in the target domain, calculate the cluster centers, and calculate the sample reliability score based on the similarity between the sample features and the corresponding cluster centers. Filter out low-confidence samples to obtain high-confidence pseudo-labels. Step S5: Construct a dynamic pure prototype memory based on the high-confidence pseudo-labels and corresponding sample features, reconstruct the category prototype using a cover-up update method without historical momentum accumulation, and calculate the contrastive learning loss based on the dynamic pure prototype memory. Step S6: Construct a joint optimization objective based on the contrastive learning loss and the camera adversarial loss, train the pedestrian re-identification network end-to-end, and use the trained network to extract pedestrian image features in the target domain to complete pedestrian image retrieval and identity matching.
2. The method according to claim 1, characterized in that, Step S1 includes: Obtain a source domain training set and a target domain training set. The source domain training set includes source domain pedestrian images and their corresponding identity labels, and the target domain training set includes target domain pedestrian images but does not include human identity labels. Perform unified preprocessing on the source domain pedestrian images and the target domain pedestrian images. The preprocessing includes at least one of image size normalization, random horizontal flipping, random cropping, random erasing, random grayscale conversion, and pixel normalization.
3. The method according to claim 1, characterized in that, The student branch is used to perform backpropagation updates based on the source domain identity label, target domain pseudo label, dynamic pure prototype memory, and camera adversarial loss; the teacher branch is used to extract features of unlabeled samples in the target domain and provide a basis for pseudo label generation, and the parameters of the teacher branch are updated by the parameters of the student branch through an exponential moving average.
4. The method according to claim 1, characterized in that, The pre-trained visual encoder is a ViT-B / 16 visual encoder based on the CLIP visual branch. During training, all or part of the parameters of the pre-trained visual encoder are frozen, and the text encoder or text prompt branch is discarded, so that the model can adapt to the target domain using the pre-trained visual semantic prior under the condition of no text.
5. The method according to claim 1, characterized in that, The lightweight residual adapter consists of a dimensionality reduction mapping, a nonlinear activation function, and a dimensionality increase mapping. First, a low-dimensional bottleneck transformation is performed on the input features. Then, the bottleneck transformation result is used as residual information and weighted and fused with the basic visual features and normalized by L2. The lightweight residual adapter satisfies the low-rank constraint that the bottleneck dimension is smaller than the original feature dimension.
6. The method according to claim 1, characterized in that, The camera adversarial decoupling module includes a gradient inversion layer and a camera classifier. The gradient inversion layer performs an identity mapping during forward propagation and inverts the gradient of the feature extraction part during backward propagation and multiplies it by a preset coefficient, so that the camera classifier tends to improve the camera category prediction ability, while the feature extraction part tends to generate identity discrimination features that are difficult to distinguish the source of the camera.
7. The method according to claim 1, characterized in that, The clustering in step S4 is density clustering or distance-based clustering; the cluster center is calculated for each cluster, and a reliability score is obtained based on the cosine similarity between the target domain sample features and its corresponding cluster center. If the reliability score is lower than a preset threshold, the corresponding sample is removed from the subsequent pseudo-label supervision as a low-confidence sample.
8. The method according to claim 1, characterized in that, The dynamic pure prototype memory is used to store the feature prototypes corresponding to each pseudo-identity category in the target domain. In each training round, the feature prototypes of the corresponding categories are directly reconstructed based on the selected high-confidence samples and their reliability weights, and the reconstructed feature prototypes are used to cover the corresponding prototypes in the previous training round, instead of updating the prototypes by accumulating historical momentum.
9. The method according to claim 1, characterized in that, The contrastive learning loss is calculated based on the similarity between sample features and prototypes of each category in the dynamic pure prototype memory, and is only calculated on the high-confidence sample set, so that low-confidence pseudo-labels and outliers do not participate in the contrastive supervision of the dynamic pure memory.
10. The method according to claim 1, characterized in that, Step S6 includes: weighting and summing the source domain supervision loss, the target domain dynamic clean memory contrastive learning loss, and the source and target domain camera adversarial losses to obtain the total loss function; updating the student branch based on the total loss function, and updating the teacher branch based on the student branch parameters; during the inference phase, removing or disabling the camera adversarial decoupling module, clustering module, and dynamic clean prototype memory, retaining only the visual encoder and lightweight residual adapter to extract pedestrian features from the query image and candidate images, and outputting the identity matching result according to the feature similarity.