A pedestrian re-identification method, device and medium
By constructing a concept-driven person re-identification algorithm, and utilizing image feature extraction and concept extraction modules, fine-grained concept features are automatically mined. This solves the problem of ensuring model decision transparency while maintaining retrieval performance in person re-identification technology, thereby improving the interpretability and retrieval accuracy of the model.
Patent Information
- Application Number
- CN202511596966.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-11-04
AI Technical Summary
Existing pedestrian re-identification technologies struggle to achieve transparency and interpretability in the model's decision-making process while ensuring retrieval performance, thus limiting their application value in security-sensitive scenarios.
A concept-driven pedestrian re-identification algorithm is adopted. By constructing an image feature extractor and a concept extraction module, and utilizing a pre-trained visual Transformer model and a teacher-student concept extraction module, combined with knowledge distillation and a location attention mask generator, fine-grained concept features are automatically mined, and weighted inference is performed through concept activation scores.
It improves the performance and interpretability of pedestrian re-identification, enhances the model's generalization ability and retrieval accuracy in complex scenarios, ensures transparency in the decision-making process, and reduces reliance on additional labeled information.
Smart Images

Figure CN121053706B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of surveillance video retrieval technology, specifically relating to a pedestrian re-identification method, device, and medium. Background Technology
[0002] Pedestrian re-identification aims to retrieve target pedestrians that match a given query image from a large database of pedestrian images captured by multiple different cameras. With the increasing demand for public safety, pedestrian re-identification is widely used in various fields such as video surveillance, criminal investigation, and smart city construction.
[0003] Most current pedestrian re-identification methods focus on improving retrieval performance, thus relying on complex network structures and computationally intensive fine-grained local feature extraction processes to address challenges such as occlusion, pose changes, illumination variations, and viewpoint changes, thereby improving the model's retrieval accuracy and robustness in practical applications. However, these methods typically train the constructed deep neural networks in an end-to-end manner. Due to their high nonlinearity, massive parameter scale, and complex feature combinations, deep neural networks often operate as a "black box," making it difficult to explain which key visual features (such as clothing color, texture, accessories, or body structure) the model relies on to determine whether a pedestrian is a target. This opacity not only reduces the model's credibility but also makes it difficult to diagnose and optimize the model's mismatch behavior, thus limiting its practical application value in security-sensitive scenarios. While existing mainstream methods based on post-hoc interpretability improve the transparency of pedestrian re-identification models, their interpretation results may be inconsistent with the actual decision-making logic and cannot provide feedback during training. While prototype-based learning-based self-interpretability methods can directly generate explanations from within the model, avoiding the drawbacks of post-hoc explanations and improving reliability, they may exhibit instability or inconsistency across different images or environments, leading to poor retrieval performance. Therefore, enhancing model interpretability while ensuring retrieval performance and making its decision-making process transparent is of great significance for promoting the practical application of person re-identification technology.
[0004] In summary, there is an urgent need for a pedestrian re-identification method, device, and medium to solve the problems existing in the current technology. Summary of the Invention
[0005] The purpose of this invention is to provide a pedestrian re-identification method, device, and medium, the specific technical solution of which is as follows:
[0006] A pedestrian re-identification method includes the following steps:
[0007] A concept-driven pedestrian re-identification algorithm is constructed, including an image feature extractor and a concept extraction module. The image feature extractor is used to extract pedestrian image features, and the concept extraction module is used to mine fine-grained concept features in the pedestrian image features and to perform concept-weighted reasoning using the fine-grained concept features.
[0008] Train the pedestrian re-identification algorithm to obtain a pedestrian re-identification model;
[0009] The pedestrian image to be queried is input into the pedestrian re-identification model and matched with images in the image library to retrieve the target pedestrian in the image library.
[0010] Optionally, the image feature extractor is a pre-trained visual Transformer model, and the pedestrian image features include a global feature and multiple image patch features.
[0011] Optionally, the image feature extractor is trained, with loss functions including ID loss and triplet loss.
[0012] Optionally, the concept extraction module includes a teacher concept extraction module and a student concept extraction module;
[0013] The teacher concept extraction module includes a part attention mask generator and a slot attention mechanism;
[0014] The student concept extraction module learns relevant knowledge from the teacher concept extraction module through knowledge distillation, and mines fine-grained concept features from pedestrian image features.
[0015] Optionally, the teacher concept extraction module uses a part attention mask generator to generate a binary part attention mask, which guides the calculation of slot attention. The process is as follows:
[0016] Calculate the probability that each image patch belongs to a different region;
[0017] Binarized region attention masks are generated by comparing random masks with probabilities.
[0018] Generate a random mask with the same shape as the calculated probability;
[0019] Compare the random mask with the probability bit by bit;
[0020] If the value of the random mask is less than the probability value, the mask value at that position is 1, meaning that for a certain part, this image patch needs to be preserved; if the value of the random mask is greater than or equal to the probability value, the mask value at that position is 0, meaning that for a certain part, this image patch needs to be masked.
[0021] Optionally, the process of extracting teacher concept features by the teacher concept extraction module is as follows:
[0022] Set a set of learnable conceptual prototypes, which correspond to different body parts in pedestrian image features;
[0023] The conceptual prototype is initialized using a self-attention mechanism;
[0024] We introduce prior knowledge of human topology and generate a binary part attention mask using a part attention mask generator.
[0025] Binarized regional attention masks are used to guide the calculation of slotted attention;
[0026] Calculate the concept activation score for each concept based on a matrix of slot attention;
[0027] The updated slots are obtained using an attention-weighted average method.
[0028] After stabilizing through multiple iterations, the slot focuses on information related to specific parts of the pedestrian in the input features, forming teacher concept features.
[0029] Optionally, the training loss for the concept extraction module includes attention consistency loss and concept differentiation loss;
[0030] The attention consistency loss is used to achieve knowledge distillation from the teacher concept extraction module to the student concept extraction module, aligning student concept features with teacher concept features in the feature space, so that the corresponding concept prototypes focus on the same body parts;
[0031] The concept differentiation loss includes the concept differentiation loss of the teacher concept extraction module and the concept differentiation loss of the student concept extraction module, which is used to minimize the similarity between fine-grained concept features and the similarity between teacher concept features.
[0032] Optionally, during the inference phase, a partial-part matching strategy is adopted, using only the student concept features extracted by the student concept extraction module, and weighting the student concept features by concept activation scores to calculate the distance between the query and the library samples, and completing the matching between the query and the library samples based on the distance.
[0033] Additionally, the present invention also includes a computer device, comprising a memory and a processor;
[0034] The memory is used to store computer programs that can run on the processor;
[0035] When the processor executes the computer program, it implements the steps of the pedestrian re-identification method as described above.
[0036] In addition, the present invention also includes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the pedestrian re-identification method described above.
[0037] The application of the technical solution of the present invention has the following beneficial effects:
[0038] (1) This invention uses an unsupervised concept bottleneck model as the core framework to improve the performance and interpretability of pedestrian re-identification by automatically mining fine-grained concept features.
[0039] (2) In this invention, a set of fine-grained concept features are learned and generated from image features through a concept extraction module. Each concept corresponds to a concept activation score, which is used to quantify the probability of the concept appearing in the image. The higher the activation score, the higher the confidence of the concept, and the greater its reference value in the retrieval process.
[0040] (3) In this invention, in order to ensure that the concept extraction module can fully explore the diverse discriminative features in the image, this invention provides a concept differentiation loss, which encourages each concept prototype to focus on different parts of the pedestrian foreground region by minimizing the similarity between concepts, thereby enhancing the diversity and uniqueness of concepts and better covering the various discriminative visual elements contained in the pedestrian image.
[0041] (4) Due to the lack of labeled information in unsupervised learning, the concepts mined by the concept bottleneck model may have insufficient accuracy or weak discriminativeness, thus affecting retrieval performance. In this invention, to solve this problem, a knowledge distillation technique is adopted, using the knowledge of the teacher concept model to guide the concept mining process of the student concept model. Specifically, the teacher concept model introduces prior knowledge of human topology to guide different concept prototypes to focus on and mine the discriminative information contained in different body parts of pedestrians, thereby generating more discriminative feature representations. During training, the feature distributions output by the teacher concept model and the student concept model are distilled to make the output of the student concept model as close as possible to the teacher concept model in the feature space. This distillation mechanism enables the student model to automatically learn to mine high-quality concepts from specific body parts to maintain the consistency and stability of corresponding concepts between different images without explicitly relying on additional semantic labeling information, thereby improving the model's generalization ability in complex scenes.
[0042] (5) In this invention, the reasoning stage only uses the fine-grained concept features extracted by the student concept extraction module for matching, and the features are weighted by the concept bottleneck activation score, thereby amplifying the contribution of high-confidence concepts in the retrieval, while suppressing the interference of low-confidence concepts on the final decision, thus improving the accuracy and interpretability of the retrieval without introducing additional network parameters.
[0043] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the figures. Attached Figure Description
[0044] To more clearly illustrate the technical solutions of the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a flowchart of the pedestrian re-identification method in a preferred embodiment of the present invention;
[0046] Figure 2 This is a model framework diagram of the pedestrian re-identification model in the pedestrian re-identification method of the preferred embodiment of the present invention. Detailed Implementation
[0047] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] like Figure 1 As shown, this embodiment provides a pedestrian re-identification method, including the following steps:
[0049] S1: Construct a concept-driven person re-identification algorithm, such as... Figure 2 As shown, the pedestrian re-identification algorithm includes an image feature extractor and a concept extraction module. The image feature extractor is used to extract pedestrian image features, and the concept extraction module is used to mine fine-grained concept features in the pedestrian image features and to perform concept-weighted reasoning using the fine-grained concept features.
[0050] S2: Train the pedestrian re-identification algorithm to obtain the pedestrian re-identification model;
[0051] S3: Input the pedestrian image to be queried into the pedestrian re-identification model and match it with the images in the image library to retrieve the target pedestrian in the image library.
[0052] In this embodiment, the image feature extractor is a pre-trained visual Transformer model, and the pedestrian image features include a global feature and multiple image patch features. The image feature extractor in this embodiment can extract a global feature from the pedestrian image. and Image patch features In this embodiment, given a pedestrian image ,in, , , The image's number of channels, height, and width are represented respectively. A global feature is extracted using an image feature extractor. and Image patch features , Represent the feature dimension. Then, the global features are... and image patch features The images are fed into the concept extraction module to extract fine-grained conceptual features from pedestrian images.
[0053] Furthermore, this embodiment also trains the image feature extractor. The loss function used in the training includes ID loss and triplet loss, and the expression of the loss function is as follows:
[0054] ;
[0055] in, This represents the loss function of the image feature extractor. Indicates ID loss, This indicates the loss of the triplet.
[0056] In this embodiment, the concept extraction module includes a teacher concept extraction module. A student concept extraction module It should be noted that the teacher concept extraction module and the student concept extraction module in this embodiment have similar network structures. The difference is that the teacher concept extraction module has an additional part attention mask generator.
[0057] The teacher concept extraction module includes a part-of-body attention mask generator and a slotted attention mechanism. Specifically, the teacher concept extraction module uses the mask generated by the part-of-body attention mask generator to guide the calculation of the slotted attention mechanism. By introducing prior knowledge of human topology, the module enables the model to extract discriminative teacher concept features from different body parts of a pedestrian. .
[0058] The student concept extraction module learns relevant knowledge from the teacher concept extraction module through knowledge distillation, thereby extracting fine-grained concept features from pedestrian image features. Specifically, the student concept extraction module learns relevant knowledge from the teacher model using knowledge distillation technology, enabling it to automatically extract fine-grained concept features from specific body parts. This does not require explicit reliance on additional semantic annotation information.
[0059] Furthermore, the teacher concept extraction module uses a part attention mask generator to generate a binary part attention mask, which guides the calculation of slot attention. The process is as follows:
[0060] Calculate the probability that each image patch belongs to a different region;
[0061] Binarized region attention masks are generated by comparing random masks with probabilities.
[0062] Generate a random mask with the same shape as the calculated probability;
[0063] Compare the random mask with the probability bit by bit;
[0064] If the value of the random mask is less than the probability value, the mask value at that position is 1, meaning that for a certain part, this image patch needs to be preserved; if the value of the random mask is greater than or equal to the probability value, the mask value at that position is 0, meaning that for a certain part, this image patch needs to be masked.
[0065] Optionally, the process of extracting teacher concept features by the teacher concept extraction module is as follows:
[0066] Set a set of learnable conceptual prototypes, which correspond to different body parts in pedestrian image features;
[0067] The conceptual prototype is initialized using a self-attention mechanism;
[0068] We introduce prior knowledge of human topology and generate a binary part attention mask using a part attention mask generator.
[0069] Binarized regional attention masks are used to guide the calculation of slotted attention;
[0070] Calculate the concept activation score for each concept based on a matrix of slot attention;
[0071] The updated slots are obtained using an attention-weighted average method.
[0072] After stabilizing through multiple iterations, the slot focuses on information related to specific parts of the pedestrian in the input features, forming teacher concept features.
[0073] In a specific implementation case, the setup and initialization of the conceptual prototype are as follows:
[0074] Set a set of learnable conceptual prototypes Since the initial concept prototypes are independent of each other, their potential connections are ignored. This independence may lead to multiple prototypes learning similar features, resulting in information redundancy and reducing the model's discriminative ability. Therefore, this embodiment introduces a self-attention mechanism, using global features to provide contextual information support for the learning of concept prototypes. This allows each concept prototype to not only focus on its own local features but also interact with other prototypes. In this way, concept prototypes can perceive each other's feature distributions and adaptively adjust when they find that multiple concept prototypes are focusing on similar visual patterns, reducing feature overlap, thereby improving the overall discriminative ability and reducing redundant information between concept prototypes. This ensures that each concept prototype focuses on different discriminative features and query matrices. Key matrix Sum matrix All are from the concatenated input Export:
[0075] ;
[0076] in, . , and These represent the weight matrices for the query, key, and value, respectively. Query matrix With the Key matrix Attention score The calculation is as follows:
[0077] ;
[0078] in, This is a scaling factor used to prevent the dot product result from becoming too large, which could lead to gradient instability. Attention score. Representing different concept prototypes and The correlation between them Represents the transpose of a matrix. Conceptual prototype. The updated conceptual prototype is obtained by weighted aggregation of all value matrices. :
[0079] ;
[0080] Ultimately, the conceptual prototype obtained after updating through the self-attention mechanism is: .
[0081] In a specific implementation example, the binarized part attention mask is generated using the part attention mask generator as follows:
[0082] Existing methods for generating binarized part attention masks typically rely on external models (such as pose estimation models and human parsing models). However, these external models have domain differences with the training data for person re-identification tasks, especially when pedestrians are severely occluded or the background is complex, making them prone to errors. Furthermore, existing methods often directly use independently trained external models without incorporating them into the end-to-end training process of the person re-identification model, resulting in generated masks that may not adequately meet the requirements of the task. To address these issues, this embodiment proposes a part attention mask generator that uses human topological prior knowledge for supervision and is trained end-to-end with the proposed person re-identification model. Specifically, the generator consists of a fully connected layer and a softmax layer:
[0083] ;
[0084] in, These are the parameters of the fully connected layer. This represents the probability that each image patch belongs to a different region. Based on This method generates a binarized attention mask for the region. Inspired by Gumbel-Softmax, this embodiment uses a random mask comparison method to generate the binarized attention mask for the region, rather than directly comparing it with a fixed threshold. By introducing randomness, this method allows the model to dynamically explore multiple mask configurations during training, rather than being limited to a single decision pattern caused by a fixed threshold, thereby effectively improving the model's generalization ability and reducing the risk of overfitting. In contrast, directly using a fixed threshold for comparison may lead to an overly deterministic and rigid decision-making process, making the model overly sensitive to small changes in the input and affecting its robustness. In addition, the introduction of a random mask can also alleviate the non-differentiability problem of the fixed threshold method, ensuring that the gradient can propagate smoothly in the backpropagation, thereby optimizing the model's training effect. Specifically, firstly, a mask is generated that is compared with... Random masks with the same shape The value is between [0, 1). Then a random mask is applied. and The probability values are compared to obtain the attention mask for the binarized region. :
[0085] ;
[0086] in, Indicates for the first Regarding the first part Each image patch needs to be preserved; otherwise, if Then it means the first One image block needs to be masked.
[0087] In a specific implementation example, this embodiment uses the generated binarized region attention mask. This guides the computation of slot attention. Slot attention uses an iterative attention mechanism to map the input to a set of slots, each corresponding to a concept in the input. This set of slots is continuously updated and refined in subsequent iterations.
[0088] In a specific implementation case, the process of calculating slot attention and generating teacher concept features is as follows:
[0089] Initialize a set of slots The traditional approach is to initialize slots by randomly sampling from a common Gaussian distribution. This embodiment uses a conceptual prototype that has been updated using a self-attention mechanism. To initialize the slot By capturing the semantic structure of the input data, a more meaningful initial representation is provided, thus accelerating convergence. Then, in each iteration... In the middle, slot A softmax-based attention mechanism guided by part attention masks is used in conjunction with image patch features. Interacting with each other allows the slots in this group to compete to interpret image patch features. The part is updated using a loop update function, and the slot is updated. In this way, the corresponding concepts can be discovered.
[0090] In this embodiment, slotted attention guided by part attention masking in image patch features is described in detail. The single iteration process.
[0091] First, the query matrix is obtained using a learnable linear transformation. Key matrix Sum matrix Among them, the query matrix From the updated concept prototype Export, key matrix Sum matrix Then based on image patch features Export:
[0092] ;
[0093] in, , and These represent the weight matrices for the query, key, and value, respectively.
[0094] Then, use a binarized region attention mask. Guiding Attention Matrix Calculation:
[0095] ;
[0096] ;
[0097] in, It is the scaling factor. Binarized region attention mask The exported weight matrix. The setting can be viewed as a penalty mechanism used to control the computational scope of attention. For image patches belonging to the region of interest of this concept ( If the image patch is not part of the target region, no attention score is processed, and the calculation proceeds normally; however, for image patches that do not belong to the target region... ), then by assigning The penalty value is applied so that the attention score after Softmax calculation approaches zero, thus completely blocking information from that region. This penalty mechanism forces different conceptual prototypes to focus only on discriminative information in specific body parts, reducing interference from irrelevant information and thereby improving the discriminative power of the mined conceptual features. Attention Represents the concept Spatial distribution in the input pedestrian image.
[0098] Based on attention matrix Calculate the concept activation score for each concept. :
[0099] ;
[0100] in, Representative concept Concept activation score, Representing concepts In the The probability of the existence of an image patch.
[0101] Image patch features are analyzed using an attention-weighted averaging method. Aggregation to slot In this way, the updated slot is obtained. :
[0102] ;
[0103] ;
[0104] in, It is a normalized attention weight matrix used to control the contribution ratio of different image patch features when they are aggregated into slots.
[0105] This embodiment uses a gated recurrent unit (GRU) as a loop function to further update the representation of each slot, enabling it to progressively optimize based on newly acquired information to effectively capture long-term dependencies in the slots before and after each iteration. Finally, a multilayer perceptron (MLP) is applied to the output of the gated recurrent unit, and residual connections are introduced to further enhance the representation capability of the slots. After the final... After rounds of iteration, the slot representations stabilize, with each slot representation focusing on information from the input features related to specific parts of the pedestrian, forming the final mined teacher concept features. .
[0106] In this embodiment, the training loss of the concept extraction module includes attention consistency loss and concept differentiation loss;
[0107] The attention consistency loss is used to achieve knowledge distillation from the teacher concept extraction module to the student concept extraction module, aligning student concept features with teacher concept features in the feature space, so that the corresponding concept prototypes focus on the same body parts;
[0108] The concept differentiation loss includes the concept differentiation loss of the teacher concept extraction module and the concept differentiation loss of the student concept extraction module, which is used to minimize the similarity between fine-grained concept features and the similarity between teacher concept features.
[0109] It should be noted that this embodiment uses attention consistency loss to encourage the output of the student concept extraction module to align as closely as possible with the teacher concept extraction module in the feature space, so that corresponding concept prototypes focus on the same body parts. Furthermore, this embodiment also minimizes the similarity between concepts through concept differentiation loss, encouraging each concept prototype to focus on different body parts, enhancing the diversity and discriminativeness of features, thereby covering as much key information in pedestrian images as possible. In addition to learning concept features, the concept extractor also generates a set of concept bottleneck activation scores. The activation score is used to measure the probability of each concept appearing in an image. A higher activation score indicates higher confidence in the concept prototype, making it more valuable for retrieval. During the inference phase, only fine-grained concept features extracted by the student concept extraction module are used, and features are weighted and matched based on the concept bottleneck activation score.
[0110] In this embodiment, attention consistency loss is used. This encourages the output of the student's concept extraction module to be as close as possible to the teacher's concept extraction module in the feature space, thereby ensuring one-to-one instruction, that is, ensuring that the corresponding concept prototypes in the teacher's model and the student's model focus on the same body parts:
[0111] ;
[0112] in, Let be the cosine similarity. and The first Individual teacher conceptual characteristics and fine-grained conceptual characteristics.
[0113] Furthermore, to ensure that the concept extraction module can fully extract diverse discriminative information from the image, we propose a concept differentiation loss. The aim is to encourage each concept prototype to focus on different parts of the pedestrian by minimizing the similarity between concepts, thereby enhancing the diversity and uniqueness of the features of the concepts being explored. Specifically, It consists of two parts: the concept difference loss of the teacher concept retrieval module. Conceptual discrepancy loss with student concept extraction module Its mathematical expression is as follows:
[0114] ;
[0115] ;
[0116] ;
[0117] in, and These represent the first concept extracted by the teacher concept extraction module and the student concept extraction module, respectively. A conceptual feature, This represents the total number of conceptual prototypes.
[0118] The principle of this loss function is that if the first... The first concept and the first When multiple concepts are assigned high attention weights to the same region in a pedestrian image, the learned visual concepts will be very similar, leading to an increase in cosine similarity. or The size increases. At this point, the model adjusts the attention distribution of the concept prototypes through gradient backpropagation, distributing it as widely as possible across different parts of the pedestrian. This mechanism effectively avoids concept redundancy, ensuring that the extracted visual concepts more comprehensively cover the discriminative information in the pedestrian image, thereby improving the model's representational ability.
[0119] Furthermore, to optimize the training of the teacher concept extraction module, student concept extraction module, and part attention mask generator in the fine-grained stage, the loss function of the concept extraction module is calculated as follows:
[0120]
[0121] in, This is the ID loss implemented using cross-entropy loss. It is the positional average triplet loss. It is splicing Features obtained from the conceptual characteristics of teachers. It is splicing Features obtained from the conceptual characteristics of each student. This is the loss function used to train the part attention mask generator. To ensure that the generated part masks can accurately locate key parts of the pedestrian's body, a labeled smoothed cross-entropy loss is used, enabling the model to learn the classification of image patches into corresponding parts. Furthermore, to make the generated part masks more suitable for pedestrian re-identification tasks, the generated masks are used to weight global features to extract corresponding part features, and loss functions commonly used in pedestrian re-identification tasks (including ID loss and triplet loss) are applied to these features to further optimize the discriminative ability of the features. The complete loss function of the part attention mask generator is calculated as follows:
[0122] ;
[0123] ;
[0124] ;
[0125] in, These are location features generated using a location attention mask generator. It is splicing Features obtained after considering the features of each part The cross-entropy loss is labeled and smoothed, calculated as follows:
[0126] ;
[0127] ;
[0128] in, Labels for rough body parts. Represents background, Represent Each body part. Indicates the first The image patch features belong to the first... The probability of each body part. It is the batch size for training. It is the label smoothing regularization rate.
[0129] In the inference stage of this embodiment, a partial-part matching strategy is adopted, using only the student concept features extracted by the student concept extraction module, and weighting the student concept features by concept activation scores to calculate the distance between the query and the image library samples, and completing the matching between the query and the image library samples based on the distance.
[0130] Specifically, only fine-grained concept features extracted using the student concept extraction module. And activate scores through conceptual bottlenecks Weight features to measure the query and image library samples Distance between This approach, which uses concept bottleneck activation score weighting, can amplify the contribution of high-confidence concepts in retrieval while suppressing the interference of low-confidence concepts on the final decision, thereby improving the accuracy and interpretability of retrieval without introducing additional network parameters. The calculation is as follows:
[0131] ;
[0132] in, and Representing queries and image library samples The Middle A conceptual feature, and They represent queries respectively. and image library samples The Middle Concept activation score of each concept feature This represents the Euclidean distance. If a certain concept is in the query... Or image library samples Activation score and If the values are all close to 1, it indicates that this concept prototype is a common feature of both the query and the library samples, and its contribution to distance calculation will be significantly amplified. Conversely, if a concept is in the query... Or image library samples Activation score or If the value is close to 0, it means that the concept does not appear in both the query and the image library samples, and its impact on the final distance is almost negligible.
[0133] Currently, most interpretability methods in the field of person re-identification employ post-interpretation approaches. These methods are independent of the model's structure and training process, and can be directly applied to a trained model without modifying its structure or retraining. They are cost-effective and can enhance interpretability while maintaining the model's original performance. However, post-interpretation methods have a fundamental limitation: the explanations they generate do not directly originate from the model's internal decision-making mechanisms, but are derived through external analysis and deduction of the model's inputs, outputs, or intermediate states.
[0134] To verify the ability of the concept mined by the method in this embodiment to identify pedestrians in application scenarios with varying degrees of complexity, this embodiment compares the method of this embodiment with state-of-the-art ReID methods on two occluded pedestrian re-identification datasets (Occluded-Duke and Occluded-ReID) and two complete pedestrian re-identification datasets (Market-1501 and DukeMTMC-ReID).
[0135] 1) Comparison results on the complete pedestrian dataset:
[0136] Table 1 shows the performance comparison between the method of this embodiment and existing state-of-the-art methods on two complete person re-identification datasets: Market-1501 and DukeMTMC-reID. This embodiment compares two types of person re-identification methods: CNN-based and Transformer-based. Experimental results show that DistillCBM (the method of this embodiment) exhibits excellent retrieval performance on both complete person re-identification datasets, achieving a Rank-1 accuracy of 95.1% and an mAP of 89.1% on the Market-1501 dataset, and a Rank-1 accuracy of 89.8% and an mAP of 81.8% on the more challenging DukeMTMC-reID dataset. Notably, DistillCBM performs particularly well in the mAP metric, which measures overall retrieval capability, achieving the best performance on both datasets. The above experimental results demonstrate that the concepts mined by DistillCBM have strong discriminative power, effectively enhancing the expression and distinguishability of pedestrian identity features, and verifying the effectiveness and competitiveness of DistillCBM in person re-identification tasks.
[0137] Table 1 Performance comparison of DistillCBM and SOTA on Market-1501 and DukeMTMC
[0138]
[0139] 2) Comparison results on occluded pedestrian datasets
[0140] Table 2 shows the performance comparison of DistillCBM with existing state-of-the-art methods on the Occluded-Duke and Occluded-ReID occluded person re-identification datasets. We compared three types of methods, namely...
[0141] i. Complete pedestrian re-identification methods: PCB, ISP, TransReID;
[0142] ii. CNN-based methods for occluded person re-identification: PGFA, HOReID, IGOAS, RFCNet, BPBReID, RTGAT, GPEOG;
[0143] iii. Transformer-based methods for occluded pedestrian re-identification: PAT, FED, DRL-Net, SCAT, SPT.
[0144] Experimental results demonstrate that DistillCBM performs exceptionally well even in complex occluded scenarios, achieving performance comparable to state-of-the-art methods. Specifically, DistillCBM achieves 71.4% Rank-1 accuracy and 59.0% mAP on the Occluded-Duke dataset, and 86.4% Rank-1 accuracy and 80.9% mAP on the Occlude-ReID dataset, surpassing both the compared full person re-identification methods and CNN-based occluded person re-identification methods. When compared with Transformer-based occluded person re-identification methods, DistillCBM achieves the best Rank-1 accuracy and mAP on the Occluded-Duke dataset, with Rank-1 accuracy 2.8% higher and mAP 1.6% higher than the second-ranked SPT, validating that the concepts mined by DistillCBM retain excellent discriminative ability even in complex occluded scenarios. On the Occluded-ReID dataset, although DistillCBM failed to surpass SPT in Rank-1 accuracy and mAP, its performance was very close to SPT's, with Rank-1 accuracy and mAP only slightly lower by 0.4% and 0.4% respectively, ranking second. This result demonstrates that DistillCBM has strong generalization ability in complex occlusion scenarios. It is worth noting that SPT expands its training data by generating a large number of occluded pedestrian images, thereby improving the model's robustness and generalization ability to occluded scenarios. In contrast, DistillCBM did not rely on additional data augmentation strategies, achieving performance similar to SPT solely through unsupervised concept mining and knowledge distillation techniques, further highlighting the effectiveness of DistillCBM.
[0145] Table 2 Performance comparison of CFPER and SOTA on Occluded-Duke
[0146]
[0147] In addition, this embodiment also provides a computer device, including a memory and a processor;
[0148] The memory is used to store computer programs that can run on the processor;
[0149] The processor is used to implement the steps of the pedestrian re-identification method described above when executing the computer program.
[0150] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device.
[0151] The computer device may be a mobile phone, desktop computer, laptop, handheld computer, or cloud server, etc. The computer device may include, but is not limited to, a processor and memory. For example, the computer device may also include input / output devices, network access devices, buses, etc.
[0152] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the computer device, connecting various parts of the computer device via various interfaces and lines.
[0153] The memory can be used to store the computer program and / or modules. The processor implements the computer program by running or executing the computer program and / or modules stored in the memory, and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0154] Wherein, if the modules / units integrated into the computer device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0155] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the pedestrian re-identification method described above.
[0156] This invention provides a pedestrian re-identification method that employs the unsupervised concept bottleneck model BotCL as its core framework. It improves the performance and interpretability of pedestrian re-identification by automatically mining fine-grained concept features. Specifically, this embodiment predefines a set of learnable concept prototypes and learns and generates a set of fine-grained concept features from image features through a concept extraction module. Each concept prototype corresponds to a concept activation score, used to quantify the probability of the concept appearing in the image. The higher the concept activation score, the higher the confidence of the concept prototype, and the greater its reference value in the retrieval process. To ensure that the concept extraction module can fully mine the diverse discriminative features in the image, this embodiment proposes a concept differentiation loss. By minimizing the similarity between concepts, it encourages each concept prototype to focus on different parts of the pedestrian foreground region, thereby enhancing the diversity and uniqueness of concept prototypes to better cover the various discriminative visual elements contained in the pedestrian image. However, due to the lack of annotation information guidance in unsupervised learning, the concepts mined by the concept bottleneck model may have insufficient accuracy or weak discriminative power, thus affecting retrieval performance. To address this issue, this embodiment introduces knowledge distillation technology, leveraging the knowledge of the teacher concept extraction model to guide the concept mining process of the student concept extraction model. Specifically, the teacher concept extraction model incorporates prior knowledge of human topology to guide different concept prototypes to focus on and mine discriminative information contained in different body parts of a pedestrian, thereby generating more discriminative feature representations. During training, the feature distributions output by the teacher and student concept extraction models are distilled to ensure that the output of the student concept extraction model is as close as possible to that of the teacher model in the feature space. This distillation mechanism enables the student concept extraction model to automatically learn to mine high-quality concepts from specific body parts without explicitly relying on additional semantic annotation information, thus improving the model's generalization ability in complex scenarios. In the inference phase, only the fine-grained concept features extracted by the student concept extraction module are used for matching, and the features are weighted by the concept bottleneck activation score, thereby amplifying the contribution of high-confidence concepts in retrieval while suppressing the interference of low-confidence concepts on the final decision, improving the accuracy and interpretability of retrieval without introducing additional network parameters.
[0157] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0158] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A pedestrian re-identification method, characterized in that, The method comprises the following steps: A concept-driven pedestrian re-identification algorithm is constructed, including an image feature extractor and a concept extraction module, the image feature extractor is used to extract pedestrian image features, and the concept extraction module is used to mine fine-grained concept features in the pedestrian image features and perform concept weighted reasoning by using the fine-grained concept features; The pedestrian re-identification algorithm is trained to obtain a pedestrian re-identification model; A pedestrian image to be queried is input into the pedestrian re-identification model, and images in a gallery are matched to retrieve a target pedestrian in the gallery; The training loss of the concept extraction module comprises an attention consistency loss and a concept differentiation loss; The attention consistency loss is used to realize knowledge distillation from a teacher concept extraction module to a student concept extraction module, aligns the student concept features and the teacher concept features in a feature space, and focuses corresponding concept prototypes on the same body part; The concept differentiation loss comprises a concept differentiation loss of the teacher concept extraction module and a concept differentiation loss of the student concept extraction module, and is used to minimize the similarity between the fine-grained concept features and the similarity between the teacher concept features; The expression of the concept differentiation loss is as follows: ; ; ; in, This represents the loss of conceptual differentiation. This represents the conceptual discrepancy loss in the teacher's concept retrieval module. This represents the conceptual discrepancy loss in the student's concept retrieval module. and These represent the first concept extracted by the teacher concept extraction module and the student concept extraction module, respectively. A conceptual feature, This represents the total number of conceptual prototypes.
2. The pedestrian re-identification method of claim 1, wherein, The image feature extractor is a pre-trained visual Transformer model, and the pedestrian image features comprise one global feature and a plurality of image block features. 3.The pedestrian re-identification method of claim 2, wherein, The image feature extractor is trained, and a loss function in the training comprises an ID loss and a triplet loss. 4.The pedestrian re-identification method of claim 1, wherein, The concept extraction module comprises a teacher concept extraction module and a student concept extraction module; The teacher concept extraction module comprises a part attention mask generator and a slot attention mechanism; The student concept extraction module learns relevant knowledge from the teacher concept extraction module through knowledge distillation, and mines fine-grained concept features in the pedestrian image features. 5.The pedestrian re-identification method of claim 4, wherein, The teacher concept extraction module generates a binary part attention mask by using the part attention mask generator, and guides the calculation of the slot attention by using the binary part attention mask, and the process is as follows: The probability that each image block belongs to different parts is calculated. A binary part attention mask is generated by using a method of comparing the probability with a random mask. A random mask with the same shape as the calculated probability is generated. The random mask is compared with the probability bit by bit. If the value of the random mask is less than the value of the probability, the mask value at the position is 1, that is, for a certain part, the image block needs to be retained; if the value of the random mask is greater than or equal to the value of the probability, the mask value at the position is 0, that is, for a certain part, the image block needs to be shielded. 6.The pedestrian re-identification method of claim 4, wherein, The process of the teacher concept extraction module extracting teacher concept features is as follows: A set of learnable concept prototypes corresponding to different body parts in the pedestrian image features is set; The set concept prototypes are initialized by using a self-attention mechanism; A binary part attention mask is generated by introducing human body topology prior knowledge through the part attention mask generator; The calculation of the slot attention is guided by using the binary part attention mask; The concept activation score of each concept is calculated based on the slot attention matrix; The updated slot is obtained by using an attention weighted average method. After the slot is stabilized after multiple rounds of iteration, the slot focuses on the information related to the specific parts of the pedestrian in the input features, forming the teacher concept features.
7. The pedestrian re-identification method of claim 1, wherein, In the reasoning stage, a part-part matching strategy is adopted, only the student concept features extracted by the student concept extraction module are used, and the student concept features are weighted through the concept activation score, the distance between the query and the gallery samples is calculated, and the matching between the query and the gallery samples is completed based on the distance.
8. A computer device, comprising: comprising a memory and a processor; the memory is configured to store a computer program capable of running on the processor; the processor is configured to implement the steps of the pedestrian re-identification method according to any one of claims 1 to 7 when the computer program is executed.
9. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and when the computer program is executed by the processor, the steps of the pedestrian re-identification method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Hardware-aware dynamic compression method and device
CN118504641A
Pedestrian re-identification method and training method for optimizing fine-grained feature fusion
CN119832596A
Image classification method and device based on concept alignment, equipment and medium
CN120543938A
KR20250017959A