Sketch-based person re-identification method with cross-modal cue adjustment

Through the combination of cross-modal prompt adjustment and sketch detail enhancement module, the problem of cross-modal differences between sketches and photos is solved, and the accuracy and generalization ability of pedestrian re-identification in sketches are improved, which is suitable for public security monitoring and criminal investigation. .

CN117953539BActive Publication Date: 2024-08-27NANJING UNIV OF INFORMATION SCI & TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410097955.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2024-08-27
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

The existing technology has the problems of too many parameters, overfitting and poor model generalization ability in sketch person re-identification, making it difficult to effectively handle the cross-modal differences between sketches and photos.

Method used

The method of cross-modal prompt adjustment is adopted to extract features by constructing a four-stage dual-stream backbone network, using photo perturbation prompts for sampling optimization, and introducing a sketch detail enhancement module for cross-modal feature alignment, and combining the general loss function for network Optimize and output matching results.

Benefits of technology

It effectively mines pedestrian characteristic information, alleviates over-fitting problems, improves the accuracy and generalization ability of sketch pedestrian re-identification, and is suitable for public security monitoring and criminal investigation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117953539B
    Figure CN117953539B
Patent Text Reader

Abstract

The present invention discloses a method for re-identifying a person in sketch with cross-modal prompt adjustment, comprising the following steps: S1, constructing a two-stream backbone network with four stages to extract features of input pedestrian photos and hand-drawn sketches; S2, using photo perturbation prompts to sample and optimize the photo features output by the first-stage backbone network of S1; S3, using the sketch features output by the third-stage backbone network of S1 to induce sketch detail enhancement, and perform cross-modal feature alignment and sketch feature optimization. S4, using a universal loss function to optimize the network, and performing similarity measurement on the features finally output by the backbone after processing by S2 and S3, and outputting matching results. The present invention guides the shallow frozen pre-trained model to perform sketch retrieval tasks from the perspective of sample prompts and feature enhancement, while taking into account the problem of large gaps between modalities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer vision technology, and more specifically, to a sketch pedestrian re-identification method with cross-modal prompt adjustment. Background Art

[0002] Person re-identification (ReID) is a crucial task in intelligent security surveillance systems, which aims to match a single pedestrian image in a query set with images in a gallery set taken by different cameras. Traditional ReID methods focus on matching pedestrian images taken by visible light cameras, which can be considered a single modality retrieval problem in visible light scenes. However, in real crime cases, criminals often appear in places where there are no cameras. Therefore, it is difficult to obtain photos of criminals. The police usually draw sketches of criminals from the descriptions of eyewitnesses. Sketch images contain many appearance features of criminals. It can be found that the query image is inevitably a sketch image rather than a photo. This situation has also been confirmed by criminal experts and law enforcement agencies, which has often been ignored in past studies. Face recognition studies how to match facial sketch images with facial photo datasets, where the sketch images are obtained by professional painters based on eyewitness descriptions.

[0003] Given a sketch query, the sketch-photo recognition system can match the same class of photo modalities. Based on the sketch method, existing sketch-photo recognition includes sketch image retrieval based on freehand drawing and sketch person re-identification based on professional hand-drawing. Due to the large modality gap, matching hand-drawn sketches with photo images is a very challenging cross-modal recognition problem. Different imaging principles make the two modes heterogeneous and information asymmetric. For example, sketch images are abstract and only contain the structure or contour information of the object, without detailed information of the object such as color and texture. The intuitive idea to alleviate the modality difference between sketches and photos is to use an image transformation network to generate style-aligned modality images, replacing the original modality, such as sketch-to-photo synthesis, photo-to-sketch synthesis. However, due to sample diversity and domain gap, generated noise is inevitably introduced, making it difficult to achieve modality alignment.

[0004] In recent years, the study of sketch person re-identification has attracted much attention. Due to the inherent cross-modal differences between sketches and photos, sketch retrieval is extremely challenging in bridging the gap between the two modalities. To this end, many researchers have proposed many effective solutions that rely on extracting shared patterns and standard triplet loss for cross-modal metric optimization. Despite the encouraging achievements, these methods still have difficulty in achieving large modality differences. Zhang et al. developed cross-compatible embedding and feature construction to enhance feature discrimination between different modalities. However, cross-transplantation inevitably introduces additional noise in the learned modalities due to the local exchange between the two modalities. In addition to enhancing feature discrimination, it is also worth noting in sketch person re-identification to bridge the modality gap and the important changes in each modality. Chen et al. proposed an asymmetric disentanglement and dynamic synthesis method to deal with modality differences in the transformer framework. In order to achieve the desired results, the above methods carry out cumbersome model design, ignoring the problems caused by large number of parameters, high computational complexity, and overfitting.

[0005] Therefore, it is necessary to design an effective sketch pedestrian re-identification method to solve the above-mentioned problems, so as to promote the further application of sketch pedestrian re-identification technology in public security monitoring, criminal investigation and other fields. Summary of the invention

[0006] In view of the problems of multiple parameters, overfitting, and poor model generalization ability in existing sketch retrieval, this paper proposes a cross-modal prompt adjustment sketch pedestrian re-identification method based on prompt adjustment and feature enhancement technology. It can fully mine the pedestrian feature information of each modality to deal with the problem of large differences between modalities, and at the same time alleviate the overfitting problem. The present invention can guide the shallow frozen pre-trained model to perform sketch retrieval tasks from the perspective of single sample prompts and feature enhancement.

[0007] In order to solve at least one of the above technical problems, according to one aspect of the present invention, a method for re-identifying a person from sketch with cross-modal prompt adjustment is provided, comprising the following steps:

[0008] S1. Construct a two-stream backbone network with four stages to extract features of input pedestrian photos and hand-drawn sketches;

[0009] S2, the photo features output by the backbone network in the first stage of S1 are sampled and optimized using photo perturbation prompts;

[0010] S3, the sketch features output by the third-stage backbone network of S1 are used to induce sketch detail enhancement using the photo features output by the third-stage backbone network, and cross-modal feature alignment and sketch feature optimization are performed.

[0011] S4: Use a common loss function to optimize the network, measure the similarity of the features processed by S2 and S3 and finally output by the backbone, and output the matching results.

[0012] Furthermore, the specific construction process of the four stages in S1 is as follows:

[0013] S101, design the first layer of resnet50 as a dual-branch structure with the same structure but no shared network parameters as the first stage of the feature extraction network;

[0014] S102, the second and third layers of resnet50 are integrated into the second stage of the feature extraction network, and the features output from the first and second stages are sent to the latter two stages to continue the deep extraction of pedestrian features, where the fourth and fifth layers of resnet50 are successively integrated into the third and fourth stages of the feature extraction network, and finally the shared photo features are obtained. and shared sketch features K represents a patch size, i.e., the height × width of the feature map, and d is the number of channels of the feature map.

[0015] Further, S101 specifically, makes (X P ,X S ) represents the set of input photo modality and sketch modality feature maps, where the photo set is composed of express, It is represented as a sketch set, where M and N represent the number of pedestrian identities and the number of samples of each pedestrian identity, respectively. Then, the photo X P and Sketch X S They are used as inputs of the two branches of the feature extraction network respectively.

[0016] Furthermore, the specific steps of S2 are as follows:

[0017] S201, outputting the photo feature f from the first stage of the feature extraction network through linear projection p and sketch feature f s Further generate sample photo representation; by using the sigmoid function and a static factor of 0.5; specifically it can be expressed as:

[0018] S = 0.5sigmoid(f p )·f s (1);

[0019] S202, perform the reshaping operation in advance, that is, reshape the features into The size of , and then linear projection is used to generate the offset set, and the set is reshaped to satisfy the spatial size. This process is called pixel shuffling. When other hyperparameters are fixed, the number of parameters can be reduced to 1 / 4 under the pixel shuffling setting. Linear projection is first used to generate the offset set; then the set is reshaped to satisfy the spatial size.

[0020] S203, given an upsampling factor of 2, is used to generate an offset S of size H×W; the grid sample function uses the positions in S to convert the shallow features f of the photo p Resampled to a feature size of 2H×2W through bilinear interpolation, the sampled photo feature f' p is the sum of the offset S and the original sampling grid Grid; this process is defined as:

[0021] f' p =S+grid_sample(f p ,S) (2).

[0022] Furthermore, the specific steps of S3 are as follows:

[0023] S301, feature extraction network outputs photo features in the third stage and sketch features They are input into the sketch detail enhancement module respectively; an affinity matrix is ​​obtained by calculating the cosine similarity between the normalized feature tensors; the calculation of cosine similarity represents the similarity between feature vectors:

[0024]

[0025] Then use the Softmax function to operate on the affinity matrix, limit the value of its elements between 0 and 1, and ensure that the sum of the elements in each row is 1; use the normalized affinity matrix to sketch the feature tensor Perform weighted summation to obtain the spatially aligned feature tensor The purpose of this step is to adjust the representation of the sketch feature vector by considering the feature vectors in the photo feature tensor that are similar to the current sketch position. The specific representation is:

[0026]

[0027] S302, two cascaded convolutional layers are used to fuse the visual features of the two modalities; the first convolutional layer with a kernel size of 1×1 is used to reduce the number of feature channels, introduces the nonlinear transformation GELU, and the convolutional layer with a kernel size of 3×3 achieves a more comprehensive feature fusion, thereby generating a feature pool f pool :

[0028]

[0029] S303, use the maximum pooling layer maxpool, two 7×7 convolutional layers, RELU and sigmoid functions on the sketch features to generate a spatial attention mask; finally, the mask mask and the feature pool f pool Multiply to reduce the introduction of irrelevant photo features and obtain the required supplementary information from the perspective of sketch modality, thereby obtaining the feature f' after sketch detail enhancement s ; The whole process can be described as:

[0030]

[0031] Where ⊙ represents the Hadamard product.

[0032] Furthermore, S4 uses the general circle loss L Cir and identity loss L id Optimize the network and classification results, circle loss L Cir and identity loss L id Respectively expressed as:

[0033]

[0034] Among them, δ(-)=m; δ(+)=1-m; [·] + is a "zero cutoff" operation to ensure and is non-negative; and are positive and negative sample pairs respectively; L and H are the number of input positive and negative pairs; γ is the scaling factor for similarity separation; m represents the margin parameter.

[0035]

[0036] Where Q is the number of pedestrian identities in each batch; y i is the label of the ith pedestrian identity; is the prediction result of the tth pedestrian identity after the feature extraction network stage 4.

[0037] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the sketch pedestrian re-identification method with cross-modal prompt adjustment of the present invention are implemented.

[0038] According to another aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the sketch pedestrian re-identification method with cross-modal prompt adjustment of the present invention are implemented.

[0039] Compared with the prior art, the present invention has at least the following beneficial effects:

[0040] This paper proposes a novel sketch person re-identification method with cross-modal cue adjustment, which guides the shallow frozen pre-trained model to perform sketch retrieval tasks from the perspective of sample cues and feature enhancement, while taking into account the large gap between modalities. Among them, an effective photo perturbation cue strategy is designed to guide the frozen shallow pre-trained model to amplify the features of the photo modality from the perspective of sample cues, emphasizing the elements that contribute to the decision boundary. At the same time, a photo-induced sketch detail enhancement module is proposed, which can supplement more detailed information to enhance deep sketch features. This paper conducts a comprehensive evaluation on the sketch person re-identification dataset and proves the effectiveness of the proposed method. In addition, evaluation experiments are conducted on four sketch retrieval-based datasets, and the results show the strong generalization of the method. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present invention, but are not intended to limit the present invention.

[0042] Figure 1 A flow chart of the method of the present invention is shown;

[0043] Figure 2 A network architecture diagram of the method of the present invention is shown. DETAILED DESCRIPTION

[0044] To make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them.

[0045] Unless otherwise defined, technical or scientific terms used herein shall have the same meaning as commonly understood by one of ordinary skill in the art to which the invention belongs.

[0046] Embodiment 1:

[0047] like Figure 1 As shown, a method for re-identifying a person from a sketch with cross-modal prompt adjustment provided by the present invention comprises the following steps:

[0048] S1. Construct a two-stream backbone network with four stages to extract features of input pedestrian photos and hand-drawn sketches;

[0049] S2, the photo features output by the backbone network in the first stage of S1 are sampled and optimized using photo perturbation prompts;

[0050] S3, the sketch features output by the third-stage backbone network of S1 are used to induce sketch detail enhancement using the photo features output by the third-stage backbone network, and cross-modal feature alignment and sketch feature optimization are performed.

[0051] S4: Use a common loss function to optimize the network, measure the similarity of the features processed by S2 and S3 and finally output by the backbone, and output the matching results.

[0052] like Figure 2 As shown in FIG. 1 , a network architecture diagram of a sketch pedestrian re-identification method with cross-modal prompt adjustment provided by the present invention is shown. The method mainly includes three parts: a feature extraction network, a photo perturbation prompt module, and a sketch detail enhancement module.

[0053] The present invention provides a preferred embodiment to perform S1. The purpose of this embodiment is to use resnet50 to build a dual-stream network to fully extract information of pedestrian images in photo mode and sketch mode. Figure 2 The overall framework of the two-stream backbone network can be seen in the feature extraction network part. The feature extraction network is mainly built based on resnet50 and mainly includes four stages. The specific construction process is as follows:

[0054] S101. Design the first layer of resnet50 as a dual-branch structure with the same structure but no shared network parameters as stage 1 of the feature extraction network.

[0055] Specifically, (X P ,X S ) represents the set of input photo modality and sketch modality feature maps, where the photo set is composed of express, It is represented as a sketch set, where M and N represent the number of pedestrian identities and the number of samples of each pedestrian identity, respectively. Then, the photo X P and Sketch X S They are used as inputs of the two branches of the feature extraction network respectively.

[0056] S102, the second and third layers of resnet50 are integrated into stage 2 of the feature extraction network, and the features output from stages 1 and 2 are sent to the next two stages to continue the deep extraction of pedestrian features, where the fourth and fifth layers of resnet50 are successively integrated into stages 3 and 4 of the feature extraction network, and finally the shared photo features are obtained. and shared sketch features K represents a patch size, i.e., the height × width of the feature map, and d is the number of channels of the feature map.

[0057] The present invention provides a preferred embodiment to perform S2. Most existing sketch pedestrian re-identification methods ignore the overfitting problem, and design a large number of parameters for the model effect, resulting in a huge amount of model calculation. Therefore, it is worth studying how to design a prompting scheme for the sketch pedestrian re-identification model to solve the convergence problem of suboptimal solutions caused by fine-tuning the entire model. The present invention proposes an effective photo perturbation prompting strategy. The specific steps are as follows:

[0058] S201. In order to improve the flexibility of photo migration, we output the photo feature f from the feature extraction network stage 1 through linear projection p and sketch feature f s The sampled photo representation is further generated by using the sigmoid function and a static factor of 0.5. Specifically, it can be expressed as:

[0059] S = 0.5sigmoid(f p )·f s (1)

[0060] S202, in order to save parameters and GFLOPs, the present invention performs a reshaping operation in advance, that is, reshaping the features into The size of is then used for linear projection to generate an offset set, and the set is reshaped to satisfy the spatial size. This process is called pixel shuffling. When other hyperparameters are fixed, the number of parameters can be reduced to 1 / 4 under the pixel shuffling setting. Linear projection is first used to generate an offset set. The set is then reshaped to satisfy the spatial size.

[0061] S203, given an upsampling factor of 2, is used to generate an offset S of size H×W. The grid sample function uses the positions in S to map the shallow features f p Resampled to a feature size of 2H×2W through bilinear interpolation, the sampled photo feature f' p is the sum of the offset S and the original sampling grid Grid. This process is defined as:

[0062] f' p =S+grid_sample(f p ,S) (2)

[0063] The present invention provides a preferred embodiment to perform S3. For sketch person re-identification, it is very important to balance the relationship between the two modalities and learn discriminative feature representations. Due to the huge intra-identity changes and cross-modal differences, the features of the sketch modality with a simple structure are easily ignored. Therefore, the present invention proposes an effective sketch detail enhancement module, which first aligns the sketch modality with the photo modality, and then uses the photo modality to enhance the high-level features to extract the details of the sketch features. The specific steps are as follows:

[0064] S301, such as Figure 2 As shown in the framework diagram of the sketch detail enhancement module, the feature extraction network stage 3 outputs photo features and sketch features They are input into the sketch detail enhancement module respectively. By calculating the cosine similarity between the normalized feature tensors, an affinity matrix is ​​obtained. The calculation of cosine similarity represents the similarity between feature vectors:

[0065]

[0066] The affinity matrix is ​​then operated using the Softmax function to limit the values ​​of its elements to between 0 and 1 and ensure that the sum of the elements in each row is 1. Use the normalized affinity matrix to sketch the feature tensor Perform weighted summation to obtain the spatially aligned feature tensor The purpose of this step is to adjust the representation of the sketch feature vector by considering the feature vectors in the photo feature tensor that are similar to the current sketch position. The specific representation is:

[0067]

[0068] S302, two cascaded convolutional layers are used to fuse the visual features of the two modalities. The first convolutional layer with a kernel size of 1×1 is used to reduce the number of feature channels and introduce the nonlinear transformation GELU to increase the representation and learning capabilities of the network. BlurPool is used to reduce the aliasing effect and improve the translation invariance of the network. The convolutional layer with a kernel size of 3×3 achieves a more comprehensive feature fusion, thereby generating a feature pool f pool :

[0069]

[0070] The advantage of transferring the photo features instead of directly transferring them to the sketch branch is that the common details of the two modalities can be enhanced, while irrelevant features can be weakened in the process.

[0071] S303. In order to provide useful information required for sketch features, we need to further filter the photo features from the sketch perspective. We use the maximum pooling layer maxpool (TOP30 channels), two 7×7 convolutional layers, RELU and sigmoid functions on the sketch features to generate a spatial attention mask. Finally, the mask and feature pool f pool Multiply to reduce the introduction of irrelevant photo features and obtain the required supplementary information from the perspective of sketch modality, thereby obtaining the feature f' after sketch detail enhancement s The whole process can be described as:

[0072]

[0073] Where ⊙ represents the Hadamard product.

[0074] The present invention provides a preferred embodiment to perform S4. Using the general circular loss L Cir and identity loss L id Optimize the network and classification results, such as Figure 2 As shown in the figure, here we mainly select the features extracted in the sharing stage and the classification results for loss calculation. Among them, the circle loss L Cir and identity loss L id Respectively expressed as:

[0075]

[0076] Among them, δ(-)=m; δ(+)=1-m; [·] + is a "zero cutoff" operation to ensure and is non-negative; and are positive and negative sample pairs respectively; L and H are the number of input positive and negative pairs; γ is the scaling factor for similarity separation; m represents the margin parameter.

[0077]

[0078] Where Q is the number of pedestrian identities in each batch; y i is the label of the ith pedestrian identity; is the prediction result of the tth pedestrian identity after the feature extraction network stage 4.

[0079] In summary, the present invention only needs to learn fewer parameters in prompts and enhancements instead of fine-tuning the entire model, thereby solving the convergence problem of fine-tuning the entire model leading to suboptimal solutions. Technically speaking, discriminative perturbation prompts are introduced as a sample prompt process, which amplifies or even exaggerates some discriminative elements that contribute to category prediction through upsampling operations. In this way, the sketch pedestrian re-identification task can be assisted by perturbation prompts that are close to solving the task during the original pre-training. Therefore, it retains the generalization and discrimination of the representations extracted from the input samples. In addition, the present invention proposes a method of modal alignment enhancement, which transfers the object localization and internal consistency of photo features to the photo branch in the high-level feature extraction stage, and realizes modal mutual alignment.

[0080] Embodiment 2:

[0081] The computer-readable storage medium of this embodiment stores a computer program thereon, which, when executed by a processor, implements the steps in the sketch pedestrian re-identification method with cross-modal prompt adjustment of Example 1.

[0082] The computer-readable storage medium of this embodiment may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal; the computer-readable storage medium of this embodiment may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, etc. equipped on the terminal; further, the computer-readable storage medium may also include both an internal storage unit of the terminal and an external storage device.

[0083] The computer-readable storage medium of this embodiment is used to store computer programs and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.

[0084] Embodiment 3:

[0085] The computer device of this embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the sketch pedestrian re-identification method with cross-modal prompt adjustment of Example 1 are implemented.

[0086] In this embodiment, the processor may be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, readily available programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0087] Those skilled in the art will appreciate that the disclosed content of the embodiments may be provided as methods, systems, or computer program products. Therefore, the present solution may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Moreover, the present solution may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.

[0088] The present solution is described with reference to the flowchart and / or block diagram of the method and computer program product according to the embodiment of the present solution. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions; these computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0089] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0090] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0091] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0092] The examples described in the present invention are merely descriptions of the preferred implementation modes of the present invention, and are not intended to limit the concept and scope of the present invention. Without departing from the design concept of the present invention, various modifications and improvements made to the technical solutions of the present invention by engineers and technicians in this field should all fall within the protection scope of the present invention.

Claims

1. A sketch person re-identification method with cross-modal prompt adjustment, characterized in that: The steps include: S1. Construct a two-stream backbone network with four stages to extract features of input pedestrian photos and hand-drawn sketches; S2, the photo features output by the backbone network in the first stage of S1 are sampled and optimized using photo perturbation prompts; S3, using the sketch features output by the third-stage backbone network of S1 to induce sketch detail enhancement using the photo features output by the third-stage backbone network, and performing cross-modal feature alignment and sketch feature optimization; S4, using a universal loss function to optimize the network, and performing similarity measurement on the features finally output by the backbone after being processed by S2 and S3, and outputting the matching results; The specific steps of S2 are as follows: S201, outputting the photo feature f from the first stage of the feature extraction network through linear projection p and sketch feature f s Further generate sample photo representation; by using the sigmoid function and a static factor of 0.5; specifically it can be expressed as: S=0.5sigmoid(f p )·f s (1); S202, perform the reshaping operation in advance, that is, reshape the features into The size of , and then linear projection is used to generate the offset set, and the set is reshaped to satisfy the spatial size. This process is called pixel shuffling. When other hyperparameters are fixed, the number of parameters can be reduced to 1 / 4 under the pixel shuffling setting. Linear projection is first used to generate the offset set; then the set is reshaped to satisfy the spatial size. S203, given an upsampling factor of 2, is used to generate an offset S of size H×W; the grid sample function uses the positions in S to convert the shallow features f of the photo p Resampled to a feature size of 2H×2W through bilinear interpolation, the sampled photo feature f' p is the sum of the offset S and the original sampling grid Grid; this process is defined as: f' p =S+grid_sample(f p ,S) (2); The specific steps of S3 are as follows: S301, feature extraction network outputs photo features in the third stage and sketch features They are input into the sketch detail enhancement module respectively; an affinity matrix is ​​obtained by calculating the cosine similarity between the normalized feature tensors; the calculation of cosine similarity represents the similarity between feature vectors: Then use the Softmax function to operate on the affinity matrix, limit the value of its elements between 0 and 1, and ensure that the sum of the elements in each row is 1; use the normalized affinity matrix to sketch the feature tensor Perform weighted summation to obtain the spatially aligned feature tensor The purpose of this step is to adjust the representation of the sketch feature vector by considering the feature vectors in the photo feature tensor that are similar to the current sketch position. Specifically, it is expressed as: S302, two cascaded convolutional layers are used to fuse the visual features of the two modalities; the first convolutional layer with a kernel size of 1×1 is used to reduce the number of feature channels, introduces the nonlinear transformation GELU, and the convolutional layer with a kernel size of 3×3 achieves a more comprehensive feature fusion, thereby generating a feature pool f pool : S303, use the maximum pooling layer maxpool, two 7×7 convolutional layers, RELU and sigmoid functions on the sketch features to generate a spatial attention mask; finally, the mask mask and the feature pool f pool Multiply to reduce the introduction of irrelevant photo features and obtain the required supplementary information from the perspective of sketch modality, thereby obtaining the feature f' after sketch detail enhancement s ; The whole process can be described as: Where ⊙ represents the Hadamard product.

2. The method according to claim 1, characterized in that The specific construction process of the four stages in S1 is as follows: S101, design the first layer of resnet50 as a dual-branch structure with the same structure but no shared network parameters as the first stage of the feature extraction network; S102, the second and third layers of resnet50 are integrated into the second stage of the feature extraction network, and the features output from the first and second stages are sent to the latter two stages to continue the deep extraction of pedestrian features, where the fourth and fifth layers of resnet50 are successively integrated into the third and fourth stages of the feature extraction network, and finally the shared photo features are obtained. and shared sketch features K represents a patch size, i.e., the height × width of the feature map, and d is the number of channels of the feature map.

3. The method according to claim 2, characterized in that S101 Specifically, (X P ,X S ) represents the set of input photo modality and sketch modality feature maps, where the photo set is composed of express, It is represented as a sketch set, where M and N represent the number of pedestrian identities and the number of samples of each pedestrian identity, respectively; then, the photo X P and Sketch X S They are used as inputs of the two branches of the feature extraction network respectively.

4. The method according to claim 1, characterized in that: S4 uses the general circle loss L Cir and identity loss L id Optimize the network and classification results, circle loss L Cir and identity loss L id Respectively expressed as: Among them, δ(-)=m; δ(+)=1-m; [·] + is a "zero cutoff" operation to ensure and is non-negative; and are positive and negative sample pairs respectively; L and H are the number of input positive and negative pairs; γ is the scaling factor for similarity separation; m represents the margin parameter; Where Q is the number of pedestrian identities in each batch; y i is the label of the i-th pedestrian identity; It is the prediction result of the identity of the t-th pedestrian after the feature extraction network stage 4.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the sketch pedestrian re-identification method with cross-modal prompt adjustment as described in any one of claims 1 to 4 are implemented.

6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the sketch pedestrian re-identification method with cross-modal prompt adjustment as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Modal-adaptive depictive query pedestrian re-identification method and modal-adaptive depictive query pedestrian re-identification system

    CN116486109A

  • Cross-appearance pedestrian re-identification detection method based on generative model

    CN116778530A

  • Sketch face recognition method and device

    CN117095433A

  • Cross-modal pedestrian re-identification method and system based on high-order structure modeling

    CN117218603A

  • Heterogenous face recognition system and method

    EP4250249A1