Small target detection methods, devices, and equipment that incorporate attention mechanisms
By introducing an attention mechanism into the small target detection method, and utilizing a simulated primary visual perception cortex model and CA attention module, the accuracy problems of existing models in noise interference and small target detection are solved, thereby improving detection performance and anti-interference ability.
Patent Information
- Application Number
- CN202210486933.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-05-06
AI Technical Summary
Existing target detection models have poor accuracy in detecting small targets when there is environmental noise interference, resulting in a high false negative rate and making them unsuitable for scenarios with a large number of small targets and noise interference.
A small target detection method with an attention mechanism is introduced. Feature extraction is performed by imitating a primary visual perception cortex model, and a CA attention module is added to the target detection model to generate five target feature maps of different sizes for target classification and coordinate localization.
It improves the ability to extract features from small targets, enhances the model's anti-interference ability, and improves detection performance.
Smart Images

Figure CN115035563B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and more specifically, to a method, apparatus, and device for small target detection that incorporates an attention mechanism. Background Technology
[0002] With the development of computer technology, a large number of object detection models have emerged, such as Faster-RCNN, SSD, CenterNet, and Yolov1 to Yolov5. However, existing object detection models suffer from poor accuracy in the presence of environmental noise and for detecting small targets, resulting in high false negative rates or even detection failures. This makes them unsuitable for applications with numerous small targets and noise interference. Summary of the Invention
[0003] One object of the present invention is to provide a new technical solution for small target detection.
[0004] According to a first aspect of the present invention, a small target detection method incorporating an attention mechanism is provided, the method comprising:
[0005] Obtain the input image;
[0006] The input image is subjected to feature extraction using a pre-defined rudimentary visual perception cortex model to obtain a first feature map; the pre-defined rudimentary visual perception cortex model includes a VOneBlock layer, a Conv layer, and a feature fusion layer.
[0007] The first feature map is subjected to target detection using a preset target detection model to obtain five target feature maps of different sizes; the target detection model is an improved model based on the Yolov5 model, and the target detection model includes a CA attention module;
[0008] The target feature maps of the five different sizes are classified and their coordinates are located to obtain the target detection results.
[0009] Optionally, the preset target detection model includes a backbone network and a head network, both of which include the CA attention module. The preset target detection model is used to perform target detection on the first feature map, resulting in five target feature maps of different sizes, including:
[0010] The first feature map is subjected to multiple size compressions and feature extractions through the backbone network to obtain multiple backbone feature maps of different sizes.
[0011] The first feature map and the multiple backbone feature maps of different sizes are input into the head network to obtain the five target feature maps of different sizes.
[0012] Optionally, the head network includes four cascaded FPN modules and four feature aggregation modules. Each FPN module includes a Conv layer, an Upsample layer, a Concat layer, and a C3 layer connected in sequence. The CA attention module includes a CA attention layer placed after the C3 layer of the FPN module and a CA attention layer placed after each feature aggregation module. The step of inputting the first feature map and the multiple backbone feature maps of different sizes into the head network to obtain the five target feature maps of different sizes includes:
[0013] The four FPN modules and the CA attention layer set after the C3 layer of each FPN module generate a first target feature map based on the multiple backbone feature maps of different sizes and the first feature map.
[0014] The first target feature map, the first backbone feature map, and the feature map output by the Conv layer of the first FPN module are input into the first feature aggregation module. The first feature aggregation module performs size compression and channel aggregation on the input multiple feature maps. The CA attention layer set after the first feature aggregation module extracts the features of interest from the feature map output by the first feature aggregation module to obtain the second target feature map.
[0015] The second target feature map, the second backbone feature map, and the feature map output by the Conv layer of the second FPN module are input into the second feature aggregation module. The second feature aggregation module performs size compression and channel aggregation on the multiple input feature maps. The CA attention layer set after the second feature aggregation module extracts the features of interest from the feature map output by the second feature aggregation module to obtain the third target feature map.
[0016] The third target feature map, the third backbone feature map, and the feature map output by the Conv layer of the third FPN module are input into the third feature aggregation module. The third feature aggregation module performs size compression and channel aggregation on the multiple input feature maps. The CA attention layer set after the third feature aggregation module extracts the features of interest from the feature map output by the third feature aggregation module to obtain the fourth target feature map.
[0017] The fourth target feature map, the fourth backbone feature map, and the feature map output from the Conv layer of the fourth FPN module are input into the fourth feature aggregation module. The fourth feature aggregation module performs size compression and channel aggregation on the input multiple feature maps. The CA attention layer set after the fourth feature aggregation module extracts the features of interest from the feature map output by the fourth feature aggregation module to obtain the fifth target feature map.
[0018] Optionally, the four FPN modules and the CA attention layer disposed after the C3 layer of each FPN module generate a first target feature map based on the plurality of feature maps of different sizes and the first feature map, including:
[0019] The fourth backbone feature map and the third backbone feature map are input into the fourth FPN module to obtain the output feature map of the fourth FPN module;
[0020] The CA attention layer, which is set after the C3 layer of the fourth FPN module, is used to extract the features of interest from the feature map output by the fourth FPN module. The feature map output by the CA attention layer, which is set after the C3 layer of the fourth FPN module, and the second backbone feature map are input into the third FPN module to obtain the output feature map of the third FPN module.
[0021] The CA attention layer, which is set after the C3 layer of the third FPN module, is used to extract the features of interest from the feature map output by the third FPN module. The feature map output by the CA attention layer, which is set after the C3 layer of the third FPN module, and the first backbone feature map are input into the second FPN module to obtain the output feature map of the second FPN module.
[0022] The CA attention layer, located after the C3 layer of the second FPN module, is used to extract the features of interest from the feature map output by the second FPN module. The feature map output by the CA attention layer, located after the C3 layer of the second FPN module, and the first feature map are input into the first FPN module. The CA attention layer, located after the C3 layer of the first FPN module, is used to extract the features of interest from the feature map output by the first FPN module to obtain the first target feature map.
[0023] Optionally, the backbone network includes a first Conv layer, a first C3 layer, a second Conv layer, a second C3 layer, a third Conv layer, a third C3 layer, a fourth Conv layer, a fourth C3 layer, and an SPP layer. The CA attention module includes a CA attention layer disposed after each C3 layer in the backbone network. The step of performing multiple feature map size compressions and feature extractions on the first feature map through the backbone network to obtain multiple backbone feature maps of different sizes includes:
[0024] The first feature map is compressed by the first Conv layer, and the first feature map is extracted by the first C3 layer to obtain the first backbone feature map.
[0025] The first backbone feature map is obtained by extracting features of interest from the first backbone feature map through a CA attention layer set after the first C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the first C3 layer through the second Conv layer, and extracting features from the feature map output by the second Conv layer through the second C3 layer.
[0026] The second backbone feature map is obtained by extracting features of interest from the second backbone feature map through a CA attention layer set after the second C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the second C3 layer through the third Conv layer, and extracting features from the feature map output by the third Conv layer through the third C3 layer.
[0027] The third backbone feature map is obtained by extracting features of interest from the third backbone feature map through a CA attention layer set after the third C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the third C3 layer through the fourth Conv layer, fusing spatial information from the feature map output by the third Conv layer through the SPP layer, and extracting features from the feature map output by the SPP layer through the fourth C3 layer.
[0028] Optionally, the step of extracting features from the input image using a preset simulated primary visual perception cortex model to obtain a first feature map includes:
[0029] The input image is subjected to feature extraction and size compression through the VOneBlock layer to obtain a second feature map.
[0030] The input image is compressed using the Conv layer to obtain a third feature map; the size of the third feature map is the same as the size of the second feature map.
[0031] The first feature map is obtained by fusing the feature values of the second feature map and the third feature map through the feature fusion layer.
[0032] According to a second aspect of the present invention, a small target detection device incorporating an attention mechanism is provided, the device comprising:
[0033] The image acquisition module is used to acquire the input image;
[0034] The preprocessing module is used to extract features from the input image using a preset rudimentary visual perception cortex model to obtain a first feature map; the preset rudimentary visual perception cortex model includes a VOneBlock layer, a Conv layer, and a feature fusion layer.
[0035] The target detection module is used to perform target detection on the first feature map using a preset target detection model to obtain five target feature maps of different sizes. The target detection model is an improved model based on the Yolov5 model and includes a CA attention module. The module performs target classification and coordinate localization on the five target feature maps of different sizes to obtain target detection results.
[0036] Optionally, the target detection module includes:
[0037] The backbone network module is used to perform multiple size compressions and feature extractions on the first feature map to obtain multiple backbone feature maps of different sizes.
[0038] The head network module is used to receive the first feature map and the multiple backbone feature maps of different sizes to obtain the five target feature maps of different sizes.
[0039] Optionally, the target detection module includes:
[0040] The detection head module is used to classify and locate the target coordinates of the five target feature maps of different sizes to obtain the target detection results.
[0041] According to a third aspect of the present invention, an electronic device is provided, including a processor and a memory, the memory storing a program executable on the processor, the program, when executed by the processor, implementing the target detection method as described in the first aspect of the present invention.
[0042] According to one embodiment of this disclosure, the present invention generates five target feature maps of different sizes and performs target detection using these five different-sized target feature maps, effectively improving the feature extraction capability for weak targets and enhancing the detection performance for weak targets. Simultaneously, a simulated primary visual cortex model is incorporated into the preprocessing stage. By simulating the perception mechanism of the brain's primary visual cortex, the model's anti-interference ability is improved. Furthermore, a CA attention module is added to the target detection model. Through spatial attention and channel attention, the efficiency of utilizing the contextual information of the feature maps is enhanced, improving the effectiveness of extracting features of interest.
[0043] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings. Attached Figure Description
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0045] Figure 1This is a flowchart of a small target detection method that incorporates an attention mechanism according to the present invention.
[0046] Figure 2 This is a schematic diagram of the rudimentary visual perception cortex model of the present invention.
[0047] Figure 3 This is a schematic diagram of a small target detection model that incorporates an attention mechanism according to the present invention.
[0048] Figure 4 This is a block diagram of a small target detection device that incorporates an attention mechanism according to the present invention.
[0049] Figure 5 This is a block diagram of the electronic device of the present invention. Detailed Implementation
[0050] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the invention.
[0051] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0052] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0053] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0054] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0055] Currently, there is no clear definition of small targets in the industry. Small targets can be defined from two perspectives: absolute scale and relative scale. For example, from an absolute scale perspective, a target area smaller than 32*32 pixels can be considered a small target. From a relative scale perspective, a target size where its length and width occupy 0.1 times the original image size is considered a small target.
[0056] like Figure 1 As shown in the figure, this embodiment of the invention introduces a small target detection method that incorporates an attention mechanism, the method including steps S1-S4.
[0057] S1: Obtain the input image.
[0058] S2: The input image is subjected to feature extraction using a preset rudimentary visual perception cortex model to obtain a first feature map; the preset rudimentary visual perception cortex model includes a VOneBlock layer, a Conv layer and a feature fusion layer.
[0059] S3: Perform target detection on the first feature map using a preset target detection model to obtain five target feature maps of different sizes; the target detection model is an improved model based on the Yolov5 model, and the target detection model includes a CA (Coordinate Attention) attention module.
[0060] S4: Perform target classification and coordinate localization on the five target feature maps of different sizes to obtain target detection results.
[0061] The input image is the image that needs to be detected. It can be an image captured by a camera, an image frame extracted from a video, or a partial image cropped from a complete image.
[0062] After acquiring the input image, it undergoes preprocessing. During preprocessing, a pre-defined model simulating the primary visual cortex is used to extract features from the input image, resulting in a first feature map. This model includes a VOneBlock layer, a Conv (convolutional) layer, and a feature fusion layer. The VOneBlock layer is a neural network layer built based on the primary visual cortex of primates, using a Gabor filter as its core component to simulate the information processing mechanism of the human visual cortex for biomimetic visual feature extraction from the input image. After feature extraction from the input image using this model, a first feature map that more closely resembles the features processed by the human brain is obtained. This model reflects the mapping relationship between the input image and the first feature map.
[0063] The object detection model in this invention is an improved version of the Yolov5 model, which includes a CA attention module. A CA attention module can be viewed as a computational unit used to enhance the expressive power of features in the network. The CA attention module can take any intermediate feature tensor as input and transform it to output features of the same size as that tensor, while also providing enhanced representation.
[0064] After obtaining the first feature map, target detection is performed on the first feature map using a pre-defined target detection model, resulting in five target feature maps of different sizes. Target classification and coordinate localization are then performed on these five target feature maps to obtain the target detection results. The target detection results contain the location and classification information of the target object in the input image, and the target detection model reflects the mapping relationship between the first feature map and the target detection results.
[0065] This invention generates five target feature maps of different sizes and uses these maps for target detection, effectively improving the feature extraction capability for small targets and enhancing detection performance for such targets. Simultaneously, a simulated primary visual cortex model is incorporated into the preprocessing stage. By mimicking the perceptual mechanism of the brain's primary visual cortex, the model's robustness against interference is improved. Furthermore, a CA attention module is added to the target detection model, enhancing the utilization efficiency of contextual information from the feature maps through spatial and channel attention, thereby improving the effectiveness of extracting features of interest.
[0066] In one embodiment of the present invention, step S2 includes S201-S203.
[0067] S201: The input image is subjected to feature extraction and size compression through the VOneBlock layer to obtain a second feature map.
[0068] S202: The input image is compressed through the Conv layer to obtain a third feature map; the size of the third feature map is the same as the size of the second feature map.
[0069] S203: The feature values of the second feature map and the third feature map are fused through the feature fusion layer to obtain the first feature map.
[0070] like Figure 2 As shown, the simulated primary visual perception cortex model in this invention includes a VOneBlock layer, a Conv layer, and a feature fusion layer, wherein the VOneBlock layer and the Conv layer are connected in parallel. The input image serves as the input to the VOneBlock layer and the Conv layer. The VOneBlock layer extracts features from the input image and compresses its size to obtain a second feature map. The Conv layer compresses the input image to obtain a third feature map, and the second and third feature maps have the same size. The second and third feature maps serve as the input to the feature fusion layer, which fuses the feature values of the second and third feature maps, finally outputting a first feature map.
[0071] For example, if the input image size is 640*640, after feature extraction and size compression in the VOneBlock layer, the resulting second feature map has a size of 320*320, which is half the size of the input image. After size compression in the Conv layer, the resulting third feature map also has a size of 320*320, which is also half the size of the input image and the same as the second feature map. Finally, the feature fusion layer fuses the feature values of the second and third feature maps, resulting in a first feature map with a size of 320*320.
[0072] In this invention, the simulated primary visual perception cortex model simply connects the VOneBlock layer and a Conv layer in parallel, which not only makes the model simpler, but also makes the simulated primary visual perception cortex model more flexible in adjusting the feature map size compression ratio, thus improving the model's flexibility.
[0073] like Figure 3 As shown, in one embodiment of the present invention, the preset target detection model includes a backbone network 101 and a head network 102. Both the backbone network 101 and the head network 102 are provided with the CA attention module. Step S3 includes S301-S302.
[0074] S301: The first feature map is subjected to multiple size compressions and feature extractions through the backbone network to obtain multiple backbone feature maps of different sizes.
[0075] S302: Input the first feature map and the multiple backbone feature maps of different sizes into the head network to obtain the five target feature maps of different sizes.
[0076] The target detection model in this invention is an improved version of the existing Yolov5 model. The model includes a backbone network 101 and a head network 102, both of which incorporate a CA attention module. The backbone network performs multiple size compressions and feature extractions on the first feature map, resulting in multiple backbone feature maps of different sizes. The head network then receives the multiple backbone feature maps of different sizes obtained from the backbone network, along with the first feature map, and outputs five target feature maps of different sizes. Figure 3 As shown, the target detection model also includes a Detect (detection head) layer 50, which performs target classification and coordinate localization on the five target feature maps of different sizes and outputs the target detection results.
[0077] In one embodiment of the present invention, the backbone network includes a first Conv layer, a first C3 layer, a second Conv layer, a second C3 layer, a third Conv layer, a third C3 layer, a fourth Conv layer, a fourth C3 layer, and an SPP (Spatial Pyramid Pooling) layer. The CA attention module includes a CA attention layer disposed after each C3 layer in the backbone network. Figure 3 As shown, the first Conv layer mentioned above is... Figure 3 Conv layer 1, the aforementioned first C3 layer is Figure 3 In the C3 layer 2, there is a CA attention layer 3 after the C3 layer 2. The aforementioned second Conv layer is... Figure 3 Conv layer 4, the aforementioned second C3 layer is Figure 3 In the C3 layer 5, there is a CA attention layer 6 after the C3 layer 5. The aforementioned third Conv layer is... Figure 3 Conv layer 7, the aforementioned third C4 layer is Figure 3 In the C3 layer 8, there is a CA attention layer 9 after the C3 layer 8. The aforementioned fourth Conv layer is... Figure 3 Conv layer 10, the aforementioned fourth C3 layer is Figure 3 The C3 layer 12 is followed by a CA attention layer 13. Step S301 includes S3011-S3014.
[0078] S3011: The first feature map is compressed in size by the first Conv layer, and the first feature map is extracted by the first C3 layer to obtain the first backbone feature map.
[0079] S3012: Extract the features of interest from the first backbone feature map by using the CA attention layer set after the first C3 layer, compress the feature map size of the feature map output by the CA attention layer set after the first C3 layer by using the second Conv layer, and extract features from the feature map output by the second Conv layer by using the second C3 layer to obtain the second backbone feature map.
[0080] S3013: Extract the features of interest from the second backbone feature map by using the CA attention layer set after the second C3 layer, compress the feature map size of the feature map output by the CA attention layer set after the second C3 layer by the third Conv layer, and extract features from the feature map output by the third Conv layer by the third C3 layer to obtain the third backbone feature map.
[0081] S3014: The third backbone feature map is obtained by extracting features of interest from the CA attention layer set after the third C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the third C3 layer through the fourth Conv layer, fusing spatial information from the feature map output by the third Conv layer through the SPP layer, and extracting features from the feature map output by the SPP layer through the fourth C3 layer.
[0082] After obtaining the input image, the first feature map obtained through the simulated primary visual perception cortex model is half the size of the input image. This first feature map is input into the backbone network, where the first Conv layer obtains the first feature map. The first feature map is then compressed, and the output feature map from the first Conv layer is one-quarter the size of the input image. This output feature map is then fed into the first C3 layer for feature extraction, and the first C3 layer outputs the first backbone feature map. The CA attention layer 3 extracts features of interest from the first backbone feature map. The second Conv layer compresses the feature map output from the CA attention layer 3 and inputs it into the second C3 layer for feature extraction, resulting in a second backbone feature map. The CA attention layer 6 extracts features of interest from the second backbone feature map. The third Conv layer compresses the feature map output from the CA attention layer 6 and inputs it into the third C3 layer for feature extraction, ultimately outputting the third backbone feature map. CA attention layer 9 extracts features of interest from the third backbone feature map. The fourth Conv layer compresses the size of the feature map output by CA attention layer 9. The feature map output by the fourth Conv layer is input into the SPP layer for spatial information fusion. The feature map output by the SPP layer is input into the fourth C3 layer for feature extraction. The fourth C3 layer outputs the fourth backbone feature map.
[0083] For example, if the input image size is 640*640, the simulated primary visual perception cortex model will compress the input image, resulting in a first feature map that is half the size of the input image, with a size of 320*320. The first feature map is then compressed four times through a backbone network, with feature extraction performed after each compression to obtain a backbone feature map. After the first compression and feature extraction process through the first Conv layer and the first C3 layer, a first backbone feature map with a size of 160*160 is obtained, which is one-quarter the size of the input image. After the second compression and feature extraction process through the second Conv layer and the second C3 layer, a second backbone feature map with a size of 80*80 is obtained, which is one-eighth the size of the input image. After the third compression and feature extraction process through the third Conv layer and the third C3 layer, a third backbone feature map with a size of 40*40 is obtained, which is one-tenth the size of the input image. After the fourth size compression and feature extraction process through the fourth Conv layer, SPP layer and the fourth C3 layer, a fourth backbone feature map with a size of 20*20 is obtained. The size of the fourth backbone feature map is 1 / 32 of the input image size.
[0084] like Figure 3 As shown, in one embodiment of the present invention, the head network includes four cascaded FPN modules and four feature aggregation modules. Each FPN module includes a Conv layer, an Upsample layer, a Concat layer, and a C3 (CSP Bottleneck with 3 convolutions) layer connected in sequence. The CA attention module includes a CA attention layer disposed after the C3 layer of the FPN module and a CA attention layer disposed after each feature aggregation module. Step S302 includes:
[0085] S3021: The four FPN modules and the CA attention layer set after the C3 layer of each FPN module generate a first target feature map based on the multiple backbone feature maps of different sizes and the first feature map.
[0086] S3022: Input the first target feature map, the first backbone feature map, and the feature map output by the Conv layer of the first FPN module into the first feature aggregation module. The first feature aggregation module performs size compression and channel aggregation on the input multiple feature maps. The CA attention layer set after the first feature aggregation module extracts the features of interest from the feature map output by the first feature aggregation module to obtain the second target feature map.
[0087] S3023: Input the second target feature map, the second backbone feature map, and the feature map output by the Conv layer of the second FPN module into the second feature aggregation module. The second feature aggregation module performs size compression and channel aggregation on the input multiple feature maps. The CA attention layer set after the second feature aggregation module extracts the features of interest from the feature map output by the second feature aggregation module to obtain the third target feature map.
[0088] S3024: Input the third target feature map, the third backbone feature map, and the feature map output by the Conv layer of the third FPN module into the third feature aggregation module. The third feature aggregation module performs size compression and channel aggregation on the input multiple feature maps. The CA attention layer set after the third feature aggregation module extracts the features of interest from the feature map output by the third feature aggregation module to obtain the fourth target feature map.
[0089] S3025: The fourth target feature map, the fourth backbone feature map, and the feature map output by the Conv layer of the fourth FPN module are input into the fourth feature aggregation module. The fourth feature aggregation module performs size compression and channel aggregation on the input multiple feature maps. The CA attention layer set after the fourth feature aggregation module extracts the features of interest from the feature map output by the fourth feature aggregation module to obtain the fifth target feature map.
[0090] The Conv, Upsample, Concat, and C3 layers in the FPN module are consistent with the existing Yolov5 model. The Conv layer is a basic convolutional unit that performs two-dimensional convolution, regularization, and activation operations on the input in sequence. The C3 layer consists of several Bottleneck modules. Bottleneck is a classic residual structure where the input is added to the original value after passing through two convolutional layers, completing the residual feature transfer without increasing the output depth.
[0091] After the first feature map is input into the backbone network, the backbone network outputs four backbone feature maps of different sizes: the first backbone feature map, the second backbone feature map, the third backbone feature map, and the fourth backbone feature map. Five target feature maps of different sizes are also output: the first target feature map, the second target feature map, the third target feature map, the fourth target feature map, and the fifth target feature map. Four feature aggregation modules are also output: the first feature aggregation module, the second feature aggregation module, the third feature aggregation module, and the fourth feature aggregation module. Each aggregation module contains one Conv layer, one Concat layer, and one C3 layer. (The rest of the text appears to be a separate, unrelated sentence fragment.) Figure 3As shown, the first feature aggregation module includes Conv layer 34, Concat layer 35, and C3 layer 36; the second feature aggregation module includes Conv layer 38, Concat layer 39, and C3 layer 40; the third feature aggregation module includes Conv layer 42, Concat layer 43, and C3 layer 44; and the fourth feature aggregation module includes Conv layer 46, Concat layer 47, and C3 layer 48. The CA attention module includes CA attention layer 37 located after C3 layer 36 in the first feature aggregation module, CA attention layer 41 located after C3 layer 40 in the second feature aggregation module, CA attention layer 45 located after C3 layer 44 in the third feature aggregation module, and CA attention layer 49 located after C3 layer 48 in the fourth feature aggregation module.
[0092] In this invention, the four FPN modules are designated as a first FPN module, a second FPN module, a third FPN module, and a fourth FPN module, which are connected in series. For example... Figure 3 As shown, the first FPN module includes Conv layer 29, Upsample layer 30, Concat layer 31, and C3 layer 32; the second FPN module includes Conv layer 24, Upsample layer 25, Concat layer 26, and C3 layer 27; the third FPN module includes Conv layer 19, Upsample layer 20, Concat layer 21, and C3 layer 22; and the fourth FPN module includes Conv layer 14, Upsample layer 15, Concat layer 16, and C3 layer 17. Figure 3 As shown, the CA attention module includes a CA attention layer 33 located after the C3 layer 32 of the first FPN module, a CA attention layer 28 located after the C3 layer 27 of the second FPN module, a CA attention layer 23 located after the C3 layer 22 of the third FPN module, a CA attention layer 18 located after the C3 layer 17 of the fourth FPN module, and a CA attention layer 13 located before the Conv layer 14 of the fourth FPN module.
[0093] The output of the fourth FPN module is processed by CA attention layer 18 and then used as the input of the third FPN module. The output of the third FPN module is processed by CA attention layer 23 and then used as the input of the second FPN module. The output of the second FPN module is processed by CA attention layer 28 and then used as the input of the first FPN module. Simultaneously, the fourth FPN module receives the third backbone feature map, which, after processing by CA attention layer 13, is also used as its input. The third FPN module also receives the second backbone feature map as input, the second FPN module also receives the first backbone feature map as input, and the first FPN module also receives the first feature map as input. Finally, the feature map output by the first FPN module is processed by CA attention layer 33 to output the first target feature map.
[0094] After obtaining the first target feature map, the first target feature map, the first backbone feature map, and the feature map output by the Conv layer of the first FPN module are input into the first feature aggregation module. The Conv layer in the first feature aggregation module compresses the size of the first target feature map. The Concat layer in the first feature aggregation module performs channel aggregation on the feature map output by the Conv layer, the first backbone feature map, and the feature map output by the Conv layer of the first feature aggregation module. The C3 layer in the first feature aggregation module extracts features from the feature map output by the Concat layer. The feature map output by the C3 layer in the first feature aggregation module is input into the CA attention layer 37, and the CA attention layer 37 outputs the second target feature map.
[0095] After obtaining the second target feature map, the second target feature map, the second backbone feature map, and the feature map output by the Conv layer of the second FPN module are input into the second feature aggregation module. The Conv layer in the second feature aggregation module compresses the size of the second target feature map. The Concat layer in the second feature aggregation module performs channel aggregation on the feature map output by the Conv layer, the second backbone feature map, and the feature map output by the Conv layer of the second feature aggregation module. The C3 layer in the second feature aggregation module extracts features from the feature map output by the Concat layer. The feature map output by the C3 layer of the second feature aggregation module is input into the CA attention layer 41, and the CA attention layer 41 outputs the third target feature map.
[0096] After obtaining the third target feature map, the third target feature map, the third backbone feature map, and the feature map output by the Conv layer of the third FPN module are input into the third feature aggregation module. The Conv layer in the third feature aggregation module compresses the size of the third target feature map. The Concat layer in the third feature aggregation module performs channel aggregation on the feature map output by the Conv layer, the third backbone feature map, and the feature map output by the Conv layer of the third feature aggregation module. The C3 layer in the third feature aggregation module extracts features from the feature map output by the Concat layer. The feature map output by the C3 layer in the third feature aggregation module is input into the CA attention layer 45, and the CA attention layer 45 outputs the fourth target feature map.
[0097] After obtaining the fourth target feature map, the fourth target feature map, the fourth backbone feature map, and the feature map output from the Conv layer of the fourth FPN module are input into the fourth feature aggregation module. The Conv layer in the fourth feature aggregation module performs size compression on the fourth target feature map. The Concat layer in the fourth feature aggregation module performs channel aggregation on the feature map output from the Conv layer, the fourth backbone feature map, and the feature map output from the Conv layer of the fourth feature aggregation module. The C3 layer in the fourth feature aggregation module extracts features from the feature map output from the Concat layer. The feature map output from the C3 layer in the fourth feature aggregation module is input into the CA attention layer 49, and the CA attention layer 49 outputs the fifth target feature map.
[0098] In one example, the input image size is 640*640. The first feature map obtained after passing through the simulated primary visual perception cortex model has a size of 320*320, and the first target feature map output by the first FPN module also has a size of 320*320. After inputting the first feature map into the backbone network, we obtain a first backbone feature map with a size of 160*160, a second backbone feature map with a size of 80*80, a third backbone feature map with a size of 40*40, and a fourth backbone feature map with a size of 20*20. Finally, the size of the first target feature map is the same as that of the first backbone feature map, which is 320*320; the size of the second target feature map is the same as that of the first backbone feature map, which is 160*160; the size of the third target feature map is the same as that of the second backbone feature map, which is 80*80; the size of the fourth target feature map is the same as that of the third backbone feature map, which is 40*40; and the size of the fifth target feature map is the same as that of the fourth backbone feature map, which is 20*20.
[0099] In one embodiment of the present invention, step S3021 includes: inputting the fourth backbone feature map and the third backbone feature map into the fourth FPN module to obtain the output feature map of the fourth FPN module;
[0100] The CA attention layer, which is set after the C3 layer of the fourth FPN module, is used to extract the features of interest from the feature map output by the fourth FPN module. The feature map output by the CA attention layer, which is set after the C3 layer of the fourth FPN module, and the second backbone feature map are input into the third FPN module to obtain the output feature map of the third FPN module.
[0101] The CA attention layer, which is set after the C3 layer of the third FPN module, is used to extract the features of interest from the feature map output by the third FPN module. The feature map output by the CA attention layer, which is set after the C3 layer of the third FPN module, and the first backbone feature map are input into the second FPN module to obtain the output feature map of the second FPN module.
[0102] The CA attention layer, located after the C3 layer of the second FPN module, is used to extract the features of interest from the feature map output by the second FPN module. The feature map output by the CA attention layer, located after the C3 layer of the second FPN module, and the first feature map are input into the first FPN module. The CA attention layer, located after the C3 layer of the first FPN module, is used to extract the features of interest from the feature map output by the first FPN module to obtain the first target feature map.
[0103] like Figure 3 As shown, the fourth backbone feature map is input into the CA attention layer 13, which extracts features of interest from it. The feature map output by the CA attention layer 13 is then input into the Conv layer of the fourth FPN module, while the third backbone feature map is input into the Concat layer of the fourth FPN module. The Conv layer of the fourth FPN module performs channel compression on the feature map output by the CA attention layer 13. The Upsample layer of the fourth FPN module then expands the size of the feature map output by the Conv layer, ensuring that the size of the feature map output by the Upsample layer is the same as that of the third backbone feature map. The Concat layer of the fourth FPN module performs channel aggregation on the feature map output by the third backbone feature map and the Upsample layer. The C3 layer of the fourth FPN module extracts features from the feature map output by the Concat layer, and the feature map output by the C3 layer is the final feature map output by the fourth FPN module.
[0104] The feature map output from the fourth FPN module is input into the CA attention layer 18. The CA attention layer 18 extracts the features of interest from the feature map output from the fourth FPN module. The feature map output from the CA attention layer 18 is then input into the Conv layer of the third FPN module, and the second backbone feature map is input into the Concat layer of the third FPN module. The Conv layer of the third FPN module performs channel compression on the feature map output from the CA attention layer 18. The Upsample layer of the third FPN module expands the size of the feature map output from the Conv layer of the third FPN module, and the size of the feature map output from the Upsample layer of the third FPN module is the same as the size of the second backbone feature map. The Concat layer of the third FPN module performs channel aggregation on the feature map output from the second backbone feature map and the Upsample layer of the third FPN module. The C3 layer of the third FPN module extracts features from the feature map output from the Concat layer of the third FPN module, and the feature map output from the C3 layer of the third FPN module is the feature map output from the third FPN module.
[0105] The feature map output by the third FPN module is input to the CA attention layer 23. The CA attention layer 23 extracts the features of interest from the feature map output by the third FPN module. The feature map output by the CA attention layer 23 is then input to the Conv layer of the second FPN module, and the first backbone feature map is input to the Concat layer of the second FPN module. The Conv layer of the second FPN module performs channel compression on the feature map output by the CA attention layer 23. The Upsample layer of the second FPN module expands the size of the feature map output by the Conv layer of the second FPN module, and the size of the feature map output by the Upsample layer of the second FPN module is the same as the size of the first backbone feature map. The Concat layer of the second FPN module performs channel aggregation on the feature map output by the first backbone feature map and the Upsample layer of the second FPN module. The C3 layer of the second FPN module extracts features from the feature map output by the Concat layer of the second FPN module, and the feature map output by the C3 layer of the second FPN module is the feature map output by the second FPN module.
[0106] The feature map output by the second FPN module is input into the CA attention layer 28. The CA attention layer 28 extracts the features of interest from the feature map output by the third FPN module. The feature map output by the CA attention layer 28 is then input into the Conv layer of the first FPN module, and the first feature map is input into the Concat layer of the first FPN module. The Conv layer of the first FPN module performs channel compression on the feature map output by the CA attention layer 28. The Upsample layer of the first FPN module expands the size of the feature map output by the Conv layer of the first FPN module, and the size of the feature map output by the Upsample layer of the first FPN module is the same as the size of the first feature map. The Concat layer of the first FPN module performs channel aggregation on the first feature map and the feature map output by the Upsample layer of the first FPN module. The C3 layer of the first FPN module extracts features from the feature map output by the Concat layer of the first FPN module. The feature map output by the C3 layer of the first FPN module is then input into the CA attention layer 33, and the CA attention layer 33 outputs the first target feature map.
[0107] like Figure 4 As shown, this embodiment of the invention introduces a small target detection device that incorporates an attention mechanism, namely... Figure 4 The target detection device 200 shown is used to implement the small target detection method with an attention mechanism as described in any embodiment of the present invention. The target detection device 200 includes:
[0108] Image acquisition module 201 is used to acquire input images;
[0109] The preprocessing module 202 is used to extract features from the input image using a preset rudimentary visual perception cortex model to obtain a first feature map; the preset rudimentary visual perception cortex model includes a VOneBlock layer, a Conv layer and a feature fusion layer.
[0110] The target detection module 203 is used to perform target detection on the first feature map using a preset target detection model to obtain five target feature maps of different sizes. The target detection model is an improved model based on the Yolov5 model and includes a CA attention module. The module performs target classification and coordinate localization on the five target feature maps of different sizes to obtain target detection results.
[0111] This invention generates five target feature maps of different sizes and uses these maps for target detection, effectively improving the feature extraction capability for small targets and enhancing detection performance for such targets. Simultaneously, a simulated primary visual cortex model is incorporated into the preprocessing stage. By mimicking the perceptual mechanism of the brain's primary visual cortex, the model's robustness against interference is improved. Furthermore, a CA attention module is added to the target detection model, enhancing the utilization efficiency of contextual information from the feature maps through spatial and channel attention, thereby improving the effectiveness of extracting features of interest.
[0112] In one embodiment of the present invention, the target detection module includes:
[0113] The backbone network module is used to perform multiple size compressions and feature extractions on the first feature map to obtain multiple backbone feature maps of different sizes.
[0114] The head network module is used to receive the first feature map and the multiple backbone feature maps of different sizes to obtain the five target feature maps of different sizes.
[0115] In one embodiment of the present invention, the target detection module includes a detection head module, which is used to classify and locate the target coordinates of the five target feature maps of different sizes to obtain target detection results.
[0116] like Figure 5 As shown in the figure, an embodiment of the present invention introduces an electronic device 300, including a processor 301 and a memory 302. The memory 302 stores a program that can run on the processor 301. When the program is executed by the processor 301, it implements the target detection method as described in any embodiment of the present invention.
[0117] This invention also introduces a computer-readable storage medium storing a computer program that, when executed, implements the target detection method as described in any embodiment of this invention.
[0118] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0119] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0120] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0121] The computer program instructions for performing the operation of the present invention can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The computer readable program instructions can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), is personalized by utilizing the state information of the computer readable program instructions, and the electronic circuit can execute the computer readable program instructions, thereby realizing various aspects of the present invention.
[0122] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0123] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0124] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0125] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of an instruction, and the module, program segment or part of the instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
[0126] While various embodiments of the present invention have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.
Claims
1. A small target detection method incorporating an attention mechanism, characterized in that, The method includes: Obtain the input image; The input image is subjected to feature extraction using a pre-defined rudimentary visual perception cortex model to obtain a first feature map; the pre-defined rudimentary visual perception cortex model includes a VOneBlock layer, a Conv layer, and a feature fusion layer. The first feature map is subjected to target detection using a preset target detection model to obtain five target feature maps of different sizes; the target detection model is an improved model based on the Yolov5 model, and the target detection model includes a CA attention module; Target classification and coordinate localization are performed on the five target feature maps of different sizes to obtain target detection results. The preset target detection model includes a backbone network and a head network, both of which contain the CA attention module. The preset target detection model is used to perform target detection on the first feature map, resulting in five target feature maps of different sizes, including: The first feature map is subjected to multiple size compressions and feature extractions through the backbone network to obtain multiple backbone feature maps of different sizes. The first feature map and the multiple backbone feature maps of different sizes are input into the head network to obtain the five target feature maps of different sizes. The backbone network includes a first Conv layer, a first C3 layer, a second Conv layer, a second C3 layer, a third Conv layer, a third C3 layer, a fourth Conv layer, a fourth C3 layer, and an SPP layer. The CA attention module includes a CA attention layer placed after each C3 layer in the backbone network. The process of performing multiple feature map size compressions and feature extractions on the first feature map through the backbone network to obtain multiple backbone feature maps of different sizes includes: The first feature map is compressed by the first Conv layer, and the first feature map is extracted by the first C3 layer to obtain the first backbone feature map. The first backbone feature map is obtained by extracting features of interest from the first backbone feature map through a CA attention layer set after the first C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the first C3 layer through the second Conv layer, and extracting features from the feature map output by the second Conv layer through the second C3 layer. The second backbone feature map is obtained by extracting features of interest from the second backbone feature map through a CA attention layer set after the second C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the second C3 layer through the third Conv layer, and extracting features from the feature map output by the third Conv layer through the third C3 layer. The third backbone feature map is obtained by extracting features of interest from the third backbone feature map through a CA attention layer set after the third C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the third C3 layer through the fourth Conv layer, fusing spatial information from the feature map output by the third Conv layer through the SPP layer, and extracting features from the feature map output by the SPP layer through the fourth C3 layer.
2. The method according to claim 1, characterized in that, The head network includes four cascaded FPN modules and four feature aggregation modules. Each FPN module includes a Conv layer, an Upsample layer, a Concat layer, and a C3 layer connected in sequence. The CA attention module includes a CA attention layer placed after the C3 layer of the FPN module and a CA attention layer placed after each feature aggregation module. The process of inputting the first feature map and the multiple backbone feature maps of different sizes into the head network to obtain the five target feature maps of different sizes includes: The four FPN modules and the CA attention layer set after the C3 layer of each FPN module generate a first target feature map based on the multiple backbone feature maps of different sizes and the first feature map. The first target feature map, the first backbone feature map, and the feature map output by the Conv layer of the first FPN module are input into the first feature aggregation module. The first feature aggregation module performs size compression and channel aggregation on the input multiple feature maps. The CA attention layer set after the first feature aggregation module extracts the features of interest from the feature map output by the first feature aggregation module to obtain the second target feature map. The second target feature map, the second backbone feature map, and the feature map output by the Conv layer of the second FPN module are input into the second feature aggregation module. The second feature aggregation module performs size compression and channel aggregation on the multiple input feature maps. The CA attention layer set after the second feature aggregation module extracts the features of interest from the feature map output by the second feature aggregation module to obtain the third target feature map. The third target feature map, the third backbone feature map, and the feature map output by the Conv layer of the third FPN module are input into the third feature aggregation module. The third feature aggregation module performs size compression and channel aggregation on the multiple input feature maps. The CA attention layer set after the third feature aggregation module extracts the features of interest from the feature map output by the third feature aggregation module to obtain the fourth target feature map. The fourth target feature map, the fourth backbone feature map, and the feature map output from the Conv layer of the fourth FPN module are input into the fourth feature aggregation module. The fourth feature aggregation module performs size compression and channel aggregation on the input multiple feature maps. The CA attention layer set after the fourth feature aggregation module extracts the features of interest from the feature map output by the fourth feature aggregation module to obtain the fifth target feature map.
3. The method according to claim 2, characterized in that, The four FPN modules and the CA attention layer set after the C3 layer of each FPN module generate a first target feature map based on the multiple feature maps of different sizes and the first feature map, including: The fourth backbone feature map and the third backbone feature map are input into the fourth FPN module to obtain the output feature map of the fourth FPN module; The CA attention layer, which is set after the C3 layer of the fourth FPN module, is used to extract the features of interest from the feature map output by the fourth FPN module. The feature map output by the CA attention layer, which is set after the C3 layer of the fourth FPN module, and the second backbone feature map are input into the third FPN module to obtain the output feature map of the third FPN module. The CA attention layer, which is set after the C3 layer of the third FPN module, is used to extract the features of interest from the feature map output by the third FPN module. The feature map output by the CA attention layer, which is set after the C3 layer of the third FPN module, and the first backbone feature map are input into the second FPN module to obtain the output feature map of the second FPN module. The CA attention layer, located after the C3 layer of the second FPN module, is used to extract the features of interest from the feature map output by the second FPN module. The feature map output by the CA attention layer, located after the C3 layer of the second FPN module, and the first feature map are input into the first FPN module. The CA attention layer, located after the C3 layer of the first FPN module, is used to extract the features of interest from the feature map output by the first FPN module to obtain the first target feature map.
4. The method according to claim 1, characterized in that, The step of extracting features from the input image using a preset simulated primary visual perception cortex model to obtain a first feature map includes: The input image is subjected to feature extraction and size compression through the VOneBlock layer to obtain a second feature map. The input image is compressed using the Conv layer to obtain a third feature map; the size of the third feature map is the same as the size of the second feature map. The first feature map is obtained by fusing the feature values of the second feature map and the third feature map through the feature fusion layer.
5. A small target detection device incorporating an attention mechanism, characterized in that, The device includes: The image acquisition module is used to acquire the input image; The preprocessing module is used to extract features from the input image using a preset rudimentary visual perception cortex model to obtain a first feature map; the preset rudimentary visual perception cortex model includes a VOneBlock layer, a Conv layer, and a feature fusion layer. The object detection module is used to perform object detection on the first feature map using a preset object detection model, resulting in five object feature maps of different sizes. The object detection model is an improved version of the Yolov5 model and includes a CA attention module. The module then performs object classification and coordinate localization on the five different-sized object feature maps to obtain the object detection results. The preset target detection model includes a backbone network and a head network, both of which incorporate the CA attention module. The target detection module includes: The backbone network module is used to perform multiple size compressions and feature extractions on the first feature map to obtain multiple backbone feature maps of different sizes. The head network module is used to receive the first feature map and the plurality of backbone feature maps of different sizes to obtain the five target feature maps of different sizes. The backbone network includes a first Conv layer, a first C3 layer, a second Conv layer, a second C3 layer, a third Conv layer, a third C3 layer, a fourth Conv layer, a fourth C3 layer, and an SPP layer. The CA attention module includes a CA attention layer located after each C3 layer in the backbone network. The backbone network module is specifically used for: The first feature map is compressed by the first Conv layer, and the first feature map is extracted by the first C3 layer to obtain the first backbone feature map. The first backbone feature map is obtained by extracting features of interest from the first backbone feature map through a CA attention layer set after the first C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the first C3 layer through the second Conv layer, and extracting features from the feature map output by the second Conv layer through the second C3 layer. The second backbone feature map is obtained by extracting features of interest from the second backbone feature map through a CA attention layer set after the second C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the second C3 layer through the third Conv layer, and extracting features from the feature map output by the third Conv layer through the third C3 layer. The third backbone feature map is obtained by extracting features of interest from the third backbone feature map through a CA attention layer set after the third C3 layer, compressing the feature map size of the feature map output by the CA attention layer set after the third C3 layer through the fourth Conv layer, fusing spatial information from the feature map output by the third Conv layer through the SPP layer, and extracting features from the feature map output by the SPP layer through the fourth C3 layer.
6. The apparatus according to claim 5, characterized in that, The target detection module includes: The detection head module is used to classify and locate the target coordinates of the five target feature maps of different sizes to obtain the target detection results.
7. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program that can run on the processor, the program being executed by the processor to implement the target detection method as described in any one of claims 1-4.
Citation Information
Patent Citations
Primary visual cortex imitating target detection method and device and equipment
CN113591843A