A target re-identification method, device and computer readable storage medium

By decoupling the features of the backbone network and branch networks, a target re-identification model is trained, which solves the problem of poor vehicle re-identification performance in different environments and achieves efficient vehicle recognition and improved recognition performance with low complexity.

CN114220078BActive Publication Date: 2025-11-18ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111358114.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-16
Publication Date
2025-11-18
Estimated Expiration
2041-11-16

AI Technical Summary

Technical Problem

Vehicle re-identification performs poorly under different environments, viewpoints, and lighting conditions, and the model is highly complex.

Method used

A target re-identification model employing a backbone network and at least two branch networks is used. By generating loss values ​​through feature decoupling, multiple classification results are trained to improve the model's generalization performance and recognition accuracy.

Benefits of technology

It improves the accuracy and generalization performance of vehicle re-identification, reduces the impact of background environment on the recognition results, and has low model complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114220078B_ABST
    Figure CN114220078B_ABST
Patent Text Reader

Abstract

The application discloses a target re-identification method, device and computer readable storage medium. The method comprises: processing a to-be-identified image comprising a to-be-identified target and a search data set comprising a plurality of search images based on a target re-identification model to obtain a re-identification result, wherein the re-identification result comprises a search image in the search data set matching the to-be-identified target; the target re-identification model comprises a main network and at least two branch networks, the main network is used to obtain sample features of sample images in training data; the branch network is used to process the sample features to obtain a feature map and classify the feature map to obtain a classification result; a loss value of the target re-identification model is determined by a first loss value and a second loss value, the first loss value is a loss obtained by decoupling processing of the feature map output by all branch networks, and the second loss value is a loss of each classification result. In the above manner, the application can improve the performance of target re-identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision technology, specifically to a target re-identification method, apparatus, and computer-readable storage medium. Background Technology

[0002] Target re-identification is a sub-problem of image retrieval, focusing on retrieving specific targets in cross-camera scenes when the target is occluded, blurred, or damaged. For example, vehicle re-identification has important practical applications in traffic management or intelligent monitoring. However, vehicle appearance varies greatly under different environments, viewing angles, resolutions, and lighting conditions. Furthermore, different vehicles may exhibit similar appearances due to having the same brand, model, and color, which brings difficulties to the vehicle re-identification task, resulting in poor recognition results or high complexity of the recognition model. Summary of the Invention

[0003] This application provides a target re-identification method, apparatus, and computer-readable storage medium, which can improve the performance of target re-identification.

[0004] To address the aforementioned technical problems, this application adopts the following technical solution: A target re-identification method is provided, comprising: acquiring an image to be identified and a search dataset, wherein the image to be identified includes a target to be identified, and the search dataset includes multiple search images; processing the image to be identified and the search dataset respectively based on a target re-identification model to obtain re-identification results, wherein the re-identification results include search images in the search dataset that match the target to be identified; wherein the target re-identification model is trained based on training data, which includes multiple sample images, and the target re-identification model includes a backbone network and at least two branch networks, wherein the backbone network is used to acquire features from the sample images to obtain sample features; the branch networks are used to process the sample features to obtain feature maps, and classify the feature maps to obtain classification results; the loss value of the target re-identification model is determined by a first loss value and a second loss value, wherein the first loss value is the loss obtained by decoupling the feature maps output by all branch networks, and the second loss value is the loss for each classification result.

[0005] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a target re-identification device, which includes a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the target re-identification method in the above-mentioned technical solution.

[0006] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium for storing a computer program, which, when executed by a processor, is used to implement the target re-identification method in the above-mentioned technical solution.

[0007] The beneficial effects of this application through the above scheme are as follows: The target re-identification model provided by this application includes a backbone network and at least two branch networks; when training the target re-identification model, the backbone network processes the sample images to generate sample features; the branch networks process the sample features to obtain feature maps, and by decoupling the feature maps output by all branch networks, a first loss value can be obtained; at the same time, each branch network also outputs a classification result, and each classification result corresponds to a second loss value; by processing the first loss value and all second loss values, the loss value for each training session can be generated; in practical use, the trained target re-identification model is used to process the image to be identified and the search dataset to obtain the re-identification result; since multiple information is trained simultaneously in the target re-identification model, multiple classification results can be obtained, improving the generalization performance of the model; moreover, since all feature maps are decoupled, various features can be distinguished, which helps to improve the accuracy of re-identification. Attached Figure Description

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

[0009] Figure 1 This is a flowchart illustrating an embodiment of the target re-identification method provided in this application;

[0010] Figure 2 This is a schematic diagram of the target re-identification model provided in this application;

[0011] Figure 3 This is a flowchart illustrating another embodiment of the target re-identification method provided in this application;

[0012] Figure 4 This is a flowchart illustrating the training target re-identification model provided in this application;

[0013] Figure 5 This is another structural diagram of the target re-identification model provided in this application;

[0014] Figure 6 This is a schematic diagram of the structure of an embodiment of the target re-identification device provided in this application;

[0015] Figure 7 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0016] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the application. Similarly, the following embodiments are only some, not all, embodiments of the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.

[0017] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0018] It should be noted that the terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0019] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the target re-identification method provided in this application. The method includes:

[0020] S11: Obtain the image to be identified and the search dataset.

[0021] The image to be identified includes the target to be identified, which is the target of interest, such as a vehicle, ship, pedestrian, or luggage; the search dataset includes multiple search images, which may contain the target to be identified; the image to be identified and the search images can be obtained from an image database, or multiple camera devices can be used to capture images of the monitored scene to generate the image to be identified and the search images.

[0022] S12: Based on the target re-identification model, the image to be identified and the search dataset are processed separately to obtain the re-identification result.

[0023] The target re-identification model can be pre-trained using training data to generate a trained target re-identification model. That is, the target re-identification model is trained based on training data, which includes multiple sample images. The target re-identification model includes a backbone network and at least two branch networks. The backbone network is used to acquire features from the sample images to obtain sample features. The branch networks are used to process the sample features to obtain feature maps and classify the feature maps to obtain classification results. The loss value of the target re-identification model is determined by a first loss value and a second loss value. The first loss value is the loss obtained by decoupling the feature maps output by all branch networks, and the second loss value is the loss for each classification result.

[0024] In one specific embodiment, such as Figure 2 As shown, the target recognition model includes branch networks 1-3, and the training data includes labels 1-3 corresponding to sample images. Branch network 1 can output features. Figure 1 Based on classification result 1, branch network 2 can output features. Figure 2 In addition to classification result 2, branch network 3 can output features. Figure 3 Compared with classification result 3, through feature analysis Figure 1 ,feature Figure 2 and features Figure 3 Decoupling is performed to obtain the first loss value L1; the loss value between classification result 1 and label 1 is calculated to obtain the second loss value L21; the loss value between classification result 2 and label 2 is calculated to obtain the second loss value L22; the loss value between classification result 3 and label 3 is calculated to obtain the second loss value L23; by processing the first loss value L1, the second loss value L21, the second loss value L22, and the second loss value L23, the loss value for this training can be obtained. Understandably, the specific process of training the model is similar to related techniques and will not be elaborated upon here.

[0025] After obtaining the trained target re-identification model, the image to be identified and the search image are input into the trained target re-identification model to generate re-identification results. The re-identification results include the search images in the search dataset that match the target to be identified, thereby enabling the search for the target to be identified captured by different camera devices.

[0026] This embodiment provides a target re-identification method based on feature decoupling. When training the target re-identification model, the feature maps output by all branch networks are decoupled to generate a first loss value; simultaneously, each branch network corresponds to a second loss value. By processing the first loss value and all second loss values, a loss value is generated, which can be used to determine whether to continue training, ultimately obtaining the trained target re-identification model. Since multiple classifications are trained simultaneously in the target re-identification model, the generalization performance of the model is improved; moreover, due to the decoupling of the feature maps, various features can be distinguished, which helps to improve the accuracy of recognition.

[0027] Please see Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the target re-identification method provided in this application. The method includes:

[0028] S31: Obtain the target re-identification model.

[0029] The target re-identification model includes at least two branch networks, such as a first branch network and a second branch network. Figure 4 As shown, training the target re-identification model includes the following steps:

[0030] S41: Select a sample image from the training data and use the backbone network to perform feature extraction processing on the sample image to obtain sample features.

[0031] The training data includes multiple sample images, each containing a target to be trained. The type of the training target is the same as the type of the target to be identified. When training the target re-identification model, one sample image can be selected from all the sample images and then input into the target recognition model. Specifically, taking an image of a vehicle as an example... Figure 5 As shown, the first four modules of ResNet50 (Deep residual network), conv1 to conv4, can be used as the backbone network.

[0032] S42: The first branch network is used to process the sample features and generate the first feature map.

[0033] The sample features output by the backbone network are input into the first branch network, which processes the sample features to obtain the first feature map.

[0034] S43: The second branch network is used to process the sample features and generate the second feature map.

[0035] The sample features output by the backbone network are input into the second branch network, which processes the sample features to obtain the second feature map.

[0036] In one specific embodiment, such as Figure 5 As shown, the first branch network is the vehicle branch, and the second branch network is the camera branch. These two branch networks have the same network structure. Specifically, both the first and second branch networks include convolutional layers (e.g., the conv5 module of ResNet50), batch normalization layers, and pooling layers connected in sequence. The convolutional layers are used to convolve the sample features, the batch normalization layers are used to batch normalize the features output by the convolutional layers, and the pooling layers are used to pool the features output by the batch normalization layers. This pooling layer can be a global average pooling layer. The first feature map is the feature output by the batch normalization layer in the first branch network, and the second feature map is the feature output by the batch normalization layer in the second branch network. The first feature map is the feature corresponding to the identity of the target to be trained, and the second feature map is the feature corresponding to the camera to which the target to be trained belongs.

[0037] S44: Decouple the first feature map and the second feature map to generate the first loss value.

[0038] The first feature map includes multiple first feature sub-maps, and the second feature map includes multiple second feature sub-maps. A first weight matrix is ​​used to perform a weighted summation on all the first feature sub-maps to generate a third feature map. A second weight matrix is ​​used to perform a weighted summation on all the second feature sub-maps to generate a fourth feature map. A first loss value is generated based on the third and fourth feature maps.

[0039] Further, the third feature map is activated to obtain the fifth feature map; the fourth feature map is activated to obtain the sixth feature map; the Hadamard product of the fifth and sixth feature maps is calculated to obtain the seventh feature map; the sum of all values ​​in the seventh feature map is calculated to obtain the first loss value.

[0040] S45: Process the first loss value and all second loss values ​​to generate a loss value.

[0041] The first loss value, the second loss value corresponding to the first branch network, and the second loss value corresponding to the second branch network are weighted and summed to obtain the loss value.

[0042] S46: Determine whether the target re-identification model meets the preset training termination condition.

[0043] The preset stopping conditions include: loss value convergence, that is, the difference between the previous loss value and the currently calculated loss value is less than a set value; determining whether the loss value is less than a preset loss value, which is a pre-set loss threshold. If the loss value is less than the preset loss value, the preset stopping condition is determined to be met; the number of training iterations reaches a set value (e.g., 10,000 training iterations); or the accuracy obtained when using the test set for testing reaches a set condition (e.g., exceeding the preset accuracy).

[0044] S47: If the target re-identification model meets the preset training termination condition, then the trained target re-identification model is obtained.

[0045] If the target re-identification model does not meet the preset training termination condition, return to the step of selecting a sample image from the training data (i.e., return to S41) until the target re-identification model meets the preset training termination condition, and the trained target re-identification model is obtained.

[0046] In one specific embodiment, such as Figure 5 As shown, taking a vehicle as the training target as an example, the vehicle's identity and the camera in the sample image can be labeled to generate vehicle identity labels and camera labels. In order to make the extracted vehicle features more focused on the information of the vehicle in the input image, while the camera perception features are more focused on the background, style and lighting information in the image, the following method is used to decouple the vehicle features and the camera perception features:

[0047] After the sample image passes through the conv5 module in the backbone network and two branch networks, as well as the batch normalization layer, a vehicle feature map F (i.e., the first feature map) and a camera perception feature map M (i.e., the second feature map) are obtained. The size and number of channels of the vehicle feature map F and the camera perception feature map M are equal.

[0048] Assuming the vehicle identification label of the sample image is denoted as t, and the camera label is denoted as c, in the fully connected weight matrix W used for vehicle classification, the weight vector corresponding to category t is W. t In the fully connected weight matrix P used for camera classification, the weight vector corresponding to category c is Pc. c .

[0049] For the vehicle classification branch (i.e., the first branch network), the weight vector W is used. t We perform a weighted summation of the feature maps of the corresponding channels in the vehicle feature map F to obtain the activation region map (i.e., the fifth feature map) A of category t. t The calculation is performed using the following formula:

[0050]

[0051] In formula (1), F i(x,y) represents the element value of the i-th channel at position (x,y) in the vehicle feature map F, d represents the number of channels in the vehicle feature map F, and W t,i For W t The value of the i-th element.

[0052] Similarly, for the camera classification branch (i.e., the second branch network), the weight vector P is used. c The feature maps of the corresponding channels in the camera's perceived feature map M are weighted and summed to obtain the activation region map (i.e., the sixth feature map) B of category c. c The calculation is performed using the following formula:

[0053]

[0054] In formula (2), M i (x,y) represents the element value of the i-th channel at position (x,y) in the camera's perceived feature map M, d represents the number of channels in the camera's perceived feature map M, and P c,i For P t The value of the i-th element.

[0055] The activation region map reflects which regions of the image the model uses to determine the target category; that is, on the activation region map, regions with higher numerical values ​​contribute more to the category score. Since the vehicle feature map F and the camera perception feature map M are of the same size, the resulting activation region map A... t and B c The sizes are also consistent.

[0056] Then, the Sigmoid activation function is used to activate region map A respectively. t and B c Each element is transformed to obtain a and b, where the value of each element in a and b ranges from (0,1). To decouple vehicle features and camera-perceived features, and to make them focus on different regions, the first loss value is calculated using the following formula:

[0057]

[0058] In formula (3), This indicates that the elements in the matrix are multiplied together.

[0059] Through the processing of the first and second branch networks, the corresponding vehicle features and camera perception features can be output. These features are used for loss calculation during training or feature retrieval in practical applications.

[0060] Therefore, the training loss of the target re-identification model consists of three parts: vehicle identity classification loss (i.e., the second loss value of the first sub-network), camera category classification loss (i.e., the second loss value of the second sub-network), and feature decoupling loss (i.e., the first loss value). These three losses are summed and then backpropagated. An optimization algorithm is used to update the model parameters to reduce the loss value, thereby enabling the model to learn better feature representations during continuous training. Understandably, the method of training the model using backpropagation and optimization algorithms is the same as in related techniques, and will not be elaborated upon here.

[0061] In this embodiment, sample images from the training data are input into the target re-identification model. After processing by the backbone network and two branch networks, the extracted vehicle features and camera perception features are output. These two features are then input into different fully connected layers and activation layers (the activation layer can use the Softmax activation function) to classify vehicle identity and camera category, respectively, thus obtaining the corresponding category prediction probabilities, namely, the vehicle category prediction probability and the camera category prediction probability. The vehicle category prediction probability represents the probability that the vehicle belongs to a certain category, and the camera category prediction probability represents the probability that the camera used to capture the sample image belongs to a certain category. At the same time, label smoothing operations (e.g., one-hot encoding) are performed on the vehicle identity label and the camera label to generate corresponding encoding values. Finally, cross-entropy loss is calculated based on the category prediction probabilities and encoding values ​​to obtain the vehicle identity classification loss and the camera category classification loss, respectively. This embodiment trains the model using vehicle identification tags and camera tags, without requiring additional models, only adding one branch (i.e., the second branch network), resulting in lower complexity compared to existing models. Without using additional models and excessive branches, it can extract discriminative semantic features from the input image, thereby improving the recognition performance of vehicle re-identification. Furthermore, it uses feature decoupling loss, making vehicle features focus more on vehicle information in the input image, while camera perception features focus more on background, style, and lighting information in the image, which helps improve recognition performance.

[0062] S32: Obtain the image to be identified and the search dataset.

[0063] S32 is the same as S11 in the above embodiment, and will not be described again here.

[0064] S33: The target re-identification model is used to process the image to be identified, and the first output feature is obtained.

[0065] The image to be identified is input into the target re-identification model so that the target re-identification model can process the image to generate the first output feature.

[0066] S34: The target re-identification model is used to identify and process the search image to obtain the second output feature.

[0067] The search image is input into the target re-identification model so that the target re-identification model processes the search image and generates a second output feature.

[0068] S35: Generate re-identification results based on the first output feature and the second output feature.

[0069] The first output features include the first classification features and the second classification features of the image to be identified. The second output features include the first classification features and the second classification features of the search image. First, the similarity between the first classification features of the image to be identified and the first classification features of the search image can be calculated to obtain the first similarity, for example, by calculating cosine distance or Euclidean distance. Then, the similarity between the second classification features of the image to be identified and the second classification features of the search image can be calculated to obtain the second similarity. Finally, based on the first and second similarities, a re-identification result is generated.

[0070] Furthermore, the first and second similarities are first weighted and summed to obtain the third similarity. Then, based on the third similarity, all search images in the search dataset are filtered to obtain the re-identification result. For example, taking the cosine distance as the method for calculating similarity, the final distance (i.e., the third similarity) = vehicle feature distance (i.e., the first similarity) - λ × camera perceived feature distance (i.e., the second similarity), where λ can be set according to specific application requirements.

[0071] In one specific embodiment, all search images in the search dataset can be sorted in descending order of third similarity to obtain a sorted set; a preset number of search images with the highest third similarity are then selected from the sorted set to obtain the re-identification result. Understandably, the preset number can be set according to specific application needs or experience; for example, assuming the search image set includes 1000 search images and the preset number is 80, then 80 search images will ultimately be selected from these 1000 search images to form the re-identification result.

[0072] In another specific embodiment, it can be determined whether the third similarity of the search images in the search image set is greater than a preset similarity; if the third similarity of the search images in the search image set is greater than the preset similarity (e.g., 0.5), then the search image is included in the re-identification results.

[0073] In one embodiment, taking a vehicle as the target to be identified as an example, the image to be identified and the images in the search image set are first input into the target re-identification model that has been trained. After processing by the backbone network and two branch networks, vehicle features and camera perception features are obtained. Then, the cosine distance between the vehicle features of each image to be identified and the vehicle features of each image in the search image set is calculated, and the cosine distance between the camera perception features of each image to be identified and the camera perception features of each image in the search image set is also calculated. The two cosine distances are then fused to obtain the final distance. Finally, the images in the search image set are sorted in ascending order of distance to obtain the corresponding re-identification results.

[0074] In this embodiment, the decoupling of vehicle features and camera-perceived features is achieved by constraining the activation region maps of vehicle classification and camera classification. Since the distances of vehicle features and camera-perceived features are fused, the influence of the background environment on the re-identification results is reduced, and the recognition performance is improved.

[0075] Understandably, a set of images to be identified can also be constructed, which includes at least one image to be identified. The method described in the above embodiments is used to process all images to be identified to generate corresponding re-identification results.

[0076] In this embodiment, no additional model is needed when training the target re-identification model; only one branch is added, resulting in lower model complexity. Simultaneously training vehicle identity classification and camera classification improves the model's generalization performance and reduces the impact of the background environment on the re-identification results, thereby enhancing the model's recognition accuracy.

[0077] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an embodiment of the target re-identification device provided in this application. The target re-identification device 60 includes a memory 61 and a processor 62 connected to each other. The memory 61 is used to store a computer program. When the computer program is executed by the processor 62, it is used to implement the target re-identification method in the above embodiment.

[0078] The approach adopted in this embodiment first constructs a target re-identification model based on feature decoupling; then, it trains the target re-identification model using images and labels from the training data; next, it inputs the images from the image set to be identified and the image set to the search set into the trained target re-identification model to obtain vehicle features and camera perception features; based on these two features, it calculates the distance between each image in the image set to be identified and the image set to the search set, obtaining the vehicle feature distance and the camera perception feature distance respectively; after fusing these two distances, they are sorted in ascending order of distance to obtain the retrieval results of the image to be identified, which can improve the recognition performance.

[0079] Please see Figure 7 , Figure 7 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this application. The computer-readable storage medium 70 is used to store a computer program 71. When the computer program 71 is executed by a processor, it is used to implement the target re-identification method in the above embodiment.

[0080] The computer-readable storage medium 70 can be any medium capable of storing program code, such as a server, USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0081] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0082] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0083] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0084] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A target re-identification method, characterized in that, include: Obtain the image to be identified and the search dataset, wherein the image to be identified includes the target to be identified, and the search dataset includes multiple search images; The image to be identified and the search dataset are processed based on the target re-identification model to obtain the re-identification result, which includes the search image in the search dataset that matches the target to be identified. The target re-identification model is trained based on training data, which includes multiple sample images. The target re-identification model includes a backbone network and at least two branch networks. The backbone network is used to acquire features from the sample images to obtain sample features. The branch networks are used to process the sample features to obtain feature maps and classify the feature maps to obtain classification results. The loss value of the target re-identification model is determined by a first loss value and a second loss value. The first loss value is the loss obtained by decoupling the feature maps output by all branch networks, and the second loss value is the loss for each classification result. The at least two branch networks include a first branch network and a second branch network, which have the same structure. The first branch network is a vehicle branch network, and the second branch network is a camera branch network. The step of processing the image to be identified and the search dataset based on the target re-identification model to obtain re-identification results includes: The vehicle branch network and camera branch network in the target re-identification model process the image to be identified and the search image in the search dataset, respectively, to obtain a first output feature and a second output feature. The first output feature includes a first classification feature and a second classification feature of the image to be identified, and the second output feature includes a first classification feature and a second classification feature of the search image. The first classification feature is a vehicle feature, and the second classification feature is a camera perception feature. Based on the first output feature and the second output feature, the re-identification result is generated. The step of generating the re-identification result based on the first output feature and the second output feature includes: A first similarity is determined based on the vehicle features of the image to be identified and the vehicle features of the search image; a second similarity is determined based on the camera perception features of the image to be identified and the camera perception features of the search image; and the re-identification result is determined based on the first similarity and the second similarity.

2. The target re-identification method according to claim 1, characterized in that, The at least two branch networks include a first branch network and a second branch network, and the training of the target re-identification model includes: Select a sample image from the training data and use the backbone network to perform feature extraction processing on the sample image to obtain the sample features; The sample features are processed using the first branch network to generate a first feature map; The sample features are processed using the second branch network to generate a second feature map; The first feature map and the second feature map are decoupled to generate the first loss value; The first loss value and all the second loss values ​​are processed to generate the loss value; Determine whether the target re-identification model meets the preset training termination condition; If not, return to the step of selecting a sample image from the training data until the target re-identification model meets the preset training termination condition, and obtain the trained target re-identification model.

3. The target re-identification method according to claim 2, characterized in that, The first feature map includes multiple first feature sub-maps, and the second feature map includes multiple second feature sub-maps. The step of decoupling the first feature map and the second feature map to generate the first loss value includes: The first feature map is generated by weighting and summing all the first feature sub-maps using the first weight matrix. The second feature map is generated by weighting and summing all the second feature sub-maps using the second weight matrix. The first loss value is generated based on the third feature map and the fourth feature map.

4. The target re-identification method according to claim 3, characterized in that, The step of generating the first loss value based on the third feature map and the fourth feature map includes: The third feature map is activated to obtain the fifth feature map; The fourth feature map is activated to obtain the sixth feature map; Calculate the Hadamard product of the fifth feature map and the sixth feature map to obtain the seventh feature map; The sum of all values ​​in the seventh feature map is calculated to obtain the first loss value.

5. The target re-identification method according to claim 3, characterized in that, The step of processing the first loss value and all the second loss values ​​to generate the loss value includes: The first loss value, the second loss value corresponding to the first branch network, and the second loss value corresponding to the second branch network are weighted and summed to obtain the loss value.

6. The target re-identification method according to claim 1, characterized in that, The step of determining the re-identification result based on the first similarity and the second similarity includes: The first similarity and the second similarity are weighted and summed to obtain the third similarity; Based on the third similarity, all search images in the search dataset are filtered to obtain the re-identification result.

7. The target re-identification method according to claim 6, characterized in that, The step of filtering all search images in the search dataset based on the third similarity to obtain the re-identification result includes: Sort all search images in the search dataset according to the third similarity from largest to smallest to obtain a sorted set; Select a preset number of search images with the highest third similarity from the sorted set to obtain the re-identification result.

8. The target re-identification method according to claim 6, characterized in that, The step of filtering all search images in the search dataset based on the third similarity to obtain the re-identification result includes: Determine whether the third similarity of the search images in the search image set is greater than a preset similarity. If so, the search image is added to the re-identification result.

9. The target re-identification method according to claim 2, characterized in that, The sample image includes the target to be trained. Both the first branch network and the second branch network include a convolutional layer, a batch normalization layer, and a pooling layer connected in sequence. The convolutional layer is used to convolve the sample features, the batch normalization layer is used to batch normalize the features output by the convolutional layer, and the pooling layer is used to pool the features output by the batch normalization layer. The first feature map is the feature output by the batch normalization layer in the first branch network, and the second feature map is the feature output by the batch normalization layer in the second branch network. The first feature map is a feature corresponding to the identity of the target to be trained, and the second feature map is a feature corresponding to the camera to which the target to be trained belongs.

10. A re-identification device, characterized in that, The system includes an interconnected memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the target re-identification method according to any one of claims 1-9.

11. A computer-readable storage medium for storing a computer program, characterized in that, When the computer program is executed by a processor, it is used to implement the target re-identification method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Attitude conversion method and device, electronic equipment and storage medium

    CN111680623A

  • Target re-identification method, network training method thereof and related device

    CN111814857A

  • Image classification method and device, equipment and medium

    CN113239878A