A method for improving the ability of a target re-identification model and a target re-identification method

By jointly training the target re-identification model, combined with the ReID detection head network and the semantic segmentation network, the problems of low accuracy and poor generalization ability in cross-lens and cross-domain recognition are solved, and higher recognition accuracy and stronger generalization ability are achieved.

CN116664833BActive Publication Date: 2025-07-25GUANGZHOU YUNCONG INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310512340.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-08
Publication Date
2025-07-25
Estimated Expiration
2043-05-08

AI Technical Summary

Technical Problem

The existing target re-identification model has low accuracy and poor generalization capabilities in cross-lens and cross-domain recognition, making it difficult to adapt to differences in different scenarios and environments.

Method used

By inputting the sample image into the backbone network to generate a ReID feature map, and inputting it into the ReID detection head network and the semantic segmentation network for joint training, the total loss function is weighted and summed to the loss function of the ReID detection head network and the semantic segmentation network, and optimizing the backbone network and the ReID detection head network.

Benefits of technology

The re-identification accuracy and generalization ability of the target re-identification model are improved, especially the recognition performance in different scenarios and environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116664833B_ABST
    Figure CN116664833B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer vision, and specifically provides a method for improving the ability of a target re-identification model and a target re-identification method, aiming to solve the problems that the accuracy of re-identification of existing target re-identification models is relatively low and the generalization ability is relatively poor. For this purpose, the method for improving the ability of a target re-identification model of the present invention includes: inputting a sample image into a backbone network to obtain a ReID feature map; respectively inputting the ReID feature map into a ReID detection head network and a semantic segmentation network for obtaining the region of interest of the sample image, and jointly training the ReID detection head network and the semantic segmentation network, wherein the total loss function used in the joint training is the weighted sum of a first loss function used by the ReID detection head network and a second loss function used by the semantic segmentation network, so as to obtain an optimized ReID detection head network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and specifically provides a method for improving the ability of a target re-identification model and a target re-identification method. Background Art

[0002] With the continuous development of modern technology, camera monitoring has become an essential security guarantee in modern life. Pedestrian re-identification technology utilizes image processing-related technologies in the field of computer vision to retrieve the images of a pedestrian across different domains and cameras based on the given pedestrian information, breaking through the limitations of the field of view brought by a single camera. Pedestrian re-identification technology has a wide range of application fields. For example, in video surveillance fields such as public security and anti-theft, with just one picture, the whereabouts of the target person can be located in real time, which has a great auxiliary effect on cross-regional positioning and capturing of suspects.

[0003] Due to the significant domain gaps between different datasets, pedestrian re-identification still faces great difficulties in cross-shot and cross-domain problems. For example, in existing publicly available datasets, the Market-1501 dataset was collected in a domestic summer campus scene, while the DukeMTMC-ReID dataset was collected in a foreign winter campus. This significant environmental difference creates a domain gap between the two datasets. Moreover, most of the currently used training data comes from surveillance data such as streets, stations, shopping malls, retail stores, airports, etc., with different scene styles. Coupled with the influence of factors such as the shooting angle of the camera and light, the domain gap is large. As a result, the model trained and fitted in the source domain has a significant decline in test performance in the target domain.

[0004] Correspondingly, there is a need in the art for a method for improving the ability of a target re-identification model and a target re-identification method to solve the above problems. Summary of the Invention

[0005] In order to overcome the above defects, the present invention is proposed to provide a method for improving the ability of a target re-identification model and a target re-identification method to solve or at least partially solve the technical problem that the existing target re-identification model has a low re-identification accuracy and poor generalization ability.

[0006] In a first aspect, the present invention provides a method for improving the ability of a target re-identification model, including the following steps:

[0007] Inputting a sample image into a backbone network to obtain a ReID feature map;

[0008] Input the ReID feature maps into a ReID detection head network and a semantic segmentation network for obtaining the region of interest of the sample image respectively, and jointly train the ReID detection head network and the semantic segmentation network, where the total loss function used for joint training is the weighted sum of a first loss function used by the ReID detection head network and a second loss function used by the semantic segmentation network, so as to obtain an optimized backbone network and ReID detection head network.

[0009] In a specific embodiment, the method further includes:

[0010] Input the sample image into a segmentation model to obtain a first mask map corresponding to the sample image, where the first mask map is used to distinguish the region of interest from the background region.

[0011] In a specific embodiment, during the training of the semantic segmentation network, the method includes:

[0012] Generate a semantic segmentation feature map corresponding to the ReID feature map through the semantic segmentation network;

[0013] Obtain a second mask map aligned with the semantic segmentation feature map according to the first mask map;

[0014] Input the second mask map and the semantic segmentation feature map into the second loss function, and aim to make the probability value in the semantic segmentation map corresponding to the region of interest in the second mask map high and the probability value in the semantic segmentation map corresponding to the background region in the second mask map low, so as to optimize the semantic segmentation network.

[0015] In a specific embodiment,

[0016] The backbone network is a ResNet network, including 5 convolutional layers that perform downsampling level by level from bottom to top. Among them, the i-th convolutional layer performs 2 i times downsampling on the input image features, and the 5th convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5;

[0017] The semantic segmentation network is a 4-layer feature pyramid that performs upsampling layer by layer from top to bottom. The first pyramid layer performs a 1×1 convolution on the output from the fifth convolutional layer and performs 2-fold upsampling, and fuses it with the output from the fourth convolutional layer after a 1×1 convolution to obtain a first fused feature; the second pyramid layer performs 2-fold upsampling on the first fused feature, and fuses it with the output from the third convolutional layer after a 1×1 convolution to obtain a second fused feature; the third pyramid layer performs 2-fold upsampling on the second fused feature, and fuses it with the output from the third convolutional layer after a 1×1 convolution to obtain a third fused feature; the fourth pyramid layer performs 2-fold upsampling on the third fused feature, and fuses it with the output from the second convolutional layer after a 1×1 convolution to obtain the semantic segmentation feature map.

[0018] In a specific embodiment,

[0019] The backbone network is a ResNet network, including 5 convolutional layers that perform downsampling layer by layer from bottom to top, where the i-th convolutional layer performs 2 i -fold downsampling on the input image features, and the fifth convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5;

[0020] The semantic segmentation network reuses the first two convolutional layers among the 5 convolutional layers, and the second convolutional layer outputs the semantic segmentation feature map.

[0021] In a specific embodiment,

[0022] The backbone network is a ResNet network, including 5 convolutional layers that perform downsampling layer by layer from bottom to top, where the i-th convolutional layer performs 2 i -fold downsampling on the input image features, and the fifth convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5;

[0023] The semantic segmentation network reuses the entire 5 convolutional layers, and the fifth convolutional layer outputs the semantic segmentation feature map.

[0024] In a specific embodiment, obtaining a second mask map aligned with the semantic segmentation feature map according to the first mask map includes:

[0025] Pooling the first mask map by max pooling to obtain the second mask map; or

[0026] Pooling the first mask map by voting to obtain the second mask map.

[0027] In a specific embodiment, during the training of the ReID detection head network, the method includes:

[0028] The ReID feature map is successively passed through a pooling layer and a convolutional layer, and the distances between positive and negative sample images are obtained through a triplet loss function.

[0029] The features obtained after convolution are successively passed through a normalization layer and a fully connected layer, and the classification result is obtained through a cross-entropy function.

[0030] In a specific embodiment, the method includes:

[0031] The convergence speeds of the ReID detection head network and the semantic segmentation network are coordinated by dynamically adjusting the weighting coefficient of the second loss function.

[0032] In a specific embodiment, the total loss function is:

[0033]

[0034] where Lreid is the first loss function, Lseg is the second loss function, α is a hyperparameter, cur_iter is the current iteration number, and total_iter is the total iteration number.

[0035] In a specific embodiment, before jointly training the ReID detection head network and the semantic segmentation network, the method further includes:

[0036] Pre-training the backbone network and the ReID detection head network for a preset number of times.

[0037] In a second aspect, the present invention provides a target re-identification method, including:

[0038] Using the ReID detection head network optimized by the method according to any one of the first aspect for target re-identification.

[0039] In a specific embodiment, the target includes one or more of pedestrians and vehicles.

[0040] One or more of the above technical solutions of the present invention at least have the following one or more

[0041] Beneficial effects:

[0042] In implementing the technical solution of the present invention, by adding a semantic segmentation branch to the target re-identification model to constrain the network's attention to foreground information and reduce the background influence, the domain generalization ability of pedestrian features can be improved and the re-identification accuracy of the existing target re-identification model can be increased. Description of the Drawings

[0043] Referring to the accompanying drawings, the disclosure of the present invention will become more readily understandable. Those skilled in the art can easily understand that these drawings are only for illustrative purposes and are not intended to limit the protection scope of the present invention. In addition, similar numbers in the figures are used to represent similar components, where:

[0044] Figure 1 is a schematic diagram of the main steps of a method for improving the ability of a target re-identification model according to an embodiment of the present invention;

[0045] Figure 2 is a schematic diagram of the joint training of a ReID detection head network and a semantic segmentation network according to an embodiment of the present invention;

[0046] Figure 3 is a schematic diagram of the process of training a semantic segmentation network according to an embodiment of the present invention;

[0047] Figure 4 is a schematic diagram of generating a semantic segmentation feature map corresponding to a ReID feature map through a semantic segmentation network according to an embodiment of the present invention;

[0048] Figure 5 is a schematic diagram of obtaining a second mask map aligned with the semantic segmentation feature map according to a first mask map in an embodiment of the present invention;

[0049] Figure 6 is a schematic diagram of the process of training a ReID detection head network according to an embodiment of the present invention. Detailed Embodiments

[0050] The following describes some embodiments of the present invention with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0051] In the description of the present invention, a "module" and a "processor" may include hardware, software, or a combination of both. A module may include a hardware circuit, various suitable sensors, communication ports, a memory, and may also include a software part, such as program code, or may be a combination of software and hardware. A processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, in hardware, or in a combination of both. A non-transitory computer-readable storage medium includes any suitable medium for storing program code, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and so on. The term "A and / or B" represents all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one of A or B" or "at least one of A and B" has a meaning similar to "A and / or B" and may include only A, only B, or A and B. The singular terms "a" and "the" may also include the plural form.

[0052] The orientation terms used herein, such as "front", "front side", "front part", "rear", "rear side", and "rear part", etc., are all based on the front-rear direction of the vehicle after the component is installed on the vehicle. The "longitudinal", "longitudinal direction", and "longitudinal section" mentioned herein are all based on the front-rear direction of the vehicle after the component is installed on the vehicle, while the "transverse", "transverse direction", and "transverse section" represent a direction perpendicular to the longitudinal direction.

[0053] In order to solve the above technical problems, especially to solve the problem that the re-identification accuracy of the existing target re-identification model is relatively low and the generalization ability is poor, for this purpose, a method for improving the ability of the target re-identification model and a target re-identification method of the present invention are proposed.

[0054] In the first aspect of the present invention, the present invention provides a method for improving the ability of the target re-identification model, refer to the attached Figure 1 , including the following steps S1-step S2:

[0055] S1. Input the sample image into the backbone network to obtain the ReID feature map.

[0056] In one example, the sample image is a batch of pedestrian images. After data augmentation such as random image padding, image cropping, image flipping, and image erasing on the pedestrian images, the images are input into the backbone network to generate a ReID feature map of 2048x12x6 dimensions.

[0057] S2. Input the ReID feature maps into the ReID detection head network and the semantic segmentation network for obtaining the region of interest of the sample image respectively, and jointly train the ReID detection head network and the semantic segmentation network, where the total loss function used in the joint training is the weighted sum of the first loss function used by the ReID detection head network and the second loss function used by the semantic segmentation network, so as to obtain an optimized backbone network and ReID detection head network.

[0058] In one example, as Figure 2 shown, the encoders (i.e., the backbone network) of the ReID detection head network and the semantic segmentation network are the same and share weights. Input the ReID feature maps into the ReID detection head network and the semantic segmentation network respectively for joint training, obtain the loss functions of the two network branches and then perform weighted summation, and further optimize the model parameters of the backbone network and the ReID detection head network to improve the target re-identification model ability.

[0059] It should be noted that using the same batch of sample images to train the two network branches can improve the re-identification accuracy and generalization ability of the target re-identification model compared with training the ReID detection head network branch with ReID data and training the semantic segmentation network branch with a segmentation dataset respectively.

[0060] In a specific embodiment, the method further includes:

[0061] Input the sample image into the segmentation model to obtain the first mask map corresponding to the sample image, where the first mask map is used to distinguish the region of interest from the background region.

[0062] For example, use Swin-B as the initial model, pre-train the weights of the initial model using the COCO part segmentation dataset, select some high-quality images from the above sample images as the training subset, perform manual annotation of the region of interest and the background region and add them to the training in batches. During the training process, continuously manually correct the pedestrians and their carried items as the region of interest, and the rest as the background region. Through the process of iterative training model - inference - correcting the results, a segmentation model with relatively high accuracy is finally obtained.

[0063] Furthermore, inputting the sample image into the segmentation model can obtain the first mask map for distinguishing the region of interest from the background region. The first mask map is a 01 binary matrix, where 1 represents the region of interest and 0 represents the background region.

[0064] Those skilled in the art can understand that the above first mask map is not input into the backbone network, but is only used when calculating the loss function of the semantic segmentation network.

[0065] In a specific embodiment, refer to the appendixFigure 3 During the training process of the semantic segmentation network, the method includes the following steps S20 to step S22:

[0066] S20. Generate a semantic segmentation feature map corresponding to the ReID feature map through the semantic segmentation network.

[0067] In a specific embodiment,

[0068] The backbone network is a resnet network, including 5 convolutional layers that perform downsampling level by level from bottom to top. Among them, the i-th convolutional layer performs 2 i times downsampling on the input image features, and the 5th convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5;

[0069] The semantic segmentation network is a 4-layer feature pyramid that performs upsampling level by level from top to bottom. The first pyramid layer performs 1*1 convolution on the output from the 5th convolutional layer and performs 2 times upsampling, and fuses with the output from the 4th convolutional layer after 1*1 convolution to obtain the first fusion feature; the second pyramid layer performs 2 times upsampling on the first fusion feature, and fuses with the output from the 3rd convolutional layer after 1*1 convolution to obtain the second fusion feature; the third pyramid layer performs 2 times upsampling on the second fusion feature, and fuses with the output from the 3rd convolutional layer after 1*1 convolution to obtain the third fusion feature; the fourth pyramid layer performs 2 times upsampling on the third fusion feature, and fuses with the output from the 2nd convolutional layer after 1*1 convolution to obtain the semantic segmentation feature map.

[0070] For example, as Figure 4 shown, the sample image generates the ReID feature map C5 (vector size [1, 2048, 12, 6]) through the 5 convolutional layers of the resnet network, compresses the number of channels through a 1*1 convolutional kernel to generate the first fusion feature (vector size [1, 64, 12, 6]), and upsamples by a factor of 1 using bilinear interpolation (vector size [1, 64, 24, 12]). The left C4 size is [1, 1024, 24, 12], compresses the number of channels through a 1*1 convolutional kernel to get [1, 64, 24, 12], and the two feature maps are added and fused to generate the second fusion feature, and so on, until the semantic segmentation feature map (vector size [1, 64, 96, 48]) is output at the last layer.

[0071] In a specific embodiment,

[0072] The backbone network is a resnet network, including 5 convolutional layers that perform downsampling level by level from bottom to top. Among them, the i-th convolutional layer performs 2 i times downsampling on the input image features, and the 5th convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5;

[0073] The semantic segmentation network reuses the first two convolutional layers of the five convolutional layers, and the second convolutional layer outputs the semantic segmentation feature map.

[0074] In another specific embodiment,

[0075] The backbone network is a ResNet network, including five convolutional layers that perform downsampling level by level from bottom to top. The i-th convolutional layer performs 2 i times downsampling on the input image features, and the fifth convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5;

[0076] The semantic segmentation network reuses all five convolutional layers, and the fifth convolutional layer outputs the semantic segmentation feature map.

[0077] S21. Obtain a second mask map aligned with the semantic segmentation feature map according to the first mask map.

[0078] For example, perform pixel-by-pixel classification on the semantic segmentation feature map and the first mask map to obtain the second mask map.

[0079] In a preferred example, before performing pixel-by-pixel classification using the first mask map, data augmentation operations can be performed on the mask map, such as random image padding, image cropping, image flipping, image erasing, etc.

[0080] S22. Input the second mask map and the semantic segmentation feature map into the second loss function, and optimize the semantic segmentation network with the goal that the probability value in the semantic segmentation map corresponding to the region of interest in the second mask map is high and the probability value in the semantic segmentation map corresponding to the background region in the second mask map is low.

[0081] In a preferred embodiment, the second loss function of the semantic segmentation network is the binary cross-entropy loss function:

[0082] L Seg = -(y log(p(x)) + (1 - y) log(1 - p(x))

[0083] where y is the value (1 or 0) of each pixel in the second mask map, x is the value of the corresponding pixel in the segmentation feature map, p() is the Sigmoid activation function, which normalizes the feature value to a probability value between 0 and 1. When y = 1, L Seg = -y log(p(x)); when y = 0, L Seg = -log(1 - p(x)).

[0084] Further, optimization is performed with the goal that the probability value in the semantic segmentation map corresponding to the region of interest (y = 1) in the second mask map is high (probability value is 1), while the probability value in the semantic segmentation map corresponding to the background region (y = 0) in the second mask map is low (probability value is 0).

[0085] In a specific embodiment, the obtaining of the second mask map aligned with the semantic segmentation feature map according to the first mask map includes:

[0086] Pooling the first mask map through max pooling to obtain the second mask map; or

[0087] Pooling the first mask map through a voting method to obtain the second mask map.

[0088] For example, as Figure 5 shown, pooling a first mask map with 4*4 pixel values into a second mask map with 2*2 pixel values, and the four 2*2 grids respectively have one 1 to four 1s. If it is max pooling, as long as there is a 1 in the 2*2, it will be pooled to 1; while pooling through the voting method, when there are more 0s, the result is 0, when there are more 1s, the result is 1, and when they are the same, it is default to take 1 (or 0). Compared with the max pooling method, the voting method can make the downsampled second mask map more accurate.

[0089] In a specific embodiment, referring to the appendix Figure 6 , during the training process of the ReID detection head network, the method includes the following steps S23 - step S24:

[0090] S23. Pass the ReID feature map through a pooling layer and a convolutional layer in sequence, and obtain the distance between positive and negative sample images through a triplet loss function;

[0091] S24. Pass the features obtained after convolution through a normalization layer and a fully connected layer in sequence, and obtain the classification result through a cross-entropy function.

[0092] In a specific embodiment, the method includes:

[0093] Coordinating the convergence speed of the ReID detection head network and the semantic segmentation network by dynamically adjusting the weighting coefficient of the second loss function.

[0094] Furthermore, the way of dynamically adjusting the weights makes the weight of the segmentation loss function increase with the number of training iterations. Compared with the way of direct weighted summation, it can significantly accelerate the convergence speed of the network model.

[0095] In a specific embodiment, the total loss function is:

[0096]

[0097] Wherein, Lreid is the first loss function, Lseg is the second loss function, α is a hyperparameter, cur_iter is the current iteration number, and total_iter is the total iteration number.

[0098] In a specific embodiment, before jointly training the ReID detection head network and the semantic segmentation network, the method further includes:

[0099] Pre-training the backbone network and the ReID detection head network for a preset number of times.

[0100] In an example, after inputting the ReID feature map into the ReID detection head network for several rounds of training, the semantic segmentation network branch is added to the training, and the encoders (i.e., the backbone network) of the semantic segmentation network and the ReID detection head network are the same and share weights. By delaying the training of the semantic segmentation network branch, a more semantic segmentation feature map can be extracted, which promotes the entire model.

[0101] In a second aspect of the present invention, the present invention further provides a method for object re-identification, including:

[0102] Performing object re-identification using the ReID detection head network optimized by the method according to any one of the first aspects of the present invention.

[0103] It should be noted that the semantic segmentation network only serves as an auxiliary network to add constraints to the ReID detection head network, enabling the model to enhance the attention to the region of interest and reduce the attention to the background region, thereby significantly improving the generalization ability of the model. In the test inference stage, the semantic segmentation network branch can be removed to reduce the network calculation amount without affecting the inference speed.

[0104] In a specific embodiment, the object includes one or more of pedestrians and vehicles.

[0105] It should be noted that in the specific embodiment of the present invention, although pedestrians are used as an example of the object in object re-identification, in actual applications, it can also be other objects such as vehicles, and the present invention does not limit this.

[0106] Those skilled in the art can understand that all or part of the processes in the methods of the above-described embodiments of the present invention can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable storage medium can include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.

[0107] Furthermore, the present invention also provides a control device. In an embodiment of the control device according to the present invention, the control device includes a processor and a storage device. The storage device can be configured to store programs for executing the methods of improving the ability of the target re-identification model and the target re-identification method in the above-described method embodiments. The processor can be configured to execute the programs in the storage device, and the programs include, but are not limited to, programs for executing the methods of improving the ability of the target re-identification model and the target re-identification method in the above-described method embodiments. For the sake of convenience of description, only the parts related to the embodiments of the present invention are shown. For the specific technical details not disclosed, please refer to the method part of the embodiments of the present invention. The control device can be a control device device formed by various electronic devices.

[0108] Furthermore, the present invention also provides a computer-readable storage medium. In an embodiment of the computer-readable storage medium according to the present invention, the computer-readable storage medium can be configured to store programs for executing the methods of improving the ability of the target re-identification model and the target re-identification method in the above-described method embodiments. The programs can be loaded and run by a processor to implement the methods of improving the ability of the target re-identification model and the target re-identification method. For the sake of convenience of description, only the parts related to the embodiments of the present invention are shown. For the specific technical details not disclosed, please refer to the method part of the embodiments of the present invention. The computer-readable storage medium can be a storage device device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiments of the present invention is a non-transitory computer-readable storage medium.

[0109] Furthermore, it should be understood that since the settings of the respective modules are merely for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules can be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is merely illustrative.

[0110] Those skilled in the art can understand that the respective modules in the device can be adaptively split or combined. Such splitting or combining of specific modules will not cause the technical solution to deviate from the principle of the present invention. Therefore, the technical solutions after splitting or combining will all fall within the protection scope of the present invention.

[0111] So far, the technical solution of the present invention has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the protection scope of the present invention.

Claims

1. A method for improving the ability of a target re-identification model, characterized in that, Including: Inputting a sample image into a backbone network to obtain a ReID feature map; Inputting the ReID feature map into a ReID detection head network and a semantic segmentation network for obtaining the region of interest of the sample image respectively, and jointly training the ReID detection head network and the semantic segmentation network, wherein the total loss function used for joint training is the weighted sum of a first loss function used by the ReID detection head network and a second loss function used by the semantic segmentation network, so as to obtain an optimized backbone network and ReID detection head network; The method further includes: inputting the sample image into a segmentation model to obtain a first mask map corresponding to the sample image, wherein the first mask map is used to distinguish the region of interest from the background region; During the process of training the semantic segmentation network, the method includes: Generating a semantic segmentation feature map corresponding to the ReID feature map through the semantic segmentation network; Obtaining a second mask map aligned with the semantic segmentation feature map according to the first mask map; Inputting the second mask map and the semantic segmentation feature map into the second loss function, and aiming at a high probability value in the semantic segmentation map corresponding to the region of interest in the second mask map and a low probability value in the semantic segmentation map corresponding to the background region in the second mask map, optimizing the semantic segmentation network.

2. The method according to claim 1, wherein The backbone network is a ResNet network, including 5 convolutional layers that perform downsampling step by step from bottom to top. The i-th convolutional layer performs 2 i times downsampling on the input image features, and the 5th convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5; The semantic segmentation network is a 4-layer feature pyramid that performs upsampling layer by layer from top to bottom. The first pyramid layer performs 1*1 convolution on the output from the fifth convolutional layer and performs 2-fold upsampling, and fuses it with the output from the fourth convolutional layer after 1*1 convolution to obtain a first fused feature; The second pyramid layer performs 2-fold upsampling on the first fused feature, and fuses it with the output from the third convolutional layer after 1*1 convolution to obtain a second fused feature; The third pyramid layer performs 2-fold upsampling on the second fused feature, and fuses it with the output from the third convolutional layer after 1*1 convolution to obtain a third fused feature; the fourth pyramid layer performs 2-fold upsampling on the third fused feature, and fuses it with the output from the second convolutional layer after 1*1 convolution to obtain the semantic segmentation feature map.

3. The method according to claim 1, wherein The backbone network is a ResNet network, including 5 convolutional layers that perform downsampling step by step from bottom to top. Among them, the i-th convolutional layer performs 2 i times downsampling on the input image features, and the 5th convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5; The semantic segmentation network reuses the first two convolutional layers among the 5 convolutional layers, and the second convolutional layer outputs the semantic segmentation feature map.

4. The method according to claim 1, wherein The backbone network is a ResNet network, including 5 convolutional layers that perform downsampling step by step from bottom to top. Among them, the i-th convolutional layer performs 2 i times downsampling on the input image features, and the 5th convolutional layer outputs the ReID feature map, where 1 ≤ i ≤ 5; The semantic segmentation network reuses the entire 5 convolutional layers, and the fifth convolutional layer outputs the semantic segmentation feature map.

5. The method according to any one of claims 1-4, characterized in that, The obtaining the second mask map aligned with the semantic segmentation feature map according to the first mask map includes: Pooling the first mask map through max pooling to obtain the second mask map; or Pooling the first mask map through voting to obtain the second mask map.

6. The method according to claim 1, wherein During the process of training the ReID detection head network, the method includes: Successively passing the ReID feature map through a pooling layer and a convolutional layer, and obtaining the distance between positive and negative sample images through a triplet loss function; The features obtained after convolution are successively passed through a normalization layer and a fully connected layer, and the classification result is obtained through a cross-entropy function.

7. The method according to claim 1, characterized in that, The method includes: Coordinating the convergence speeds of the ReID detection head network and the semantic segmentation network by dynamically adjusting the weighting coefficient of the second loss function.

8. The method according to claim 7, wherein The total loss function is: Among them, L reid is the first loss function, and the L seg is the second loss function, α is a hyperparameter, cur_iter is the current iteration number, and total_iter is the total number of iterations.

9. The method according to claim 1, wherein Before jointly training the ReID detection head network and the semantic segmentation network, the method further includes: Pre-training the backbone network and the ReID detection head network a preset number of times.

10. A target re-identification method, characterized in that, It includes: Performing object re-identification using a ReID detection head network optimized by the method according to any one of claims 1-9.

11. The method according to claim 10, characterized in that, The objects include one or more of pedestrians and vehicles.

Citation Information

Patent Citations

  • A traffic scene analysis method based on a multi-task network

    CN108985250A

  • Image processing method, electronic equipment and computer readable storage medium

    CN116012339A