Cross-modal person re-identification model, method and application based on auxiliary features
By introducing Gaussian-guided adaptive modules and auxiliary features into the cross-modal person re-identification model, combined with deep residual networks and dual-stream convolutional neural networks, the problem of modal differences and posture changes is solved, and the performance of pedestrian re-identification is improved. accuracy.
Patent Information
- Application Number
- CN202411044800.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-01
AI Technical Summary
Existing cross-modal pedestrian re-identification models have problems with modal differences, posture changes and background interference when processing visible and infrared light images, making the recognition accuracy difficult to meet actual needs.
A deep residual network based on ResNet combined with a Gaussian-guided adaptive module is used to introduce auxiliary features to reduce modal differences. Pedestrian features are extracted through a two-stream convolutional neural network, and cross-entropy loss and difficult triplet loss functions are used in the training stage. Optimize the model.
It achieves high-precision pedestrian re-identification under different spectrum and attitude changes, and improves the accuracy and feature discrimination of cross-modal pedestrian re-identification.
Smart Images

Figure CN118570844B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of pedestrian re-identification, and in particular relates to a cross-modal pedestrian re-identification model, method and application based on auxiliary features. Background Art
[0002] The goal of person re-identification is to retrieve images of the same person taken by different cameras from a database, that is, to find multiple photos of a specific person in non-overlapping camera perspectives. Person re-identification (ReID) is a long-standing challenge in the field of computer vision and has wide applications in smart security and smart life. With the development of deep learning technology, the accuracy of person re-identification has been significantly improved compared to traditional manual feature extraction methods. However, the current accuracy of person re-identification still has room for improvement.
[0003] In order to ensure that the camera can work properly at night, modern cameras are usually equipped with two modes: visible light and infrared light. However, most mainstream pedestrian re-identification models still rely on image recognition of visible light images, which results in the inability of such pedestrian re-identification models to recognize images in infrared light mode well. Therefore, the cross-modal pedestrian re-identification task came into being. Its goal is to retrieve the corresponding pedestrian image of another modality (infrared light or visible light) from the database given a pedestrian image of one modality (visible light or infrared light). The main challenge of cross-modal pedestrian re-identification lies in the modal differences between cameras with different spectra. Visible light images contain more color and detail information, while infrared light images provide richer structural information. In addition, cross-modal pedestrian re-identification is also affected by factors such as pedestrian posture changes, occlusion, and lighting changes. The above factors make it difficult for the current cross-modal pedestrian re-identification model to meet actual needs in terms of recognition accuracy. Summary of the invention
[0004] The present invention provides a cross-modal pedestrian re-identification model, method and application based on auxiliary features, which overcomes the influencing factors such as the bimodal differences between visible light images and infrared light images, pedestrian posture changes and background interference, provides high-precision cross-modal pedestrian re-identification prediction results, and realizes cross-modal pedestrian re-identification.
[0005] To achieve the above objectives, the present technical solution provides a method for constructing a cross-modal pedestrian re-identification model based on auxiliary features, comprising the following steps:
[0006] Step S1: obtaining a plurality of image groups consisting of visible light images and infrared light images corresponding to and marked with the same type of people as training sets;
[0007] Step S2: input the training set into the cross-modal person re-identification framework for training until the training conditions are met to obtain a cross-modal person re-identification model;
[0008] The cross-modal pedestrian re-identification framework includes a deep residual network based on ResNet, an infrared feature extraction network, a visible light feature extraction network and a fully connected layer, wherein the deep residual network based on ResNet includes four parallel stages of RGB streams and IR streams, the parameters of the extraction networks of the first and second stages corresponding to the RGB streams and IR streams are independent, the parameters of the extraction networks of the third and fourth stages corresponding to the RGB streams and IR streams are shared with each other, and the feature map output by the extraction network of the second stage of the RGB stream and the IR stream is input into the corresponding third stage after passing through an adaptive module based on Gaussian guidance, and the feature map output by the extraction network of the third stage of the RGB stream and the IR stream is input into the corresponding fourth stage after passing through an adaptive module based on Gaussian guidance; wherein the infrared feature extraction network and the visible light feature extraction network both include global feature branches and local feature branches;
[0009] The visible light image is input into the RGB stream of the deep residual network based on ResNet to obtain the visible light features, the infrared light image is input into the IR stream of the deep residual network based on ResNet to obtain the infrared light features, the infrared light features are input into the global feature branch and the local feature branch of the infrared light feature extraction network for processing to obtain the infrared light global features and the infrared light local features respectively, the infrared light global features and the infrared light local features are concatenated to obtain the infrared light pedestrian features corresponding to the current pedestrian, the visible light features are input into the global feature branch and the local feature branch of the visible light feature extraction network for processing to obtain the visible light global features and the visible light local features respectively, the visible light global features and the visible light local features are concatenated to obtain the visible light pedestrian features corresponding to the current pedestrian; the visible light pedestrian features and the infrared pedestrian features are input into the fully connected layer for classification to obtain the re-identification result.
[0010] In the second aspect, the present solution provides a cross-modal pedestrian re-identification model based on auxiliary features, which is trained using a cross-modal pedestrian re-identification dataset including visible light images and infrared light images corresponding to the same pedestrian according to the construction method of the cross-modal pedestrian re-identification model based on auxiliary features of the first aspect.
[0011] In the third aspect, this solution provides a cross-modal pedestrian re-identification method based on auxiliary features, comprising the following steps:
[0012] The query image of the visible light modality and / or the query image of the infrared light modality are input into the cross-modal pedestrian re-identification model based on auxiliary features constructed by the method for constructing the cross-modal pedestrian re-identification model based on auxiliary features in the first aspect, and the pedestrian features of the corresponding modality are output. In the search library, images with the same pedestrian features in images of another modality are searched based on the pedestrian features of the corresponding modality, wherein the cross-modal pedestrian re-identification model based on auxiliary features constructed in the first aspect does not have a fully connected layer.
[0013] Fourthly, this solution provides a cross-modal pedestrian re-identification system based on auxiliary features, including:
[0014] An image processing module, which inputs a query image of a visible light modality and / or a query image of an infrared light modality into a cross-modal pedestrian re-identification model based on auxiliary features constructed by a method for constructing a cross-modal pedestrian re-identification model based on auxiliary features, and outputs pedestrian features of corresponding modalities;
[0015] A retrieval module searches a search library for multiple images of another modality having high similarity with the pedestrian features in the query image based on the pedestrian features of the corresponding modality, wherein the images in the search library are processed to obtain the corresponding pedestrian features;
[0016] The display module arranges and displays the multiple images of another modality that have been searched in order of similarity.
[0017] Compared with the prior art, the present application scheme has the following characteristics and beneficial effects: the cross-modal pedestrian re-identification model provided by the present scheme can realize cross-modal pedestrian re-identification of infrared light modality and visible light modality, and introduces a Gaussian-guided adaptive module in the feature extraction stage to improve the overall identification of pedestrian features, and introduces auxiliary features in the training stage to reduce the error caused by the modal difference between the infrared light modality and the visible light modality, which can effectively extract pedestrian features in the image and improve the accuracy of cross-modal pedestrian re-identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 4 is a schematic diagram of the architecture of a cross-modal pedestrian re-identification model based on auxiliary features according to an embodiment of the present application.
[0020] Figure 2 This is an example schematic diagram of an application scenario of a cross-modal pedestrian re-identification model based on auxiliary features according to an embodiment of the present application.
[0021] Figure 3 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0023] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0024] Embodiment 1
[0025] This scheme provides a cross-modal pedestrian re-identification model, method and application based on auxiliary features. The cross-modal pedestrian re-identification model based on auxiliary features adopts a two-stream convolutional neural network as the main framework to realize feature extraction of dual-modal images, and introduces an adaptive module based on Gaussian guidance to improve the feature quality of the extracted pedestrian features. At the same time, the generated auxiliary features are used as guidance items to alleviate the modal differences between visible light images and infrared images.
[0026] Specifically, the construction method of the cross-modal pedestrian re-identification model based on auxiliary features provided by this solution includes the following steps:
[0027] Step S1: obtaining a plurality of image groups consisting of visible light images and infrared light images corresponding to and marked with the same type of people as training sets;
[0028] Step S2: input the training set into the cross-modal person re-identification framework for training until the training conditions are met to obtain a cross-modal person re-identification model;
[0029] The cross-modal pedestrian re-identification framework includes a deep residual network based on ResNet, an infrared feature extraction network, a visible light feature extraction network and a fully connected layer, wherein the deep residual network based on ResNet includes four parallel stages of RGB streams and IR streams, the parameters of the extraction networks of the first and second stages corresponding to the RGB streams and IR streams are independent, the parameters of the extraction networks of the third and fourth stages corresponding to the RGB streams and IR streams are shared with each other, and the feature map output by the extraction network of the second stage of the RGB stream and the IR stream is input into the corresponding third stage after passing through an adaptive module based on Gaussian guidance, and the feature map output by the extraction network of the third stage of the RGB stream and the IR stream is input into the corresponding fourth stage after passing through an adaptive module based on Gaussian guidance; wherein the infrared feature extraction network and the visible light feature extraction network both include global feature branches and local feature branches;
[0030] The visible light image is input into the RGB stream of the deep residual network based on ResNet to obtain the visible light features, the infrared light image is input into the IR stream of the deep residual network based on ResNet to obtain the infrared light features, the infrared light features are input into the global feature branch and the local feature branch of the infrared light feature extraction network for processing to obtain the infrared light global features and the infrared light local features respectively, the infrared light global features and the infrared light local features are concatenated to obtain the infrared light pedestrian features corresponding to the current pedestrian, the visible light features are input into the global feature branch and the local feature branch of the visible light feature extraction network for processing to obtain the visible light global features and the visible light local features respectively, the visible light global features and the visible light local features are concatenated to obtain the visible light pedestrian features corresponding to the current pedestrian; the visible light pedestrian features and the infrared pedestrian features are input into the fully connected layer for classification to obtain the re-identification result.
[0031] In step S1, the present solution obtains a plurality of groups of image groups consisting of visible light images and infrared light images corresponding to and labeled with the same pedestrian category as a training set. Specifically, the present solution obtains a plurality of groups of image groups consisting of visible light images and infrared light images corresponding to and labeled with the same pedestrian from an existing cross-modal pedestrian re-identification dataset. In some embodiments, the existing cross-modal pedestrian re-identification dataset includes but is not limited to SYSU-MM01, RegDB, LLCM, etc.
[0032] Of course, in order to realize the training and testing of the cross-modal pedestrian re-identification model based on auxiliary features, multiple groups of image groups consisting of corresponding visible light images and infrared images marked with the same pedestrian class can also be obtained as verification sets and test sets.
[0033] In some embodiments, the training set is preprocessed: data enhancement is performed on the image groups in the training set, including operations such as horizontal flipping, random cropping, random deletion, scaling, and random grayscale.
[0034] In addition, since the sizes of the images in the training set are inconsistent, this solution performs image processing on the visible light images and infrared light images in the training set to uniformly adjust the scale to 394*192.
[0035] In step S2, the present solution inputs the training set into the cross-modal person re-identification framework for training. In some embodiments, the present solution divides the training set into 80 batches for training the cross-modal person re-identification framework, and the batch size of each batch of training sets is 64. Specifically, each batch of training sets corresponds to 4 different pedestrians, and each pedestrian corresponds to 4 visible light images and 4 infrared light images.
[0036] Regarding the training method: In some embodiments, the present scheme uses stochastic gradient descent (SGD) as the optimizer with a momentum of 0.8. The warm-up method is used for the first 10 rounds, and the learning rate increases linearly from 0.01 to 0.4. Then, the learning rate is reduced to one tenth of the original value in the 20th and 50th rounds, respectively.
[0037] The ResNet-based deep residual network in the cross-modal pedestrian re-identification framework of this scheme adopts a two-stream convolutional neural network architecture. The RGB stream and IR stream of the ResNet-based deep residual network are both implemented based on ResNet50. The parameters of the first and second stage extraction networks corresponding to the RGB stream and IR stream are independent, and the parameters of the third and fourth stage extraction networks corresponding to the RGB stream and IR stream are shared with each other.
[0038] For example, each of the four stages of the deep residual network based on ResNet can be expressed as:
[0039] ;
[0040] in Represents the stage numbers of different stages of the ResNet-based deep residual network,
[0041] In the ResNet-based deep residual network of this scheme, the first two stages of the RGB stream and the IR stream ( ) are independent of the network parameters, while the next two stages ( ) network parameters are shared. In addition, the step size of the last layer of the deep residual network based on ResNet is set to 1 in this scheme.
[0042] In the step of "the feature map output by the extraction network of the second stage of RGB stream and IR stream is input into the corresponding third stage after passing through the adaptive module based on Gaussian guidance", and in the step of "the feature map output by the extraction network of the third stage of RGB stream and IR stream is input into the corresponding fourth stage after passing through the adaptive module based on Gaussian guidance", the adaptive module based on Gaussian guidance adopts local feature extraction to obtain the identity identification features corresponding to different parts of the body in the feature map.
[0043] For example, the feature map output by the second stage extraction network of the RGB stream and the IR stream is The output feature map is obtained through the adaptive module based on Gaussian guidance , and the output feature map Input to the third stage; the feature map of the third stage extraction network output The output feature map is obtained through the adaptive module based on Gaussian guidance , and the output feature map The fourth stage outputs visible light features corresponding to the RGB stream, and the fourth stage outputs infrared light features corresponding to the IR stream.
[0044] Specifically, the feature map input into the Gaussian-guided adaptive module is divided into multiple non-overlapping local feature blocks in the vertical direction, and each local feature block is flattened in the spatial dimension to obtain the flattened feature. The flattened features are extracted by three fully connected layers to obtain embedded features Q, embedded features K and embedded features V. Gaussian weights are introduced based on the embedded features Q, embedded features K and embedded features V to obtain weighted features. The weighted features are restored to the original spatial dimensions to obtain local weighted feature blocks, and all local weighted feature blocks are spliced in the vertical direction to obtain the output feature map.
[0045] Specifically, regarding "weighted features obtained by introducing Gaussian weights based on embedded features Q, embedded features K and embedded features V", matrix calculation and normalization operations are performed using embedded features Q and embedded features K to obtain a first attention weight matrix, Gaussian weighting is performed according to the flattened features to obtain Gaussian weighted values, the Gaussian weighted values are matrix-element multiplied with the first attention weight matrix to obtain a second attention weight matrix, and the second attention weight matrix is applied to the embedded feature V to obtain weighted features.
[0046] It should be noted that the Gaussian weighting value is introduced in this solution to make the neighboring regions have a higher similarity. The advantage of this is that the feature quality of the local feature blocks can be improved, and the discriminability of pedestrian features can be enhanced.
[0047] For example, the input feature of the Gaussian guided adaptive module is , where C is the number of channels, H is the height of the feature map, W is the width of the feature map, and F represents the feature map; the feature map F input into the Gaussian-guided adaptive module is divided into Z non-overlapping local feature blocks in the vertical direction , for each local feature block Flattened in the spatial dimension to obtain flattened features ,in , and then use three fully connected layers to extract the flattened features to obtain embedded features , , .
[0048] Then, the embedded features Q and K are used to perform matrix calculation and normalization operations to obtain the first attention weight matrix :
[0049] ;
[0050] in represents matrix product, softmax() represents the softmax function;
[0051] Then Gaussian weighting is performed according to the flattened features to obtain the Gaussian weighted value , the specific calculation method of Gaussian weighted value is as follows:
[0052] ;
[0053] in is the Gaussian weighted value between the i-th pixel and the j-th pixel, and Represent the horizontal coordinates of the i-th pixel and the j-th pixel, respectively. and Respectively represent the ordinates of the i-th pixel and the j-th pixel, represents the variance of the population, and exp() represents the natural exponential function.
[0054] An example of a calculation function for the horizontal and vertical coordinates of a pixel point is as follows:
[0055]
[0056] ;
[0057] in , the horizontal and vertical coordinates of the pixel points are numbered starting from 0.
[0058] Then, the Gaussian weighted value is multiplied element by element with the first attention weight matrix to obtain the second attention weight matrix. The corresponding calculation method is as follows:
[0059] ;
[0060] in Represents element-wise matrix multiplication.
[0061] Then the second attention weight matrix is applied to the embedded feature V to obtain the weighted feature , the specific formula is as follows:
[0062] .
[0063] Then the weighted features Restore the original spatial dimension to obtain the local weighted feature block, where the shape of the local weighted feature block is .
[0064] Then all local weighted feature blocks are spliced in the vertical direction to obtain the output feature map, where the shape of the output feature map is .
[0065] Regarding the structures of the infrared light feature extraction network and the visible light feature extraction network of this solution, the infrared light feature extraction network includes a global feature branch and a local feature branch, and the visible light feature extraction network also includes a global feature branch and a local feature branch. The structures of the infrared light feature extraction network and the visible light extraction network are the same.
[0066] Correspondingly, in the step of "inputting the infrared light features into the global feature branch and the local feature branch of the infrared light feature extraction network for processing to obtain the infrared light global features and the infrared light local features respectively", the global feature branch performs a global average pooling operation on the infrared light features to obtain the infrared light global features, and the local feature branch divides the infrared light features into multiple equally divided local blocks along the horizontal direction, and performs an average pooling operation on each equally divided local block to obtain the infrared light local features. In the step of "joining the infrared light global features and the infrared light local features to obtain the infrared light pedestrian features corresponding to the current pedestrian", the infrared light local features are joined with all the infrared light local features to obtain the infrared light pedestrian features.
[0067] In the step of "inputting the visible light features into the global feature branch and the local feature branch of the visible light feature extraction network for processing to obtain the visible light global features and the visible light local features respectively", the global feature branch performs a global average pooling operation on the visible light features to obtain the visible light global features, and the local feature branch divides the visible light features into multiple equally divided local blocks along the horizontal direction, and performs an average pooling operation on each equally divided local block to obtain the visible light local features. In the step of "joining the visible light global features and the visible light local features to obtain the visible light pedestrian features corresponding to the current pedestrian", the visible light local features are joined with all the visible light local features to obtain the visible light pedestrian features.
[0068] Correspondingly, without distinguishing between infrared light features and visible light features, the global feature branch of this scheme will correspond to the feature map output by the fourth stage Perform global average pooling operation to obtain global features The local feature branch is to transform the feature map Divide along the horizontal direction to obtain Z equally divided local blocks, where the size of each equally divided local block is , and perform average pooling on each equally divided local block to obtain local features ; The global features and Z local features Splice to get pedestrian features .
[0069] In the step of "inputting visible light pedestrian features and infrared light pedestrian features into the fully connected layer for classification to obtain a re-identification result", the re-identification result refers to the pedestrian category of the current pedestrian.
[0070] During the training phase of the current cross-modal pedestrian re-identification model, the corresponding pedestrian category labels are marked for both the infrared image and the visible light image, so that the cross-modal pedestrian re-identification model can know the pedestrians in the currently trained infrared image and / or visible light image, and can also use the current pedestrian category to supervise the cross-modal pedestrian re-identification model. In the actual testing phase, the similarity of pedestrian features in different images is directly used to achieve retrieval, without the need for the fully connected layer in the training phase.
[0071] It should be noted that in order to improve the feature similarity of the same pedestrian and reduce the feature similarity of different categories, the cross-modal pedestrian re-identification model based on auxiliary features in this scheme adopts the cross entropy loss function and the difficult triplet loss function to constrain pedestrian features.
[0072] In other preferred embodiments, in order to further alleviate the modality difference between visible light images and infrared light images, the present solution introduces additional auxiliary modalities as guiding items to assist in the learning of modality-independent features.
[0073] Correspondingly, infrared light pedestrian features and visible light pedestrian features of the same pedestrian are obtained, auxiliary modal pedestrian features of the same pedestrian are generated based on the infrared light pedestrian features and visible light pedestrian features of the same pedestrian, the modal feature center of the corresponding modality is obtained according to the infrared light pedestrian features, the visible light pedestrian features and the auxiliary modal pedestrian features, the same identity constraint loss function and the different identity constraint loss function are calculated according to the modal feature centers of the different modalities, and the sum of the same identity constraint loss function and the different identity constraint loss function is used as the total loss function of the current cross-modal pedestrian re-identification model based on auxiliary features. In some embodiments, the goal of training a cross-modal pedestrian re-identification model based on auxiliary features is to minimize the total loss function of the cross-modal pedestrian re-identification model based on auxiliary features. In an embodiment of the present scheme, back propagation is performed by calculating the loss value in the loss function to update the network parameters.
[0074] It should be noted that the same-identity constraint loss function proposed in this scheme uses auxiliary features as a guide for the same-identity constraint, so as to make the features of the visible light modality and the infrared light modality as close as possible; and the different-identity constraint loss function uses auxiliary features as a guide, which can maximize the differences between different identities.
[0075] Specifically, the formula for generating the auxiliary modal pedestrian features of the same pedestrian based on the infrared light pedestrian features and the visible light pedestrian features of the same pedestrian is as follows:
[0076] ;
[0077] in is the visible light pedestrian feature of the jth visible light image of the i-th pedestrian, is the infrared pedestrian feature of the jth infrared image of the i-th pedestrian, is the auxiliary modal pedestrian feature corresponding to the j-th infrared image or j-th visible light image in the i-th row, Represents the fusion coefficient.
[0078] The formula for obtaining the modal feature center of the corresponding modality based on the infrared light pedestrian feature, the visible light pedestrian feature and the auxiliary modality pedestrian feature is as follows:
[0079] ;
[0080] in represents the mode, v corresponds to the visible light mode, i corresponds to the infrared light mode, and m corresponds to the auxiliary mode, so the corresponding The modal feature center of the visible light pedestrian feature corresponding to the visible light modality of the p-th pedestrian, The modal feature center corresponding to the auxiliary modal pedestrian feature of the p-th pedestrian, The modal feature center of the infrared light pedestrian feature corresponding to the infrared light modality of the p-th pedestrian, represents the number of the pedestrian, and M represents each pedestrian in the current training batch. Visible light images and An infrared photo.
[0081] The formula for calculating the same identity constraint loss function based on the modal feature centers of different modalities is as follows: ;
[0082] in The modal feature center of the visible light pedestrian feature corresponding to the visible light modality of the p-th pedestrian, The modal feature center corresponding to the auxiliary modal pedestrian feature of the p-th pedestrian, The modal feature center of the infrared light pedestrian feature corresponding to the infrared light modality of the p-th pedestrian, represents the Euclidean distance between feature a and feature b, represents the same identity constraint loss function.
[0083] The calculation formula for calculating different identity constraint loss functions based on the modal feature centers of different modalities is as follows:
[0084] ;
[0085] in , , represents the gap distance, Represents different identity constraint loss functions.
[0086] Embodiment 2
[0087] Based on the same technical concept as that of Example 1, this solution provides a cross-modal pedestrian re-identification model based on auxiliary features, which is constructed using a cross-modal pedestrian re-identification dataset including visible light images and infrared light images corresponding to the same pedestrian according to the construction method described in Example 1. The verification set and test set mentioned in Example 1 can be used to verify and test the cross-modal pedestrian re-identification model based on auxiliary features corresponding to Example 2. The cross-modal pedestrian re-identification based on auxiliary features in the test phase does not have a fully connected layer.
[0088] Embodiment 3
[0089] Based on the same concept, the present technical solution provides a cross-modal pedestrian re-identification method based on auxiliary features, comprising the following steps:
[0090] The query image of the visible light modality and / or the query image of the infrared light modality is input into the cross-modal pedestrian re-identification model based on auxiliary features constructed in Example 1 to output the pedestrian features of the corresponding modality, and the image with the same pedestrian features in the image of another modality is searched in the search library based on the pedestrian features of the corresponding modality, wherein the constructed cross-modal pedestrian re-identification model cancels the fully connected layer.
[0091] It should be noted that the image of another modality corresponding to the query image of the visible light modality refers to the infrared light image, and the image of another modality corresponding to the query image of the infrared light modality refers to the visible light image. In the actual test process, the infrared light image and the visible light image can be input into the cross-modal pedestrian re-identification model based on auxiliary features together, or the infrared light image and the visible light image can be input into the cross-modal pedestrian re-identification model based on auxiliary features separately. It is only necessary to ensure that the query image of the corresponding modality enters the corresponding IR stream or RGB stream in the deep residual network based on ResNet.
[0092] In addition, the images in the search library in this solution have also been processed by the cross-modal pedestrian re-identification model based on auxiliary features, and the corresponding pedestrian features are also present. The image of the other modality corresponding to the query image of the visible light modality is an infrared light image, and the image of the other modality corresponding to the query image of the infrared light modality is a visible light image.
[0093] Embodiment 4
[0094] Based on the same concept, the present technical solution provides a cross-modal pedestrian re-identification system based on auxiliary features, including:
[0095] An image processing module, inputting a query image of a visible light modality and / or a query image of an infrared light modality into the cross-modal pedestrian re-identification model based on auxiliary features constructed in the first embodiment to output pedestrian features of corresponding modalities;
[0096] A retrieval module searches for images with the same pedestrian features in another modality based on the pedestrian features of the corresponding modality in the search library, wherein the constructed cross-modal pedestrian re-identification model cancels the fully connected layer, and the images in the search library are processed to obtain the corresponding pedestrian features;
[0097] The display module arranges and displays the multiple images of another modality that have been searched in order of similarity.
[0098] It should be noted that the image of another modality corresponding to the query image of the visible light modality refers to the infrared light image, and the image of another modality corresponding to the query image of the infrared light modality refers to the visible light image. In addition, the images in the search library in this solution are also processed by the cross-modal pedestrian re-identification model based on auxiliary features, and have corresponding pedestrian features.
[0099] Embodiment 5
[0100] This embodiment also provides an electronic device, referring to Figure 3 , including a memory 304 and a processor 302, wherein the memory 304 stores a computer program, and the processor 302 is configured to run the computer program to execute the steps in any of the above-mentioned methods for constructing a cross-modal pedestrian re-identification model based on auxiliary features or the embodiments of the cross-modal pedestrian re-identification method based on auxiliary features.
[0101] Specifically, the processor 302 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0102] Among them, the memory 304 may include a large capacity memory 304 for data or instructions. By way of example and not limitation, the memory 304 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 304 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 304 may be inside or outside the data processing device. In a specific embodiment, the memory 304 is a non-volatile memory. In a specific embodiment, the memory 304 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable Programmable Read-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 304 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0103] The memory 304 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 302 .
[0104] The processor 302 reads and executes the computer program instructions stored in the memory 304 to implement any one of the methods for constructing a cross-modal pedestrian re-identification model based on auxiliary features or the cross-modal pedestrian re-identification method based on auxiliary features in the above embodiments.
[0105] Optionally, the electronic device may further include a transmission device 306 and an input / output device 308 , wherein the transmission device 306 is connected to the processor 302 , and the input / output device 308 is connected to the processor 302 .
[0106] The transmission device 306 can be used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 306 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0107] The input and output device 308 is used to input or output information. In this embodiment, the input information may be cross-modal images, etc., and the output information may be similar results, etc.
[0108] Optionally, in this embodiment, the processor 302 may be configured to perform the following steps through a computer program:
[0109] Step S1: obtaining a plurality of image groups consisting of visible light images and infrared light images corresponding to and marking the same pedestrian as a training set;
[0110] Step S2: input the training set into the cross-modal person re-identification framework for training until the training conditions are met to obtain a cross-modal person re-identification model;
[0111] The cross-modal pedestrian re-identification framework includes a deep residual network based on ResNet, an infrared feature extraction network, a visible light feature extraction network and a fully connected layer, wherein the deep residual network based on ResNet includes four parallel stages of RGB streams and IR streams, the parameters of the extraction networks of the first and second stages corresponding to the RGB streams and IR streams are independent, the parameters of the extraction networks of the third and fourth stages corresponding to the RGB streams and IR streams are shared with each other, and the feature map output by the extraction network of the second stage of the RGB stream and the IR stream is input into the corresponding third stage after passing through an adaptive module based on Gaussian guidance, and the feature map output by the extraction network of the third stage of the RGB stream and the IR stream is input into the corresponding fourth stage after passing through an adaptive module based on Gaussian guidance; wherein the infrared feature extraction network and the visible light feature extraction network both include global feature branches and local feature branches;
[0112] The visible light image is input into the RGB stream of the deep residual network based on ResNet to obtain the visible light features, the infrared light image is input into the IR stream of the deep residual network based on ResNet to obtain the infrared light features, the infrared light features are input into the global feature branch and the local feature branch of the infrared light feature extraction network for processing to obtain the infrared light global features and the infrared light local features respectively, the infrared light global features and the infrared light local features are concatenated to obtain the infrared light pedestrian features corresponding to the current pedestrian, the visible light features are input into the global feature branch and the local feature branch of the visible light feature extraction network for processing to obtain the visible light global features and the visible light local features respectively, the visible light global features and the visible light local features are concatenated to obtain the visible light pedestrian features corresponding to the current pedestrian; the visible light pedestrian features and the infrared pedestrian features are input into the fully connected layer for classification to obtain the re-identification result.
[0113] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0114] In general, various embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the boxes, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0115] Embodiments of the present invention can be implemented by computer software, which is executable by a data processor of a mobile device, such as in a processor entity, or implemented by hardware, or implemented by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros can be stored in any device readable data storage medium, and they include program instructions for performing specific tasks. Computer program products can include one or more computer executable components configured to perform embodiments when the program is running. One or more computer executable components can be at least one software code or a part thereof. In addition, at this point, it should be noted that any box of the logic flow in the figure can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored in physical media such as memory chips or storage blocks implemented in processors, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and data variants thereof, CDs. Physical media are non-transient media.
[0116] Those skilled in the art should understand that the technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0117] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for constructing a cross-modal person re-identification model based on auxiliary features, characterized in that: The following steps are included: S1: Obtain multiple sets of image groups consisting of visible light images and infrared light images that correspond to and are labeled with the same type of pedestrian as training sets; Step S2: input the training set into the cross-modal person re-identification framework for training until the training conditions are met to obtain a cross-modal person re-identification model; The cross-modal pedestrian re-identification framework includes a deep residual network based on ResNet, an infrared light feature extraction network, a visible light feature extraction network and a fully connected layer, wherein the deep residual network based on ResNet includes four parallel stages of RGB streams and IR streams, the parameters of the first and second stages of the extraction networks corresponding to the RGB streams and IR streams are independent, the parameters of the third and fourth stages of the extraction networks corresponding to the RGB streams and IR streams are shared with each other, and the feature map output by the second stage of the extraction network of the RGB stream and the IR stream is input into the corresponding third stage after passing through an adaptive module based on Gaussian guidance, and the feature map output by the third stage of the extraction network of the RGB stream and the IR stream is input into the corresponding fourth stage after passing through an adaptive module based on Gaussian guidance, The feature map input into the Gaussian-guided adaptive module is divided into multiple non-overlapping local feature blocks in the vertical direction, and each local feature block is flattened in spatial dimension to obtain flattened features. The flattened features are extracted using three fully connected layers to obtain embedded features Q, embedded features K, and embedded features V. Gaussian weights are introduced based on embedded features Q, embedded features K, and embedded features V to obtain weighted features. The weighted features are restored to the original spatial dimensions to obtain local weighted feature blocks, and all local weighted feature blocks are spliced in the vertical direction to obtain the output feature map; the infrared feature extraction network and the visible light feature extraction network both include global feature branches and local feature branches; the visible light image is input into the RGB deep residual network based on ResNet. The infrared light features are obtained from the infrared stream, the infrared image is input into the IR stream of the deep residual network based on ResNet to obtain the infrared light features, the infrared light features are input into the global feature branch and the local feature branch of the infrared light feature extraction network for processing to obtain the infrared light global features and the infrared light local features respectively, the infrared light global features and the infrared light local features are concatenated to obtain the infrared light pedestrian features corresponding to the current pedestrian, the visible light features are input into the global feature branch and the local feature branch of the visible light feature extraction network for processing to obtain the visible light global features and the visible light local features respectively, the visible light global features and the visible light local features are concatenated to obtain the visible light pedestrian features corresponding to the current pedestrian; the visible light pedestrian features and the infrared pedestrian features are input into the fully connected layer for classification to obtain the re-identification result.
2. The method for constructing a cross-modal person re-identification model based on auxiliary features according to claim 1, characterized in that: The Gaussian-guided adaptive module uses local feature extraction to obtain identity identification features corresponding to different parts of the body in the feature map.
3. The method for constructing a cross-modal person re-identification model based on auxiliary features according to claim 1, characterized in that: The first attention weight matrix is obtained by matrix calculation and normalization operations using the embedded features Q and K. Gaussian weighting is performed according to the flattened features to obtain Gaussian weighted values. The Gaussian weighted values are matrix-element-wise multiplied with the first attention weight matrix to obtain the second attention weight matrix. The second attention weight matrix is applied to the embedded feature V to obtain the weighted feature.
4. The method for constructing a cross-modal person re-identification model based on auxiliary features according to claim 1, characterized in that: The global feature branch performs a global average pooling operation on the infrared light features to obtain the infrared light global features. The local feature branch divides the infrared light features into multiple equally divided local blocks along the horizontal direction, and performs an average pooling operation on each equally divided local block to obtain the infrared light local features.
5. The method for constructing a cross-modal person re-identification model based on auxiliary features according to claim 1, characterized in that: Obtain infrared light pedestrian features and visible light pedestrian features of the same pedestrian, generate auxiliary modal pedestrian features of the same pedestrian based on the infrared light pedestrian features and visible light pedestrian features of the same pedestrian, obtain the modal feature center of the corresponding modality according to the infrared light pedestrian features, visible light pedestrian features and auxiliary modal pedestrian features, calculate the same identity constraint loss function and the different identity constraint loss function according to the modal feature centers of different modalities, and take the sum of the same identity constraint loss function and the different identity constraint loss function as the total loss function of the current cross-modal pedestrian re-identification model based on auxiliary features.
6. A cross-modal pedestrian re-identification method based on auxiliary features, characterized in that: The following steps are involved: A query image in the visible light modality or a query image in the infrared light modality is input into the cross-modal pedestrian re-identification model based on auxiliary features constructed by the method for constructing a cross-modal pedestrian re-identification model based on auxiliary features as described in any one of claims 1 to 5, and pedestrian features of the corresponding modality are output. In the search library, multiple images of another modality with high similarity to the pedestrian features in the query image are searched based on the pedestrian features of the corresponding modality, wherein the images in the search library are processed to obtain the corresponding pedestrian features, and the constructed cross-modal pedestrian re-identification model based on auxiliary features cancels the fully connected layer.
7. A cross-modal person re-identification system based on auxiliary features, characterized in that: include: An image processing module, inputting a query image of a visible light modality or a query image of an infrared light modality into a cross-modal pedestrian re-identification model based on auxiliary features constructed as described in any one of claims 1 to 5, and outputting pedestrian features of the corresponding modality; A retrieval module searches for multiple images of another modality with high similarity to the pedestrian features in the query image based on the pedestrian features of the corresponding modality in the search library, wherein the images in the search library are processed to obtain the corresponding pedestrian features, and the constructed cross-modal pedestrian re-identification model based on auxiliary features cancels the fully connected layer; The display module arranges and displays the multiple images of another modality that have been searched in order of similarity.
8. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the method for constructing a cross-modal pedestrian re-identification model based on auxiliary features as described in any one of claims 1 to 5.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which includes a program code for controlling a process to execute a process, and the process includes a method for constructing a cross-modal pedestrian re-identification model based on auxiliary features according to any one of claims 1 to 5.
Citation Information
Patent Citations
Cross-modal pedestrian re-identification method based on local detail features
CN115050048A
Cross-modal pedestrian re-identification method and device based on fine-grained features
CN116524542A
Cross-modal pedestrian re-identification method based on attitude feature alignment
CN117333908A
Collaborative segmentation assisted cross-modal pedestrian re-identification method, system and device, and medium
CN117437692A
Cross-modal pedestrian re-identification method based on modal imbalance feature conversion
CN118116035A
