Pedestrian search method for cross-modal consistency knowledge transfer based on text description

Through cross-modal knowledge transfer and contrast loss of inconsistency perception, the problem of inconsistent image and text descriptions in pedestrian search is solved, and the cross-modal alignment ability and search accuracy of the model are improved.

CN118733808AActive Publication Date: 2024-10-01UNIV OF CHINESE ACAD OF SCI

Patent Information

Application Number
CN202410878983.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-01
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

In pedestrian search based on text queries, there are inconsistencies between images and text descriptions corresponding to different instances of the same person, resulting in poor cross-modal alignment of the model, which in turn affects search accuracy.

Method used

The cross-modal knowledge transfer method (CMKT) is used to fine-tune the contrastive language-picture pre-training CLIP network on cropped pedestrian picture-text pairs, obtain the identity retrieval teacher model, and transfer its cross-modal alignment capabilities to the end through feature distillation The end-to-end pedestrian search network also introduces inconsistency-aware contrast loss and dynamically constrains weak positive sample pairs to reduce noise interference.

Benefits of technology

We successfully narrowed the instance representation gap in the end-to-end pedestrian search network, improved the accuracy of cross-modal alignment and search performance, and verified the effectiveness of the method through ablation experiments and visualization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733808A_ABST
    Figure CN118733808A_ABST
Patent Text Reader

Abstract

The invention discloses a pedestrian search method for cross-modal consistency knowledge transfer based on text description, and relates to the technical field of image processing methods. The method comprises the following steps: using a cross-modal knowledge migration (CMKT) method to pre-train a CLIP network on a cut pedestrian picture-text pair by a fine tuning contrast language-picture to obtain an identity retrieval teacher model with a cross-modal alignment capability; then, the cross-modal knowledge migration CMKT further migrates the cross-modal alignment capability of the identity retrieval teacher model to an end-to-end pedestrian search network through feature distillation; and performing pedestrian search on the pedestrian picture-text pair by using a pedestrian search network. According to the method, the instance representation gap in the end-to-end pedestrian search network can be reduced, and the accuracy of pedestrian search is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing methods, and in particular to a pedestrian search method based on cross-modal consistent knowledge transfer of text description. Background Art

[0002] In the pedestrian search scenario based on text queries, there are often inconsistencies between the images and text descriptions corresponding to different instances of the same pedestrian. Figure 1 As shown in the figure, pedestrian images and their annotated texts have a complete and accurate correspondence, so they constitute strong positive pairs, for example, (image 1, text 1) and (image 2, text 2) are two sets of strong positive pairs respectively; however, there are often inconsistencies between the images and texts corresponding to different instances of the same person, for example, the "white shoulder bag" in image 2 has no corresponding description in text 1, and the "brown shoes" in text 2 are also missing in image 1, so (image 1, text 2) and (image 2, text 1) constitute two sets of weak positive pairs respectively. These weak positive pairs seriously affect the effect of model cross-modal alignment, which in turn brings great challenges to the pedestrian search task based on text queries. For example, the InfoNCE loss ignores the connection between modeling weak positive pairs during training, resulting in the model overfitting to strong positive pairs, and then it is difficult to generalize to weak positive pairs during reasoning. The SDM loss treats strong positive pairs and weak positive pairs equally during training, which introduces a lot of noise interference to cross-modal alignment. Therefore, how to effectively utilize weak positive sample pairs in text query-based pedestrian search requires more sophisticated design.

[0003] In addition, the inherent modality gap between images and text remains a huge challenge for pedestrian search based on text queries. This problem leads to the inability to fully align the identity representations extracted by the pedestrian search network between different modalities, thus lacking the necessary identity distinction ability. Jiang et al. used Contrastive Language-Image Pre-training (CLIP) to initialize the pedestrian retrieval model to inherit its powerful cross-modal alignment ability, thereby solving the modality gap problem in cross-modal pedestrian re-identification. Although such methods have achieved results in enhancing cross-modal alignment at the image level, due to the current lack of instance-level image-text alignment pre-training models, the modality gap problem in cross-modal pedestrian search has not been solved. Summary of the invention

[0004] The technical problem to be solved by the present invention is how to provide a pedestrian search method based on cross-modal consistent knowledge transfer of text description, which can narrow the instance representation gap in the end-to-end pedestrian search network, reduce the noise interference caused by cross-modal alignment, and improve the accuracy of search.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a pedestrian search method based on cross-modal consistent knowledge transfer of text description, comprising the following steps:

[0006] We use the cross-modal knowledge transfer (CMKT) method to fine-tune the contrastive language-image pre-trained CLIP network on cropped pedestrian image-text pairs to obtain an identity retrieval teacher model with cross-modal alignment capabilities.

[0007] Then, the cross-modal knowledge transfer CMKT further transfers the cross-modal alignment capability of the identity retrieval teacher model to the end-to-end pedestrian search network through feature distillation;

[0008] Use the Person Search Network to perform person search on pedestrian image-text pairs.

[0009] The beneficial effects of adopting the above technical solution are: This application proposes a cross-modal knowledge transfer method, which successfully narrows the instance representation gap in the end-to-end pedestrian search network by means of feature distillation; further, an inconsistency-aware contrast loss is proposed. This loss function imposes different degrees of constraints according to the inconsistency of the positive sample pairs, thereby alleviating the noise interference caused by the inconsistency problem to the cross-modal alignment. Finally, the superiority of this method is demonstrated through experiments on the two datasets PRW-TPS-EN and PRW-TPS-CN, and the effectiveness of this method is further demonstrated through a series of ablation experiments, hyperparameter experiments and visualization experiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0011] Figure 1 It is a schematic diagram of the inconsistency between the pictures and texts corresponding to different instances of the same person;

[0012] Figure 2 is a main flow chart of the method described in the embodiment of the present invention;

[0013] Figure 3 Schematic diagram of strong positive constraint and weak positive constraint in IAC loss in the method according to an embodiment of the present invention;

[0014] Figure 4 It is a structural diagram of the identity retrieval teacher model in the method described in the embodiment of the present invention;

[0015] Figure 5 is a pedestrian search architecture diagram for cross-modal knowledge transfer in the method according to an embodiment of the present invention;

[0016] Figure 6is a different L in the embodiment of the present invention q Graph of impact on model performance;

[0017] Figure 7 is the influence of different β7 on the model performance in the embodiment of the present invention;

[0018] Figure 8 is a visualization diagram of pedestrian search results on PRW-TPS-EN using the method described in the embodiment of the present invention;

[0019] Fig. 9 3 is a visualization diagram of pedestrian search results on PRW-TPS-CN using the method described in the embodiment of the present invention. DETAILED DESCRIPTION

[0020] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0022] like Figure 2 As shown, the embodiment of the present invention discloses a pedestrian search method based on cross-modal consistent knowledge transfer of text description, comprising the following steps:

[0023] S1: Use the cross-modal knowledge transfer (CMKT) method to fine-tune the contrastive language-image pre-trained CLIP network on the cropped pedestrian image-text pairs to obtain an identity retrieval teacher model with cross-modal alignment capabilities;

[0024] S2: Then, cross-modal knowledge transfer CMKT further transfers the cross-modal alignment capability of the identity retrieval teacher model to the end-to-end pedestrian search network through feature distillation;

[0025] S3: Person search on pedestrian image-text pairs using the Person Search Network.

[0026] The following is a detailed description of the above steps combined with specific content

[0027] Cross-modal alignment-enhanced pedestrian search framework:

[0028] In order to solve the modality gap problem at the instance level, this application designs a cross-modal knowledge transfer (CMKT) method for pedestrian search based on text queries. Specifically, CMKT first fine-tunes CLIP on cropped pedestrian image-text pairs to obtain an identity retrieval teacher model with strong cross-modal alignment capabilities. Then, CMKT further transfers the cross-modal alignment capability of the teacher model to the end-to-end pedestrian search network by means of feature distillation, thereby significantly improving the cross-modal retrieval effect of the end-to-end pedestrian search method based on text queries.

[0029] In addition, in order to learn consistent identity representations between image and text modalities, this application also proposes an inconsistency-aware contrast (IAC) loss. In view of the interference caused by weak positive sample pairs to cross-modal alignment, this application proposes the concept of cross-modal inconsistency score, which is used to measure the difference between weak positive sample pairs. The cross-modal inconsistency score is quantified by the similarity between the two text descriptions associated with the weak positive sample pairs. Therefore, in the process of cross-modal image-text matching, IAC dynamically imposes constraints on weak positive sample pairs based on the cross-modal inconsistency score. This means that weaker constraints will be imposed on weak positive sample pairs than on strong positive sample pairs. Ultimately, IAC enables weak positive sample pairs to effectively participate in the training of cross-modal alignment and reduces the negative impact of the inconsistency problem.

[0030] 1) Inconsistency-aware contrast loss

[0031] Given a batch of N image-text pairs Use an image encoder and a text encoder to build a set of image-text representations where v i and t i They represent the image embedding and text embedding after L2 norm normalization, c i Indicates their corresponding identity tags;

[0032] The pedestrian image and its corresponding annotated text are regarded as a set of strong positive sample pairs (v i , t i ), the pictures and texts corresponding to different instances of the same pedestrian are regarded as a set of weak positive sample pairs (v i , t j ), where c i =c j And i≠j.

[0033] In order to more effectively utilize strong positive sample pairs and weak positive sample pairs in image text matching training, this application improves the IAC loss based on InfoNCE. IAC is constrained by a strong positive sample pair and a weak positive pair constraint The orange and green graphs represent the image-text embeddings of two pedestrian identities, and a group of graphs with consistent color depth represent strong positive sample pairs, while graphs with inconsistent color depth represent weak positive sample pairs. Based on AM-Softmax loss, The similarity of the strong positive sample pair is constrained to be larger than that of the negative sample pair by a certain interval m1. Therefore, The goal of matching from image to text is to maximize p i,sp The expected log-likelihood of is:

[0034]

[0035] Among them, τ is a temperature hyperparameter used to control the softness of the distribution, K i Indicates the current batch with v i The set of texts that constitute negative sample pairs.

[0036] Based on the idea of ​​difficult sample mining, The main focus is on distinguishing the weakest positive and negative pairs in a batch. Figure 3 As shown, The similarity of the weakest positive sample pair is constrained to be greater than that of the negative sample pair by a certain interval, and this interval is dynamic and determined by the inconsistency of the weakest positive sample pair. Specifically, in order to effectively model the complex relationship between weak positive sample pairs, this application is The concept of cross-modal inconsistency score is proposed. The cross-modal inconsistency score is used to reflect the weak positive sample pair (v i , t j ), which is composed of the two texts associated with the weak positive sample pair (i.e., T i and T j ), and this semantic similarity can be calculated using a public pre-trained sentence embedding model (such as MiniLM), denoted as sim(T i ,T j ). Based on the cross-modal inconsistency score, Inconsistency-aware intervals are introduced to constrain weak positive pairs. Therefore, can be formalized as maximizing p i,wp The log-likelihood of :

[0037]

[0038] Where m2 is the reference interval, J iIndicates that within the current batch, i The set of texts that constitute weak positive pairs, Indicates that the current batch is related to v i The text that constitutes the weakest positive sample pair, and γ represents the text T i and The semantic similarity of In essence, the inconsistency-aware interval γm2 controls the constraint to be proportional to the cross-modal inconsistency score of the weak positive sample pair, thus alleviating the problem of noise interference. Finally, the IAC loss from image to text The calculation method is as follows:

[0039]

[0040] Symmetrically, the IAC loss from text to image It can be obtained by exchanging v and t in formula (1) and formula (2). Finally, the bidirectional IAC loss is calculated as follows:

[0041]

[0042] 2) Cross-modal knowledge transfer

[0043] In order to enhance the cross-modal alignment capability of end-to-end person search methods based on text queries at the instance level, this application proposes the CMKT method. CMKT consists of two parts: an identity retrieval teacher model and an end-to-end person search network for knowledge distillation.

[0044] Identity retrieval teacher model. In the first step, CMKT first trains an identity retrieval teacher model to obtain more powerful cross-modal identity retrieval capabilities. Specifically, this application obtains this identity retrieval teacher model by fine-tuning CLIP on cropped pedestrian image-text pairs.

[0045] like Figure 4 As shown, the cropped pedestrian image The image and text description T are processed by the image encoder and text encoder of CLIP respectively, where H, W and C represent the height, width and number of channels of the image respectively. For the pedestrian image V, it is first split into N = H × W / P 2 Fixed-size, non-overlapping patches are then mapped into a token sequence of length N. where P is the patch size. After being injected with the positional encoding and an additional [CLS] token, the token sequence Input image encoder. The last layer of the image encoder outputs After embedding, a layer of linear mapping and L2 norm normalization is performed to obtain the final representation of the pedestrian image f v .

[0046] For the text T, it is first tokenized into a text token sequence by the Byte Pair Encoding (BPE) method, and the text token sequence is enclosed by two special tokens [SOS] and [EOS] to indicate the start and end of the sequence. It should be noted that the text token sequence exceeds the preset length L t The text token is input to the text encoder to extract features. The last layer of the text encoder outputs After another layer of linear mapping and L2 norm normalization, the final representation of the text description is obtained. t Finally, f v and f t is used to perform cross-modal identity matching, which is jointly supervised by the SDM loss and the IAC loss proposed in this paper, which is formalized as:

[0047]

[0048] Among them, β1 is used to balance the weight of the loss. This set of loss functions guides the representation alignment of image-text pairs, thereby improving the model's ability to retrieve cross-modal identities.

[0049] The fine-tuned CLIP image encoder and text encoder are called identity retrieval image encoder and identity retrieval text encoder, respectively. It is worth noting that during this training process, all parameters of the two identity retrieval encoders are updated, which allows the model to fully inherit the powerful cross-modal alignment capability of CLIP. Ultimately, the identity retrieval teacher model can extract re-identification representations that are more identity-distinguishing and fully aligned across modalities.

[0050] End-to-End Pedestrian Search Network with Knowledge Distillation:

[0051] In the second step, CMKT builds an end-to-end person search network with knowledge distillation, which is dedicated to improving the cross-modal alignment capability at the instance level. Specifically, this goal is achieved by transferring the identity recognition capability obtained by the identity retrieval image encoder to the end-to-end person search network.

[0052] like Figure 5 As described above, the identity retrieval text encoder remains frozen and is responsible for generating representations f for the text query tThe pedestrian search pipeline is built on the basis of the Faster R-CNN detector. Initially, the original scene image is first input into the backbone network and a region proposal network to generate proposal boxes. Then, this application uses RoI-Align to pool the proposal boxes to obtain a fixed-size region of interest feature map. Inspired by the "re-identification first" principle in AlignPS, this application directly uses the norm-aware embedding method to extract the final pedestrian identity representation f from the flattened region of interest feature map. r Next, these region of interest features are fed into a detection head network to obtain a more refined detection bounding box.

[0053] Regarding the training objective of identity recognition, traditional image-text retrieval methods calculate the loss function based on samples within a batch. However, this approach is inefficient for pedestrian search networks, which usually use smaller batch sizes. Therefore, this application introduces an extended version of the IAC loss designed specifically for pedestrian search, denoted as IAC ext Specifically, this application maintains two lengths L q The circular queue (Q t and Q c ) respectively store the text representations and their corresponding identity tags in the past iterations. In each forward propagation process, this application first uses the text features of the current batch f t and its corresponding identity label c respectively update Q t and Q c Then, according to formula (1) and formula (2), this application uses pedestrian instances to represent f r and Q t Calculate from image to text Loss, that is and The goals are to maximize and The log-likelihood of :

[0054]

[0055] in, as well as And m1, m2 and τ have the same meaning as in formula (1) and formula (2). In addition, it should be noted that since the identity retrieval text encoder is frozen during training, this application only uses supervision from image to text for the end-to-end pedestrian search network. The calculation process is as follows:

[0056]

[0057] Finally, due to By introducing more weak positive and negative sample pairs into the loss calculation, the model training process becomes more efficient and achieves higher convergence quality.

[0058] Furthermore, this application uses cross-modal feature distillation to transfer identity recognition knowledge to the end-to-end pedestrian search network. Specifically, this application first crops pedestrian instances with identity labels on the scene graph based on the annotated bounding boxes, and then uses the frozen identity retrieval image encoder to generate identity representations for these pedestrian instances. v , these identity representations will serve as supervisory signals in the knowledge distillation process. The loss is used to minimize the identity representation of the region of interest f r and their corresponding f v The distance between them can be formalized as:

[0059]

[0060] Where N l Indicates the number of regions of interest that are assigned identity labels in the current batch. The above method ensures that the identity representation extracted by the end-to-end pedestrian search network and the representation extracted by the identity retrieval image encoder are fully aligned, thereby reducing the modality gap between it and the identity retrieval text encoder, and ultimately improving the effect of cross-modal identity retrieval.

[0061] Finally, the CMKT method is trained in an end-to-end manner. In this method, consistent with Faster R-CNN, the detection subnetwork consists of a classification loss A regression loss A region proposal foreground / background classification loss and a region proposal regression loss Joint supervision. Cross-modal identity retrieval is performed by and cross-modal feature distillation loss Joint supervision. Therefore, the complete training objective can be formalized as:

[0062]

[0063] After training, the identity retrieval image encoder is discarded, leaving the identity retrieval text encoder and the end-to-end pedestrian search pipeline to perform inference. During inference, the query text is encoded by the identity retrieval text encoder to obtain query features, and the pedestrian search pipeline extracts the detection bounding box and its corresponding re-identification representation on the scene graph. The model then outputs the search results in order based on the similarity between the re-identification representation and the query feature.

[0064] Experimental verification and analysis

[0065] This section first introduces the implementation and training details of the method described in this application, and then conducts comparative experiments with advanced methods on the English dataset PRW-TPS-EN and the Chinese dataset PRW-TPS-CN, respectively, to prove that the method has reached the advanced level of pedestrian search based on text queries. Next, this section further conducts ablation experiments and hyperparameter experiments on key modules to verify the effectiveness of the method described in this application. In each group of experiments in this section, the mAP score and Rank-1 / 5 / 10 accuracy are used to evaluate the search performance of the model. Finally, this section also intuitively demonstrates the search effect of the method described in this application through visualization experiments.

[0066] 1) Model implementation and training details

[0067] For PRW-TPS-EN and PRW-TPS-CN, this application uses the pre-trained CLIP-ViT-B / 16 and Chinese-CLIP-ViT-B / 16 to initialize the identity retrieval teacher model. All images input to the identity retrieval teacher model are uniformly resized to 384×128, that is, H=384, W=128, and the patch size P is set to 16. According to the settings of the pre-trained model, for PRW-TPS-EN and PRW-TPS-CN, the truncation length L of the input text token t are set to 77 and 52 respectively. During training, this application uses three data augmentation methods for images: random horizontal flipping, random cropping, and random erasing, and randomly masks 15% of the tokens for data augmentation. Regarding the hyperparameters in formulas (1) and (2), this paper sets m1 and m2 to 0.3 and 0.1 respectively, and sets the temperature coefficient τ to 0.02. This application uses MiniLM-L12-V2 as the sentence embedding model for calculating the cross-modal inconsistency score in the IAC loss. The loss function weight β1 in formula (5) is set to 0.5. Finally, the identity retrieval teacher model was trained for 60 cycles using the Adaptive Moment Estimation (Adam) optimization algorithm, the training batch size was 128, the learning rate was initialized to 1e-5 and cosine decay was used.

[0068] This application uses ResNet50 pre-trained on ImageNet to initialize the end-to-end pedestrian search network, where res1~res4 are used as the backbone network and res5 is used as the detection head network. For the pedestrian search network, the input scene images are uniformly adjusted to 1500×900, and the processing method of the input text is consistent with the identity retrieval teacher model. The size of the region of interest feature map generated by RoI-Align pooling is set to 14×14. The re-identification representation dimension of the embedding head network output is 256. Q t and Qc The queue length L q is set to 200. The hyperparameter settings in formula (6) and formula (7) are consistent with formula (1) and formula (2), respectively. In formula (10), the loss function weights are set to β2=β4=β5=β6=1, β3=10, and β7=500. Regarding the training details, the end-to-end pedestrian search network was trained for 24 cycles using a stochastic gradient descent optimization algorithm with a momentum of 0.9. Among them, the training batch size is 5, the learning rate is heated to 0.002 in the first cycle, and then decreased to 0.0002 in the sixteenth cycle. This experiment used GeForce RTX 3090GPU and Intel Xeon Gold6330CPU for calculation, used the Pytorch framework to write and implement the code, and ran the experiment on the Ubuntu 20.04 operating system.

[0069] Table 1 - Comparison of advanced methods on the PRW-TPS-EN dataset

[0070]

[0071] 2) Comparative Experiments on Advanced Methods

[0072] This section evaluates the proposed method and two existing text query-based pedestrian search methods, namely the two-stage method and the one-stage method. Among them, the two-stage method splits the text query-based pedestrian search into two subtasks, namely, first using a detector to locate all pedestrian instances in the scene graph, and then performing text query-based pedestrian re-identification on the cropped pedestrian frame graph. In contrast, the one-stage method simultaneously trains two subtasks, pedestrian detection and text query-based pedestrian re-identification, in an end-to-end network. This type of method usually includes a pedestrian search subnetwork responsible for processing scene images and a text encoder responsible for processing text descriptions.

[0073] For two-stage methods, this paper compares an existing method PGPS, as well as some methods that combine advanced detectors (such as RetinaNet, Faster R-CNN and Deformable DETR) and the most advanced cross-modal pedestrian re-identification model IRRA. For one-stage methods, this paper compares an existing method SDPG, as well as some models extended from one-stage pedestrian search methods based on image queries, including SeqNet and COAT that combine BERT and DeBERTa text encoders.

[0074] Table 2 - Comparison of advanced methods on the PRW-TPS-CN dataset

[0075]

[0076] Table 1 shows the performance comparison of the above methods on the PRW-TPS-EN dataset. From the experimental results, it can be seen that the method of the present application is significantly better than all two-stage methods and one-stage methods, reaching the most advanced level of pedestrian search based on text queries. Compared with the two-stage method PGPS proposed by Wu et al., the method of the present application has an improvement of 5.33% and 10.16% in mAP score and Rank-1 accuracy respectively; compared with the one-stage method SDPG proposed by Zhang et al., the method of the present application shows a more significant advantage, with an improvement of 20.20% and 31.43% in mAP score and Rank-1 accuracy respectively. More importantly, compared with the advanced one-stage method COAT+DeBERTa-large, the present application still maintains a significant performance advantage, with an improvement of 4.16% and 13.19% in mAP score and Rank-1 accuracy respectively. These experimental results show that the proposed method effectively solves the complex problem of simultaneously optimizing the three subtasks of pedestrian detection, pedestrian re-identification and cross-modal retrieval in an end-to-end model, thereby surpassing the two-stage method in performance and reaching the current best level of pedestrian search based on text queries.

[0077] Table 2 also shows the performance comparison of advanced methods on the PRW-TPS-CN dataset. It can be seen that the performance of the method of the present application is still significantly ahead of all two-stage methods and one-stage methods, showing the superiority of the method of the present application. Compared with the advanced two-stage method Deformable DETR+IRRA, the method of the present application has advantages of 1.82% and 2.16% in mAP score and Rank-1 accuracy respectively; compared with the advanced one-stage method COAT+DeBERTa-large, the method of the present application has advantages of 2.73% and 10.58% in mAP score and Rank-1 accuracy respectively. These results prove that the method of the present application is insensitive to the query language and is very effective in both English text query and Chinese text query scenarios.

[0078] In addition, Tables 1 and 2 also show that the performance of all the two-stage methods involved in the comparison is better than the one-stage baseline method. This shows that the one-stage model does face huge challenges brought by the instance-level modality gap and multi-task joint optimization, which severely limits their pedestrian search effect. However, the one-stage method proposed in this application is able to surpass all two-stage models, which once again proves the effectiveness of the method in this application in enhancing instance-level cross-modal alignment through cross-modal knowledge distillation.

[0079] 3) Module ablation experiment

[0080] In order to verify the effectiveness of the inconsistency-aware contrast loss and cross-modal knowledge transfer proposed in this application, as well as the role of the re-identification priority principle adopted in this application in improving the model search performance, this section conducted a series of ablation experiments on the PRW-TPS-EN dataset.

[0081] Table 3 - Comparison of different supervision losses for identity retrieval teacher models

[0082]

[0083] Effectiveness of inconsistency-aware contrast loss. In order to evaluate the effectiveness of IAC loss, this section compares the performance of the proposed method when using different supervision losses on the identity retrieval teacher model. The experimental results are shown in Table 3. fixed express A fixed-interval IAC variant is used, which means that IAC imposes a fixed constraint on weak positive pairs but weaker than that on strong positive pairs. From the table results, we can see that compared with InfoNCE and SDM, IAC has an improvement of 3.14% and 0.98% in mAP score, respectively, which shows that IAC can alleviate the noise interference in the cross-modal alignment process by treating strong positive pairs and weak positive pairs differently. Furthermore, compared with IAC fixed , IAC produced a 0.62% improvement in mAP score and a 0.60% improvement in Rank-1 accuracy, which shows that IAC dynamically imposes constraints based on the inconsistency of positive sample pairs, which can more accurately model the complex connections of weak positive sample pairs, and thus more effectively utilize weak positive sample pairs in the process of cross-modal alignment. Finally, it was found that using IAC loss and SDM loss at the same time can achieve a better training effect of the identity retrieval teacher model.

[0084] Table 4 - Comparison of different supervision losses in end-to-end pedestrian search network

[0085]

[0086] In Table 4, this application further analyzes the effectiveness of IACext loss by comparing the supervision losses of different end-to-end pedestrian search networks. ext Used and IAC ext The same extension method makes SDM loss more suitable for pedestrian search networks. In addition, since the unlabeled pedestrian instances in the PRW-TPS-EN dataset do not have corresponding text description annotations, the OIM loss here only uses a lookup table to store the features of pedestrians with identity labels and calculates the loss based on them, while ignoring pedestrians without identity labels. Finally, the experimental results in Table 4 show that IAC extCompared with OIM loss, the mAP score and Rank-1 accuracy are improved by 3.05% and 3.66% respectively. ext The loss improves mAP score and Rank-1 accuracy by 3.79% and 5.84% respectively, further demonstrating the effectiveness of IAC in imposing constraints on the inconsistency of positive sample pairs for cross-modal alignment.

[0087] Effectiveness of cross-modal knowledge transfer: Table 4 also compares the performance with and without the use of cross-modal feature distillation loss L1. Experimental results show that the use of cross-modal knowledge transfer improves the mAP score by 3.34% and the Rank-1 accuracy by 2.83%. These results prove that the CMKT method proposed in this application successfully narrows the instance-level modality gap problem in the end-to-end pedestrian search network, thereby significantly improving the performance of pedestrian search. On the other hand, the end-to-end pedestrian search network based on text queries needs to optimize the three goals of pedestrian detection, pedestrian re-identification, and cross-modal retrieval at the same time, which makes it difficult for the model to fully learn the ability of cross-modal identity retrieval. This application enhances the learning of cross-modal identity retrieval in the end-to-end network through cross-modal knowledge transfer, and ultimately achieves superior pedestrian search performance.

[0088] Table 5- Comparative experiment on the effectiveness of the re-identification priority principle

[0089]

[0090] Effectiveness of the re-identification priority principle: In order to continue to explore the effectiveness of the re-identification priority principle adopted by the method of this application, this application compares the effects of re-identification representation learning based on feature maps at different levels, and the experimental results are shown in Table 5. Among them, "res4" means that the re-identification representation learning is performed directly based on the region of interest features obtained by pooling the features of the last layer of the backbone network, "res5" means that the re-identification representation learning is performed based on the detection box features output by the detection head network, and "res4+res5" means that the re-identification representation learning is performed using the concatenation of the first two features. It should be noted that this group of experiments controls the dimensions of the final pedestrian re-identification representation to be the same. It can be seen that the position of the pedestrian re-identification representation learning in advance in the pedestrian search network can effectively improve the training effect of the model's cross-modal identity retrieval. In view of the fact that the re-identification representation learning based on the last layer of the backbone network features achieved the highest Rank-1, Rank-5 and Rank-10 accuracies, the method of this application adopts this re-identification priority pedestrian search structure.

[0091] Hyperparameter Experiments

[0092] To explore IAC ext The length of the circular queue in the loss is L qIn order to investigate the influence of the weight β7 of the L1 loss on the performance of the method in this application, a series of hyperparameter experiments were conducted on the PRW-TPS-EN dataset.

[0093] Q t (Q c ) The impact of queue length on model performance. q About IAC ext The impact of the loss, this application compares L q The pedestrian search effect of the model when the number increases from 10 to 300. The experimental results are shown in Figure 6 It should be noted that in order to more clearly show L q Impact on model performance. This group of experiments did not use cross-modal knowledge transfer methods when evaluating model performance, that is, only detection loss and IAC were used. ext Loss training model. As can be seen from the figure, when L q When L increases from 10 to 100, the model performance shows a stable upward trend; q When Q increases from 100, the performance of the model hardly improves. t (Q c ) The increase in queue length, IAC ext More inconsistent positive and negative sample pairs are considered in cross-modal alignment, thus achieving better training results; on the other hand, this advantage reaches saturation after the queue length increases to a certain scale. Therefore, the above results prove the reliability of the IAC loss expansion method and the effectiveness of IAC loss in cross-modal alignment using inconsistent positive sample pairs. Finally, the method of this application sets L q =200.

[0094] The impact of the cross-modal feature distillation loss weight on model performance. In order to further explore the impact of the cross-modal feature distillation loss weight β7 on model performance, this application compares the pedestrian search performance of the model when β7 increases from 1 to 700, such as Figure 7 As shown. As can be seen from the figure, as β7 increases, the model performance gradually increases and reaches the highest level when β7=500; when β7 continues to increase, the model performance shows a certain downward trend. This shows that the cross-modal feature distillation loss can effectively guide the pedestrian search network to improve the ability of cross-modal identity retrieval, and when this loss reaches a balance with the detection loss and IACext loss, the model can achieve the best training effect. Finally, the method of this application sets β7 to 500.

[0095] Visualization experiment:

[0096] Figure 8 and Fig. 9The visualization results of the pedestrian search based on text queries of the method of the present application on the PRW-TPS-EN and PRW-TPS-CN datasets are respectively shown. Specifically, for each query text, the present application shows the top three search results from left to right, and each search result is highlighted in the lower left corner of the scene graph. Among them, the green rectangular box represents the correct search result, and the red rectangular box represents the wrong answer. It can be seen from the figure that the method of the present application can correctly find the target pedestrian described in the text when the scale of the pedestrian is small and the posture of the pedestrian and the background change dramatically. Even in the wrong case, some features of the search result are consistent with the text description. For example, Figure 8 The third search result corresponding to query text 1 in the text meets the characteristics described in the text, such as "a short-haired man wearing a white short-sleeved shirt, black trousers and black leather shoes, carrying a black briefcase"; Fig. 9 The third search result corresponding to query text 2 in the text meets the characteristics described in the text, such as "a man with short hair, wearing gray shorts, dark gray shoes, and carrying a black backpack"; Fig. 9 The first search result corresponding to the query text 3 in the text matches the features described in the text, such as "a woman with black hair, wearing a black short-sleeved shirt and blue denim shorts". These results intuitively illustrate that the method of this application achieves a good cross-modal alignment effect in the pedestrian search task based on text query, and thus can find pedestrian instances that match the text description.

[0097] This application proposes a cross-modal knowledge transfer method, which successfully narrows the instance representation gap in the end-to-end pedestrian search network by means of feature distillation; further, an inconsistency-aware contrast loss is proposed. This loss function imposes different degrees of constraints according to the inconsistency of the positive sample pairs, thereby alleviating the noise interference caused by the inconsistency problem to the cross-modal alignment. Finally, the superiority of the method in this application is demonstrated through experiments on the two datasets PRW-TPS-EN and PRW-TPS-CN, and the effectiveness of the method in this application is further demonstrated through a series of ablation experiments, hyperparameter experiments and visualization experiments. The superiority of the method in this application is demonstrated through experiments on the two datasets PRW-TPS-EN and PRW-TPS-CN, and the effectiveness of the method in this application is further demonstrated through a series of ablation experiments, hyperparameter experiments and visualization experiments.

Claims

1. A pedestrian search method based on cross-modal consistent knowledge transfer of text description, characterized by The steps include: We use the cross-modal knowledge transfer (CMKT) method to fine-tune the contrastive language-image pre-trained CLIP network on cropped pedestrian image-text pairs to obtain an identity retrieval teacher model with cross-modal alignment capabilities. Then, the cross-modal knowledge transfer CMKT further transfers the cross-modal alignment capability of the identity retrieval teacher model to the end-to-end pedestrian search network through feature distillation; Use the Person Search Network to perform person search on pedestrian image-text pairs.

2. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 1, characterized in that: An inconsistency-aware contrastive IAC loss method is used in the training of the identity retrieval teacher model to learn consistent identity representations between image and text modalities.

3. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 2, characterized in that: The inconsistency-aware contrast IAC loss is: Given a batch of N image-text pairs Use an image encoder and a text encoder to build a set of image-text representations where v i and t i They represent the image embedding and text embedding after L2 norm normalization, c i Indicates their corresponding identity tags; The pedestrian image and its corresponding annotated text are regarded as a set of strong positive sample pairs (v i , t i ), the pictures and texts corresponding to different instances of the same pedestrian are regarded as a set of weak positive sample pairs (v i , t j ), where c i =c j And i≠j; Inconsistency-aware contrastive IAC includes a strong positive pair constraint and a weak positive pair constraint Weak positive pair constraint The similarity of the strong positive sample pair is constrained to be larger than that of the negative sample pair by a specific interval m1. Therefore, the strong positive sample pair constraint The goal of matching from image to text is to maximize p i,sp The expected log-likelihood of is: Among them, τ is a temperature hyperparameter used to control the softness of the distribution, K i Indicates the current batch with v i The set of texts that constitute negative sample pairs; In order to effectively model the complex relationship between weak positive pairs, we need to constrain the weak positive pairs. The concept of cross-modal inconsistency score is proposed, which is used to reflect the weak positive sample pairs (v i , t j ) is determined by the two texts T associated with the weak positive sample pair i and T j This semantic similarity can be calculated using a public pre-trained sentence embedding model, denoted as sim(T i ,T j ); Based on cross-modal inconsistency scores, weak positive sample pair constraints Inconsistency-aware intervals are introduced to constrain weak positive pairs; therefore, the weak positive pairs are constrained It is formalized as maximizing p i,wp The log-likelihood of : Where m2 is the reference interval, J i Indicates that within the current batch, i The set of texts that constitute weak positive pairs, Indicates that the current batch is related to v i The text that constitutes the weakest positive sample pair, and γ represents the text T i and The semantic similarity of The inconsistency-aware interval γm2 controls the constraint and is proportional to the cross-modal inconsistency score of the weak positive sample pair. Finally, the IAC loss from image to text The calculation formula is as follows: Symmetrical IAC loss from text to images By exchanging v and t in formula (1) and formula (2), we can finally calculate the bidirectional IAC loss as follows:

4. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 1, characterized in that: The identity retrieval teacher model is obtained by fine-tuning the contrastive language-image pre-trained CLIP model on cropped pedestrian image-text pairs: Cropped pedestrian image and text description T are processed by the image encoder and text encoder of the contrastive language-image pre-trained CLIP model, respectively, where H, W, and C represent the height, width, and number of channels of the image, respectively; for the pedestrian image V, it is first split into N = H × W / P 2 Fixed-size, non-overlapping patches are then mapped into a token sequence of length N. where P is the patch size; after being injected with the positional encoding and an additional [CLS] token, the token sequence Input image encoder; the output of the last layer of the image encoder After embedding, a layer of linear mapping and L2 norm normalization is performed to obtain the final representation of the pedestrian image f v ; For the text T, it is first tokenized into a text token sequence by the byte pair encoding BPE method, and the text token sequence is enclosed by two special tokens [SOS] and [EOS] to indicate the start and end of the sequence. The text token sequence exceeds the preset length L t The part is truncated; then, the text token is input into the text encoder to extract features; the last layer of the text encoder outputs After another layer of linear mapping and L2 norm normalization, the final representation of the text description is obtained. t ; Finally, f v and f t is used to perform cross-modal identity matching, which is jointly supervised by the SDM loss and the IAC loss, which is formalized as: Among them, β1 is used to balance the weight of loss; The fine-tuned CLIP image encoder and text encoder are called identity retrieval image encoder and identity retrieval text encoder, respectively; ultimately, the identity retrieval teacher model extracts re-ID representations that are more identity-discriminative and well-aligned across modalities.

5. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 3, characterized in that: Through the cross-modal knowledge transfer (CMKT) method, the identity recognition capability obtained by the identity retrieval image encoder is transferred to the end-to-end pedestrian search network.

6. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 5, characterized in that: The identity retrieval text encoder remains frozen and is responsible for generating representations f for the text query. t ; The pedestrian search pipeline is built on the basis of the FasterR-CNN detector; First, the original scene image is input into the backbone network and a region proposal network to generate proposal boxes; Then, RoI-Align is used to pool the proposal box to obtain a fixed-size region of interest feature map; the final pedestrian identity representation f is directly extracted from the flattened region of interest feature map using the norm-aware embedding method. r ; Next, these region of interest features are further fed into a detection head network to obtain more refined detection bounding boxes.

7. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 5, characterized in that: The training objective of identity recognition in the pedestrian search network is to introduce an extended version of the IAC loss designed for pedestrian search, denoted as IAC ext ; Maintain two lengths L q The circular queue Q t and Q c Store the text representations and their corresponding identity tags in the past iterations respectively; in each forward propagation process, first use the text features f of the current batch t and its corresponding identity label c respectively update Q t and Q c ; Then, according to formula (1) and formula (2), the pedestrian instance is used to represent f r and Q t Calculate from image to text Loss, that is and The goals are to maximize and The log-likelihood of : in, as well as Since the identity retrieval text encoder is frozen during training, only image-to-text supervision is used for the end-to-end person search network. The calculation process is as follows: Finally, due to By introducing more weak positive and negative sample pairs into the loss calculation, the model training process becomes more efficient and achieves higher convergence quality.

8. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 5, characterized in that: Transferring identity recognition knowledge to an end-to-end person search network using cross-modal feature distillation.

9. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 8, characterized in that: First, we crop the pedestrian instances with identity labels on the scene graph based on the annotated bounding boxes, and then use the frozen identity retrieval image encoder to generate identity representations f for these pedestrian instances. v , these identity representations will serve as supervisory signals in the knowledge distillation process; then, The loss is used to minimize the identity representation of the region of interest f r and its corresponding f v The distance between them, the process is formalized as: Among them, N l Indicates the number of regions of interest that have been assigned identity labels in the current batch; Finally, the cross-modal knowledge transfer CMKT method is trained in an end-to-end manner; the detection subnetwork consists of a classification loss A regression loss A region proposal foreground / background classification loss and a region proposal regression loss Joint supervision; cross-modal identity retrieval by and cross-modal feature distillation loss Joint supervision; therefore, the complete training objective is formalized as: After training, the identity retrieval image encoder is discarded, leaving the identity retrieval text encoder and the end-to-end pedestrian search pipeline to perform inference; during inference, the query text is encoded by the identity retrieval text encoder to obtain query features, and the pedestrian search pipeline extracts the detection bounding box and its corresponding re-identification representation on the scene graph, and then the model outputs the search results in sequence according to the similarity between the re-identification representation and the query feature.

10. The pedestrian search method based on cross-modal consistent knowledge transfer of text description as claimed in claim 1, characterized in that: The method was compared with advanced methods on the English dataset PRW-TPS-EN and the Chinese dataset PRW-TPS-CN.

Citation Information

Patent Citations

  • Text-pedestrian retrieval method based on bounding box extraction and semantic consistency constraint

    CN116842212A

  • Cross-modal pedestrian search method and system based on knowledge transfer

    CN117556330A

  • News event search method and system based on multi-level image-text semantic alignment model

    WO2023093574A1

Cited By

  • Underwater target detection method based on vision-language model knowledge distillation

    CN119445353A

  • An underwater target detection method based on visual-linguistic model knowledge distillation

    CN119445353B