Cross-modal pedestrian re-identification model generation method, identification method, device and equipment

By using a cross-modal pedestrian re-identification model and employing techniques such as convolutional layers and attention mechanisms, the problem of information loss caused by the imaging differences between infrared and visible light images was solved, and reliable mutual search for cross-modal pedestrian re-identification was achieved.

CN115546844BActive Publication Date: 2026-05-29AGRICULTURAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AGRICULTURAL BANK OF CHINA
Filing Date
2022-11-09
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, there are significant differences in the imaging methods between infrared images and visible light images. Cross-modal pedestrian re-identification achieved through modal conversion strategies lacks fine-grained pedestrian information and correlation information, resulting in unreliable results.

Method used

A cross-modal pedestrian re-identification model is adopted. Visible light image samples and infrared image samples are respectively input into the preset model. The model uses a network structure composed of convolutional layers, attention mechanism, average pooling layer and fully connected layer to obtain feature information. The model is trained with the target loss function as the optimization objective to establish the correlation between cross-modalities.

Benefits of technology

It enables mutual searching between visible light and infrared images, extracts key information, and narrows the feature distribution, thereby improving the accuracy and reliability of cross-modal pedestrian re-identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546844B_ABST
    Figure CN115546844B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a cross-modal pedestrian re-identification model generation method, a recognition method, an apparatus and a device. The method comprises: inputting a visible light image sample and an infrared image sample into a preset cross-modal pedestrian re-identification model, wherein the model is composed of at least one convolution layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer; obtaining feature information processed by each network layer in the preset cross-modal pedestrian re-identification model for the visible light image sample and the infrared image sample; and determining a target loss function of the preset cross-modal pedestrian re-identification model according to the feature information; and performing model training to obtain an optimized target cross-modal pedestrian re-identification model with the target loss function as an optimization target. The method extracts key information of an image by adding an attention module, and establishes a correlation between cross-modal through the constraint of the target loss function, thereby realizing cross-modal pedestrian re-identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, recognition method, apparatus and device for generating cross-modal pedestrian re-identification models. Background Technology

[0002] Typically, in surveillance systems, during the day under natural light, ordinary cameras can capture visible light images of pedestrians with rich color information; at night, when light is low, infrared cameras can capture infrared images of pedestrians. In practical applications of pedestrian trajectory recognition, there are often scenarios where visible light and infrared images of pedestrians are searched for each other, i.e., cross-modal pedestrian re-identification based on visible light and infrared images.

[0003] In existing technologies, a modality conversion strategy is typically employed to unify the processing of two modalities of data. For example, a visible light image is converted into a corresponding infrared image, or an infrared image is converted into a corresponding visible light image. Then, a single-modal person re-identification strategy is used to achieve the goal of cross-modal person re-identification.

[0004] However, infrared and visible light images differ significantly in their imaging methods. Infrared images lose color information, while visible light images contain color information from three channels. Visible light images offer richer and more effective identification information. Therefore, the information gap between infrared and visible light images is substantial. Cross-modal person re-identification achieved through modal conversion strategies lacks fine-grained pedestrian information and also misses the correlation information between the two types of images. Consequently, the results of cross-modal person re-identification are unreliable. Summary of the Invention

[0005] This invention provides a method, method, apparatus, and device for generating cross-modal pedestrian re-identification models. It establishes cross-modal correlations to enable mutual searching between visible light and infrared images.

[0006] In a first aspect, embodiments of the present invention provide a method for generating a cross-modal person re-identification model, the method comprising:

[0007] Visible light image samples and infrared image samples are respectively input into a preset cross-modal pedestrian re-identification model, wherein the preset cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer.

[0008] The feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for processing visible light image samples and infrared image samples is obtained; and the target loss function of the preset cross-modal pedestrian re-identification model is determined based on the feature information.

[0009] The optimized cross-modal pedestrian re-identification model is obtained by training the model with the target loss function as the optimization objective.

[0010] Secondly, embodiments of the present invention provide a cross-modal person re-identification method, the method comprising:

[0011] The visible light image set and the infrared image set are respectively input into the target cross-modal pedestrian re-identification model provided in any embodiment of the present invention to obtain visible light image features and infrared image features;

[0012] The target cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer.

[0013] Based on the features of visible light images and infrared images, cross-modal image mutual search is performed to determine the target image set that matches the target pedestrian;

[0014] Determine the trajectory of the target pedestrian based on the target image set.

[0015] Thirdly, embodiments of the present invention provide a cross-modal pedestrian re-identification model generation apparatus, the apparatus comprising:

[0016] The image sample input module is used to input visible light image samples and infrared image samples into a preset cross-modal pedestrian re-identification model, wherein the preset cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer.

[0017] The target loss function determination module is used to obtain the feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for processing visible light image samples and infrared image samples; and to determine the target loss function of the preset cross-modal pedestrian re-identification model based on the feature information.

[0018] The target cross-modal pedestrian re-identification model generation module is used to train the model with the target loss function as the optimization objective to obtain the optimized target cross-modal pedestrian re-identification model.

[0019] Fourthly, embodiments of the present invention provide a cross-modal pedestrian re-identification device, the device comprising:

[0020] The image feature generation module is used to input the visible light image set and the infrared image set into the target cross-modal pedestrian re-identification model provided in any embodiment of the present invention, respectively, to obtain visible light image features and infrared image features;

[0021] The target image set determination module is used to perform cross-modal image mutual search based on visible light image features and infrared image features to determine the target image set that matches the target pedestrian;

[0022] The pedestrian trajectory determination module is used to determine the trajectory of the target pedestrian based on the target image set.

[0023] Fifthly, embodiments of the present invention provide an electronic device, the electronic device comprising:

[0024] At least one processor; and

[0025] A memory that is communicatively connected to at least one processor; wherein,

[0026] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor can execute the cross-modal pedestrian re-identification model generation method provided in any embodiment of the present invention; or, the cross-modal pedestrian re-identification method provided in the embodiments of the present invention.

[0027] In a sixth aspect, embodiments of the present invention provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to execute and implement the cross-modal pedestrian re-identification model generation method provided in any embodiment of the present invention; or, the cross-modal pedestrian re-identification method provided in embodiments of the present invention.

[0028] The technical solution of this invention involves inputting visible light image samples and infrared image samples into a preset cross-modal pedestrian re-identification model. This preset cross-modal pedestrian re-identification model comprises at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer. The method acquires feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model from the visible light and infrared image samples. Based on the feature information, a target loss function for the preset cross-modal pedestrian re-identification model is determined. The model is trained using the target loss function as the optimization objective to obtain an optimized target cross-modal pedestrian re-identification model. This method, by adding an attention module, can extract key information from different modalities. Furthermore, by constraining the feature distribution of different domains with the target loss function during the feature extraction stage, a cross-modal correlation can be established, thereby enabling mutual search between visible light and infrared images through the cross-modal pedestrian re-identification model.

[0029] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1a This is a flowchart of a cross-modal pedestrian re-identification model generation method provided in Embodiment 1 of the present invention;

[0032] Figure 1b This is a schematic diagram of a DAM attention mechanism model structure provided in Embodiment 1 of the present invention;

[0033] Figure 1c This is a schematic diagram of the structure of a cross-modal pedestrian re-identification model provided in Embodiment 1 of the present invention;

[0034] Figure 2 This is a flowchart of another cross-modal pedestrian re-identification model generation method provided in Embodiment 2 of the present invention;

[0035] Figure 3 This is a flowchart of a cross-modal pedestrian re-identification method provided in Embodiment 3 of the present invention;

[0036] Figure 4 This is a schematic diagram of the structure of a cross-modal pedestrian re-identification model generation device according to Embodiment 4 of the present invention;

[0037] Figure 5 This is a schematic diagram of the structure of a cross-modal pedestrian re-identification device according to Embodiment 5 of the present invention;

[0038] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the cross-modal pedestrian re-identification model generation method of this invention. Detailed Implementation

[0039] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0041] Example 1

[0042] Figure 1a This is a flowchart of a cross-modal pedestrian re-identification model generation method according to Embodiment 1 of the present invention. This embodiment is applicable to situations where cross-modal pedestrian re-identification is performed on visible light images and infrared images using a cross-modal pedestrian re-identification model. Pedestrian re-identification can be a technique that uses computer vision technology to determine whether a specific pedestrian exists in an image or video sequence. Cross-modal refers to a practical problem involving two different modalities of data. For example, cross-modal retrieval; the cross-modal pedestrian re-identification between infrared images and visible light images solved in this embodiment of the invention is a special type of cross-modal retrieval problem. This method can be executed by a cross-modal pedestrian re-identification model generation device, which can be implemented in hardware and / or software and can be configured in an electronic device, such as a laptop or desktop computer.

[0043] like Figure 1a As shown in the figure, the method for generating a cross-modal pedestrian re-identification model provided in this embodiment includes the following steps:

[0044] Step 110: Input the visible light image samples and infrared image samples into the preset cross-modal pedestrian re-identification model.

[0045] The preset cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer.

[0046] In this embodiment, the visible light image can be a color image containing color information from the R, G, and B channels. The infrared image can be an image formed by different thermal infrared rays obtained based on the difference in infrared radiation emitted by an object. The visible light sample image can be obtained by a regular optical camera. The infrared sample image can be obtained by an infrared camera. Each sample image contains preset pedestrian information. The preset cross-modal pedestrian re-identification model can use a two-stream network structure, that is, the network can contain a branch for feature extraction from the visible light image and a branch for feature extraction from the infrared image. The network structure consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer.

[0047] For example, the two branches of a two-stream network can have identical model structures. Taking the branch with the input visible light image as an example, the backbone network of this branch can use a residual neural network (ResNet-50) with the last downsampled sample removed. This ResNet-50 network can contain four convolutional modules (convolutional layers), which are connected sequentially. The visible light image passes through each convolutional layer of the ResNet-50 network to obtain corresponding feature maps. These feature maps can be split into multiple feature sub-maps, and each feature sub-map passes through an average pooling layer to obtain corresponding local features. The dimension of each local feature can be 2048. Each local feature can then pass through a fully connected layer for dimensionality reduction, further reducing the difference in feature distribution between the two modalities. The dimensionality reduction can be 512. The dimensionality-reduced local features can then be concatenated to obtain a concatenated feature map. The network structures of the two branches can be completely identical. After obtaining different concatenated feature maps, each branch can also pass through a final fully connected layer. This ensures that the parameters of the two branches remain consistent. After passing through the fully connected layer at the end, a classification prediction feature vector is obtained, which can contain the outputs of both branches after passing through the fully connected layer at the end. An attention mechanism can be added between any two of the above convolutional layers to allow the extracted image features to contain more fine-grained pedestrian information. The above network layers and processing procedures can constitute a complete preset cross-modal pedestrian re-identification model.

[0048] Cross-modal processing can be a practical problem involving two different modalities of data (such as text-image or audio-image). In this embodiment, it involves cross-modal processing between two different types of images, namely, cross-modal mutual search between visible light images and infrared images. In a two-stream network structure, each stream has a neural network with the same structure. The attention mechanism can be a mechanism that enables the neural network to focus on key feature information.

[0049] In an optional embodiment of the present invention, an attention mechanism is connected between any two convolutional layers in a preset cross-modal pedestrian re-identification model. The attention mechanism is used to perform weighted processing on the visible light intermediate feature map or infrared intermediate feature map output from the previous convolutional layer to obtain a visible light weighted feature map or an infrared weighted feature map; and then input the visible light weighted feature map or infrared weighted feature map into the next convolutional layer.

[0050] In this embodiment, the attention mechanism may be a squeeze-and-excitation (SE) mechanism, a convolutional block attention module (CBAM) mechanism, or a DAM attention mechanism, etc.

[0051] For example, a DAM attention mechanism can be added between every two convolutional layers of the four convolutional layers in a ResNet-50 network, resulting in three attention mechanisms. The input is a visible light image or an infrared image from a pre-defined cross-modal person re-identification model. After passing through each of the aforementioned convolutional layers, a visible light intermediate feature map or an infrared intermediate feature map is obtained. The DAM attention mechanism can then perform weighted processing on these intermediate feature maps. By adding attention mechanism modules, the features extracted by the model from different modalities can contain key information.

[0052] Figure 1b This is a schematic diagram of a DAM attention mechanism model structure provided in Embodiment 1 of the present invention. Figure 1b As shown: First, the visible light intermediate feature map or the infrared intermediate feature map F is weighted to obtain a weighted vector a. Then, the weighted vector is multiplied by the intermediate feature map to obtain a weighted feature map Fa. Finally, the weighted feature map is added to the intermediate feature map to obtain the intermediate weighted feature map. The intermediate weighted feature maps obtained by the attention mechanism model can be fed into the next convolutional layer.

[0053] The formula for weight processing is as follows:

[0054] a = σ(W2δ(W1pool(F))).

[0055] Where σ is the sigmoid function, δ is the Dirac function, W1 and W2 are the matrix parameters to be trained, and pool is the global pooling operation.

[0056] Figure 1c This is a schematic diagram of a cross-modal pedestrian re-identification model structure according to Embodiment 1 of the present invention. Based on the model structure described above in this embodiment, the preset cross-modal pedestrian re-identification model can be as follows: Figure 1cAs shown: This model uses a two-stream network structure, which can be divided into a branch for input visible light images and a branch for input infrared images. The network structures of the two branches can be the same. Conv1, Conv2, Conv3, and Conv4 are four convolutional layers. DAM is an attention mechanism module, added between every two convolutional layers. Average pooling is an average pooling layer. Fully connected (FC) is a fully connected layer.

[0057] Step 120: Obtain the feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for processing visible light image samples and infrared image samples; and determine the target loss function of the preset cross-modal pedestrian re-identification model based on the feature information.

[0058] In this embodiment, each network layer processes visible light image samples and infrared image samples to obtain different feature information. For example, convolutional layers can extract features from both visible light and infrared image samples; the attention mechanism module can weight the intermediate features output by the convolutional layers to extract key information. Based on the different feature information obtained from each layer, the model can be optimized using different loss functions. Multiple loss functions can be combined to form a target loss function.

[0059] For example, various loss functions can be combined into a target loss function through addition, multiplication, etc. Different forms of loss can include numerical loss functions, squared loss functions, cross-entropy loss functions, etc.

[0060] Step 130: Using the target loss function as the optimization objective, train the model to obtain the optimized cross-modal pedestrian re-identification model.

[0061] In this embodiment, the target loss function can calculate the error between the output data of each layer of the model and the target data. Based on the error data, the weights of the preset cross-modal person re-identification model can be further optimized, so that the model performance continuously approaches the preset performance, thereby obtaining the target cross-modal person re-identification model. The structure of the target cross-modal person re-identification model is also as follows. Figure 1c As shown.

[0062] The technical solution of this invention involves inputting visible light image samples and infrared image samples into a preset cross-modal pedestrian re-identification model. This preset cross-modal pedestrian re-identification model comprises at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer. The method acquires feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model from the visible light and infrared image samples. Based on the feature information, a target loss function for the preset cross-modal pedestrian re-identification model is determined. The model is trained using the target loss function as the optimization objective to obtain an optimized target cross-modal pedestrian re-identification model. This method, by adding an attention module, can extract key information from different modalities. Furthermore, by constraining the feature distribution of different domains with the target loss function during the feature extraction stage, a cross-modal correlation can be established, thereby enabling mutual search between visible light and infrared images through the cross-modal pedestrian re-identification model.

[0063] Example 2

[0064] Figure 2 This is a flowchart of another cross-modal pedestrian re-identification model generation method provided by Embodiment 2 of the present invention. This embodiment is a further refinement of the above technical solution. The technical solution in this embodiment can be combined with various optional solutions in one or more of the above embodiments.

[0065] Specifically, in an optional embodiment of the present invention, feature information obtained by each network layer in a preset cross-modal pedestrian re-identification model for processing visible light image samples and infrared image samples is acquired; and based on the feature information, the target loss function of the preset cross-modal pedestrian re-identification model is determined, including:

[0066] For visible light images and infrared images, obtain the visible light intermediate weighted feature maps and infrared intermediate weighted feature maps output by each attention mechanism in the preset cross-modal pedestrian re-identification model;

[0067] The visible light intermediate weighted feature map and the infrared intermediate weighted feature map are respectively subjected to average pooling to obtain the intermediate features of the visible light target and the intermediate features of the infrared target.

[0068] Based on the intermediate features of visible light targets and infrared targets, the triplet loss function in the target loss function of the preset cross-modal pedestrian re-identification model is determined.

[0069] In an optional embodiment of the present invention, feature information obtained by each network layer in a preset cross-modal pedestrian re-identification model for processing visible light image samples and infrared image samples is acquired; and based on the feature information, the target loss function of the preset cross-modal pedestrian re-identification model is determined, including:

[0070] For visible light images and infrared images, the visible light target feature maps and infrared target feature maps output by the last convolutional layer in the preset cross-modal pedestrian re-identification model are obtained respectively.

[0071] The visible light target feature map and the infrared target feature map are respectively cut into multiple visible light target feature sub-maps and infrared target feature sub-maps along the horizontal direction;

[0072] Each visible light target feature sub-image and each infrared target feature sub-image are concatenated after being subjected to average pooling and regularization respectively to obtain visible light target features and infrared target features.

[0073] Based on the visible light target features and infrared target features, the central loss function in the target loss function of the preset cross-modal pedestrian re-identification model is determined.

[0074] In an optional embodiment of the present invention, feature information obtained by each network layer in a preset cross-modal pedestrian re-identification model for processing visible light image samples and infrared image samples is acquired; and based on the feature information, the target loss function of the preset cross-modal pedestrian re-identification model is determined, including:

[0075] For visible light images and infrared images, obtain the visible light classification features and infrared classification features output by the last fully connected layer in the preset cross-modal pedestrian re-identification model, respectively.

[0076] Based on visible light classification features and infrared classification features, the classification loss function in the target loss function of the preset cross-modal pedestrian re-identification model is determined.

[0077] like Figure 2 As shown in this embodiment, another method for generating a cross-modal pedestrian re-identification model includes the following steps:

[0078] Step 201: Input the visible light image samples and infrared image samples into the preset cross-modal pedestrian re-identification model respectively.

[0079] The preset cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer. An attention mechanism is connected between any two convolutional layers in the preset cross-modal pedestrian re-identification model. The attention mechanism is used to weight the visible light intermediate feature map or infrared intermediate feature map output from the previous convolutional layer to obtain a visible light weighted feature map or an infrared weighted feature map; and then input the visible light weighted feature map or infrared weighted feature map into the next convolutional layer.

[0080] Step 202: Obtain the visible light intermediate weighted feature map and the infrared intermediate weighted feature map output by each attention mechanism in the preset cross-modal pedestrian re-identification model for visible light images and infrared images.

[0081] In this embodiment, an attention mechanism module is added in step 110. After the visible light image and infrared image are input into the preset cross-modal pedestrian re-identification model, they pass through a convolutional layer and then through the attention mechanism module to obtain the visible light intermediate weighted feature map and the infrared intermediate weighted feature map. For example... Figure 1c As shown, each branch has three DAM attention mechanism modules added, and each attention mechanism can output an intermediate weighted feature map after processing.

[0082] Step 203: Perform average pooling on the visible light intermediate weighted feature map and the infrared intermediate weighted feature map respectively to obtain the visible light target intermediate feature and the infrared target intermediate feature.

[0083] Specifically, by performing average pooling on the visible light intermediate weighted feature map and the infrared intermediate weighted feature map output by each attention mechanism in each branch, the intermediate features of the visible light target and the intermediate features of the infrared target can be obtained.

[0084] Step 204: Based on the intermediate features of visible light targets and the intermediate features of infrared targets, determine the triplet loss function in the target loss function of the preset cross-modal pedestrian re-identification model.

[0085] In this embodiment, in order to narrow the feature distributions of the two modes, a triplet loss function can be used for optimization based on the data of the intermediate features of the visible light target and the intermediate features of the infrared target. The formula for calculating the triplet loss function is as follows:

[0086]

[0087] Among them, f V and f T These are the intermediate features of visible light targets and the intermediate features of infrared targets, respectively. Since multiple visible light sample images and infrared sample images are input, then... The feature of the i-th visible light image is called the anchor sample. This represents the infrared image feature of the same type that is furthest away. "Same type" can refer to images of the same category, i.e., images containing the same pedestrian. This represents the infrared image feature of the nearest out-of-place element. The out-of-place element can be from different categories, i.e., images containing different pedestrians. Similarly, the i-th infrared image feature is used. To make an anchor, use This represents the feature of the same type of visible light image that is furthest away from it. Let D(.,.) represent the closest out-of-class infrared image features. D(.,.) represents the cosine distance between the two classes of features. Δ1 represents the boundary of the triplet loss. m and s represent the random selection of m pedestrians from the sample images, with s visible light and infrared light images selected for each pedestrian.

[0088] Step 205: Obtain the visible light target feature map and the infrared target feature map output by the last convolutional layer in the preset cross-modal pedestrian re-identification model for visible light image and infrared image, respectively.

[0089] Specifically, such as Figure 1c As shown, the last convolutional layer in the four convolutional layers, namely Conv4, can output the target feature map, while the two branch networks output the visible light target feature map and the infrared target feature map, respectively.

[0090] Step 206: Cut the visible light target feature map and the infrared target feature map into multiple visible light target feature sub-maps and infrared target feature sub-maps along the horizontal direction, respectively.

[0091] In this embodiment, the target feature map can be equally divided into p sub-feature maps (target feature sub-maps), where p represents the number of target feature sub-maps. For example, the visible light target feature map and the infrared target feature map can be equally divided in height, with up to 8 divisions. That is, the visible light target feature map and the infrared target feature map can be divided into 8 visible light target feature sub-maps and 8 infrared target feature sub-maps, respectively. The advantage of this setting is that it allows the extracted image features to contain more fine-grained pedestrian information.

[0092] Step 207: After performing average pooling and regularization on each visible light target feature sub-image and each infrared target feature sub-image, concatenate them to obtain visible light target features and infrared target features.

[0093] In this embodiment of the invention, regularization involves adding rules to some training data to prevent overfitting and thus enhance generalization ability. Concatenation can be achieved by concatenating the feature sub-images of visible light targets and the feature sub-images of infrared targets according to their respective length dimensions.

[0094] Specifically, by performing average pooling and concatenation on each visible light target feature sub-image and each infrared target feature sub-image respectively, visible light target features and infrared target features can be obtained by recombining the target feature sub-images.

[0095] Step 208: Based on the visible light target features and infrared target features, determine the center loss function in the target loss function of the preset cross-modal pedestrian re-identification model.

[0096] In this embodiment, to narrow the distribution gap between the two modal data, based on the data conditions of visible light target features and infrared target features, a center loss can be applied to both the infrared and visible light target features to narrow their distributions. Specifically, t can be used... i v i These represent infrared target features and visible light target features, respectively. The formula for calculating the center loss function is shown below:

[0097]

[0098] in, The central feature is the average of the s visible light image features of the i-th pedestrian. Let s represent the central feature of the average value of s infrared image features of the i-th pedestrian.

[0099] Step 209: Obtain the visible light classification features and infrared classification features output by the last fully connected layer in the preset cross-modal pedestrian re-identification model for visible light and infrared images.

[0100] In this embodiment, as Figure 1c As shown, the last fully connected layer can be Figure 1c The second fully connected layer in the array. This final fully connected layer can then output visible light classification features and infrared classification features, respectively.

[0101] Step 210: Based on the visible light classification features and infrared classification features, determine the classification loss function in the target loss function of the preset cross-modal pedestrian re-identification model.

[0102] In this embodiment, the visible light classification features and the infrared classification features can be jointly represented as a classification prediction vector h. i To ensure the distinguishability of features within a modality, a classification loss function can be used for optimization. The formula for calculating the classification loss function is shown below:

[0103]

[0104] Where C can represent the number of pedestrian identities in the training set, exp can represent an exponential function with base e, log can represent a logarithmic function with base e, and h i It is a feature of infrared or visible light images, y i h i The category.

[0105] Step 211: Using the target loss function as the optimization objective, train the model to obtain the optimized cross-modal pedestrian re-identification model.

[0106] Combining the loss functions obtained from the above steps, the optimization objective of the cross-modal person re-identification model in this embodiment of the invention can be expressed as:

[0107] L = L cls +L center +L trip .

[0108] The advantage of this setup is that, during the feature extraction stage, the target loss function can be used to constrain the feature distribution of different domains, bringing the data distribution of the two modalities closer together, thereby establishing a cross-modal correlation. This makes the extracted image features more semantically expressive, ensuring that the cross-modal pedestrian re-identification model can achieve mutual search between visible light images and infrared images.

[0109] For example, the parameter p in the above steps can be set to 6, and Δ1 can be set to 0.3. During training, the present invention can use the SGD gradient optimization algorithm to optimize the parameters in the feature extraction process (such as the matrix parameters in the attention mechanism, the parameters in the feature extraction network ResNet-50, etc.). The learning rate uses a piecewise constant decay method, and the learning rate used for the first 30 iterations is 1x10. -2 The learning rate decays to 1x10 from the 30th iteration. -4 Through training, a cross-modal pedestrian re-identification model that can better express the semantics of images can be obtained.

[0110] The technical solution of this embodiment involves inputting visible light image samples and infrared image samples into a preset cross-modal pedestrian re-identification model; obtaining the visible light intermediate weighted feature map and the infrared intermediate weighted feature map output by each attention mechanism in the preset cross-modal pedestrian re-identification model for the visible light image and the infrared intermediate weighted feature map respectively; performing average pooling on the visible light intermediate weighted feature map and the infrared intermediate weighted feature map respectively to obtain the visible light target intermediate feature and the infrared target intermediate feature; and determining the triplet loss function in the target loss function of the preset cross-modal pedestrian re-identification model based on the visible light target intermediate feature and the infrared target intermediate feature. For visible light and infrared images, the visible light target feature maps and infrared target feature maps output by the last convolutional layer of a pre-defined cross-modal pedestrian re-identification model are obtained. These feature maps are then horizontally segmented into multiple sub-maps. Each sub-map is processed with average pooling and regularization before being concatenated to obtain the visible light and infrared target features. Based on these features, the center loss function is determined within the target loss function of the pre-defined cross-modal pedestrian re-identification model. Next, the visible light classification features and infrared classification features output by the last fully connected layer of the pre-defined cross-modal pedestrian re-identification model are obtained. Based on these features, the classification loss function is determined within the target loss function of the pre-defined cross-modal pedestrian re-identification model. The optimized cross-modal pedestrian re-identification model is obtained by training the model using the target loss function as the optimization objective. This method can extract more key feature information of the image through the DAM attention mechanism, obtain local detail information of the image through image segmentation, and combine the triple loss function to bring the distribution of the two modalities closer together; combine the center loss function to bring the distribution between the two modal data closer together; and combine the classification loss function to ensure that the features within the modality are distinguishable, so that the model can better extract fine-grained information of the image, thereby achieving better cross-modal pedestrian re-identification.

[0111] The acquisition, storage, and application of visible light images, infrared images, and corresponding image features involved in the technical solutions of this invention comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0112] Example 3

[0113] Figure 3This is a flowchart of a cross-modal pedestrian re-identification method according to Embodiment 3 of the present invention. This embodiment can be applied to situations where cross-modal pedestrian trajectory identification is performed in visible light pedestrian image sets and infrared pedestrian image sets. The method can be executed by a cross-modal pedestrian re-identification device, which can be implemented in hardware and / or software. This device can be configured in an electronic device, such as a laptop or desktop computer.

[0114] like Figure 3 As shown, the cross-modal pedestrian re-identification method provided in this embodiment three specifically includes the following steps:

[0115] Step 310: Input the visible light image set and the infrared image set into the target cross-modal pedestrian re-identification model provided in any embodiment of the present invention to obtain visible light image features and infrared image features.

[0116] The target cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer.

[0117] In this embodiment, the target cross-modal pedestrian re-identification model can narrow down the distribution of features from different modalities during feature extraction; it can extract more key feature information through the DAM attention mechanism module; and it can obtain local detail information of pedestrian images. By inputting the visible light image and infrared image to be identified into the target cross-modal pedestrian re-identification model for feature extraction, visible light image features and infrared image features with stronger semantic expressiveness for fine-grained information can be obtained.

[0118] Step 320: Based on the features of visible light images and infrared images, perform cross-modal image mutual search to determine the target image set that matches the target pedestrian.

[0119] In this embodiment, both visible light image features and infrared image features can represent the characteristics of pedestrians in the image. Cross-modal image mutual search can be performed by matching visible light image features with infrared image features, or by matching infrared image features with visible light image features.

[0120] For example, one image feature can be arbitrarily selected from visible light image features and infrared image features as the target pedestrian image feature. This image feature is then matched against all visible light and infrared image features to calculate the similarity between the target pedestrian image feature and other image features. A similarity threshold is set; image features with matching results greater than this threshold are considered target pedestrian image features. The image corresponding to the target pedestrian image feature is taken as the target image, and all images that match this threshold are taken as the target image set.

[0121] The similarity can be cosine similarity, distance similarity, etc.

[0122] Step 330: Determine the trajectory of the target pedestrian based on the target image set.

[0123] In this embodiment, the trajectory of a target pedestrian can be determined in several ways. For example, the image set can be arranged into a sequence according to the time order in which the images were captured, and the trajectory of the target pedestrian can be determined as time progresses. Alternatively, the pedestrian's actions in the images can be sorted according to the target image set to determine the trajectory of the target pedestrian.

[0124] The technical solution of this invention involves inputting visible light image sets and infrared image sets into the target cross-modal pedestrian re-identification model provided in any embodiment of the invention, respectively, to obtain visible light image features and infrared image features; performing cross-modal image mutual search based on the visible light image features and infrared image features to determine the target image set matching the target pedestrian; and determining the target pedestrian trajectory based on the target image set. This method, through the target cross-modal pedestrian re-identification model, can narrow the distribution of image features across different modalities; extract more key feature information; and obtain local detail information of the image, making the extracted image features more semantically expressive of fine-grained information, improving the effect of mutual search between visible light and infrared images, and realizing the identification of target pedestrian trajectories in different modalities.

[0125] The acquisition, storage, and application of visible light images and infrared images involved in the technical solutions of this invention comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0126] Example 4

[0127] Figure 4 This is a schematic diagram of a cross-modal pedestrian re-identification model generation device according to Embodiment 4 of the present invention. Figure 4 As shown, the device includes: an image sample input module 401, a target loss function determination module 402, and a target cross-modal person re-identification model generation module 403, wherein:

[0128] The image sample input module 401 is used to input visible light image samples and infrared image samples into a preset cross-modal pedestrian re-identification model, wherein the preset cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer.

[0129] The target loss function determination module 402 is used to obtain the feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for processing visible light image samples and infrared image samples; and to determine the target loss function of the preset cross-modal pedestrian re-identification model based on the feature information.

[0130] The target cross-modal pedestrian re-identification model generation module 403 is used to train the model with the target loss function as the optimization objective to obtain the optimized target cross-modal pedestrian re-identification model.

[0131] Optionally, the device may also include:

[0132] An attention mechanism addition module is provided to connect an attention mechanism between any two convolutional layers in a preset cross-modal person re-identification model.

[0133] Optionally, the target loss function determination module 402 includes:

[0134] The weighted feature map acquisition unit is used to acquire the intermediate weighted feature maps of visible light and infrared light respectively output by each attention mechanism in the preset cross-modal pedestrian re-identification model for visible light and infrared images.

[0135] The intermediate feature generation unit is used to perform average pooling on the visible light intermediate weighted feature map and the infrared intermediate weighted feature map to obtain the visible light target intermediate feature and the infrared target intermediate feature respectively.

[0136] The triplet loss function determination unit is used to determine the triplet loss function in the target loss function of the preset cross-modal pedestrian re-identification model based on the intermediate features of visible light targets and the intermediate features of infrared targets.

[0137] Optionally, the target loss function determination module 402 includes:

[0138] The target feature map acquisition unit is used to acquire the visible light target feature map and the infrared target feature map output by the last convolutional layer in the preset cross-modal pedestrian re-identification model for visible light images and infrared images, respectively.

[0139] The target sub-feature map generation unit is used to cut the visible light target feature map and the infrared target feature map into multiple visible light target feature maps and infrared target feature maps along the horizontal direction, respectively.

[0140] The target feature generation unit is used to concatenate each visible light target feature sub-image and each infrared target feature sub-image after passing them through average pooling and regularization respectively, to obtain visible light target features and infrared target features.

[0141] The center loss function determination unit is used to determine the center loss function in the target loss function of the preset cross-modal pedestrian re-identification model based on the visible light target features and infrared target features.

[0142] Optionally, the target loss function determination module 402 includes:

[0143] The classification feature acquisition unit is used to acquire the visible light classification features and infrared classification features output by the last fully connected layer in the preset cross-modal pedestrian re-identification model for visible light and infrared images, respectively.

[0144] The classification loss function determination unit is used to determine the classification loss function in the target loss function of the preset cross-modal pedestrian re-identification model based on visible light classification features and infrared classification features.

[0145] The technical solution of this invention involves inputting visible light image samples and infrared image samples into a preset cross-modal pedestrian re-identification model. This preset cross-modal pedestrian re-identification model comprises at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer. The method acquires feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model from the visible light and infrared image samples. Based on the feature information, a target loss function for the preset cross-modal pedestrian re-identification model is determined. The model is trained using the target loss function as the optimization objective to obtain an optimized target cross-modal pedestrian re-identification model. This method, by adding an attention module, can extract key information from different modalities. Furthermore, by constraining the feature distribution of different domains with the target loss function during the feature extraction stage, a cross-modal correlation can be established, thereby enabling mutual search between visible light and infrared images through the cross-modal pedestrian re-identification model.

[0146] The cross-modal pedestrian re-identification model generation device provided in this embodiment of the invention can execute the cross-modal pedestrian re-identification model generation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0147] Example 5

[0148] Figure 5 This is a schematic diagram of the structure of a cross-modal pedestrian re-identification device according to Embodiment 5 of the present invention. Figure 5 As shown, the device includes: an image feature generation module 501, a target image set determination module 502, and a pedestrian trajectory determination module 503, wherein:

[0149] The image feature generation module 501 is used to input the visible light image set and the infrared image set into the target cross-modal pedestrian re-identification model provided in any embodiment of the present invention to obtain visible light image features and infrared image features.

[0150] The target image set determination module 502 is used to perform cross-modal image mutual search based on visible light image features and infrared image features to determine the target image set that matches the target pedestrian;

[0151] The pedestrian trajectory determination module 503 is used to determine the trajectory of the target pedestrian based on the target image set.

[0152] The technical solution of this invention involves inputting visible light image sets and infrared image sets into the target cross-modal pedestrian re-identification model provided in any embodiment of the invention, respectively, to obtain visible light image features and infrared image features; performing cross-modal image mutual search based on the visible light image features and infrared image features to determine the target image set matching the target pedestrian; and determining the target pedestrian trajectory based on the target image set. This method, through the target cross-modal pedestrian re-identification model, can narrow the distribution of image features across different modalities; extract more key feature information; and obtain local detail information of the image, making the extracted image features more semantically expressive of fine-grained information, improving the effect of mutual search between visible light and infrared images, and realizing the identification of target pedestrian trajectories in different modalities.

[0153] The cross-modal pedestrian re-identification device provided in the embodiments of the present invention can execute the cross-modal pedestrian re-identification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0154] Example 6

[0155] Figure 6 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0156] like Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0157] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0158] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as cross-modal pedestrian re-identification model generation methods.

[0159] In some embodiments, the cross-modal pedestrian re-identification model generation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the cross-modal pedestrian re-identification model generation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the cross-modal pedestrian re-identification model generation method by any other suitable means (e.g., by means of firmware).

[0160] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0161] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0162] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0163] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0164] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0165] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0166] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0167] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for generating a cross-modal pedestrian re-identification model, characterized in that, include: Visible light image samples and infrared image samples are respectively input into a preset cross-modal pedestrian re-identification model, wherein the preset cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer. The feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for the visible light image sample and the infrared image sample is obtained; and the target loss function of the preset cross-modal pedestrian re-identification model is determined based on the feature information. The optimized cross-modal pedestrian re-identification model is obtained by training the model using the target loss function as the optimization objective. Obtain the feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for the visible light image samples and the infrared image samples; and determine the target loss function of the preset cross-modal pedestrian re-identification model based on the feature information, including: For the visible light image and the infrared image, the visible light target feature map and the infrared target feature map output by the last convolutional layer in the preset cross-modal pedestrian re-identification model are obtained respectively. The visible light target feature map and the infrared target feature map are respectively divided into multiple visible light target feature sub-maps and infrared target feature sub-maps along the horizontal direction; wherein, the horizontal division is to equally divide the visible light target feature map and the infrared target feature map along the height dimension; The visible light target feature sub-images and the infrared target feature sub-images are concatenated after being subjected to average pooling and regularization, respectively, to obtain the visible light target features and the infrared target features. Based on the visible light target features and the infrared target features, determine the center loss function in the target loss function of the preset cross-modal pedestrian re-identification model; An attention mechanism is connected between any two convolutional layers in the preset cross-modal pedestrian re-identification model; The attention mechanism is used to perform weight processing on the visible light intermediate feature map or infrared intermediate feature map output by the previous convolutional layer to obtain a visible light intermediate weighted feature map or an infrared intermediate weighted feature map; and input the visible light intermediate weighted feature map or the infrared intermediate weighted feature map into the next convolutional layer. Obtain the feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for the visible light image samples and the infrared image samples; and determine the target loss function of the preset cross-modal pedestrian re-identification model based on the feature information, including: For the visible light image and the infrared image, the visible light intermediate weighted feature map and the infrared intermediate weighted feature map output by each attention mechanism in the preset cross-modal pedestrian re-identification model are obtained respectively. The visible light intermediate weighted feature map and the infrared intermediate weighted feature map are respectively subjected to average pooling to obtain the visible light target intermediate feature and the infrared target intermediate feature; Based on the intermediate features of the visible light target and the intermediate features of the infrared target, the triplet loss function in the target loss function of the preset cross-modal pedestrian re-identification model is determined.

2. The method according to claim 1, characterized in that, The feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for the visible light image sample and the infrared image sample is obtained. Based on the aforementioned feature information, the target loss function of the preset cross-modal person re-identification model is determined, including: For the visible light image and the infrared image, the visible light classification features and infrared classification features output by the last fully connected layer in the preset cross-modal pedestrian re-identification model are obtained respectively. Based on the visible light classification features and the infrared classification features, the classification loss function in the target loss function of the preset cross-modal pedestrian re-identification model is determined.

3. A cross-modal pedestrian re-identification method, characterized in that, include: The visible light image set and the infrared image set are respectively input into the target cross-modal pedestrian re-identification model as described in any one of claims 1 to 2 to obtain visible light image features and infrared image features; The target cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer. Based on the visible light image features and the infrared image features, a cross-modal image mutual search is performed to determine the target image set that matches the target pedestrian; Based on the target image set, determine the trajectory of the target pedestrian.

4. A cross-modal pedestrian re-identification model generation device, characterized in that, include: The image sample input module is used to input visible light image samples and infrared image samples into a preset cross-modal pedestrian re-identification model, wherein the preset cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer. The target loss function determination module is used to obtain the feature information obtained by each network layer in the preset cross-modal pedestrian re-identification model for the visible light image sample and the infrared image sample; and to determine the target loss function of the preset cross-modal pedestrian re-identification model based on the feature information. The target cross-modal pedestrian re-identification model generation module is used to train the model with the target loss function as the optimization objective to obtain the optimized target cross-modal pedestrian re-identification model. The target loss function determination module includes: The target feature map acquisition unit is used to acquire the visible light target feature map and the infrared target feature map output by the last convolutional layer in the preset cross-modal pedestrian re-identification model for visible light images and infrared images, respectively. The target sub-feature map generation unit is used to cut the visible light target feature map and the infrared target feature map into multiple visible light target feature maps and infrared target feature maps along the horizontal direction, respectively; wherein, the horizontal cutting is to cut the visible light target feature map and the infrared target feature map into equal parts along the height dimension; The target feature generation unit is used to concatenate each visible light target feature sub-image and each infrared target feature sub-image after passing them through average pooling and regularization respectively, to obtain visible light target features and infrared target features. The center loss function determination unit is used to determine the center loss function in the target loss function of the preset cross-modal pedestrian re-identification model based on the visible light target features and infrared target features. An attention mechanism addition module is used to connect an attention mechanism between any two convolutional layers in a preset cross-modal pedestrian re-identification model; wherein, the attention mechanism is used to perform weight processing on the visible light intermediate feature map or infrared intermediate feature map output by the previous convolutional layer to obtain a visible light intermediate weighted feature map or an infrared intermediate weighted feature map; and input the visible light intermediate weighted feature map or infrared intermediate weighted feature map into the next convolutional layer; The target loss function determination module includes: a weighted feature map acquisition unit, used to acquire the intermediate weighted feature maps of visible light and infrared light respectively output by each attention mechanism in the preset cross-modal pedestrian re-identification model for visible light and infrared images; The intermediate feature generation unit is used to perform average pooling on the visible light intermediate weighted feature map and the infrared intermediate weighted feature map to obtain the visible light target intermediate feature and the infrared target intermediate feature respectively. The triplet loss function determination unit is used to determine the triplet loss function in the target loss function of the preset cross-modal pedestrian re-identification model based on the intermediate features of visible light targets and the intermediate features of infrared targets.

5. A cross-modal pedestrian re-identification device, characterized in that, include: An image feature generation module is used to input a visible light image set and an infrared image set into the target cross-modal pedestrian re-identification model as described in any one of claims 1 to 2, respectively, to obtain visible light image features and infrared image features; The target cross-modal pedestrian re-identification model consists of at least one convolutional layer, at least one attention mechanism, an average pooling layer, and at least one fully connected layer. The target image set determination module is used to perform cross-modal image mutual search based on the visible light image features and the infrared image features to determine the target image set that matches the target pedestrian; The pedestrian trajectory determination module is used to determine the trajectory of the target pedestrian based on the target image set.

6. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, which is executed by the at least one processor to enable the at least one processor to perform the cross-modal pedestrian re-identification model generation method according to any one of claims 1-2; or, the cross-modal pedestrian re-identification method according to claim 3.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the cross-modal pedestrian re-identification model generation method according to any one of claims 1-2; or, the cross-modal pedestrian re-identification method according to claim 3.