A multi-cluster guided volatile feature contrastive learning method and system for unsupervised person re-identification
Through multi-cluster-guided variable feature comparison learning method, screening and utilizing variable features, the problem of noise introduction in unsupervised pedestrian re-identification is solved, and the adaptability and generalization ability of the model are improved.
Patent Information
- Application Number
- CN202510703480.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-05-29
AI Technical Summary
The existing unsupervised pedestrian re-identification method introduces noise during the training process of variable features, resulting in inter-class mergers, limiting the generalization ability and retraining effect of model, and the existing methods fail to effectively screen and utilize the boundary information of variable features.
The multi-cluster-guided variable feature comparison learning method is used to filter variable features through two clustering algorithms with different parameters, and the multi-cluster center of mass scheduler and dynamic center of mass is used to update the memory bank, combining the variable feature mining losses, and optimizing the model training process.
It effectively suppresses the introduction of noise during training, improves the model's learning ability of volatile features, and enhances the model's adaptability and generalization ability in complex scenarios.
Smart Images

Figure CN120236242B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unsupervised person re-identification, and more particularly to a multi-cluster guided variable feature contrast learning method and system for unsupervised person re-identification. Background Art
[0002] Unsupervised person re-identification aims to learn robust and discriminative features from unlabeled datasets to identify specific pedestrians. Currently, state-of-the-art methods rely primarily on contrastive learning strategies based on memory dictionaries, generating pseudo-labels through clustering for model training and constructing a memory library to compute the loss. These methods typically use a single-parameter clustering algorithm to assign pseudo-labels and initialize the memory library using the average centroid of samples. While achieving significant results, during training, strong classes gradually absorb weak classes, leading to inter-class merging and the introduction of a large amount of noisy labels, which limits the model's generalization and retraining effectiveness.
[0003] Unsupervised person re-identification mainly includes two categories: unsupervised domain adaptation (UDA) person re-identification and pure unsupervised (USL) person re-identification. UDA methods learn from a labeled source domain and transfer knowledge to an unlabeled target domain. They usually use a two-stage training strategy. The initial stage is to pre-train the model on a labeled source domain dataset, and then fine-tune it on an unlabeled target domain dataset. However, due to the need for additional annotation labels, UDA methods are easily affected by the quality of the knowledge learned from the source domain and the data differences between the source and target domains, which limits the performance of the model. In contrast, USL methods do not require additional annotation information and are therefore more suitable for real-world scenarios.
[0004] In recent years, state-of-the-art USL methods have made significant progress by utilizing pseudo-labels generated by clustering algorithms for training. These methods generally employ the following training scheme: 1) Clustering: Generate corresponding pseudo-labels using clustering algorithms such as DBSCAN; 2) Training: Establish a memory bank to store features and, in a supervised manner, compute a contrastive loss (such as InfoNCE or ClusterNCE) between the input instance (query) and the memory bank; 3) Update: Update the cluster representation vectors in the memory bank in the next iteration. This allows the network to learn more discriminative features with each iteration. However, during the clustering and training cycle, the model's blind trust in pseudo-labels often leads to misleading information from unreliable labels. During training, inter-class distances gradually increase while intra-class distances decrease. Classes with high intra-class density gradually absorb neighboring classes with low intra-class density, resulting in a process where strong classes swallow up weaker classes. As iterations progress, strong classes gradually swallow up weaker classes, introducing a large amount of noise into the strong classes and limiting model retraining. Although existing methods have refined pseudo-labels for noisy information, often using auxiliary information such as camera ID and body part prediction, they have not paid attention to the interaction between classes of different densities during training.
[0005] In USL, the principle of assigning pseudo labels to unlabeled samples through one clustering is usually followed. However, during the training process, there is a specific boundary feature that directly induces the merging phenomenon between classes, which is called "volatile feature". Unlike noise information, the volatile feature itself is not noise information, but a feature that may lead to the introduction of potential noise in subsequent training. This type of feature often exists in weak classes with low density, while weak classes contain rich clustering boundary information and are close to the features of other classes. Since the intra-class density of its class is small, the volatile feature is easily attracted by the strong class with high intra-class density, thereby introducing a lot of noise in the strong class. Figure 1 (a) shows this specific process. It is observed that the mutable features have significant sensitivity to the clustering parameters, such as Figure 1 As shown in (b), using various clustering parameters can effectively influence the distribution of volatile features and, to a certain extent, act as a filter. Because volatile features embed boundary sample information that can easily be confused with other classes, they are highly sensitive to clustering parameters. As a non-noisy boundary information, volatile features can guide the model to form more reliable clusters.
[0006] Therefore, how to propose a multi-clustering guided volatile feature comparative learning method and system for unsupervised pedestrian re-identification, cluster to screen out volatile features, and use volatile features to guide the initialization of the memory library, so as to encourage the model to learn more fine-grained feature distribution during the update process of the memory library, and to a certain extent solve the disadvantages of using the hardest samples and average samples, propose a volatile feature mining loss, take into account both the cluster level and the instance level, and guide the model to more fully mine the information in the volatile features. This is a problem that technical personnel in this field urgently need to solve. Summary of the Invention
[0007] In view of this, the present invention provides a multi-cluster guided volatile feature comparative learning method and system for unsupervised person re-identification, which guides the model to more fully exploit the information in volatile features. To achieve the above purpose, the present invention adopts the following technical solutions:
[0008] A multi-clustering guided volatile feature contrastive learning method for unsupervised person re-identification, including:
[0009] Collect pedestrian image data and build an image dataset;
[0010] The unsupervised person re-identification model is used to extract features from the image dataset to obtain samples to be processed;
[0011] Use two clustering algorithms with different parameters to assign labels to samples to be processed, and filter out mutable features by comparing the two clusters to guide the initialization of the memory library;
[0012] The initialized memory library is processed by the multi-cluster centroid scheduler to obtain a mutable feature memory library;
[0013] Utilize the contextual information in the small batch of samples to be processed, dynamically assign different weights to each sample, construct a dynamic centroid to update the mutable feature memory library;
[0014] The unsupervised person re-identification model is back-propagated and optimized through the volatile feature memory library to obtain the optimal unsupervised person re-identification model.
[0015] Optionally, the clustering algorithm using two different parameters includes:
[0016] ;
[0017] in, , are the clustering results and labels of the benchmark clustering, , are the clustering results and labels of extended clustering respectively, 、 are the hyperparameters controlling clustering, and is the expansion factor that controls the hyperparameters.
[0018] Optionally, the comparison label is obtained by adding the labels of the corresponding features in the baseline label and the extended label. The features at the boundary between classes in the baseline cluster will have a smaller number of intra-class features in the comparison cluster than the hyperparameter of the baseline cluster. In the case of clustering, these features are marked as clustering sensitive features:
[0019] ;
[0020] ;
[0021] ;
[0022] ;
[0023] in, and are the clustering results and labels of the comparative clustering, Represents the mapping from label to clustering result, num represents the set of features of each class in the comparison cluster, represents the number of features in the i-th category, To compare the jth feature of the i-th class in the cluster, is the clustering hyperparameter, is a clustering sensitive feature.
[0024] Optionally, construct uncertainty factors for the clustering sensitive features Screening to obtain variable samples:
[0025] ;
[0026] in, represents the jth feature in the i-th class, is the clustering sensitive feature, Indicates the number of features in the i-th category, and sets the threshold Q to control the selection of mutable features. For cluster-sensitive features, when the value of p is greater than Q, cluster-sensitive features are filtered to obtain the final mutable features. .
[0027] Optionally, the final variable feature is used to guide the formation of the centroid, and the obtained k-th centroid is as follows:
[0028] ;
[0029] in, is the weight of the mutable feature, is a variable feature, M is the total number of features in the kth class, By increasing the weight of volatile features in the cluster centroid formation process, we obtain centroids that contain more non-noise boundary information, allowing the model to learn the boundaries of each cluster and use the weighted centroids to initialize the memory library.
[0030] Optionally, utilizing context information in a small batch of samples to be processed to dynamically assign a different weight to each sample and constructing a dynamic centroid to update the mutable feature memory library includes:
[0031] Based on the distance between the sample and the centroid, the Softmax function is used to assign different weights to each query sample to reflect the overall distribution of the features:
[0032] ;
[0033] Where N represents the number of instances of class i in the mini-batch, is the centroid of the i-th class, and For sample instances, is a linear scheduler.
[0034] Optionally, the linear scheduler include:
[0035] ;
[0036] in, It is the initial linear scheduler, and the weights are dynamically changed during the entire training process:
[0037] The dynamic centroid of the i-th class is obtained as follows:
[0038] ;
[0039] Update the memory bank using dynamic centroids:
[0040] ;
[0041] in, is a hyperparameter that controls the momentum update.
[0042] Optionally, the performing back-propagation optimization on the unsupervised person re-identification model through the volatile feature memory library includes:
[0043] Based on all the mutable features, representative features are selected to construct the loss function. The inner product of , and select the variable representative positive sample vector and volatile representative negative sample vector , capturing information about mutable features:
[0044] ;
[0045] in, and are the mutable features of the same and different classes as the query instance q, is the mutable feature that is farthest away from the query instance q in the feature space, and It is the mutable feature that is closest to the query instance q in the feature space in a different class.
[0046] Optionally, the method also includes filtering the vectors to obtain the mutable positive samples and mutable negative samples with the largest boundary information, and constructing the mutable feature loss:
[0047] ;
[0048] in, is the temperature hyperparameter, is the expected value. The total loss of volatile feature mining consists of two parts: ClusterNCE loss and volatile feature loss:
[0049] ;
[0050] in, is the ClusterNCE loss, is the weight coefficient used to balance these two losses.
[0051] Optionally, a multi-cluster guided volatile feature contrastive learning system for unsupervised person re-identification, including:
[0052] Acquisition module: used to collect pedestrian image data and build image datasets;
[0053] Feature extraction module: used to extract features from image datasets using an unsupervised person re-identification model to obtain samples to be processed;
[0054] Initialization module: This module is used to assign labels to samples using two clustering algorithms with different parameters. It then compares the two clusters to identify mutable features and guides the initialization of the memory library.
[0055] Mutable feature memory library construction module: used to process the initialized memory library through the multi-cluster centroid scheduler to obtain the mutable feature memory library;
[0056] Update module: It is used to use the context information in the small batch of samples to be processed to dynamically assign different weights to each sample, construct a dynamic centroid and update the mutable feature memory library;
[0057] Backpropagation optimization module: used to perform backpropagation optimization on the unsupervised person re-identification model through the volatile feature memory library to obtain the optimal unsupervised person re-identification model.
[0058] As can be seen from the above technical solutions, compared with the prior art, the present invention provides a multi-cluster guided variable feature contrast learning method and system for unsupervised person re-identification, which has the following beneficial effects:
[0059] This paper proposes a multi-cluster guided volatile feature contrastive learning method for unsupervised person re-identification (PRI). The method includes: collecting pedestrian image data to construct an image dataset; extracting features from the image dataset using an unsupervised PRI model to obtain samples to be processed; assigning labels to the samples using two clustering algorithms with different parameters, and filtering out volatile features by comparing the two clusters to guide the initialization of a memory bank; processing the initialized memory bank using a multi-cluster centroid scheduler to obtain a volatile feature memory bank; utilizing contextual information from a small batch of PRI samples to dynamically assign different weights to each sample, constructing a dynamic centroid to update the volatile feature memory bank; and back-propagating the unsupervised PRI model using the volatile feature memory bank to obtain the optimal PRI model. This paper proposes a multi-cluster guided volatile feature contrastive learning method (MGVF) and designs a multi-cluster centroid modulator (MCM). This method uses multiple clustering algorithms with different parameters to filter volatile features and dynamically adjusts the contribution of each sample in the memory bank to its corresponding centroid, thereby enhancing the model's learning of non-noise boundary samples and effectively suppressing the introduction of noise during training. In addition, a dynamic global feature update strategy (DGF) is proposed to couple the feature library update process with the different stages of model training and the context of the sample. Finally, to further improve the model's discriminative and generalization capabilities, a variable feature mining loss (VFE) is constructed to enhance the model's adaptability to complex scenarios. Extensive experiments demonstrate that MGVF is effective and achieves state-of-the-art performance in the field of unsupervised person re-identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0061] Figure 1 Schematic diagram of the traditional pure unsupervised (USL) pedestrian re-identification principle provided by the present invention.
[0062] Figure 2A schematic diagram of the process principles for screening volatile features and initializing a volatile feature memory library provided by the present invention.
[0063] Figure 3 Schematic diagram of the principle of a multi-cluster guided variable feature contrast learning method for unsupervised pedestrian re-identification provided by the present invention.
[0064] Figure 4 This is a schematic diagram of the dynamic center of mass formation process provided by the present invention.
[0065] FIG5( a ) is a schematic diagram showing the relationship between the Φ value and the number of training rounds under the action of the logarithmic scheduler provided by the present invention.
[0066] FIG5( b ) is a schematic diagram showing the relationship between the Φ value and the number of training rounds under the action of the linear scheduler provided by the present invention.
[0067] FIG5( c ) is a schematic diagram showing the relationship between the value of Φ and the number of training rounds under the action of the exponential scheduler provided by the present invention.
[0068] FIG5( d ) is a graph showing the relationship between the model performance (mAP) and the Φ value on the Market-1501 dataset when there is no scheduler (ie, when Φ is a constant) provided by the present invention.
[0069] Figure 6 This is the TSNE visualization analysis result diagram of the baseline model and MGVF model provided by the present invention on the dataset Market-1501.
[0070] FIG7 (a) is a visualization analysis result of the intra-class and inter-class distances of the baseline model provided by the present invention on the Market-1501 dataset.
[0071] FIG7 (b) is a visualization analysis result of the intra-class and inter-class distances of the MGVF model provided by the present invention on the Market-1501 dataset.
[0072] FIG8 (a) is a visualization analysis result diagram of the baseline model Rank-list provided by the present invention.
[0073] FIG8( b ) is a visualization analysis result diagram of the MGVF model Rank-list provided by the present invention.
[0074] Figure 9 (a) shows the parameters provided by the present invention Analysis results on the Market-1501 dataset.
[0075] Figure 9 (b) shows the parameters provided by the present invention Analysis results on the Market-1501 dataset. DETAILED DESCRIPTION
[0076] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0077] The embodiment of the present invention discloses a multi-cluster guided variable feature contrast learning method for unsupervised person re-identification, comprising:
[0078] Collect pedestrian image data and build an image dataset;
[0079] The unsupervised person re-identification model is used to extract features from the image dataset to obtain samples to be processed;
[0080] Use two clustering algorithms with different parameters to assign labels to samples to be processed, and filter out mutable features by comparing the two clusters to guide the initialization of the memory library;
[0081] The initialized memory library is processed by the multi-cluster centroid scheduler to obtain a mutable feature memory library;
[0082] Utilize the contextual information in the small batch of samples to be processed, dynamically assign different weights to each sample, construct a dynamic centroid to update the mutable feature memory library;
[0083] The unsupervised person re-identification model is back-propagated and optimized through the volatile feature memory library to obtain the optimal unsupervised person re-identification model.
[0084] Furthermore, the clustering algorithm using two different parameters includes:
[0085] ;
[0086] in, , are the clustering results and labels of the benchmark clustering, , are the clustering results and labels of extended clustering respectively, 、 are the hyperparameters controlling clustering, and is the expansion factor that controls the hyperparameters.
[0087] Furthermore, the comparison label is obtained by adding the labels of the corresponding features in the baseline label and the extended label. The features at the boundary between classes in the baseline cluster will have a smaller number of features in the comparison cluster than the hyperparameters of the baseline cluster. In the case of clustering, these features are marked as clustering sensitive features:
[0088] ;
[0089] ;
[0090] ;
[0091] ;
[0092] in, and are the clustering results and labels of the comparative clustering, Represents the mapping from label to clustering result, num represents the set of features of each class in the comparison cluster, represents the number of features in the i-th category, To compare the jth feature of the i-th class in the cluster, is the clustering hyperparameter, is a clustering sensitive feature.
[0093] Furthermore, the uncertainty factor is constructed to determine the clustering sensitive features Screening to obtain variable samples:
[0094] ;
[0095] in, represents the jth feature in the i-th class, is the clustering sensitive feature, Indicates the number of features in the i-th category, and sets the threshold Q to control the selection of mutable features. For cluster-sensitive features, when the value of p is greater than Q, cluster-sensitive features are filtered to obtain the final mutable features. .
[0096] Furthermore, the final variable feature is used to guide the formation of the centroid, and the k-th centroid is obtained as follows:
[0097] ;
[0098] in, is the weight of the mutable feature, is a variable feature, M is the total number of features in the kth class, By increasing the weight of volatile features in the cluster centroid formation process, we obtain centroids that contain more non-noise boundary information, allowing the model to learn the boundaries of each cluster and use the weighted centroids to initialize the memory library.
[0099] Furthermore, the method of utilizing context information in a small batch of samples to be processed to dynamically assign different weights to each sample and constructing a dynamic centroid to update a mutable feature memory library includes:
[0100] Based on the distance between the sample and the centroid, the Softmax function is used to assign different weights to each query sample to reflect the overall distribution of the features:
[0101] ;
[0102] Where N represents the number of instances of class i in the mini-batch, is the centroid of the i-th class, and For sample instances, is a linear scheduler.
[0103] Furthermore, the linear scheduler include:
[0104] ;
[0105] in, It is the initial linear scheduler, and the weights are dynamically changed during the entire training process:
[0106] The dynamic centroid of the i-th class is obtained as follows:
[0107] ;
[0108] Update the memory bank using dynamic centroids:
[0109] ;
[0110] in, is a hyperparameter that controls the momentum update.
[0111] Optionally, the performing back-propagation optimization on the unsupervised person re-identification model through the volatile feature memory library includes:
[0112] Based on all the mutable features, representative features are selected to construct the loss function. The inner product of , and select the variable representative positive sample vector and volatile representative negative sample vector , capturing information about mutable features:
[0113] ;
[0114] in, and are the mutable features of the same and different classes as the query instance q, is the mutable feature that is farthest away from the query instance q in the feature space, and It is the mutable feature that is closest to the query instance q in the feature space in a different class.
[0115] Optionally, the method also includes filtering the vectors to obtain the mutable positive samples and mutable negative samples with the largest boundary information, and constructing the mutable feature loss:
[0116] ;
[0117] in, is the temperature hyperparameter, is the expected value. The total loss of volatile feature mining consists of two parts: ClusterNCE loss and volatile feature loss:
[0118] ;
[0119] in, is the ClusterNCE loss, is the weight coefficient used to balance these two losses.
[0120] In a specific embodiment, a multi-cluster guided volatile feature contrastive learning system for unsupervised person re-identification includes:
[0121] Acquisition module: used to collect pedestrian image data and build image datasets;
[0122] Feature extraction module: used to extract features from image datasets using an unsupervised person re-identification model to obtain samples to be processed;
[0123] Initialization module: This module is used to assign labels to samples using two clustering algorithms with different parameters. It then compares the two clusters to identify mutable features and guides the initialization of the memory library.
[0124] Mutable feature memory library construction module: used to process the initialized memory library through the multi-cluster centroid scheduler to obtain the mutable feature memory library;
[0125] Update module: It is used to use the context information in the small batch of samples to be processed to dynamically assign different weights to each sample, construct a dynamic centroid and update the mutable feature memory library;
[0126] Backpropagation optimization module: used to perform backpropagation optimization on the unsupervised person re-identification model through the volatile feature memory library to obtain the optimal unsupervised person re-identification model.
[0127] In a specific embodiment, for Re-id methods such as USL, the goal is to train a robust deep neural network to maximize the distance between different individual features and reduce the difference between the same individual features. In Cluster Contrast Learning (ClusterContrast), the dataset is represented as ,in Represents an unlabeled image, which contains N images in total. For each sample in the dataset , Re-id model A feature is generated for each of them. At the beginning of each epoch, DBSCAN is used to cluster these features and assign corresponding pseudo labels to them. At the same time, before each round of training, based on the clustering results, the average feature vector in each cluster sample is calculated, and the memory library is initialized with these feature vectors and the corresponding pseudo labels. In each clustering result, the cluster representation vector of the kth class is The formula is as follows:
[0128] ;
[0129] in, represents the set of features of samples falling into the kth class, Represents the number of features in the set, and uses the obtained pseudo labels to optimize the network. The objective function is ClusterNCE, and its formula is:
[0130] ;
[0131] in, is the cluster representation vector corresponding to feature q, C is the total number of clusters in the pseudo label, is the temperature factor, is the expected value. In each epoch, the memory bank maintains a long-term feature store, providing rich and diverse samples for loss calculation. This allows the model to effectively leverage information from historical samples, enhancing its understanding of new samples and improving its adaptability to different perspectives and environments. To ensure that the model is exposed to diverse data, thereby learning more comprehensive features and reducing the risk of overfitting, the memory bank is updated using momentum during training iterations:
[0132] ;
[0133] in, is the momentum update factor, is the cluster representation vector of the i-th category in the current mini-batch.
[0134] In a specific implementation, the present invention will follow the baseline model of cluster contrastive learning and propose a contrastive learning algorithm guided by variable features (MGVF) based on this model. The framework is as follows: Figure 3 As shown in the figure, the primary purpose of using biclustering in the clustering algorithm is to screen for volatile features (star-shaped image markers). The initial feature library is formed by assigning pseudo-labels to the solid-line clusters in the figure. After obtaining the volatile features, the initial memory library is guided by MCM to form a volatile feature memory library for subsequent loss calculation. It also includes other modules such as the backbone network and clustering algorithm. This paper differs from previous work in three key aspects: 1) Regarding the memory library, the average centroid of each sample is not used as the final memory library. At the beginning of clustering, two clustering algorithms with different parameters are used to assign labels to samples, and a multi-cluster centroid scheduler is used to provide more optimal cluster representation vectors for feature learning. 2) Regarding the memory library update, the average centroid of each mini-batch is not used for memory library updates. Instead, each sample is assigned a different weight. Based on this, the weight of each sample changes with each epoch. 3) Regarding the loss function, the paper combines ClusterNCE to construct a volatile feature mining loss to further exploit volatile features, forming a new overall loss function.
[0135] In a specific embodiment, the multi-cluster centroid scheduler specifically includes:
[0136] S11: In methods such as USLRe-id, clustering algorithms such as DBSCAN are often used to assign a pseudo-label to samples for subsequent training. However, the clustering hyperparameters directly control the classification results. Some cluster edge features are often affected by this single label assignment method and are classified into categories they do not belong to. This situation is particularly evident in the early stages of training. To solve the above problem, two clustering methods with different parameters are used. By comparing the two clustering methods, the mutable features are screened out to guide the initialization of the memory library. The clustering formula is as follows:
[0137] ;
[0138] in, , are the clustering results and labels of the benchmark clustering, , They are the clustering results and labels of extended clustering respectively. , are the hyperparameters controlling clustering, and is the expansion factor that controls the hyperparameters, where Too big, If it is too small, a lot of noise will be introduced. Too small, If it is too large, a large number of valid samples will be excluded.
[0139] S12: Add the labels of the corresponding features in the baseline label and the extended label to obtain the comparison label. Due to the influence of the mutable features, the features at the boundary between classes in the baseline cluster will have fewer features in the comparison cluster than those in the baseline cluster. In the case of clustering, these features are marked as clustering sensitive features:
[0140]
[0141] in, and are the clustering results and labels of the comparative clustering, represents the mapping from labels to clustering results, num Represents the set of features of each class in the comparison cluster, represents the number of features in the i-th class. is the jth feature of the i-th class in the comparison cluster. is the clustering hyperparameter.
[0142] S13: Clustering sensitive features The data contains a large amount of difficult-to-distinguish edge information, which is one of the reasons for confusion between features. However, these features are not completely equivalent to volatile features. Especially in the early stages of model training, a large number of features are marked as clustering-sensitive features. However, a considerable portion of these marked features is noise information generated by the model's insufficient discriminative ability. Therefore, to further filter out volatile samples, an uncertainty factor is proposed:
[0143] ;
[0144] in, represents the jth feature in the i-th class, is a class-sensitive feature, represents the number of features in class i. A higher uncertainty factor means lower confidence in the class. If mutable features are still labeled as mutable, they will mislead the model into learning erroneous noise information. Therefore, a threshold is set to control the selection of mutable features. For cluster-sensitive features, when the value of p is greater than 0.5, it means that they contain a lot of noise information. These cluster-sensitive features are filtered out to obtain the final mutable features:
[0145] ,The volatile features are rich in a large amount of cluster boundary information, which is the main reason for the merging between classes.
[0146] S14: Different from the average centroid obtained by averaging the samples, the formation of the centroid is guided by the use of mutable features. The k-th centroid is obtained as follows:
[0147] ;
[0148] in, is the weight of the variable feature, M is the total number of features in the kth class, and it should be noted that . Figure 2 This figure illustrates the process of filtering volatile features and initializing the volatile feature memory. For the clusters in the first figure on the left, hexagons represent cluster-sensitive features. When the uncertainty factor is greater than 0.5, the cluster has a low confidence level and potentially contains a high level of noise information. Therefore, the labeling of these cluster-sensitive features should be discarded. After filtering the uncertainty factor, volatile features are obtained and used to guide the formation of the volatile memory. For the four clusters in the second figure on the left, solid arrows represent embedding more volatile feature information into the centroids of the standard memory, with the thickness representing the degree of embedding. Dashed arrows indicate no processing. Specifically, by increasing the weight of volatile features in the cluster centroid formation process, centroids containing more non-noisy boundary information are obtained, guiding the model to better learn the boundaries of each cluster, significantly improving inter-cluster separability. Furthermore, this approach effectively prevents the merging of strong and weak classes, preventing the introduction of further noise information during training. Finally, the memory is initialized using the weighted centroids.
[0149] In a specific embodiment, the specific steps of the dynamic global update strategy include:
[0150] S21: Although the averaging strategy adopted in SpCL and CC has achieved impressive results in memory library updates, this strategy fails to effectively reflect the overall distribution of features, and the model performs poorly when learning more challenging samples. In HHCL, ICE, and HDCRL, in order to further improve the generalization ability of the model, a hard sample method is adopted to update the memory library. However, in the early stages of training, the model's discriminative ability is insufficient, and this method may introduce a large number of erroneous samples, thereby misleading the model's learning. In order to address the shortcomings of these two update methods and enable the model to make more full use of contextual information, a method based on dynamic weighted centroid updating of the memory library is proposed. Specifically, according to the distance between the sample and the centroid, a Softmax function is used to assign different weights to each query sample, thereby more accurately reflecting the overall distribution of the features:
[0151] ;
[0152] Where N represents the number of instances of class i in the mini-batch, is the centroid of the i-th class, and is a sample instance. The greater the distance between the sample and the centroid in the feature space, the greater the weight assigned, and thus the richer the embedded feature information. In the early stages of training, due to the large amount of noise information, the model should be cautious in mining hard samples to avoid introducing too much noise information. As the epoch increases, the intra-class features become more compact and the inter-class distance gradually increases. The model should gradually emphasize the mining of hard samples and increase the proportion of difficult samples in the cluster representation vector. Therefore, a linear scheduler is introduced. :
[0153] ;
[0154] Specifically, The larger the value, the more emphasis is placed on the importance of boundary samples.
[0155] S22: Weights are not only dynamically allocated within the same epoch, but also change dynamically throughout the training process. The dynamic centroid of the i-th class is as follows:
[0156] ;
[0157] Update the memory bank with these dynamic centroids:
[0158] ;
[0159] in, is a hyperparameter that controls the momentum update. Figure 4 The process of forming a dynamic centroid is demonstrated. DGF consists of two parts: dynamic weight allocation and a linear scheduler. A static average weight vector is obtained from the samples in the mini-batch, and a dynamic weight vector is obtained after dynamic weight allocation and a linear scheduler. Samples in the mini-batch that are farther away from the centroid in feature space are assigned higher weights, and this allocation ratio is also affected by the linear scheduler during the training cycle. The dynamic centroid not only incorporates rich contextual information but is also more sensitive to feature distribution. In addition, as the epoch increases, the dynamic centroid can be adaptively adjusted to better fit the changing trend of intra-class and inter-class distances.
[0160] In a specific embodiment, the specific steps of mining the loss of volatile features include:
[0161] The multi-cluster centroid scheduler reconstructs the weight of each feature in the centroid, providing a more reliable basis for memory library initialization. However, the formation of the centroid is still limited to the level of each class, and does not pay attention to the information of each volatile feature itself, which may affect the adaptability of the model in various complex scenarios. To this end, a volatile feature mining loss is proposed, which aims to deeply explore the volatile feature information and make full use of the potential of volatile samples. Volatile features are often challenging, but not all volatile features are worth mining. Some volatile features are located close to the centroid of the class and may be marked due to insufficient discriminative ability of the model. Therefore, based on all volatile features, the most representative features are selected to construct the loss function. Calculate the loss between each query instance and the volatile feature The inner product of , and select the variable representative positive sample vector and volatile representative negative sample vector In this way, information about volatile features can be captured more effectively, thereby improving the adaptability of the model:
[0162] ;
[0163] in, and are the mutable features of the same and different classes as the query instance q, is the mutable feature that is farthest away from the query instance q in the feature space, and It is the most volatile feature in the feature space that is closest to the query instance q in different classes. For common classes, since there is no corresponding volatile feature to be mined, the average centroid is used. By screening the vectors, we can obtain the mutable positive samples and mutable negative samples with the largest boundary information, thereby constructing the following mutable feature loss:
[0164] ;
[0165] in, Is the temperature hyperparameter. The total loss of volatile feature mining consists of two parts: ClusterNCE loss and volatile feature loss:
[0166] ;
[0167] in, is the weight coefficient used to balance these two losses.
[0168] In a specific embodiment, the experiment of the multi-cluster guided variable feature contrastive learning method for unsupervised person re-identification includes:
[0169] S31: Dataset and evaluation metrics
[0170] The proposed method is validated on the Market1501, DukeMTMC-reID, and MSMT17 datasets. The Market150 dataset consists of 32,668 images covering 1,501 identities, captured by six cameras. The training set includes 12,936 images covering 751 pedestrian identities, while the test set contains 19,732 images covering 750 pedestrian identities.
[0171] The DukeMTMC-reID dataset consists of 36,411 images of 1,812 pedestrians captured by eight different cameras. The training set includes 16,522 images of 702 pedestrian IDs, and the test set contains 702 pedestrians and 408 interfering pedestrians, for a total of 17,661 images. The query set consists of 702 pedestrians from the test set, with one image randomly selected from each camera for each of the 702 pedestrians, for a total of 2,228 images. MSMT17 consists of 126,441 images of 4,101 pedestrian IDs captured by 15 cameras. The training set contains 32,621 images of 1,041 pedestrian IDs, and the test set contains 93,820 images from 3,060 pedestrian IDs.
[0172] All experiments used the Rank-1, Rank-5, Rank-10 accuracy and mean average precision (mAP) of the cumulative matching features (CMC). No post-processing methods such as re-ranking were used during testing.
[0173] Table 1 Comparison results with the most advanced unsupervised Re-ID methods on Market-1501, DukeMTMC-reID and MSMT17 datasets
[0174]
[0175] The best results are marked in bold. †Indicates use of additional camera information.
[0176] S32: Experimental details
[0177] Based on the previous work of others in the field, we use ResNet-50 pre-trained on ImageNet as the backbone network to give it the most basic discriminative ability. We remove all modules after the fourth layer and add a generalized average pooling layer (GeM), followed by a batch normalization layer and Normalization layer, and finally generate 2048-dimensional features as output for each image.
[0178] Table 2 Effectiveness results of each component in the proposed multi-cluster guided contrastive learning of variable features (MGVF)
[0179]
[0180] Among them, MGVF includes multi-cluster centroid regulator (MCM), dynamic global features (DGF) and volatile feature mining loss (VFE).
[0181] Table 3 Comparison results of different scheduler strategies on Market1501 and DukeMTMC-reID datasets
[0182]
[0183] Training was performed on two RTX3090 GPUs. At the beginning of training, the input image was resized to 256×128. Random inversion, cropping, and erasing were used as data augmentation. Each mini-batch contained 64 images from four pedestrian IDs, with a batch size of 256. These images were randomly selected from the training set. The Adam optimizer was used, and its weight decay coefficient was The initial learning rate is 0.00035, and the warmup strategy is adopted in the first 10 epochs. and Set to 0.1 and 1 respectively. For DBSCAN hyperparameters, the maximum distance between two samples on Market-1501 and DukeMTMC-reID is set to 0.6, the minimum number of neighbors of the core point is set to 4, and on MSMT17, they are set to 0.45 and 4 respectively. Based on the experience of previous work, momentum update hyperparameters is set to 0.2. We train the model for 70 epochs on Market-150 and DukeMTMC-reID, and for 80 epochs on MSMT17.
[0184] S33: Comparison with the performance of the most advanced models
[0185] The proposed method (MGVF) was compared with the state-of-the-art pure unsupervised person re-identification (USL) method on three datasets: Market-1501, DukeMTMC-reID, and MSMT17. The experimental results are shown in Table 1. As can be seen from Table 1, the proposed method achieved 86.7% mAP and 94.5% Rank-1 on the Market-1501 dataset, 76.7% mAP and 86.9% Rank-1 on the DukeMTMC-reID dataset, and 41.8% mAP and 72.6% Rank-1 on the MSMT17 dataset. The overall performance is better than BUC, SSL, MMCL, JVCT+, HCT, SpCL, GCL, IICS, ClusterContrast, PPLR, ISE, HDCRL, Adamg, RTMem, and DHCCN, showing significant advantages and strong competitiveness. It is worth mentioning that, unlike CAP, ICE, and IIDS, this paper does not use any additional camera information, which shows that MGVF can achieve better performance under more limited information conditions. In addition, it also performs well compared with some well-known supervised methods.
[0186] S34: Ablation experiment
[0187] To validate the effectiveness of the proposed method, detailed ablation experiments were conducted on the Market1501 and DukeMTMC-reID datasets. Compared to the baseline model (Cluster Contrast), three key components were thoroughly validated: the Multicluster Centroid Modulator, Dynamic Global Feature Update, and the Variable Feature Exploration Loss. The relevant results are shown in Table 2.
[0188] The effectiveness of the multi-cluster centroid modulator. The effectiveness of MCM can be demonstrated by comparing #1 and #2, #3 and #5, #4 and #6, and #7 and #8. For #1 and #2, the baseline model improved mAP by 1.3% and 1.1% and Rank-1 by 0.4% and 0.6% on the Market1501 and DukeMTMC-reID datasets, respectively, through MCM. Compared to the baseline model's strategy of using the average centroid to initialize the memory library, MCM effectively guides the model to push the distance between different classes farther by embedding more reliable edge sample information in the cluster centroid, avoiding the merging of classes during training.
[0189] Effectiveness of dynamic global feature update. The effectiveness of DGF can be illustrated by comparing #1 and #3, #2 and #5, #4 and #7, #6 and #8. Dynamic global feature update assigns different weights according to the distance between the feature and the mini-batch center, so that more contextual information is embedded in the cluster representation vector. In addition, in order to avoid introducing erroneous samples in the early stage of training, a linear scheduler is used to adjust the proportion of hard samples in the training process, while overcoming the shortcomings of using the average centroid and the hardest sample update in the minibatch. For #1 and #3, the baseline model improved the mAP by 1.0% and 0.9% and the Rank-1 by 0.2% and 0.5% on the data Market1501 and DukeMTMC-reID respectively through MCM. In order to further illustrate the effectiveness of each part of the dynamic global feature update and compare other strategies that can gradually increase the proportion of difficult samples, detailed comparative experiments were conducted. As shown in Figure 5 (a), Figure 5 (b), Figure 5 (c) and Figure 5 (d), three different strategies of logarithmic growth, linear growth and exponential growth are compared, and the The value range of . When the value is 0.05, the mAP reaches a maximum of 83.4%. Therefore, the scheduler range is selected to be between 0.01 and 0.08. Furthermore, to explore the impact of three schedulers on DGF performance, a comparative experiment was designed. The experimental results are shown in Table 3. As can be seen from Table 3, the linear function best matches the changing trends between classes during training and has the best performance.
[0190] The effectiveness of the loss for mining volatile features. Comparing #1 and #4, #2 and #6, #3 and #7, and #5 and #8 demonstrates the effectiveness of VFE. This loss exploits volatile samples more deeply, overcoming the shortcomings of MCM, which focuses solely on the cluster level. In particular, the combination of MCM and VFE is more conducive to separating different classes at both the cluster and instance levels, learning more challenging volatile features, and further improving the model's generalization capabilities. As shown in #1 and #6, the baseline model, with the combined effects of MCM and VFE, achieves mAPs of 86.0% and 74.9% on the Market1501 and DukeMTMC-reID datasets, respectively, and Rank-1 scores of 94.4% and 86.3%, respectively. Comparing #4 and #6 shows that, compared to using VFE alone in #4, #6 improves mAP by 2.6% and 1.7% on both datasets, and Rank-1 scores by 1.8% and 1.2%, respectively.
[0191] Visual analysis, using the T-SNE method to visualize the dimensionality reduction of some test samples to compare the baseline model (baseline) with the MGVF method. The results are as follows Figure 6 As shown. Each point represents a sample, and the typical representatives are marked by the elliptical dotted lines. From the samples marked by the elliptical dotted lines, it can be seen that the features obtained by this method have a more compact intra-class structure and better inter-class separability. In addition, all the samples in the test set are extracted, and the intra-class and inter-class distance distributions are visually displayed. The results are shown in Figures 7(a) and 7(b), where d represents the peak distance between the intra-class and inter-class distances. Experiments show that compared with the baseline model, the intra-class distance of the overall samples is smaller, the inter-class distance is larger, and the peak distance between the two is also farther (d1 < d2). To more intuitively demonstrate the superiority of the algorithm, the Rank-list visualization of MGVF and the baseline model is also carried out. The results are shown in Figures 8(b) and 8(a). The leftmost column is the query image, and then from left to right are Rank-1 to Rank-10 in turn. The images marked with thick frames are the misrecognized images. The experimental results show that compared with the baseline, the algorithm of the present invention significantly improves the matching hit rate of the overall query images in the gallery. Especially in the first 5 rankings, there are more misrecognition cases in the baseline model, while MGVF has a very significant improvement in the hit rate, indicating that the algorithm has stronger applicability.
[0192] S35: Parameter Analysis
[0193] The hyperparameters and are analyzed in detail. Among them, controls the degree of contribution of the volatile features to the centroid. The larger is, the more information of the volatile features is embedded in the centroid, and the model will focus more on learning the clustering boundary information, but the global information reflecting the feature distribution in the centroid will become less. On the contrary, the smaller the value of , the model will fall into the local optimal solution and cannot obtain higher performance. Therefore, in order to find the best value of , experiments are carried out on the dataset Market-1501 with its value in the range of 1-11. The experimental results are shown in Figure 9(a). The results show that as increases, the performance of the model gradually improves and reaches the peak when the value of is 6, and then slowly decreases. The hyperparameter controls the ratio between the ClusterNCE loss and the volatile feature loss. The balance between the two is crucial for the performance. Experiments are carried out on the dataset Market-1501 with its value in the range of 0.0-1.0. The experimental results are shown in Figure 9(b). When is 0.4, the model obtains the best performance. The larger the value, the slower the model convergence speed will be, but it can emphasize the diversity of samples and improve the generalization ability of the model. It is worth mentioning that If the value of is greater than 0.8, the model may even experience negative optimization and the performance may drop sharply. This may be due to the model’s inability to learn more general information.
[0194] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0195] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-cluster guided variable feature contrast learning method for unsupervised person re-identification, characterized by: include: Collect pedestrian image data and build an image dataset; The unsupervised person re-identification model is used to extract features from the image dataset to obtain samples to be processed; Use two clustering algorithms with different parameters to assign labels to samples to be processed, and filter out mutable features by comparing the two clusters to guide the initialization of the memory library; The initialized memory library is processed by the multi-cluster centroid scheduler to obtain a mutable feature memory library; Utilize the contextual information in the small batch of samples to be processed, dynamically assign different weights to each sample, construct a dynamic centroid to update the mutable feature memory library; The unsupervised person re-identification model is back-propagated and optimized through the volatile feature memory library to obtain the optimal unsupervised person re-identification model.
2. The multi-cluster guided variable feature contrast learning method for unsupervised person re-identification according to claim 1 is characterized in that: The clustering algorithm using two different parameters includes: ; in, , are the clustering results and labels of the benchmark clustering, , are the clustering results and labels of extended clustering respectively, 、 are the hyperparameters controlling clustering, and is the expansion factor that controls the hyperparameters.
3. The multi-cluster guided variable feature contrast learning method for unsupervised person re-identification according to claim 2 is characterized in that: It also includes adding the labels of the corresponding features in the baseline label and the extended label to obtain the comparison label. The features at the intersection of classes in the baseline cluster will have fewer features in the comparison cluster than the hyperparameters of the baseline cluster. In the case of clustering, these features are marked as clustering sensitive features: ; ; ; ; in, and are the clustering results and labels of the comparative clustering, Represents the mapping from label to clustering result, num represents the set of features of each class in the comparison cluster, represents the number of features in the i-th category, To compare the jth feature of the i-th class in the cluster, is the clustering hyperparameter, is a clustering sensitive feature.
4. The multi-cluster guided variable feature contrast learning method for unsupervised person re-identification according to claim 3 is characterized in that: Construct uncertainty factors to the cluster sensitive features Screening to obtain variable samples: ; in, represents the jth feature in the i-th class, is the clustering sensitive feature, Indicates the number of features in the i-th category, and sets the threshold Q to control the selection of mutable features. For cluster-sensitive features, when the value of p is greater than Q, cluster-sensitive features are filtered to obtain the final mutable features. .
5. The multi-cluster guided variable feature contrast learning method for unsupervised person re-identification according to claim 4, characterized in that: It also includes using the final mutable features to guide the formation of the centroid, and the k-th centroid is obtained as follows: ; in, is the weight of the mutable feature, is a variable feature, M is the total number of features in the kth class, By increasing the weight of volatile features in the cluster centroid formation process, we obtain centroids that contain more non-noise boundary information, allowing the model to learn the boundaries of each cluster and use the weighted centroids to initialize the memory library.
6. The multi-cluster guided variable feature contrast learning method for unsupervised person re-identification according to claim 1, characterized in that: The method of utilizing context information in a small batch of samples to be processed to dynamically assign different weights to each sample and construct a dynamic centroid to update the mutable feature memory library includes: Based on the distance between the sample and the centroid, the Softmax function is used to assign different weights to each query sample to reflect the overall distribution of the features: ; Where N represents the number of instances of class i in the mini-batch, is the centroid of the i-th class, and For sample instances, is a linear scheduler.
7. The multi-cluster guided variable feature contrast learning method for unsupervised person re-identification according to claim 6, characterized in that: The linear scheduler include: ; in, It is the initial linear scheduler, and the weights are dynamically changed during the entire training process: The dynamic centroid of the i-th class is obtained as follows: ; Update the memory bank using dynamic centroids: ; in, is a hyperparameter that controls the momentum update.
8. The multi-cluster guided variable feature contrast learning method for unsupervised person re-identification according to claim 1, characterized in that: The back-propagation optimization of the unsupervised person re-identification model through the volatile feature memory library includes: Based on all the mutable features, representative features are selected to construct the loss function. The inner product of , and select the variable representative positive sample vector and volatile representative negative sample vector , capturing information about mutable features: ; in, and are the mutable features of the same and different classes as the query instance q, is the mutable feature with the farthest distance in feature space from the query instance q, and It is the mutable feature that is closest to the query instance q in the feature space in a different class.
9. The multi-cluster guided variable feature contrast learning method for unsupervised person re-identification according to claim 8, characterized in that: It also includes obtaining the mutable positive samples and mutable negative samples with the largest boundary information by screening the vectors, and constructing the mutable feature loss: ; in, is the temperature hyperparameter, is the expected value. The total loss of volatile feature mining consists of two parts: ClusterNCE loss and volatile feature loss: ; in, is the ClusterNCE loss, is the weight coefficient used to balance these two losses.
10. A multi-cluster guided variable feature contrastive learning system for unsupervised person re-identification, characterized by: include: Acquisition module: used to collect pedestrian image data and build image datasets; Feature extraction module: used to extract features from image datasets using an unsupervised person re-identification model to obtain samples to be processed; Initialization module: This module is used to assign labels to samples using two clustering algorithms with different parameters. It then compares the two clusters to identify mutable features and guides the initialization of the memory library. Mutable feature memory library construction module: used to process the initialized memory library through the multi-cluster centroid scheduler to obtain the mutable feature memory library; Update module: It is used to use the context information in the small batch of samples to be processed to dynamically assign different weights to each sample, construct a dynamic centroid and update the mutable feature memory library; Backpropagation optimization module: used to perform backpropagation optimization on the unsupervised person re-identification model through the volatile feature memory library to obtain the optimal unsupervised person re-identification model.
Citation Information
Patent Citations
Unsupervised cross-domain pedestrian re-identification method based on clustering and multi-scale learning
CN115641613A
Pedestrian re-identification method and device based on unsupervised learning
CN116030502A