Target identification method, device and equipment and readable storage medium

By introducing a dual-branch adaptive convolutional kernel attention mechanism and a self-attention mechanism into the YOLOv3 algorithm, combined with optional scale feature fusion, the accuracy of target recognition is improved, and the balance between multi-scale prediction and complexity in the YOLOv3 algorithm is solved.

CN115908938BActive Publication Date: 2026-02-06CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211566625.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-07
Publication Date
2026-02-06
Estimated Expiration
2042-12-07

AI Technical Summary

Technical Problem

The Yolov3 algorithm has room for improvement in target recognition accuracy, especially in balancing multi-scale prediction and complexity.

Method used

A dual-branch adaptive convolutional kernel attention mechanism is used to process the feature map. Combined with self-attention mechanism and optional scale feature fusion, the feature extraction and recognition accuracy is improved by multiple convolutions and feature map fusion.

Benefits of technology

By employing a self-attention mechanism and optional scale feature fusion, the target recognition accuracy of the YOLOv3 algorithm is improved, especially when dealing with targets of different scales.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115908938B_ABST
    Figure CN115908938B_ABST
Patent Text Reader

Abstract

The application provides a target recognition method, device and equipment and a readable storage medium. In the application, three feature maps of a sample image are obtained; the three feature maps are processed respectively through a double-branch adaptive convolution kernel attention mechanism to obtain three feature maps fused with a self-attention mechanism; one of the feature maps is processed through N times of convolution to obtain a first enhanced feature map; optional scale feature fusion is performed based on the first enhanced feature map and the other two feature maps to obtain a second enhanced feature map and a third enhanced feature map; the three enhanced feature maps are processed through 3*3 convolution respectively, target recognition is performed on an image to be recognized based on the three enhanced feature maps processed through convolution respectively, and a target recognition result is obtained. Through the application, the YoloV3 target detection method with the added self-attention mechanism and the optional scale feature fusion method is used, the network connection is changed, and the accuracy of the recognition result of the YoloV3 algorithm is improved.
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, and in particular to a target recognition method, device, equipment and readable storage medium. BACKGROUND

[0002] At present, although the Yolov3 algorithm applies a better basic classification network and classifier to improve the complexity of the model, and proposes multi-scale prediction, so that the Yolov3 algorithm is faster than other detection methods under the premise of realizing the same accuracy, the accuracy of the recognition result of the Yolov3 algorithm still needs to be improved. SUMMARY

[0003] The main purpose of the present application is to provide a target recognition method, device, equipment and readable storage medium, which aims to improve the accuracy of the recognition result of the Yolov3 algorithm.

[0004] In a first aspect, the present application provides a target recognition method, which comprises:

[0005] obtaining a first feature map, a second feature map and a third feature map of a sample image;

[0006] processing the first feature map, the second feature map and the third feature map through a double-branch adaptive convolution kernel attention mechanism respectively to obtain a fourth feature map, a fifth feature map and a sixth feature map fused with a self-attention mechanism;

[0007] performing N times of convolution processing on the fourth feature map to obtain a first enhanced feature map, wherein N is a positive integer;

[0008] performing optional scale feature fusion based on the first enhanced feature map, the fifth feature map and the sixth feature map to obtain a second enhanced feature map and a third enhanced feature map;

[0009] performing 3*3 convolution processing on the first enhanced feature map, the second enhanced feature map and the third enhanced feature map respectively to obtain a fourth enhanced feature map, a fifth enhanced feature map and a sixth enhanced feature map;

[0010] performing target recognition on an image to be recognized based on the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map respectively to obtain a target recognition result.

[0011] Optionally, the step of obtaining the first feature map, the second feature map and the third feature map of the sample image comprises:

[0012] The first feature map of the sample image output by the last stacked residual module in the feature extraction network, the second feature map of the sample image output by the second last stacked residual module, and the third feature map of the sample image output by the third last stacked residual module are obtained, wherein the feature extraction network includes one convolutional layer with a size of 3*3 and a channel of 32 and M stacked residual modules, M is greater than 3, the feature extraction result of the sample image after down-sampling is taken as the input of the first residual module, and the output of the previous residual module after down-sampling is taken as the input of the next residual module.

[0013] Optionally, the step of processing the first feature map, the second feature map and the third feature map respectively through the double-branch adaptive convolution kernel attention mechanism to obtain the fourth feature map, the fifth feature map and the sixth feature map fused with the self-attention mechanism comprises:

[0014] The first feature map, the second feature map and the third feature map are respectively processed through 3*3 convolution to obtain feature maps A corresponding to the first feature map, the second feature map and the third feature map respectively;

[0015] The first feature map, the second feature map and the third feature map are respectively processed through 5*5 convolution to obtain feature maps B corresponding to the first feature map, the second feature map and the third feature map respectively;

[0016] The feature maps A and the feature maps B corresponding to the first feature map, the second feature map and the third feature map are respectively added to obtain feature maps U corresponding to the first feature map, the second feature map and the third feature map respectively;

[0017] The feature maps U corresponding to the first feature map, the second feature map and the third feature map are respectively subjected to global pooling operation and full connection operation to obtain low-dimensional vectors S corresponding to the first feature map, the second feature map and the third feature map respectively;

[0018] The low-dimensional vectors S corresponding to the first feature map, the second feature map and the third feature map are respectively input into two full connection layers to obtain attention weight vectors α and β corresponding to the first feature map, the second feature map and the third feature map output by the two full connection layers respectively;

[0019] respectively, and adding the first product and the second product corresponding to the first feature map, the second feature map and the third feature map respectively to obtain a fourth feature map corresponding to the first feature map, a fifth feature map corresponding to the second feature map and a sixth feature map corresponding to the third feature map, which are fused with the self-attention mechanism.

[0020] Optionally, the step of performing optional scale feature fusion based on the first enhanced feature map, the fifth feature map and the sixth feature map to obtain a second enhanced feature map and a third enhanced feature map comprises:

[0021] performing an up-sampling operation on the first enhanced feature map and adjusting the channel number of the first enhanced feature map and the fifth feature map to obtain an adjusted first enhanced feature map, wherein the size and the channel number of the adjusted first enhanced feature map are the same as the size and the channel number of the adjusted fifth feature map;

[0022] performing optional scale feature fusion on the adjusted first enhanced feature map and the adjusted fifth feature map to obtain a second enhanced feature map;

[0023] performing an up-sampling operation on the second enhanced feature map and adjusting the channel number of the second enhanced feature map and the sixth feature map to obtain an adjusted second enhanced feature map, wherein the size and the channel number of the adjusted second enhanced feature map are the same as the size and the channel number of the adjusted sixth feature map;

[0024] performing optional scale feature fusion on the adjusted second enhanced feature map and the adjusted sixth feature map to obtain a third enhanced feature map.

[0025] Optionally, the step of performing optional scale feature fusion on the adjusted first enhanced feature map and the adjusted fifth feature map to obtain a second enhanced feature map comprises:

[0026] adding the size and the channel number of the adjusted first enhanced feature map and the size and the channel number of the adjusted fifth feature map;

[0027] performing a global pooling operation on the sum to obtain a vector with a length of the channel number;

[0028] expanding the vector with the length of the channel number through a fully connected layer to obtain two attention vectors with the length of the channel number;

[0029] The Softmax operation is performed on the two attention vectors with the length of the channel number to obtain two channel attention weights corresponding to the adjusted first enhanced feature map and the adjusted fifth feature map, respectively;

[0030] The channel attention weight corresponding to the adjusted first enhanced feature map is multiplied by the size and channel number of the adjusted first enhanced feature map to obtain a third product;

[0031] The channel attention weight corresponding to the adjusted fifth feature map is multiplied by the size and channel number of the adjusted fifth feature map to obtain a fourth product;

[0032] The third product and the fourth product are added to obtain a second enhanced feature map.

[0033] Optionally, the step of performing target recognition on the to-be-recognized image based on the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map to obtain a target recognition result, comprises:

[0034] Based on the number of target recognition boxes, the target categories to be recognized in the to-be-recognized image, the size and center point coordinates of the target recognition boxes and the confidence of the target recognition boxes, a target channel number is calculated.

[0035] Based on the target channel number, the channel numbers of the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map are adjusted through 1*1 convolution to obtain the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map after channel number adjustment, wherein the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map after channel number adjustment are the target recognition result.

[0036] Optionally, after the step of performing target recognition on the to-be-recognized image based on the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map to obtain a target recognition result, comprises:

[0037] Based on the target recognition result, the recognition rate of each target category is counted.

[0038] Based on the recognition rate of each target category, the accuracy of the target recognition result is calculated.

[0039] In a second aspect, the present application further provides a target recognition device, which comprises:

[0040] An acquisition module is configured to acquire a first feature map, a second feature map and a third feature map of a sample image.

[0041] The image processing module is configured to process the first feature map, the second feature map and the third feature map respectively through a double-branch adaptive convolution kernel attention mechanism to obtain a fourth feature map, a fifth feature map and a sixth feature map fused with a self-attention mechanism.

[0042] The convolution module is configured to perform N times of convolution processing on the fourth feature map to obtain a first enhanced feature map, where N is a positive integer.

[0043] The image processing module is configured to perform optional scale feature fusion based on the first enhanced feature map, the fifth feature map and the sixth feature map to obtain a second enhanced feature map and a third enhanced feature map.

[0044] The convolution module is configured to perform 3*3 convolution processing on the first enhanced feature map, the second enhanced feature map and the third enhanced feature map respectively to obtain a fourth enhanced feature map, a fifth enhanced feature map and a sixth enhanced feature map.

[0045] The target recognition module is configured to perform target recognition on the to-be-recognized image based on the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map respectively to obtain a target recognition result.

[0046] In a third aspect, the present application further provides a target recognition device, which comprises a processor, a memory and a target recognition program stored in the memory and executable by the processor, wherein the target recognition program is executed by the processor to implement the steps of the target recognition method.

[0047] In a fourth aspect, the present application further provides a readable storage medium, which stores a target recognition program, wherein the target recognition program is executed by a processor to implement the steps of the target recognition method.

[0048] In the present application, the first feature map, the second feature map and the third feature map of the sample image are obtained; the first feature map, the second feature map and the third feature map are processed respectively through the double-branch adaptive convolution kernel attention mechanism to obtain the fourth feature map, the fifth feature map and the sixth feature map fused with the self-attention mechanism; the fourth feature map is subjected to N times of convolution processing to obtain the first enhanced feature map, wherein N is a positive integer; the first enhanced feature map, the fifth feature map and the sixth feature map are subjected to optional scale feature fusion to obtain the second enhanced feature map and the third enhanced feature map; the first enhanced feature map, the second enhanced feature map and the third enhanced feature map are subjected to 3*3 convolution processing respectively to obtain the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map; the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map are used for target recognition of the image to be recognized respectively to obtain the target recognition result. Through the present application, the Yolov3 target detection method with the added self-attention mechanism and the optional scale feature fusion method is used, the network connection is changed, and the accuracy of the recognition result of the Yolov3 algorithm is improved. BRIEF DESCRIPTION OF DRAWINGS

[0049] Figure 1 The flowchart of the first embodiment of the target recognition method of the present application is shown in the figure.

[0050] Figure 2 The processing flowchart of the feature extraction network of the target recognition method of the present application is shown in the figure.

[0051] Figure 3 The processing flowchart of the residual module of the target recognition method of the present application is shown in the figure.

[0052] Figure 4 The processing flowchart of the double-branch attention mechanism of the target recognition method of the present application is shown in the figure.

[0053] Figure 5 The flowchart of the target recognition method of the present application is shown in the figure.

[0054] Figure 6 The processing flowchart of the optional feature scale fusion of the target recognition method of the present application is shown in the figure.

[0055] Figure 7a The recognition result diagram of the target recognition method of the present application is shown in the figure.

[0056] Figure 7b The recognition result diagram of the prior art is shown in the figure.

[0057] Figure 8 The function module diagram of the first embodiment of the target recognition device of the present application is shown in the figure.

[0058] Figure 9A hardware structure schematic diagram of the target recognition device involved in the embodiment of the present application.

[0059] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0060] It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

[0061] In a first aspect, the embodiment of the present application provides a target recognition method.

[0062] In an embodiment, the target recognition method comprises the following steps. Figure 1 , Figure 1 A hardware structure schematic diagram of the target recognition device involved in the embodiment of the present application. Figure 1 As shown in the figure, the target recognition method comprises the following steps.

[0063] In step S10, a first feature map, a second feature map and a third feature map of a sample image are acquired.

[0064] In the embodiment, the first feature map, the second feature map and the third feature map of the sample image are acquired through a feature extraction network, wherein the convolutional neural network for processing the input image to generate the deep and high semantic feature map is the feature extraction network.

[0065] Further, in an embodiment, step S10 comprises the following steps.

[0066] The first feature map of the sample image output by the last stacked residual module, the second feature map of the sample image output by the second last stacked residual module and the third feature map of the sample image output by the third last stacked residual module in the feature extraction network are acquired, wherein the feature extraction network comprises a convolutional layer with a size of 3*3 and a channel of 32 and M stacked residual modules, M is greater than 3, the feature extraction result of the sample image after down-sampling is taken as the input of the first residual module, and the output of the previous residual module after down-sampling is taken as the input of the next residual module.

[0067] In the embodiment, the target recognition method comprises the following steps. Figure 2 , Figure 2 A hardware structure schematic diagram of the target recognition device involved in the embodiment of the present application. Figure 2 As shown in the figure, taking the size and the number of channels of the sample image as 416*416*3 for example, if M is 5, in the feature extraction network, the sample image first passes through a convolutional layer with a size of 3*3 and a channel of 32 to adjust the number of channels of the sample image, and a feature map with a size of 416*416*32 and a channel of 32 is obtained.

[0068] After performing a down-sampling operation on the feature map with the size and the number of channels of 416*416*32 of the output of the convolutional layer, a feature map with the size and the number of channels of 208*208*32 is obtained, and the feature map with the size and the number of channels of 208*208*32 is taken as the input of the first stacked residual module, that is, the input of the first residual module. The first residual module processes the feature map with the size and the number of channels of 208*208*32, and then outputs a feature map with the size and the number of channels of 208*208*64;

[0069] After performing a down-sampling operation on the feature map with the size and the number of channels of 208*208*64 of the output of the first stacked residual module, a feature map with the size and the number of channels of 104*104*64 is obtained, and the feature map with the size and the number of channels of 104*104*64 is taken as the input of the second stacked residual module. The second stacked residual module processes the feature map with the size and the number of channels of 104*104*64, and then outputs a feature map with the size and the number of channels of 104*104*128;

[0070] After performing a down-sampling operation on the feature map with the size and the number of channels of 104*104*128 of the output of the second stacked residual module, a feature map with the size and the number of channels of 52*52*128 is obtained, and the feature map with the size and the number of channels of 52*52*128 is taken as the input of the third stacked residual module. The third stacked residual module processes the feature map with the size and the number of channels of 52*52*128, and then outputs a feature map with the size and the number of channels of 52*52*526;

[0071] After performing a down-sampling operation on the feature map with the size and the number of channels of 52*52*526 of the output of the third stacked residual module, a feature map with the size and the number of channels of 26*26*526 is obtained, and the feature map with the size and the number of channels of 26*26*526 is taken as the input of the fourth stacked residual module. The fourth stacked residual module processes the feature map with the size and the number of channels of 26*26*526, and then outputs a feature map with the size and the number of channels of 26*26*512;

[0072] The feature map with the size and the number of channels of 26*26*512 output by the fourth stacked residual module is down-sampled to obtain a feature map with the size and the number of channels of 13*13*512, and the feature map with the size and the number of channels of 13*13*512 is taken as the input of the fifth stacked residual module. The fifth stacked residual module processes the feature map with the size and the number of channels of 13*13*512, and then outputs a feature map with the size and the number of channels of 13*13*1024. The first stacked residual module includes one residual module, the second stacked residual module includes two residual modules, the third stacked residual module includes eight residual modules, the fourth stacked residual module includes eight residual modules, and the fifth stacked residual module includes four residual modules. The output of a previous residual module in each stacked residual module is the input of a subsequent residual module.

[0073] Therefore, the first feature map of the sample image output by the last stacked residual module in the feature extraction network is the feature map with the size and the number of channels of 13*13*1024 output by the fifth stacked residual module; the second feature map of the sample image output by the second last stacked residual module is the feature map with the size and the number of channels of 26*26*512 output by the fourth stacked residual module; and the third feature map of the sample image output by the third last stacked residual module is the feature map with the size and the number of channels of 52*52*526 output by the third stacked residual module.

[0074] Further, referring to Figure 3 , Figure 3 is a schematic diagram of a residual module processing flow of the object recognition method of the present application. As shown in Figure 3 , when the feature map with the size and the number of channels of 208*208*32 is taken as the input of the first residual module, the feature map with the size and the number of channels of 208*208*32 is first subjected to a convolution processing with a convolution kernel size of 3*3 and a step of 2 to obtain a first convolution processing result, and the first convolution processing result is denoted as layer_1. The convolution processing compresses the width and the height of the input feature map with the size and the number of channels of 208*208*32. Then, the feature map with the size and the number of channels of 208*208*32 is subjected to a 1*1 convolution processing to obtain a second convolution processing result, and the second convolution processing result is subjected to a 3*3 convolution processing to obtain a third convolution processing result. The third convolution processing result is added to the first convolution processing result to obtain the output of the first residual module.

[0075] In step S20, the first feature map, the second feature map and the third feature map are processed by the double-branch adaptive convolution kernel attention mechanism respectively to obtain a fourth feature map, a fifth feature map and a sixth feature map fused with the self-attention mechanism.

[0076] In this embodiment, the first feature map, the second feature map and the third feature map are processed by the double-branch adaptive convolution kernel attention mechanism respectively, so that the first feature map fuses the self-attention mechanism to obtain a fourth feature map fusing the self-attention mechanism, the second feature map fuses the self-attention mechanism to obtain a fifth feature map fusing the self-attention mechanism, and the third feature map fuses the self-attention mechanism to obtain a sixth feature map fusing the self-attention mechanism.

[0077] Further, in an embodiment, step S20 comprises:

[0078] The first feature map, the second feature map and the third feature map are respectively subjected to 3*3 convolution processing to obtain feature maps A corresponding to the first feature map, the second feature map and the third feature map respectively;

[0079] The first feature map, the second feature map and the third feature map are respectively subjected to 5*5 convolution processing to obtain feature maps B corresponding to the first feature map, the second feature map and the third feature map respectively;

[0080] The feature maps A and the feature maps B corresponding to the first feature map, the second feature map and the third feature map are respectively added to obtain feature maps U corresponding to the first feature map, the second feature map and the third feature map respectively;

[0081] The feature maps U corresponding to the first feature map, the second feature map and the third feature map are respectively subjected to global pooling operation and full connection operation to obtain low-dimensional vectors S corresponding to the first feature map, the second feature map and the third feature map respectively;

[0082] The low-dimensional vectors S corresponding to the first feature map, the second feature map and the third feature map are respectively input into two full connection layers to obtain attention weight vectors a and β output by the two full connection layers corresponding to the first feature map, the second feature map and the third feature map respectively;

[0083] The first products of the feature maps A and the attention weight vectors a corresponding to the first feature map, the second feature map and the third feature map are respectively calculated, the second products of the feature maps B and the attention weight vectors β corresponding to the first feature map, the second feature map and the third feature map are respectively calculated, and the first products and the second products corresponding to the first feature map, the second feature map and the third feature map are respectively added to obtain the fourth feature map fusing the self-attention mechanism corresponding to the first feature map, the fifth feature map fusing the self-attention mechanism corresponding to the second feature map, and the sixth feature map fusing the self-attention mechanism corresponding to the third feature map.

[0084] In this embodiment, the first feature map, the second feature map and the third feature map are processed by the double-branch adaptive convolution kernel attention mechanism respectively, so that the first feature map fuses the self-attention mechanism to obtain a fourth feature map fusing the self-attention mechanism, the second feature map fuses the self-attention mechanism to obtain a fifth feature map fusing the self-attention mechanism, and the third feature map fuses the self-attention mechanism to obtain a sixth feature map fusing the self-attention mechanism. Figure 4 , Figure 4A flowchart of a double-branch attention mechanism processing procedure for an object recognition method of the present application is shown in FIG. 1. Figure 4 As shown in FIG. 1, a 3*3 convolution operation is performed on the first feature map to obtain a feature map A corresponding to the first feature map, a 3*3 convolution operation is performed on the second feature map to obtain a feature map A corresponding to the second feature map, and a 3*3 convolution operation is performed on the third feature map to obtain a feature map A corresponding to the third feature map.

[0085] A 5*5 convolution operation is performed on the first feature map to obtain a feature map B corresponding to the first feature map, a 5*5 convolution operation is performed on the second feature map to obtain a feature map B corresponding to the second feature map, and a 5*5 convolution operation is performed on the third feature map to obtain a feature map B corresponding to the third feature map.

[0086] The feature map A corresponding to the first feature map is added to the feature map B corresponding to the first feature map to obtain a feature map U corresponding to the first feature map, which fuses features of different receptive fields. The feature map A corresponding to the second feature map is added to the feature map B corresponding to the second feature map to obtain a feature map U corresponding to the second feature map, which fuses features of different receptive fields. The feature map A corresponding to the third feature map is added to the feature map B corresponding to the third feature map to obtain a feature map U corresponding to the third feature map, which fuses features of different receptive fields.

[0087] A global pooling operation is performed on the feature map U corresponding to the first feature map, which fuses features of different receptive fields, to reduce the dimension of the feature map U corresponding to the first feature map, so as to assign an attention weight value. Then, the feature map U corresponding to the first feature map, which has undergone the global pooling operation, is input into a simple fully connected layer to perform a full connection operation, so that the feature map U, which has undergone the global pooling operation, is compressed to obtain a low-dimensional vector S corresponding to the first feature map. A global pooling operation is performed on the feature map U corresponding to the second feature map, which fuses features of different receptive fields. Then, the feature map U corresponding to the second feature map, which has undergone the global pooling operation, is input into a simple fully connected layer to perform a full connection operation, so as to obtain a low-dimensional vector S corresponding to the second feature map. A global pooling operation is performed on the feature map U corresponding to the third feature map, which fuses features of different receptive fields. Then, the feature map U corresponding to the third feature map, which has undergone the global pooling operation, is input into a simple fully connected layer to perform a full connection operation, so as to obtain a low-dimensional vector S corresponding to the third feature map.

[0088] The low-dimensional vector S corresponding to the first feature map is input into two fully connected layers to obtain an attention weight vector a and an attention weight vector β output by the two fully connected layers corresponding to the first feature map. The low-dimensional vector S corresponding to the second feature map is input into two fully connected layers to obtain an attention weight vector a and an attention weight vector β output by the two fully connected layers corresponding to the second feature map. The low-dimensional vector S corresponding to the third feature map is input into two fully connected layers to obtain an attention weight vector a and an attention weight vector β output by the two fully connected layers corresponding to the third feature map.

[0089] That is, wherein F fc denotes a full connection operation, the activation function used in the full connection layer is a Relu function, and GMP denotes a global pooling operation.

[0090] The first feature map A corresponding to the first feature map is multiplied by the attention weight vector a, and the first product of the first feature map A corresponding to the first feature map and the attention weight vector a is calculated. The first feature map B corresponding to the first feature map is multiplied by the attention weight vector β, and the second product of the first feature map B corresponding to the first feature map and the attention weight vector β is calculated. The first product corresponding to the first feature map is added to the second product corresponding to the first feature map, and the sum obtained is the fourth feature map E (13*13*1024) corresponding to the first feature map which is fused with the self-attention mechanism. The first feature map A corresponding to the second feature map is multiplied by the attention weight vector a, and the first product of the first feature map A corresponding to the second feature map and the attention weight vector a is calculated. The first feature map B corresponding to the second feature map is multiplied by the attention weight vector β, and the second product of the first feature map B corresponding to the second feature map and the attention weight vector β is calculated. The first product corresponding to the second feature map is added to the second product corresponding to the second feature map, and the sum obtained is the fifth feature map E (26*26*512) corresponding to the second feature map which is fused with the self-attention mechanism. The first feature map A corresponding to the third feature map is multiplied by the attention weight vector a, and the first product of the first feature map A corresponding to the third feature map and the attention weight vector a is calculated. The first feature map B corresponding to the third feature map is multiplied by the attention weight vector β, and the second product of the first feature map B corresponding to the third feature map and the attention weight vector β is calculated. The first product corresponding to the third feature map is added to the second product corresponding to the third feature map, and the sum obtained is the sixth feature map E (52*52*526) corresponding to the third feature map which is fused with the self-attention mechanism. That is, E=A*α+B*β.

[0091] In step S30, the fourth feature map is subjected to N times of convolution processing to obtain a first enhanced feature map, wherein N is a positive integer.

[0092] In this embodiment, with reference to Figure 5 , Figure 5 is the flowchart of the optional feature scale fusion method for the target recognition method. As shown in Figure 5 , taking N as 5 as an example, the fourth feature map with a size of 13*13*1024 and a channel number of 1024 is subjected to 5 times of convolution processing to obtain a first enhanced feature map f1 with a size of 13*13*1024 and a channel number of 1024. When the fourth feature map is subjected to N times of convolution processing, the size of the convolution kernel is not limited.

[0093] In step S40, optional scale feature fusion is performed based on the first enhanced feature map, the fifth feature map, and the sixth feature map to obtain a second enhanced feature map and a third enhanced feature map.

[0094] In this embodiment, optional scale feature fusion is performed based on the first enhanced feature map and the fifth feature map to obtain the second enhanced feature map, and optional scale feature fusion is performed based on the second enhanced feature and the sixth feature map to obtain the third enhanced feature map.

[0095] Further, in an embodiment, step S40 includes:

[0096] The first enhanced feature map is up-sampled, and the number of channels of the first enhanced feature map and the fifth feature map is adjusted to obtain an adjusted first enhanced feature map, wherein the size and the number of channels of the adjusted first enhanced feature map are the same as the size and the number of channels of the adjusted fifth feature map.

[0097] The adjusted first enhanced feature map and the adjusted fifth feature map are subjected to optional scale feature fusion to obtain a second enhanced feature map.

[0098] The second enhanced feature map is up-sampled, and the number of channels of the second enhanced feature map and the sixth feature map is adjusted to obtain an adjusted second enhanced feature map, wherein the size and the number of channels of the adjusted second enhanced feature map are the same as the size and the number of channels of the adjusted sixth feature map.

[0099] The adjusted second enhanced feature map and the adjusted sixth feature map are subjected to optional scale feature fusion to obtain a third enhanced feature map.

[0100] In this embodiment, the above description is continued. Figure 5 The first enhanced feature map f1 with the size and the number of channels of 13*13*1024 is up-sampled, and the number of channels of the first enhanced feature map f1 is adjusted through 1*1 convolution to obtain a feature map f2 with the size and the number of channels of 26*26*256. The number of channels of the fifth feature map v1 with the size and the number of channels of 26*26*512 is adjusted through 1*1 convolution to obtain a feature map v2 with the size and the number of channels of 26*26*256.

[0101] The adjusted first enhanced feature map f2 and the adjusted fifth feature map v2 are subjected to optional scale feature fusion to obtain a second enhanced feature map fv1 with the size and the number of channels of 26*26*256.

[0102] The second enhanced feature map fv1 with a size of 26*26*256 and a channel number is up-sampled, and the channel number of the second enhanced feature map fv1 is adjusted through 1*1 convolution to obtain a feature map fv2 with a size of 52*52*128 and a channel number of 128. The channel number of the sixth feature map q1 with a size of 52*52*256 and a channel number is adjusted through 1*1 convolution to obtain a feature map q2 with a size of 52*52*128 and a channel number of 128.

[0103] The adjusted second enhanced feature map fv2 and the adjusted sixth feature map q2 are subjected to optional scale feature fusion to obtain a third enhanced feature map with a size of 52*52*128 and a channel number of 128.

[0104] Further, in an embodiment, the step of performing optional scale feature fusion on the adjusted first enhanced feature map and the adjusted fifth feature map to obtain a second enhanced feature map comprises:

[0105] adding the size and the channel number of the adjusted first enhanced feature map to the size and the channel number of the adjusted fifth feature map;

[0106] performing global pooling operation on the sum to obtain a vector with a length of the channel number;

[0107] expanding the vector with the length of the channel number through a fully connected layer to obtain two attention vectors with a length of the channel number;

[0108] performing Softmax operation on the two attention vectors with the length of the channel number to obtain two channel attention weights corresponding to the adjusted first enhanced feature map and the adjusted fifth feature map respectively;

[0109] multiplying the channel attention weight corresponding to the adjusted first enhanced feature map with the size and the channel number of the adjusted first enhanced feature map to obtain a third product;

[0110] multiplying the channel attention weight corresponding to the adjusted fifth feature map with the size and the channel number of the adjusted fifth feature map to obtain a fourth product;

[0111] adding the third product and the fourth product to obtain the second enhanced feature map.

[0112] In the embodiment, reference is made to Figure 6 , Figure 6 is a schematic diagram of a processing flow of optional feature scale fusion of the target recognition method of the present application. As shown in Figure 6As shown, the size and the number of channels of the adjusted first enhanced feature map are added to the size and the number of channels of the fifth feature map, and the added result is subjected to a global pooling operation to obtain a vector with a length of the number of channels, i.e., 1*1*C, wherein C represents the number of channels.

[0113] The vector of 1*1*C is expanded through a fully connected layer to obtain two attention vectors with a length of the number of channels, i.e., two vectors of 1*1*C.

[0114] The two attention vectors with a length of the number of channels are subjected to a Softmax operation to obtain two channel attention weights corresponding to the adjusted first enhanced feature map and the fifth feature map, respectively.

[0115] The channel attention weight corresponding to the adjusted first enhanced feature map is multiplied by the size and the number of channels of the adjusted first enhanced feature map to obtain a third product, and the channel attention weight corresponding to the adjusted fifth feature map is multiplied by the size and the number of channels of the adjusted fifth feature map to obtain a fourth product.

[0116] The third product and the fourth product are added to obtain a second enhanced feature map.

[0117] Further, the method for obtaining the third enhanced feature map corresponds to the method for obtaining the second enhanced feature map, and the implementation process will not be described here.

[0118] In step S50, 3*3 convolution processing is performed on the first enhanced feature map, the second enhanced feature map, and the third enhanced feature map to obtain a fourth enhanced feature map, a fifth enhanced feature map, and a sixth enhanced feature map.

[0119] In this embodiment, the first enhanced feature map with a size and a number of channels of 13*13*1024 is subjected to 3*3 convolution processing to integrate features, and the fourth enhanced feature map with a size and a number of channels of 13*13*1024 is obtained. The second enhanced feature map with a size and a number of channels of 26*26*256 is subjected to 3*3 convolution processing to integrate features, and the fifth enhanced feature map with a size and a number of channels of 26*26*256 is obtained. The third enhanced feature map with a size and a number of channels of 52*52*128 is subjected to 3*3 convolution processing to integrate features, and the sixth enhanced feature map with a size and a number of channels of 52*52*128 is obtained.

[0120] In step S60, target recognition is performed on the to-be-recognized image based on the fourth enhanced feature map, the fifth enhanced feature map, and the sixth enhanced feature map to obtain a target recognition result.

[0121] In this embodiment, the fourth enhanced feature map with a size of 13*13*1024 and a number of channels is used to perform target recognition on the to-be-identified image to obtain a target recognition result. The fifth enhanced feature map with a size of 26*26*256 and a number of channels is used to perform target recognition on the to-be-identified image to obtain a target recognition result. The sixth enhanced feature map with a size of 52*52*128 and a number of channels is used to perform target recognition on the to-be-identified image to obtain a target recognition result. Among them, the larger the object in the to-be-identified image, the higher the accuracy of the target recognition result obtained based on the fourth enhanced feature map. The larger the object in the to-be-identified image, the accuracy of the target recognition result obtained based on the fourth enhanced feature map is greater than the accuracy of the target recognition result obtained based on the fifth enhanced feature map, and the accuracy of the target recognition result obtained based on the fifth enhanced feature map is greater than the accuracy of the target recognition result obtained based on the sixth enhanced feature map.

[0122] It is easy to think that the smaller the object in the to-be-identified image, the greater the accuracy of the target recognition result obtained based on the sixth enhanced feature map than the accuracy of the target recognition result obtained based on the fifth enhanced feature map, and the accuracy of the target recognition result obtained based on the fifth enhanced feature map is greater than the accuracy of the target recognition result obtained based on the fourth enhanced feature map.

[0123] Further, in an embodiment, step S60 comprises:

[0124] Based on the number of target recognition boxes, the target categories to be identified in the to-be-identified image, the size and center point coordinates of the target recognition box, and the confidence of the target recognition box, the target channel number is calculated.

[0125] Based on the target channel number, the number of channels of the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map are adjusted respectively through 1*1 convolution to obtain the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map after channel number adjustment, wherein the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map after channel number adjustment are the target recognition result.

[0126] In this embodiment, taking the number of target recognition boxes as 3, the target categories to be identified in the to-be-identified image as 5, and the confidence of the target recognition box as 1 as an example, based on the number of target recognition boxes, the target categories to be identified in the to-be-identified image, the size and center point coordinates of the target recognition box, and the confidence of the target recognition box, the target channel number C=3*(5+4+1)=30 is calculated, wherein 4 represents the four parameters of the width, height of the target recognition box and the target recognition center point coordinates x and y.

[0127] Based on the target channel number 30, the channel number of the fourth enhanced feature map with a size of 13*13*1024 is adjusted to 30 through 1*1 convolution, and the fourth enhanced feature map with a size of 13*13*30 after channel number adjustment is the target recognition result. The channel number of the fourth enhanced feature map with a size of 26*26*256 is adjusted to 30 through 1*1 convolution, and the fourth enhanced feature map with a size of 26*26*30 after channel number adjustment is the target recognition result. The channel number of the fourth enhanced feature map with a size of 52*52*128 is adjusted to 30 through 1*1 convolution, and the fourth enhanced feature map with a size of 52*52*50 after channel number adjustment is the target recognition result.

[0128] In the embodiment, the first feature map, the second feature map and the third feature map of the sample image are obtained; the first feature map, the second feature map and the third feature map are processed respectively through the double-branch adaptive convolution kernel attention mechanism to obtain the fourth feature map, the fifth feature map and the sixth feature map fused with the self-attention mechanism; the fourth feature map is processed through N times of convolution to obtain the first enhanced feature map, wherein N is a positive integer; the first enhanced feature map, the fifth feature map and the sixth feature map are used for optional scale feature fusion to obtain the second enhanced feature map and the third enhanced feature map; the first enhanced feature map, the second enhanced feature map and the third enhanced feature map are processed through 3*3 convolution to obtain the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map; the target recognition is performed on the image to be recognized based on the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map to obtain the target recognition result. Through the embodiment, the Yolov3 target detection method with the added self-attention mechanism and the optional scale feature fusion method is used, the network connection is changed, and the accuracy of the recognition result of the Yolov3 algorithm is improved.

[0129] Further, in an embodiment, after the step S60, the following steps are included:

[0130] Based on the target recognition result, the recognition rate of each target category is counted.

[0131] Based on the recognition rate of each target category, the accuracy of the target recognition result is calculated.

[0132] In the embodiment, the target recognition result is obtained, the recognition rate of each target category, i.e. the AP value, is counted based on the target recognition result, i.e. the proportion of a certain category recognized by the Yolov3 algorithm to all real categories. Based on the recognition rate of each target category, the average value is calculated to obtain the accuracy mAP of the target recognition result, i.e. the average value of the AP of all categories. A column chart is generated according to the AP value of each target category, wherein the vertical coordinate represents the marked category in the image to be recognized, and the horizontal coordinate represents the AP value of each category.

[0133] Referring to Figure 7a , Figure 7a is a schematic diagram of the recognition result of the target recognition method of the present application. Referring to Figure 7b , Figure 7b is a schematic diagram of the recognition result of the prior art. As shown in Figure 7a and Figure 7b , the mAP in the present application is greater than the mAP obtained by the Yolov3 target detection method without adding the self-attention mechanism and the optional scale feature fusion method, that is, the accuracy of the target recognition result is significantly improved.

[0134] In a second aspect, the embodiments of the present application also provide a target recognition device.

[0135] In an embodiment, referring to Figure 8 , Figure 8 is a schematic diagram of the functional modules of the first embodiment of the target recognition device of the present application. As shown in Figure 8 , the target recognition device comprises:

[0136] The acquisition module 10 is configured to acquire a first feature map, a second feature map and a third feature map of a sample image.

[0137] The image processing module 20 is configured to process the first feature map, the second feature map and the third feature map respectively through a double-branch adaptive convolution kernel attention mechanism to obtain a fourth feature map, a fifth feature map and a sixth feature map fused with the self-attention mechanism.

[0138] The convolution module 30 is configured to perform N times of convolution processing on the fourth feature map to obtain a first enhanced feature map, wherein N is a positive integer.

[0139] The image processing module 20 is configured to perform optional scale feature fusion based on the first enhanced feature map, the fifth feature map and the sixth feature map to obtain a second enhanced feature map and a third enhanced feature map.

[0140] The convolution module 30 is configured to perform 3*3 convolution processing on the first enhanced feature map, the second enhanced feature map and the third enhanced feature map respectively to obtain a fourth enhanced feature map, a fifth enhanced feature map and a sixth enhanced feature map.

[0141] The target recognition module 40 is configured to perform target recognition on a to-be-recognized image based on the fourth enhanced feature map, the fifth enhanced feature map and the sixth enhanced feature map respectively to obtain a target recognition result.

[0142] Further, in an embodiment, the acquisition module 10 is configured to:

[0143] obtain a first feature map of a sample image output by a last stacked residual module in the feature extraction network, a second feature map of the sample image output by a second last stacked residual module, and a third feature map of the sample image output by a third last stacked residual module, wherein the feature extraction network comprises one convolutional layer with a size of 3*3 and a channel of 32 and M stacked residual modules, M is greater than 3, and a feature extraction result of the sample image after down-sampling is taken as an input of the first residual module, and an output of a previous residual module after down-sampling is taken as an input of a subsequent residual module.

[0144] Further, in an embodiment, the image processing module 20 is configured to:

[0145] perform 3*3 convolution processing on the first feature map, the second feature map, and the third feature map respectively to obtain feature maps A corresponding to the first feature map, the second feature map, and the third feature map respectively;

[0146] perform 5*5 convolution processing on the first feature map, the second feature map, and the third feature map respectively to obtain feature maps B corresponding to the first feature map, the second feature map, and the third feature map respectively;

[0147] add the feature maps A and the feature maps B corresponding to the first feature map, the second feature map, and the third feature map respectively to obtain feature maps U corresponding to the first feature map, the second feature map, and the third feature map respectively;

[0148] perform global pooling operation and full connection operation on the feature maps U corresponding to the first feature map, the second feature map, and the third feature map respectively to obtain low-dimensional vectors S corresponding to the first feature map, the second feature map, and the third feature map respectively;

[0149] input the low-dimensional vectors S corresponding to the first feature map, the second feature map, and the third feature map respectively into two full connection layers to obtain attention weight vectors a and β output by the two full connection layers respectively;

[0150] calculate first products of the feature maps A and the attention weight vectors a corresponding to the first feature map, the second feature map, and the third feature map respectively, calculate second products of the feature maps B and the attention weight vectors β corresponding to the first feature map, the second feature map, and the third feature map respectively, and add the first products and the second products corresponding to the first feature map, the second feature map, and the third feature map respectively to obtain a fourth feature map corresponding to the first feature map, a fifth feature map corresponding to the second feature map, and a sixth feature map corresponding to the third feature map, which are fused with self-attention mechanisms.

[0151] Further, in an embodiment, the image processing module 20 is configured to:

[0152] performing an up-sampling operation on the first enhanced feature map and adjusting the channel numbers of the first enhanced feature map and the fifth feature map to obtain an adjusted first enhanced feature map, wherein the size and the channel number of the adjusted first enhanced feature map are the same as the size and the channel number of the adjusted fifth feature map;

[0153] performing optional scale feature fusion on the adjusted first enhanced feature map and the adjusted fifth feature map to obtain a second enhanced feature map;

[0154] performing an up-sampling operation on the second enhanced feature map and adjusting the channel numbers of the second enhanced feature map and the sixth feature map to obtain an adjusted second enhanced feature map, wherein the size and the channel number of the adjusted second enhanced feature map are the same as the size and the channel number of the adjusted sixth feature map;

[0155] performing optional scale feature fusion on the adjusted second enhanced feature map and the adjusted sixth feature map to obtain a third enhanced feature map.

[0156] Further, in an embodiment, the image processing module 20 is configured to:

[0157] adding the size and the channel number of the adjusted first enhanced feature map and the size and the channel number of the adjusted fifth feature map;

[0158] performing a global pooling operation on the sum to obtain a vector with a length of the channel number;

[0159] expanding the vector with the length of the channel number through a fully connected layer to obtain two attention vectors with the length of the channel number;

[0160] performing a Softmax operation on the two attention vectors with the length of the channel number to obtain two channel attention weights corresponding to the adjusted first enhanced feature map and the adjusted fifth feature map, respectively;

[0161] multiplying the channel attention weight corresponding to the adjusted first enhanced feature map and the size and the channel number of the adjusted first enhanced feature map to obtain a third product;

[0162] multiplying the channel attention weight corresponding to the adjusted fifth feature map and the size and the channel number of the adjusted fifth feature map to obtain a fourth product;

[0163] adding the third product and the fourth product to obtain the second enhanced feature map.

[0164] Further, in an embodiment, the target recognition module 40 is configured to:

[0165] The target channel number is calculated based on the number of target identification boxes, the target categories to be identified in the image to be identified, the size and center point coordinates of the target identification boxes, and the confidence of the target identification boxes.

[0166] The channel numbers of the fourth enhanced feature map, the fifth enhanced feature map, and the sixth enhanced feature map are adjusted by 1*1 convolution based on the target channel number, to obtain the fourth enhanced feature map, the fifth enhanced feature map, and the sixth enhanced feature map after channel number adjustment, wherein the fourth enhanced feature map, the fifth enhanced feature map, and the sixth enhanced feature map after channel number adjustment are the target identification result.

[0167] Further, in an embodiment, the target identification device further includes a statistics module configured to:

[0168] Based on the target identification result, the identification rate of each target category is counted.

[0169] Based on the identification rate of each target category, the accuracy of the target identification result is calculated.

[0170] The functions of each module in the target identification device correspond to the steps in the target identification method embodiments, and the functions and implementation processes will not be repeated here.

[0171] In a third aspect, an embodiment of the present application provides a target identification device, which can be a personal computer (PC), a notebook computer, a server, or other device with data processing function.

[0172] Reference Figure 9 , Figure 9 is a schematic diagram of the hardware structure of the target identification device involved in the embodiment of the present application. In the embodiment of the present application, the target identification device can include a processor 1001 (such as a central processing unit (CPU)), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 can include a display screen (Display) and an input unit such as a keyboard (Keyboard); the network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface); the memory 1005 can be a high-speed random access memory (RAM), and can also be a stable memory (non-volatile memory) such as a disk memory; the memory 1005 can optionally be a storage device independent of the aforementioned processor 1001. Those skilled in the art can understand that the processor 1001 can be replaced by or include one or more hardware central processing units (CPUs), microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and other processing logic that can perform computations and / or other processing of the present application. The software in the memory 1005 mayFigure 9 The hardware structure shown in the foregoing embodiments is not intended to limit the present application, and can include more or less components, or combine certain components, or arrange different components.

[0173] With reference to the foregoing Figure 9 , Figure 9 The memory 1005 in the foregoing embodiments can include an operating system, a network communication module, a user interface module, and a target identification program. The processor 1001 can invoke the target identification program stored in the memory 1005 and execute the target identification method provided by the embodiments of the present application.

[0174] In a fourth aspect, the embodiments of the present application further provide a readable storage medium.

[0175] The readable storage medium of the present application stores a target identification program, wherein the target identification program is executed by a processor to implement the steps of the target identification method described above.

[0176] The method implemented by the target identification program when executed can refer to the embodiments of the target identification method of the present application, which will not be described herein.

[0177] It should be noted that, in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles, or systems that include a series of elements not only include those elements, but also include other elements not explicitly listed, or inherent to such processes, methods, articles, or systems. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article, or system that includes the element.

[0178] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

[0179] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platforms, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, an optical disk) as described above, and includes a plurality of instructions for causing a terminal device to execute the methods described in the embodiments of the present application.

[0180] The above merely describes the preferred embodiments of the present application, and is not intended to limit the patent scope of the present application, and any equivalent structure or equivalent process conversion, or direct or indirect application in other related technical fields, which are made by using the content of the present application specification and drawings, are also included in the patent protection scope of the present application.

Claims

1. A target recognition method, characterized in that, The target recognition method includes: Obtain the first feature map, second feature map, and third feature map of the sample image; The first feature map, the second feature map, and the third feature map are processed by a dual-branch adaptive convolutional kernel attention mechanism to obtain the fourth feature map, the fifth feature map, and the sixth feature map that incorporate the self-attention mechanism. The fourth feature map is subjected to N convolutions to obtain the first enhanced feature map, where N is a positive integer; Based on the first enhanced feature map, the fifth feature map and the sixth feature map, optional scale feature fusion is performed to obtain the second enhanced feature map and the third enhanced feature map; The first, second, and third enhanced feature maps are convolved with 3×3 respectively to obtain the fourth, fifth, and sixth enhanced feature maps. Target recognition is performed on the image to be recognized based on the fourth, fifth and sixth enhanced feature maps, and the target recognition result is obtained. The step of processing the first, second, and third feature maps respectively using a dual-branch adaptive convolutional kernel attention mechanism to obtain the fourth, fifth, and sixth feature maps that incorporate the self-attention mechanism includes: Perform 3×3 convolution on the first feature map, the second feature map, and the third feature map respectively to obtain feature maps A corresponding to the first feature map, the second feature map, and the third feature map; Perform 5×5 convolution on the first feature map, the second feature map, and the third feature map respectively to obtain feature maps B corresponding to the first feature map, the second feature map, and the third feature map; Add the feature maps A and B corresponding to the first feature map, the second feature map, and the third feature map respectively to obtain the feature maps U corresponding to the first feature map, the second feature map, and the third feature map respectively; Global pooling and fully connected operations are performed on the feature maps U corresponding to the first, second, and third feature maps, respectively, to obtain the low-dimensional vectors S corresponding to the first, second, and third feature maps, respectively. The low-dimensional vectors S corresponding to the first, second, and third feature maps are respectively fed into two fully connected layers to obtain the attention weight vectors corresponding to the first, second, and third feature maps output by the two fully connected layers. and ; Calculate the feature map A and attention weight vector corresponding to the first, second, and third feature maps respectively. The first product is used to calculate the feature map B and attention weight vector corresponding to the first, second, and third feature maps, respectively. The second product is obtained by adding the first product and the second product corresponding to the first feature map, the second feature map, and the third feature map respectively, to obtain the fourth feature map corresponding to the first feature map that incorporates the self-attention mechanism, the fifth feature map corresponding to the second feature map that incorporates the self-attention mechanism, and the sixth feature map corresponding to the third feature map that incorporates the self-attention mechanism.

2. The target recognition method as described in claim 1, characterized in that, The steps of acquiring the first feature map, the second feature map, and the third feature map of the sample image include: The first feature map of the sample image output by the last stacked residual module in the feature extraction network, the second feature map of the sample image output by the second-to-last stacked residual module, and the third feature map of the sample image output by the third-to-last stacked residual module are obtained. The feature extraction network includes a 3×3 convolutional layer with 32 channels and M stacked residual modules, where M is greater than 3. The feature extraction result of the convolutional layer on the sample image is downsampled and used as the input of the first residual module. The output of the previous residual module is downsampled and used as the input of the next residual module.

3. The target recognition method as described in claim 1, characterized in that, The step of performing optional scale feature fusion based on the first enhanced feature map, the fifth feature map, and the sixth feature map to obtain the second enhanced feature map and the third enhanced feature map includes: An upsampling operation is performed on the first enhanced feature map, and the number of channels of the first enhanced feature map and the fifth feature map are adjusted to obtain an adjusted first enhanced feature map, wherein the size and number of channels of the adjusted first enhanced feature map are the same as the size and number of channels of the adjusted fifth feature map; The adjusted first enhanced feature map and the adjusted fifth feature map are fused using optional scale features to obtain the second enhanced feature map; An upsampling operation is performed on the second enhanced feature map, and the number of channels of the second enhanced feature map and the sixth feature map are adjusted to obtain an adjusted second enhanced feature map, wherein the size and number of channels of the adjusted second enhanced feature map are the same as the size and number of channels of the adjusted sixth feature map; The adjusted second enhanced feature map and the adjusted sixth feature map are fused using optional scale features to obtain the third enhanced feature map.

4. The target recognition method as described in claim 3, characterized in that, The step of performing optional-scale feature fusion between the adjusted first enhanced feature map and the adjusted fifth feature map to obtain the second enhanced feature map includes: Add the adjusted size and number of channels of the first enhanced feature map to the adjusted size and number of channels of the fifth feature map; Perform global pooling on the sum to obtain a vector of length equal to the number of channels; The vector of length equal to the number of channels is expanded through a fully connected layer to obtain two attention vectors of length equal to the number of channels. Perform a Softmax operation on two attention vectors of length equal to the number of channels to obtain two channel attention weights corresponding to the adjusted first enhanced feature map and the adjusted fifth feature map, respectively. The channel attention weights of the corresponding adjusted first enhanced feature map are multiplied by the size and number of channels of the adjusted first enhanced feature map to obtain the third product; The channel attention weights of the corresponding adjusted fifth feature map are multiplied by the size and number of channels of the adjusted fifth feature map to obtain the fourth product; The third product is added to the fourth product to obtain the second enhanced feature map.

5. The target recognition method as described in claim 1, characterized in that, The step of performing target recognition on the image to be recognized based on the fourth, fifth, and sixth enhanced feature maps respectively, and obtaining the target recognition result, includes: The number of target channels is calculated based on the number of target recognition boxes, the target category in the image to be recognized, the size and center point coordinates of the target recognition boxes, and the confidence level of the target recognition boxes. Based on the target number of channels, the number of channels in the fourth, fifth, and sixth enhanced feature maps is adjusted by 1×1 convolution to obtain the fourth, fifth, and sixth enhanced feature maps with adjusted channel numbers. The fourth, fifth, and sixth enhanced feature maps with adjusted channel numbers are the target recognition results.

6. The target recognition method as described in claim 1, characterized in that, After the step of performing target recognition on the image to be recognized based on the fourth, fifth, and sixth enhanced feature maps respectively to obtain the target recognition result, the following steps are included: Based on the target recognition results, the recognition rate for each target category is calculated. The accuracy of the target recognition result is calculated based on the recognition rate of each target category.

7. A target recognition device for implementing the steps of the target recognition method as described in any one of claims 1-6, characterized in that, The target identification device includes: The acquisition module is used to acquire the first feature map, the second feature map, and the third feature map of the sample image; The image processing module is used to process the first feature map, the second feature map, and the third feature map respectively through a dual-branch adaptive convolutional kernel attention mechanism to obtain the fourth feature map, the fifth feature map, and the sixth feature map that are fused with the self-attention mechanism. The convolution module is used to perform N convolution processes on the fourth feature map to obtain the first enhanced feature map, where N is a positive integer; The image processing module is used to perform optional scale feature fusion based on the first enhanced feature map, the fifth feature map and the sixth feature map to obtain the second enhanced feature map and the third enhanced feature map; The convolution module is used to perform 3×3 convolution processing on the first enhanced feature map, the second enhanced feature map, and the third enhanced feature map respectively to obtain the fourth enhanced feature map, the fifth enhanced feature map, and the sixth enhanced feature map; The target recognition module is used to perform target recognition on the image to be recognized based on the fourth, fifth and sixth enhanced feature maps respectively, and obtain the target recognition result.

8. A target recognition device, characterized in that, The target recognition device includes a processor, a memory, and a target recognition program stored in the memory and executable by the processor, wherein when the target recognition program is executed by the processor, it implements the steps of the target recognition method as described in any one of claims 1 to 6.

9. A readable storage medium, characterized in that, The readable storage medium stores a target recognition program, wherein when the target recognition program is executed by a processor, it implements the steps of the target recognition method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Target detection method and device based on multi-head fusion attention

    CN110084299A

  • Remote sensing image target detection method based on attention mechanism

    CN110276269A