Pedestrian re-identification method based on multi-angle similarity aggregation and multiple distance optimization
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XINJIANG UNIVERSITY
- Filing Date
- 2024-01-03
- Publication Date
- 2026-07-21
Smart Images

Figure CN117809253B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a pedestrian re-identification method based on multi-angle similarity aggregation and multi-distance optimization. Background Technology
[0002] Pedestrian re-identification technology is applied in fields such as video surveillance and intelligent security, aiming to retrieve the same pedestrians under different cameras and at different times. However, with the development of urbanization, the widespread adoption of large-scale surveillance systems has also generated massive amounts of data, and processing this data faces the problems of costly, time-consuming, and labor-intensive labeling. To solve this problem and to better meet the practical application scenarios in the real world, some scholars have begun to show great interest in unsupervised pedestrian re-identification methods. Unsupervised pedestrian re-identification technology mainly faces the following challenges: a large amount of noise from pseudo-labels, difficulty in matching across cameras, and a small number of training samples due to security and privacy issues.
[0003] With the development of deep learning, research on unsupervised person re-identification has emerged in large numbers. In unsupervised person re-identification, due to external conditions such as lighting, occlusion, and cross-camera sample capture, the pseudo-labels generated by clustering algorithms contain a large amount of noise, thus misleading model optimization. As a result, samples within the same cluster tend to be far apart, while samples from different clusters tend to be closer together. Deep learning algorithms are currently the mainstream solution, dedicated to reducing pseudo-label noise caused by various factors. Some researchers plan to start from the fine-grained contextual features of the samples, comprehensively considering both global and local output features. Before generating pseudo-labels, some researchers directly calculate the similarity relationship between global and multiple local learnings separately, and then weight multiple matrices from different views. Alternatively, a two-branch model can be designed, using a pre-trained camera classification network to calculate the camera similarity between two samples, and then subtracting the feature similarity from the camera similarity. However, this may introduce additional noise and significantly increase network costs, and is highly dependent on pre-trained camera models, thus having a negative effect. Summary of the Invention
[0004] To address the shortcomings of the existing technologies, the present invention aims to provide a pedestrian re-identification method based on multi-angle similarity aggregation and multi-distance optimization, which minimizes the risk of generating false label noise from the source and does not require additional computing resources, making it highly suitable for complex scene datasets.
[0005] The technical solution adopted by this invention to solve its technical problem is as follows:
[0006] A pedestrian re-identification method based on multi-angle similarity aggregation and multi-distance optimization is provided, including the following steps:
[0007] S1: The multi-angle similarity aggregation module utilizes the similarity relationship between sample features from multiple angles to avoid being influenced by a single preference;
[0008] S2: The multi-distance optimization strategy will further start from the perspective of mining difficult samples, while considering the consistency between instance samples and clustered samples. It will utilize their extremely difficult samples and average samples respectively to reduce the sample distance under the same cluster, while increasing the sample distance between different categories.
[0009] The method for step S1 is as follows:
[0010] S11: Utilize the feature extractor E(.|θ) to obtain the global information extracted by the current model, and directly calculate the Jaccard distance D between the global features of the training set samples. V1 ;
[0011] S12: Calculate the Euclidean distance D between samples O The new Jaccard distance D is calculated using a reordering technique. V2 The final D is obtained by directly weighting the Jaccard distance matrices calculated from the two perspectives using fixed weights. J ;
[0012] S13: Put D J Used to generate pseudo-labels using the DBSCAN clustering algorithm.
[0013] Furthermore, in step S12, D J The calculation formula is:
[0014] D v2 =ReCompute(||f i -f j ||)
[0015] D J =(1-γ)D v1 +γD V2
[0016] Where γ is a hyperparameter used to weight the influence of the distance matrices generated from the two perspectives; ReCompute(x) represents recalculating the matrix similarity directly based on the x matrix, (||f i -f j ||) represents directly calculating the Euclidean distance D between two eigenvectors. O .
[0017] Furthermore, in step S13, DJ is used with the DBSCAN clustering algorithm to generate pseudo-labels y corresponding to all training set samples. i y i Indicates sample x iThe pseudo-labels after clustering ultimately form a set of sample pairs U′={(x1,y1), (x2,y2), (x3,y3)…,(x N y N )}, where N represents the total number of samples in the training set, and y i ∈{1, 2, 3…C}, where C represents the number of centroid categories in the cluster-level storage dictionary, and sample information at different levels is stored separately to generate an instance-level storage dictionary M. I and cluster-level storage dictionary M C .
[0018] Furthermore, in M I The system will directly store the global features of the training set samples in order; M C ={m1, m2…m C}, while not considering outlier clustering, m i Let M represent the centroid vector of the i-th cluster, expressed by the following formula. I and M C Initialize them separately:
[0019] C k ={f i |y i =y k and y i ≠-1}
[0020]
[0021] Among them, C k Let represent the feature vectors of all samples in cluster k corresponding to sample i, and all samples in this cluster have a pseudo-label that is not -1. Then, the mean feature of all samples in this cluster is directly calculated as the centroid. At the same time, the instance-level storage dictionary is also initialized using the following formula:
[0022]
[0023] Furthermore, in step S2, the relationship between the input sample and the cluster-level storage dictionary is measured by directly calculating the transpose product between the input sample and the centroid of the cluster storage dictionary. The specific formula is as follows:
[0024]
[0025] Among them, f j This represents the model output for the current input sample, m. i is the centroid of the i-th cluster level dictionary, m+ is the centroid vector corresponding to the input sample i, and τ is the temperature coefficient.
[0026] Furthermore, in step S2, it is also necessary to measure the relationship between the input samples and the instance-level dictionary, as follows:
[0027]
[0028] Where P is the set of positive samples corresponding to the current input sample. No outliers are discarded, and they are also included in the calculation of the loss function. Finally, the baseline loss function L... base Directly consider L cluster and L instance :
[0029] L base =L instance +1.2L cluster .
[0030] Furthermore, within each batch of samples, the difference between the positive and negative sample sets is measured for each input instance:
[0031] P S =Softmax(Cat([f min -E(f p ), f max -E(f n )]))
[0032] L SS =E(-λ1P) S [0]-(1-λ1)P S [1])
[0033] Here, E(x) represents the calculation of the mean of the vector set x, and Cat(x, y) concatenates the vectors x and y within the parentheses along the first dimension; f max and f min Then, f represents the nearest negative sample and the positive sample with the lowest similarity to the current input sample, respectively; p and f n This represents the set of positive and negative samples in the current batch.
[0034] Treating the cluster centroids corresponding to the input samples and other centroids as positive and negative clusters, the values are calculated according to the two formulas mentioned above, ultimately yielding the L values between the input samples. SS L between cluster centroids SC The final L is obtained by weighting ω0. S0 :
[0035] L s0 =ω0L SS +(1-ω0)L SC .
[0036] Furthermore, starting from the relationships between individual samples and between cluster centroids, the corresponding loss function L is obtained. S-adapt and L C-adapt Finally, considering both losses, L is obtained. GPM :
[0037]
[0038] L S1 =ω1L S-adapt +(1-ω1)L C-adapt
[0039] L GPM =L S0 +L s1
[0040] Where C represents the number of clusters, and E(x) represents the mean. This means that, taking all samples in cluster i as anchor points, the similarity between the anchor point and all other negative class samples is calculated, and the similarity between positive sample pairs is calculated. and Let be the set of difficult positive samples and the set of least difficult positive samples for all samples.
[0041] Furthermore, the total loss function L all The feature extractor E(.|θ) is optimized as follows:
[0042] L all =L base +L GPM .
[0043] Furthermore, while optimizing the model, it is necessary to update the clustering and instance-level storage dictionary in real time using input samples. The specific update method is as follows:
[0044]
[0045]
[0046] Where α represents the update rate of the input sample to the cluster-level and instance-level storage dictionaries.
[0047] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0048] 1. The pedestrian re-identification method of this invention proposes a novel multi-angle similarity aggregation for unsupervised pedestrian re-identification. Currently, most methods mainly perform denoising operations after obtaining pseudo-labels through clustering algorithms. While these methods can help generate high-quality pseudo-labels to some extent, they are all based on the fact that the similarity matrix itself contains a lot of noise. These methods will lead to the calculation of similarity relationships being limited by a single feature, making it difficult to effectively solve the huge intra-class differences in the same pedestrian identifier caused by factors such as pose, viewpoint, and lighting. This invention directly utilizes the similarity relationships between multiple sample features to perform noise reduction operations before clustering generates pseudo-labels. This can effectively avoid the influence of a single preference, minimize the risk of generating pseudo-label noise from the source, and does not require additional computing resources, making it very suitable for complex scene datasets.
[0049] 2. The pedestrian re-identification method of the present invention designs a multi-distance optimization strategy to calculate the differences and balance between individual samples and between clusters, bringing the distance between samples in the same cluster closer, while expanding the differences between clusters, which can effectively reduce false label noise and further improve the performance of the model. Attached Figure Description
[0050] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0051] Figure 1 This is a network framework diagram. Detailed Implementation
[0052] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0053] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0054] To reduce false label noise, shorten the distance between samples within the same cluster, and widen the distance between samples from different categories, this embodiment provides a pedestrian re-identification method based on multi-angle similarity aggregation and multiple distance optimization. This method consists of two main modules: multi-angle similarity aggregation technology and multiple distance optimization strategy. First, it directly utilizes the similarity relationships between sample features from multiple angles. The multi-angle similarity aggregation module statistically analyzes the global information extracted by the current model, integrating it from multiple perspectives to generate a robust sub-distance matrix. Then, it uses fixed parameters to weight the sub-matrix into a final similarity matrix, which is then used by the DBSCAN clustering algorithm to generate false labels. This minimizes the risk of generating false label noise at the source and requires no additional computational resources, making it highly suitable for complex datasets. Subsequently, the multiple distance optimization strategy further considers the mining of difficult samples, taking into account the consistency between instance samples and clustered samples. It utilizes their extremely difficult samples and average samples respectively to narrow the distance between samples within the same cluster while widening the distance between samples from different categories. Ultimately, this improves the model's ability to extract discriminative sample features and reduces the risk of false label noise misleading model training.
[0055] Overall network structure:
[0056] like Figure 1 As shown, the multi-angle similarity aggregation module directly utilizes the similarity relationships between sample features from multiple angles. First, it uses the feature extractor E(.|θ) to obtain the global information extracted by the current model, and then directly calculates the Jaccard distance D between the global features of the training set samples. V1 Next, calculate the Euclidean distance D between the samples. O Then, the new Jaccard distance D is calculated using a reordering technique. V2 Finally, by using fixed weights, the Jaccard distance matrices calculated from the two perspectives are directly weighted to obtain the final D. J Then put D J The DBSCAN clustering algorithm is used to generate pseudo-labels. This minimizes the risk of generating pseudo-label noise at the source and does not require additional network structures, making it highly suitable for datasets with complex scenarios. Subsequently, a multi-distance optimization strategy further considers the mining of difficult samples, taking into account the consistency between instance samples and cluster samples. It utilizes their extremely difficult samples and average samples respectively to reduce the distance between samples within the same cluster, while increasing the distance between samples from different categories. Ultimately, this improves the model's ability to extract discriminative sample features and reduces the risk of pseudo-label noise misleading model training.
[0057] Formally, we define the unlabeled original training set as U = {x1, x2, x3, ..., x...} N|}, where N represents the total number of samples in the training set. In each mini-batch, we randomly select P pedestrians, and then select K different pedestrian image samples for each pedestrian. The training set samples are processed by the feature extractor E(.|θ) to obtain the global output F = {f1, f2, f3, ..., f} of the model. N |}, where f i It is sample x i The feature vectors after feature extraction E(.|θ). Next, we use a multi-angle similarity aggregation strategy to generate the final distance D. J By employing the clustering algorithm DBSCAN and the final similarity matrix D... J We can obtain the pseudo-labels y corresponding to all training set samples. i y i Indicates sample x i Pseudo-labels after clustering. The final set of sample pairs is U′={(x1,y1), (x2,y2), (x3,y3)…,(x N y N )}, and y i ∈{1, 2, 3…C}, where C represents the number of centroid clusters in the cluster-level storage dictionary. Considering that sample information at different levels needs to be stored separately, an instance-level storage dictionary M is generated. I and cluster-level storage dictionary M C In M I The system will directly store the global features of the training set samples in order; M C ={m1, m2…m C}, while not considering outlier clustering, m i Let M represent the centroid vector of the i-th cluster. The following formula is used to define M... I and M C Initialize them separately. It is important to emphasize that the number of clusters C and the corresponding centroid vectors will be dynamically adjusted with different training iterations.
[0058] C k ={f i |y i =y k and y i ≠-1}
[0059]
[0060] C here k Let $\mathbf{i}$ represent the feature vectors of all samples in cluster $k$ corresponding to sample $i$, and all samples in this cluster have a pseudo-label that is not -1. Then, we directly calculate the mean feature of all samples in this cluster as the centroid. Simultaneously, we initialize the instance-level storage dictionary using the following formula:
[0061]
[0062] For instance-level storage dictionaries, all training set samples are retained and used in model optimization. The feature vector f corresponding to the j-th training sample... j Store the data directly in the j-th row of the dictionary in order for easy maintenance later.
[0063] In purely unsupervised person re-identification, model optimization primarily relies on the InfoNCE contrastive loss. The standard contrastive loss function typically involves calculating the transpose product of the input sample and the centroids of the cluster storage dictionary:
[0064]
[0065] f j This represents the model output for the current input sample, m. i It is the centroid of the i-th cluster-level dictionary, m + This is the centroid vector corresponding to input sample i. τ is a temperature coefficient used to adjust the uncertainty of the model, thereby improving the confidence level in classification problems. During model optimization, the clustering and instance-level storage dictionaries need to be updated in real-time using input samples. The specific update method is as follows:
[0066]
[0067]
[0068] Here, α represents the update rate of the cluster-level and instance-level storage dictionaries for the input sample. The two dictionary update methods are similar, with the main difference being that when updating the cluster-level dictionary, the centroid of the input sample is updated; while the instance-level dictionary only updates the content at the corresponding index position of the input sample, without involving other positive samples, ensuring that the sample has independent identifiability.
[0069] Multi-angle similarity aggregation module:
[0070] Numerous scholars have made significant efforts to reduce pseudo-label noise in the field of unsupervised person re-identification, but most of these efforts focus on denoising after pseudo-labels are obtained through clustering algorithms. While these methods can contribute to generating high-quality pseudo-labels to some extent, they all rely on the fact that the similarity matrix itself contains substantial noise, and they fail to consider the distance matrix based on clustering algorithms from multiple perspectives. These methods lead to the calculated similarity relationships being limited by a single feature, resulting in biases that affect the pseudo-labels generated by clustering and mislead model optimization. This is particularly evident when dealing with complex data from various scenarios.
[0071] Inspired by this, we directly utilize the similarity relationships between multiple sample features to reduce noise before clustering generates pseudo-labels, effectively avoiding the influence of a single preference. The multi-angle similarity aggregation technique proposed in this invention statistically analyzes the global information extracted by the current model, integrating it from multiple perspectives to generate a robust sub-distance matrix. This sub-distance matrix is then weighted into a final similarity matrix, which is used by the DBSCAN clustering algorithm to generate pseudo-labels. This approach minimizes the risk of generating pseudo-label noise from the source and requires no additional computational resources, making it highly suitable for datasets with complex scenarios.
[0072] First, to maintain the baseline network structure, we only select the feature vector set F after passing through the feature extractor E(.|θ), without introducing a multi-branch network or using a strategy of complementing global and local feature information. We first directly use the feature vector set F to calculate the Jaccard distance matrix D. V1 To preserve the integrity of information while avoiding the introduction of additional processing or dimensionality reduction, this method not only reduces the risk of losing certain feature information but also more accurately represents the correlation between sample features. Furthermore, this method does not require additional computational steps, thus reducing computational costs, simplifying the entire process, and improving interpretability and maintainability. However, calculating Jaccard distance in high-dimensional data remains very expensive because it requires comparing all possible subsets, leading to a sharp increase in computational complexity and making it impractical. Moreover, Jaccard distance may fail for sparse data because it is not flexible enough in handling missing values. Furthermore, such Jaccard distances are discontinuous; small data changes can cause drastic changes in similarity, making it highly sensitive to noise or minor variations. Therefore, we consider avoiding directly calculating the similarity matrix and instead first calculating the Euclidean distance matrix D using the feature vectors F. O Then, the distance matrix is re-evaluated to obtain a new matrix D. V2 The final distance matrix D is obtained. J :
[0073] D v2 =ReCompute(||f i -f j ||)
[0074] D J =(1-γ)D v1 +γD V2
[0075] Where γ is a hyperparameter used to weight the influence of the distance matrices generated from the two perspectives; ReCompute(x) represents recalculating the matrix similarity directly based on the x matrix, (||f i -f j ||) represents directly calculating the Euclidean distance D between two eigenvectors.O .
[0076]
[0077] Where λ0 is a fixed initial value, t represents the current training batch, and T is the final total number of training iterations.
[0078] Multiple distance optimization strategies:
[0079] By directly calculating the transpose product of the input sample and the centroid of the cluster storage dictionary, we can measure the relationship between the input sample and the cluster-level storage dictionary. At the same time, we also need to measure the relationship between the input sample and the instance-level dictionary, as follows:
[0080]
[0081] Here, P is the set of positive samples corresponding to the current input sample. No outliers are discarded, and they are included in the calculation of the loss function. Finally, the baseline loss function L... base Directly consider L cluster and L instance :
[0082] L base =L instance +1.2L cluster
[0083] Despite L base The loss function plays a role in removing pseudo-label noise, but it cannot significantly mitigate its adverse effects. This is because the complexity and diversity of pseudo-label noise make it difficult to completely eliminate its influence, ignoring the differences between corresponding positive and negative samples of the input sample. Therefore, as the encoder is continuously optimized, the model becomes increasingly unable to distinguish between difficult positive and negative samples during training, ultimately leading to poor denoising performance. Based on this premise, we propose: in each batch of samples, measure the difference between the positive and negative sample sets for each input instance:
[0084] P S =Softmax(Cat([f min -E(f p ), f max -E(f n )]))
[0085] L SS =E(-λ1P) S [0]-(1-λ1)P S [1])
[0086] E(x) represents the calculation of the mean of the vector set x, and Cat(x, y) concatenates the vectors x and y within the parentheses along the first dimension; fmax and f min Then, f represents the nearest negative sample and the positive sample with the lowest similarity to the current input sample, respectively; p and f n This represents the set of positive and negative samples in the current batch. In practice, we treat the cluster centroids corresponding to the input samples and other centroids as positive and negative clusters, and calculate them according to the two formulas mentioned above. Finally, we obtain the L0 among the input samples. SS L between cluster centroids SC The final L is obtained by weighting ω0. S0 :
[0087] L s0 =ω0L SS +(1-ω0)L SC
[0088] Considering both positive and negative hard samples for each instance can improve the model's robustness to some extent. However, considering only the hard samples of a single instance largely depends on the sample's own features and pseudo-labels. Pseudo-labels themselves contain a lot of noise, and the feature vectors extracted from the samples are also affected by external factors. This ignores the correlation between samples and misleads the model's optimization direction. Therefore, we comprehensively consider the balance between categories, treating each category as a unified whole. This effectively balances different categories, reduces bias caused by class imbalance, and improves the model's generalization ability. We designed a new loss function, following the above approach, starting from the relationships between individual samples and cluster centroids, to obtain the corresponding loss function L. S-adapt and L C-adapt Finally, considering both losses, L is obtained. GPM :
[0089]
[0090] L S1 =ω1L S-adapt +(1-ω1)L C-adapt
[0091] L GPM =L S0 +L s1
[0092] Where C represents the number of clusters, and E(x) represents the mean. This means that, taking all samples in cluster i as anchor points, the similarity between the anchor point and all other negative class samples is calculated, and the similarity between positive sample pairs is calculated. and Let L be the set of difficult positive samples and the set of least difficult positive samples for all samples. S-adapt and LC-adapt They all use L adaptive The approach is the same, only the computational objects have changed to the input samples and the current cluster centroids. As you can see, it can bring intra-cluster samples closer together while pushing apart inter-cluster samples. Finally, the total loss function L... all The feature extractor E(.|θ) is optimized as follows:
[0093] L all =L base +L GPM
[0094] By comprehensively considering both difficult samples between samples and difficult samples between categories, the model can learn key features in the data distribution more comprehensively and accurately, improving performance in complex scenarios. Calculating difficult samples between categories allows for a global understanding of the entire category distribution, ensuring the model captures relationships between different categories and mitigating class imbalance. Simultaneously, calculating difficult samples between samples helps identify more challenging samples within the same category, increasing the model's sensitivity to intra-class differences. This comprehensive approach can more fully uncover elusive patterns in the data, making the model more robust and capable of generalization, while adapting to the needs of different tasks, ensuring the model better understands both overall and local data relationships during training.
[0095] This embodiment demonstrates a pedestrian re-identification method, proposing a novel multi-angle similarity aggregation and multi-distance optimization strategy without modifying the network structure or increasing the number of network flows. To fully utilize the similarity relationships between sample features from multiple angles and avoid the influence of a single preference, the multi-angle similarity aggregation module statistically analyzes the global information extracted by the current model, integrating it from multiple perspectives to generate a robust sub-distance matrix. Then, with fixed parameters, these sub-distance matrices are weighted to form the final similarity matrix, which is used by the DBSCAN clustering algorithm to generate pseudo-labels. This minimizes the risk of generating pseudo-label noise at the source and requires no additional computational resources, making it highly suitable for complex scene datasets. Subsequently, the multi-distance optimization strategy further considers the difficulty sample mining perspective, taking into account the consistency between instance samples and clustered samples. It utilizes their extreme difficulty samples and average samples respectively to reduce the sample distance within the same cluster while increasing the sample distance between different categories. Ultimately, this improves the model's ability to extract discriminative sample features, reduces the risk of pseudo-label noise misleading model training, and thus improves the overall robustness and generalization of the network.
[0096] Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-mentioned technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-mentioned technical features or their equivalent features without departing from the inventive concept. For example, technical solutions formed by substituting the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A pedestrian re-identification method based on multi-angle similarity aggregation and multi-distance optimization, characterized in that, Includes the following steps: S1: The multi-angle similarity aggregation module utilizes the similarity relationship between sample features from multiple angles to avoid being influenced by a single preference; S2: The multi-distance optimization strategy will further start from the perspective of mining difficult samples, while considering the consistency between instance samples and clustered samples. It will utilize their extremely difficult samples and average samples respectively to reduce the sample distance under the same cluster, while increasing the sample distance between different categories. The method for step S1 is as follows: S11: Using a feature extractor By obtaining the global information extracted by the current model, the Jaccard distance between the global features of the training set samples can be directly calculated. ; S12: Calculate the Euclidean distance between samples The new Jaccard distance is calculated using a reordering technique. The final result is obtained by directly weighting the Jaccard distance matrices calculated from the two perspectives using fixed weights. ; S13: Put Used to generate pseudo-labels using the DBSCAN clustering algorithm; In step S12, The calculation formula is: in These are hyperparameters used to weight the influence of the distance matrix generated from the two perspectives; This means recalculating the matrix similarity directly based on the x matrix. This means directly calculating the Euclidean distance between two feature vectors. ; In step S13, Used to generate pseudo-labels for all training set samples using the DBSCAN clustering algorithm. , Indicates sample The pseudo-labels after clustering ultimately form a set of sample pairs. ,in, N This represents the total number of samples in the entire training set, and Where C represents the number of centroid categories in the cluster-level storage dictionary, and sample information at different levels is stored separately to generate an instance-level storage dictionary. and cluster-level storage dictionary ; In step S2, the relationship between the input sample and the cluster-level storage dictionary is measured by directly calculating the transpose product between the input sample and the centroid of the cluster storage dictionary. The specific formula is as follows: in, This represents the model output for the current input sample. It is the centroid of the i-th cluster-level dictionary. τ is the centroid vector corresponding to input sample i, and τ is the temperature coefficient. In step S2, it is also necessary to measure the relationship between the input samples and the instance-level dictionary, as follows: Where P is the set of positive samples corresponding to the current input sample. No outliers are discarded, and they are also included in the calculation of the loss function. Ultimately, the baseline loss function... Direct comprehensive consideration and : ; In each batch of samples, measure the difference between the positive and negative sample sets for each input instance: Here, E(x) represents the calculation of the mean of the vector set x, and Cat(x,y) concatenates the vectors x and y within the parentheses in the first dimension; and These represent the nearest negative sample and the positive sample with the lowest similarity to the current input sample, respectively. and This represents the set of positive and negative samples in the current batch. Treating the cluster centroids corresponding to the input samples and other centroids as positive and negative clusters, the relationships between the input samples are calculated. Between and cluster-level centroids Through weighted average Get the final : ; based on Starting from the relationships between individual samples and between cluster centroids, the corresponding loss functions are obtained. and Finally, considering both losses, the value is... : Where C represents the number of clusters, and E(x) represents the mean. This means that, taking all samples in cluster i as anchor points, the similarity between the anchor point and all other negative class samples is calculated, and the similarity between positive sample pairs is calculated. and Let be the set of difficult positive samples and the set of least difficult positive samples for all samples; Total loss function The following methods are used to optimize the feature extractor. : 。 2. The pedestrian re-identification method based on multi-angle similarity aggregation and multi-distance optimization according to claim 1, characterized in that, exist The system will directly store the global features of the training set samples in order; At the same time, outlier sample clustering is not considered. Let the centroid vector of the i-th cluster be represented by the following formula. and Initialize them separately: in, Let represent the feature vectors of all samples in cluster k corresponding to sample i, and all samples in this cluster have a current pseudo-label that is not -1. Then, the mean feature of all samples in this cluster is directly calculated as the centroid. At the same time, the instance-level storage dictionary is also initialized using the following formula: 。 3. The pedestrian re-identification method based on multi-angle similarity aggregation and multi-distance optimization according to claim 1, characterized in that, While optimizing the model, it is necessary to update the clustering and instance-level storage dictionary in real time using input samples. The specific update method is as follows: in, This indicates the update rate of the input samples to the cluster-level and instance-level storage dictionaries.