Target re-identification method and device, electronic equipment and storage medium

By combining the method of channel attention branch and global branch, the channel attention features and global features of pedestrian images are extracted, which solves the problem of inaccurate pedestrian re-identification results in the existing technology and improves the accuracy and robustness of recognition.

CN118865448APending Publication Date: 2024-10-29BEIJING LONGZHI DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411020963.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Existing technology is difficult to extract accurate pedestrian features when faced with changes in pedestrian postures and occlusions, resulting in inaccurate target re-identification results.

Method used

Using the method of combining the channel attention branch and the global branch, the channel attention module adds a preset weight value to each channel of the initial feature map, extracts the channel attention feature, and jointly trains with the global feature to obtain a more distinctive Re-identify features.

Benefits of technology

It improves the accuracy and robustness of target re-identification, enhances the network's ability to extract features, and can better cope with the challenges of complex backgrounds and occlusions, different camera angles and lighting changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118865448A_ABST
    Figure CN118865448A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, and provides a target re-identification method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a target image containing a to-be-re-recognized target, and obtaining an initial feature map of the to-be-re-recognized target based on the target image; inputting the initial feature map to a channel attention branch, adding a preset weight value to each channel of the initial feature map by using a channel attention module to obtain a weight feature map, and sequentially processing the weight feature map through a first pooling layer and a convolution layer with a preset size to obtain channel attention features; determining a global feature corresponding to the target to be re-recognized based on the initial feature map, and determining a re-recognition feature corresponding to the target to be re-recognized based on the global feature and the channel attention feature; and re-identifying the target to be re-identified in the image to be re-identified based on the re-identification feature. According to the embodiment of the invention, the problem of inaccurate target re-identification result is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a target re-identification method, device, electronic device and storage medium. Background Art

[0002] With the development of deep learning algorithms, target re-identification technology in the field of computer vision has gradually been applied to the market, especially in the fields of video surveillance and intelligent security, where it is used to match and identify the same target (such as pedestrians) from different camera perspectives.

[0003] Taking pedestrian re-identification as an example, existing pedestrian re-identification technologies are usually based on convolutional neural network methods. One method is to locate local areas through prior knowledge such as posture estimation and key point positioning, so that the model can learn local features with semantic information. The PDC network model consists of two subnetworks. The first is the feature embedding subnetwork FEN, which divides the pedestrian image into 6 parts through 14 key points of posture estimation, and then standardizes the 6 parts of the image and adjusts the posture of the image. The second is the feature weighted subnetwork FWN, which automatically learns the weights of different parts so that feature fusion can be performed. However, when the above algorithms face changes in pedestrian posture, partial occlusion, etc., they cannot distinguish the characteristics of different pedestrians well, and it is difficult to extract accurate pedestrian information. That is, the existing technology cannot extract target features well when facing occlusion and target posture changes, which leads to inaccurate target re-identification results. Summary of the invention

[0004] In view of this, the present application provides a target re-identification method, device, electronic device and storage medium to solve the problem of inaccurate target re-identification results in the prior art.

[0005] In a first aspect of the present application, a target re-identification method is provided, including: obtaining a target image including a target to be re-identified, and obtaining an initial feature map of the target to be re-identified based on the target image; inputting the initial feature map into a channel attention branch, the channel attention branch including a channel attention module, a first pooling layer, and a convolutional layer of a preset size, using the channel attention module to add a preset weight value to each channel of the initial feature map to obtain a weight feature map, and sequentially processing the weight feature map through the first pooling layer and the convolutional layer of the preset size to obtain a channel attention feature; determining a global feature corresponding to the target to be re-identified based on the initial feature map, and determining a re-identification feature corresponding to the target to be re-identified based on the global feature and the channel attention feature; and re-identifying the target to be re-identified in the image to be re-identified based on the re-identification feature.

[0006] According to a second aspect of the present application, a target re-identification device is provided, including: an acquisition module, configured to acquire a target image including a target to be re-identified, and obtain an initial feature map of the target to be re-identified based on the target image; a local feature extraction module, configured to input the initial feature map into a channel attention branch, the channel attention branch includes a channel attention module, a first pooling layer, and a convolution layer of a preset size, and use the channel attention module to add a preset weight value to each channel of the initial feature map to obtain a weight feature map, and the weight feature map is processed by the first pooling layer and the convolution layer of the preset size in sequence to obtain a channel attention feature; a global feature extraction module, configured to determine a global feature corresponding to the target to be re-identified based on the initial feature map, and determine a re-identification feature corresponding to the target to be re-identified based on the global feature and the channel attention feature; and a re-identification module, configured to re-identify the target to be re-identified in the image to be re-identified based on the re-identification feature.

[0007] According to a third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0008] According to a fourth aspect of the present application, a storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0009] At least one of the above technical solutions adopted in this application can achieve the following beneficial effects:

[0010] By acquiring a target image containing a target to be re-identified, an initial feature map of the target to be re-identified is determined based on the target image, the initial feature map is input into a channel attention branch, and the initial feature map is processed using a channel attention module, a first pooling layer, and a convolutional layer of a preset size in the channel attention branch to extract local information of the target of interest and obtain channel attention features, wherein the channel attention module can weight the local features of the initial feature map to obtain a weighted feature map, and by processing the weighted feature map, more discriminative local features can be focused on, thereby accurately extracting features of the target to be re-identified; at the same time, the initial feature map is input into a global branch to extract the overall torso information of the target to be re-identified to obtain a global feature, so that the global feature and the channel attention feature can be jointly trained to obtain a more discriminative feature, namely, a re-identification feature, and the target to be re-identified in the image to be re-identified is re-identified based on the re-identification feature. In this way, the global branch can be used to extract the overall torso information and the convolutional layer can be used to process the feature map, which reduces the dimension of the feature and reduces the computational complexity. The channel attention module in the attention branch is used to add weights to each channel of the initial feature map to extract more interesting local features to obtain channel attention features. In this way, the final global features and channel attention features are jointly learned to obtain a more comprehensive feature representation, thereby enhancing the accuracy of target re-identification. The network's feature extraction capability and robustness are also improved based on local and global feature extraction methods, thereby solving the problem of inaccurate target re-identification results caused by missing feature information in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 It is a flowchart of a target re-identification method provided in an embodiment of the present application;

[0013] Figure 2 is a flowchart of another target re-identification method provided in an embodiment of the present application;

[0014] Figure 3 is a flowchart of another target re-identification method provided in an embodiment of the present application;

[0015] Figure 4 is a schematic diagram of the structure of a target re-identification device provided in an embodiment of the present application;

[0016] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0017] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0018] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0019] In addition, it should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "includes..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0020] A method and device for target re-identification according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0021] Figure 1 It is a flowchart of a target re-identification method provided in an embodiment of the present application. Figure 1 The target re-identification method can be executed by an application installed on the mobile terminal. Figure 1 As shown, the target re-identification method includes:

[0022] S101, acquiring a target image including a target to be re-identified, and obtaining an initial feature map of the target to be re-identified based on the target image;

[0023] S102, inputting the initial feature map into the channel attention branch, the channel attention branch includes a channel attention module, a first pooling layer, and a convolutional layer of a preset size, using the channel attention module to add a preset weight value to each channel of the initial feature map to obtain a weight feature map, and sequentially processing the weight feature map through the first pooling layer and the convolutional layer of the preset size to obtain a channel attention feature;

[0024] S103, determining a global feature corresponding to the target to be re-identified based on the initial feature map, and determining a re-identification feature corresponding to the target to be re-identified based on the global feature and the channel attention feature;

[0025] S104, re-identifying the target to be re-identified in the image to be re-identified based on the re-identification features.

[0026] Specifically, the target in the present application can represent the object that needs to be re-identified, which can be a pedestrian, an animal or other object. First of all, it can be understood that the target re-identification technology aims to match the same target captured by cameras in different areas at different times, that is, the target image can be obtained based on the camera or image database. The core is to achieve effective distinction between different targets through fine-grained differences between targets. Traditional target re-identification technology is usually suitable for visible light modal data under good lighting and wide field of view, but the performance of target re-identification tasks will be severely limited when the target is occluded or in dark conditions. Therefore, this application aims to solve the problem of incomplete feature extraction and adjust the network architecture, that is, the last pooling layer and the fully connected layer can be replaced with two independent branches on the traditional resnet50 architecture: a global branch and a channel attention branch.

[0027] Furthermore, the target image can be identified and the initial features of the target can be extracted to obtain an initial feature map. The initial feature map provides basic data for subsequent identification, that is, the initial feature map can be further subjected to feature extraction through the global branch and the channel attention branch respectively to obtain the overall information of the target trunk, namely the global features, and the features of interest to the local part of the target, namely the channel attention features. The channel attention branch can calculate the weight value of each channel, and apply these weight values ​​to each channel of the initial feature map to generate a weighted feature map. By adding weight values, the channel attention module can emphasize the more discriminative features in the target image, emphasize important feature channels and suppress irrelevant information. The weighted feature map is processed in turn through the first pooling layer and the convolution layer of a preset size to further extract and compress features to obtain channel attention features. At the same time, the global features representing the overall information of the target can be extracted from the initial feature map through the global branch.

[0028] Furthermore, the global features and the channel attention features can be jointly learned to obtain the re-identification features, and the re-identification features are compared with the target features containing the target to be re-identified to obtain the re-identification results.

[0029] According to the method provided in the above embodiment, by obtaining a target image containing a to-be-recognized target, an initial feature map of the to-be-recognized target is extracted from the target image, and the initial feature map is respectively input into the channel attention branch and the global branch for processing to obtain channel attention features and global features. By combining the global features and the local channel attention features, the overall information and local information of the target image can be fully utilized to improve the accuracy and robustness of recognition. The target object can be accurately identified by comparison based on the re-identification features, thereby improving the accuracy and efficiency of target re-identification. In this way, the combination of the channel attention mechanism, the pooling layer and the convolution layer is used to effectively extract the global and local features of the target image, and obtain the re-identification features containing accurate and complete information. The re-identification features are used for re-identification, which can not only cope with complex background and occlusion problems, but also adapt to the challenges of different camera perspectives and lighting changes, thereby avoiding the problem of inaccurate target re-identification results.

[0030] In some embodiments, a channel attention module is used to add a preset weight value to each channel of the initial feature map to obtain a weighted feature map, including: processing the initial feature map in sequence through a second pooling layer, a first fully connected layer, a first activation layer, and a second fully connected layer to obtain a processed initial feature map; processing the processed initial feature map through a second activation layer to obtain a weight value for each channel in the processed initial feature map; multiplying the weight value by the initial feature map channel by channel to obtain a weighted feature map.

[0031] Specifically, in the channel attention branch, the initial feature map can first be processed by the channel attention module to obtain a weighted feature map.

[0032] Figure 2 is a flowchart of another target re-identification method provided in an embodiment of the present application, based on Figure 2 The embodiments of the present application are described.

[0033] First, the target image is processed by the backbone network to obtain the initial feature map, which is then input into the channel attention module for processing. Figure 2 The network architecture of the channel attention module can be represented, and its channel attention module can include a second pooling layer (ie, Avg pool), a first fully connected layer (ie, FC), a first activation layer (ie, Relu), a second fully connected layer (ie, FC), and a second activation layer (ie, Sigmoid).

[0034] Furthermore, the initial feature map obtained by the backbone network (e.g., the network obtained by the traditional resnet50 transformation) can be processed by the second pooling layer, and the second pooling layer can be a global average pooling layer (i.e., Avg Pool layer), that is, the initial feature map can be processed by global average pooling, the spatial information of each channel can be compressed into a single value, the global semantic information can be retained to reduce the computational complexity, and the first global average pooling feature of 1×1×C can be obtained, where C can represent the number of channels of the first global average pooling feature, and the first global average pooling feature can be processed by the first fully connected layer (i.e., FC layer), and the first fully connected layer can reduce the number of channels to obtain the scaled first global average pooling feature, so as to reduce the dimension, reduce the amount of calculation and remove some unnecessary redundant information, and then the scaled first global average pooling feature can be nonlinearly transformed by the first activation layer (i.e., Relu layer) to obtain the activated feature, and the activated feature can be processed by the second fully connected layer (i.e., FC layer) to restore the number of feature channels to obtain the processed initial feature map, and the number of channels of the processed initial feature map is consistent with the number of channels of the first global average pooling feature before the first fully connected layer is processed.

[0035] Furthermore, the processed initial feature map can be processed by the second activation layer to obtain the weight value of each channel in the processed initial feature map. The second activation layer here can use the sigmoid activation function to process the processed initial features, so that the weight value of each channel can be limited to between 0 and 1, so that the weight can be directly used to weight the initial feature map, and the importance of the feature can be intuitively represented by the weight value.

[0036] Finally, the scale operation can be used to multiply the weight value with the initial feature map channel by channel to obtain a weight feature map of unchanged size. In this way, the initial feature map can be reweighted according to the weight value of the channel to emphasize important features and suppress unimportant features, thereby enhancing the network model's attention to key features.

[0037] According to the method provided in the above embodiment, the initial feature map is subjected to global average pooling, dimensionality reduction, nonlinear transformation, feature dimension recovery, channel weighting, and weighting through the channel attention module. This can increase the network model's attention to key features, help the network extract and strengthen local important features in the initial feature map, and improve the network's feature expression ability and final performance.

[0038] In other embodiments, the initial feature map is processed in sequence by a second pooling layer, a first fully connected layer, a first activation layer, and a second fully connected layer to obtain a processed initial feature map, including: processing the initial feature map by a second pooling layer to obtain a first global average pooling feature, the second pooling layer is used to perform global average pooling on the input; scaling the number of channels of the first global average pooling feature by a preset ratio through the first fully connected layer to obtain the scaled first global average pooling feature; activating the scaled first global average pooling feature through the first activation layer to obtain an activated feature; performing channel number recovery processing on the activated feature based on the second fully connected layer to obtain a processed initial feature map, and the number of channels of the processed initial feature map is consistent with the number of channels of the initial feature map.

[0039] Specifically, in the channel attention module, the process of recovering the dimension after the dimensionality reduction of the initial feature map may include:

[0040] First, an initial feature map of size W×H×C is input, where W can represent the width of the initial feature map, H can represent the height of the initial feature map, and C represents the number of channels of the initial feature map. The initial feature map is input into the second pooling layer for global average pooling processing and compressed into a first global average pooling feature of size 1×1×C. Then, the first global average pooling feature is processed by the first fully connected layer. The first fully connected layer can perform a linear transformation on the first global average pooling feature, and the channel can be scaled by a preset multiple (for example, r times) to obtain a 1×1×C / r size reduction. The first global average pooling feature after scaling, where r is determined based on the actual situation or is obtained by adaptive learning of the network model according to the input of the re-identification task. There is no restriction here. The scaled first global average pooling feature can be further subjected to nonlinear changes through the first activation layer, such as being activated by a ReLU activation function to obtain an activation function. In this way, the channel attention module can learn more complex features to improve the expression ability by introducing nonlinearity. Furthermore, the activated feature channel can be restored to C based on the second fully connected layer, that is, a 1×1×C processed initial feature map is obtained. Restoring the feature dimension can facilitate subsequent operations.

[0041] It should be understood that the first fully connected layer and the second fully connected layer may be similar in structure, that is, both may be composed of weighted evidence and bias, but they are not the same in function and role, and will not be elaborated in detail.

[0042] According to the method provided in the above embodiment, by compressing the initial feature map and then restoring the channel, the initial feature map can be effectively processed, key features can be extracted and enhanced, and the performance and accuracy of the network model can be improved, thereby helping the network to accurately extract re-identification features to accurately perform target re-identification tasks.

[0043] In some embodiments, the first pooling layer includes global average pooling and global maximum pooling; the weight feature map is processed by the first pooling layer and the convolution layer of a preset size in sequence to obtain a channel attention feature, including: the weight feature map is subjected to global average pooling and global maximum pooling respectively to obtain a second global average pooling feature and a first global maximum pooling feature; the second global average pooling feature and the first global maximum pooling feature are added to obtain a first pooling result; the first pooling result is subjected to dimensionality reduction processing using a convolution layer of a preset size to obtain a channel attention feature.

[0044] Specifically, after the weight feature map is obtained through processing by the channel attention module, the weight feature map can be further input into the first pooling layer and the convolution layer of a preset size in the channel attention branch for processing.

[0045] Specifically, the first pooling layer can be composed of global average pooling and global maximum pooling, that is, the weight feature map can be subjected to global average pooling and global maximum pooling respectively to obtain the second average pooling feature corresponding to the global average pooling and the first global maximum pooling feature corresponding to the global maximum pooling, wherein the global maximum pooling can extract the most distinctive information from the weight feature map, and the global average pooling can extract the global information of each spatial unit from the initial feature map, that is, the torso information and local information of the target object can be further extracted.

[0046] Furthermore, the second global average pooling feature and the first global maximum pooling feature can be added to obtain a first pooling result. By adding, the features of the two can be fused to enhance the feature representation capability, so that the first pooling result contains more information.

[0047] The first pooling result is further processed by a convolution layer of a preset size to reduce the dimension of the first pooling result, wherein the convolution layer of the preset size may be a 1×1 convolution, and a linear transformation of the first pooling result may reduce the number of channels from C to a smaller value, for example, the number of channels of the first pooling result may be reduced from 2048 to 1024, thereby reducing the amount of computation while retaining important features.

[0048] According to the method provided in the above embodiment, the average information and the most significant information of each channel in the weighted feature map are extracted through the first pooling layer to comprehensively capture the features, and the captured second global average pooling features and the first global maximum pooling features are fused to obtain the first pooling result with enhanced representation capability. By reducing the dimension of the first pooling result through a convolutional layer of a preset size, key information can be retained while reducing the computational complexity, thereby more effectively extracting channel attention features and improving the modeling capability of the model for dependencies between channels.

[0049] In some embodiments, determining the global features corresponding to the target to be re-identified based on the initial feature map includes: inputting the initial feature map into the global branch, the global branch includes a first pooling layer and a convolution layer of a preset size; using the first pooling layer to perform global average pooling and global maximum pooling on the initial feature map, respectively, to obtain a third global average pooling feature and a second global maximum pooling feature; adding the third global average pooling feature and the second global maximum pooling feature to obtain a second pooling result; using a convolution layer of a preset size to perform dimensionality reduction processing on the second pooling result to obtain a global feature.

[0050] Specifically, in this embodiment, not only can the initial feature map be input into the channel attention branch to extract the desired pedestrian features, but the initial feature map can also be input into the global branch for processing to extract the global information of the pedestrian and obtain the global features, wherein the global branch may include a first pooling layer and a convolution layer of a preset size.

[0051] Furthermore, the initial feature map is processed by the first pooling layer, that is, the initial feature map is subjected to global average pooling to take the average value of the pixels of each channel in the initial feature map to obtain the third global average pooling feature, and the initial feature map is subjected to global maximum pooling to obtain the maximum value of all pixel values ​​of each channel in the initial feature map to obtain the second global maximum pooling feature.

[0052] The third global average pooling feature and the second global maximum pooling feature are further added to obtain a more comprehensive feature representation, namely the second pooling result. The second pooling result is subjected to dimensionality reduction processing by a convolutional layer of a preset size to obtain a global feature. The dimensionality reduction process of the convolutional layer of a preset size is not described here.

[0053] According to the method provided in the above embodiment, the initial feature map is processed based on the global branch and the dimension is reduced to obtain the global feature, which can provide a powerful feature representation for subsequent target re-identification.

[0054] In some embodiments, re-identifying a target to be re-identified in an image to be re-identified based on the re-identification feature includes: calculating the similarity between the re-identification feature and the target feature through a preset similarity algorithm, where the target feature representation includes the features of the target to be re-identified; if the similarity exceeds a preset threshold, determining the target feature whose similarity exceeds the preset threshold as the target re-identification result.

[0055] Specifically, after the re-identification feature is obtained, the target to be re-identified can be re-identified based on the re-identification feature.

[0056] Furthermore, the similarity between the re-identification feature and the target feature can be calculated by a preset similarity algorithm, wherein the preset similarity algorithm can be cosine similarity, Euclidean similarity, etc., which is not limited here. After calculation, if the similarity exceeds the preset threshold, it means that the target corresponding to the target feature and the target corresponding to the re-identification feature are very similar, then the target feature can be determined as the target re-identification result, wherein the preset similarity threshold can be determined based on different similarity algorithms, such as the similarity threshold of cosine similarity can be 0.9, that is, if the similarity between the target feature and the re-identification feature exceeds 0.9, the target feature is determined to be the re-identification result. The target feature can represent the features corresponding to the target to be re-identified in different scenes. For example, the features corresponding to the same target in different frames of the video.

[0057] According to the method provided in the above embodiment, the re-identification feature is input into the third fully connected layer for processing, and the similarity between the re-identification feature and the target feature is calculated by a similarity algorithm. Finally, the re-identification result is determined by comparing with a preset threshold. In this way, the accuracy and reliability of the re-identification can be ensured, and the target can be effectively identified and confirmed.

[0058] In some embodiments, an initial feature map of the target to be re-identified is obtained based on the target image, including: using a backbone network to perform initial feature extraction on the target to be re-identified in the target image to obtain an initial feature map, the backbone network is obtained based on a preset network model, the preset network model includes an initial convolutional layer, a third pooling layer, a residual module, a fourth pooling layer, and a third fully connected layer, and the backbone network includes an initial convolutional layer, a third pooling layer and a residual module.

[0059] Specifically, when performing the target re-identification task, the image containing the target can first be cut to extract the target to obtain the target image, and then the initial feature map corresponding to the target image can be extracted. This process can be performed by the backbone network, and its backbone network can be obtained based on a preset network model. The preset network model can be the traditional resnet 50. Resnet 50 includes an initial convolutional layer, a maximum pooling layer (i.e., the third pooling layer), multiple residual modules, a global average pooling layer (i.e., the fourth pooling layer), and a fully connected layer (the third fully connected layer). The last two layers of the traditional resnet-50 are deleted and replaced with the aforementioned global branch and channel attention branch. All modules before Conv5 are kept unchanged to obtain the backbone network of the embodiment of the present application, that is, the backbone network can include an initial convolutional layer, a third pooling layer and a residual module. The target image is processed based on the backbone network to obtain the initial feature map.

[0060] According to the method provided in the above embodiment, the target image can be feature extracted through the backbone network, so that features with discriminative ability can be extracted from the target image, an initial feature map can be obtained, and the initial feature map can be input into the subsequent branch for processing, which can improve the accuracy of feature extraction and thus achieve accuracy and robustness in target re-identification.

[0061] Figure 3 This is a flow chart of another target re-identification method provided in an embodiment of the present application. Figure 3 The embodiments of the present application are described.

[0062] First, the target image can be passed through the backbone network to extract initial features to obtain an initial feature map, which is then input into the global branch and channel attention branch for processing.

[0063] In the global branch, the initial feature map is processed by pooling layers (including global average pooling: Avg pool, and global maximum pooling: Max pool) and dimensionality reduction in turn to obtain the corresponding global features, where the pooling layer includes global average pooling and global maximum pooling.

[0064] In the channel attention branch, the initial feature map is processed by the channel attention module (CA), the pooling layer (including global average pooling: Avg pool, and global maximum pooling: Max pool), and dimensionality reduction to obtain the channel attention feature. The channel attention feature and the global feature are both features obtained by dimensionality reduction through a 1×1 convolution layer. After that, the channel attention feature and the global feature can be input into the concat layer for concatenation to obtain a re-identification feature with the same number of channels as the initial feature map. The re-identification feature is further input into the final fully connected layer (FC layer) for target re-identification to obtain the target re-identification result.

[0065] In this way, the channel attention module can be used to explicitly model the interdependence between channels and adaptively recalibrate the feature responses of the channels, that is, add weights to each channel of the initial feature map, use the global branch to extract global features of the initial feature map, and combine the global features of the target with the channel attention branch. Through the complementarity of various features, the re-identification features of the target with distinctiveness can be extracted, which facilitates the further execution of the target re-identification task to obtain accurate target re-identification results.

[0066] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0067] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0068] Figure 4 Schematic diagram of a target re-identification device provided in an embodiment of the present application. Figure 4 As shown, the target re-identification device includes:

[0069] An acquisition module 401 is configured to acquire a target image containing a target to be re-identified, and obtain an initial feature map of the target to be re-identified based on the target image;

[0070] The local feature extraction module 402 is configured to input the initial feature map into the channel attention branch, the channel attention branch includes a channel attention module, a first pooling layer and a convolution layer of a preset size, use the channel attention module to add a preset weight value to each channel of the initial feature map to obtain a weight feature map, and process the weight feature map in turn through the first pooling layer and the convolution layer of the preset size to obtain a channel attention feature;

[0071] A global feature extraction module 403 is configured to determine a global feature corresponding to the target to be re-identified based on the initial feature map, and determine a re-identification feature corresponding to the target to be re-identified based on the global feature and the channel attention feature;

[0072] The re-identification module 404 is configured to re-identify the target to be re-identified in the image to be re-identified based on the re-identification features.

[0073] In some embodiments, the local feature extraction module 402 is specifically used to process the initial feature map in sequence through the second pooling layer, the first fully connected layer, the first activation layer, and the second fully connected layer to obtain a processed initial feature map; process the processed initial feature map through the second activation layer to obtain the weight value of each channel in the processed initial feature map; multiply the weight value by the initial feature map channel by channel to obtain a weighted feature map.

[0074] In some embodiments, the local feature extraction module 402 is specifically used to process the initial feature map through the second pooling layer to obtain a first global average pooling feature, and the second pooling layer is used to perform global average pooling on the input; the number of channels of the first global average pooling feature is scaled according to a preset ratio through the first fully connected layer to obtain the scaled first global average pooling feature; the scaled first global average pooling feature is activated through the first activation layer to obtain an activated feature; based on the second fully connected layer, the number of channels of the activated feature is restored to obtain a processed initial feature map, and the number of channels of the processed initial feature map is consistent with the number of channels of the initial feature map.

[0075] In some embodiments, the local feature extraction module 402 is specifically used to perform global average pooling and global maximum pooling on the weight feature map, respectively, to obtain a second global average pooling feature and a first global maximum pooling feature; add the second global average pooling feature and the first global maximum pooling feature to obtain a first pooling result; and perform dimensionality reduction processing on the first pooling result using a convolutional layer of a preset size to obtain a channel attention feature.

[0076] In some embodiments, the global feature extraction module 403 is specifically used to input the initial feature map into the global branch, and the global branch includes a first pooling layer and a convolution layer of a preset size; use the first pooling layer to perform global average pooling and global maximum pooling on the initial feature map, respectively, to obtain a third global average pooling feature and a second global maximum pooling feature; add the third global average pooling feature and the second global maximum pooling feature to obtain a second pooling result; use a convolution layer of a preset size to perform dimensionality reduction processing on the second pooling result to obtain a global feature.

[0077] In some embodiments, the re-identification module 404 is specifically used to calculate the similarity between the re-identification feature and the target feature through a preset similarity algorithm, and the target feature representation includes the features of the target to be re-identified; if the similarity exceeds a preset threshold, the target feature whose similarity exceeds the preset threshold is determined as the target re-identification result.

[0078] In some embodiments, the acquisition module 401 is specifically used to use the backbone network to perform initial feature extraction on the target to be re-identified in the target image to obtain an initial feature map. The backbone network is obtained based on a preset network model. The preset network model includes an initial convolutional layer, a third pooling layer, a residual module, a fourth pooling layer, and a third fully connected layer. The backbone network includes an initial convolutional layer, a third pooling layer, and a residual module.

[0079] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0080] Figure 5 Schematic diagram of an electronic device 5 provided in an embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 503, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 501 executes the computer program 503, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0081] The electronic device 5 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 The electronic device 5 is merely an example and does not limit the electronic device 5 , and may include more or less components than those shown in the figure, or different components.

[0082] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0083] The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. The memory 502 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device.

[0084] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments 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 above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0085] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0086] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A target re-identification method, characterized in that: include: Acquire a target image containing a target to be re-identified, and obtain an initial feature map of the target to be re-identified based on the target image; The initial feature map is input into a channel attention branch, wherein the channel attention branch includes a channel attention module, a first pooling layer, and a convolutional layer of a preset size. The channel attention module is used to add a preset weight value to each channel of the initial feature map to obtain a weight feature map. The weight feature map is sequentially processed by the first pooling layer and the convolutional layer of the preset size to obtain a channel attention feature. Determine a global feature corresponding to the target to be re-identified based on the initial feature map, and determine a re-identification feature corresponding to the target to be re-identified based on the global feature and the channel attention feature; The target to be re-identified in the image to be re-identified is re-identified based on the re-identification feature.

2. The method according to claim 1, characterized in that The step of adding a preset weight value to each channel of the initial feature map by using the channel attention module to obtain a weight feature map includes: Processing the initial feature map sequentially through a second pooling layer, a first fully connected layer, a first activation layer, and a second fully connected layer to obtain a processed initial feature map; Processing the processed initial feature map through a second activation layer to obtain a weight value of each channel in the processed initial feature map; The weight value is multiplied by the initial feature map channel by channel to obtain the weight feature map.

3. The method according to claim 2, characterized in that The initial feature map is processed sequentially through a second pooling layer, a first fully connected layer, a first activation layer, and a second fully connected layer to obtain a processed initial feature map, including: Processing the initial feature map through the second pooling layer to obtain a first global average pooling feature, wherein the second pooling layer is used to perform global average pooling on the input; Scaling the number of channels of the first global average pooling feature according to a preset ratio through the first fully connected layer to obtain a scaled first global average pooling feature; activating the scaled first global average pooling feature through the first activation layer to obtain an activated feature; Based on the second fully connected layer, channel number recovery processing is performed on the activated feature to obtain the processed initial feature map, and the number of channels of the processed initial feature map is consistent with the number of channels of the initial feature map.

4. The method according to claim 1, characterized in that The first pooling layer includes global average pooling and global maximum pooling; The weight feature map is processed sequentially through a first pooling layer and a convolution layer of a preset size to obtain a channel attention feature, including: The weight feature map is subjected to global average pooling and global maximum pooling respectively to obtain a second global average pooling feature and a first global maximum pooling feature; Adding the second global average pooling feature and the first global maximum pooling feature to obtain a first pooling result; The first pooling result is processed by dimension reduction using the convolutional layer of the preset size to obtain the channel attention feature.

5. The method according to claim 4, characterized in that The determining, based on the initial feature map, the global feature corresponding to the target to be re-identified includes: Inputting the initial feature map into a global branch, wherein the global branch includes the first pooling layer and the convolutional layer of the preset size; Using the first pooling layer to perform global average pooling and global maximum pooling on the initial feature map, respectively, to obtain a third global average pooling feature and a second global maximum pooling feature; Adding the third global average pooling feature and the second global maximum pooling feature to obtain a second pooling result; The second pooling result is processed by dimension reduction using the convolutional layer of the preset size to obtain the global feature.

6. The method according to claim 1, characterized in that The re-identifying the target to be re-identified in the image to be re-identified based on the re-identification feature includes: Calculating the similarity between the re-identification feature and the target feature by using a preset similarity algorithm, wherein the target feature represents the feature of the target to be re-identified; If the similarity exceeds a preset threshold, the target feature whose similarity exceeds the preset threshold is determined as a target re-identification result.

7. The method according to claim 1, characterized in that The step of obtaining an initial feature map of the target to be re-identified based on the target image includes: A backbone network is used to perform initial feature extraction on the target to be re-identified in the target image to obtain the initial feature map. The backbone network is obtained based on a preset network model. The preset network model includes an initial convolutional layer, a third pooling layer, a residual module, a fourth pooling layer, and a third fully connected layer. The backbone network includes the initial convolutional layer, the third pooling layer and the residual module.

8. A target re-identification device, characterized in that: include: An acquisition module is configured to acquire a target image containing a target to be re-identified, and obtain an initial feature map of the target to be re-identified based on the target image; A local feature extraction module is configured to input the initial feature map into a channel attention branch, wherein the channel attention branch includes a channel attention module, a first pooling layer, and a convolutional layer of a preset size, and use the channel attention module to add a preset weight value to each channel of the initial feature map to obtain a weight feature map, and sequentially process the weight feature map through the first pooling layer and the convolutional layer of the preset size to obtain a channel attention feature; A global feature extraction module is configured to determine the global feature corresponding to the target to be re-identified based on the initial feature map, and determine the re-identification feature corresponding to the target to be re-identified based on the global feature and the channel attention feature; The re-identification module is configured to re-identify the target to be re-identified in the image to be re-identified based on the re-identification feature.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.