A small target detection method based on multi-layer attention fusion
By introducing a multi-layer attention fusion module into the target detection algorithm, the problem of insufficient small target detection performance is solved. By fusing attention weights across layers and multiple scales, the performance and prediction ability of small target detection are significantly improved, achieving more accurate detection. detection effect.
Patent Information
- Application Number
- CN202410740827.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing target detection algorithms have insufficient performance in small target detection, especially due to problems such as small target size, few features, and severe masking, which make it difficult to effectively identify and locate small targets.
A small target detection method based on multi-layer attention fusion is adopted. By constructing a convolutional neural network and a multi-layer attention fusion module, spatial position information is used to extract feature maps of different scales across multiple layers, generate attention weights, and conduct cross-layer Multi-scale fusion enhances the network's attention to small targets.
The performance and prediction ability of the model are improved, and the model parameters are optimized through multiple rounds of iterative training, which significantly improves the average precision and recall rate of small target detection and achieves more accurate and targeted prediction results.
Smart Images

Figure CN118314335B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image recognition, relates to a target detection algorithm, and in particular to a small target detection method based on multi-layer attention fusion. Background Art
[0002] In the field of image recognition, the main purpose of target detection is to quickly and accurately identify and locate targets of predefined categories in images. With the continuous development of deep learning technology, target detection algorithms have achieved good results in medium and large targets, but due to the small size, few features, and severe occlusion of small targets, the detection performance still needs to be further improved.
[0003] Currently, there are two types of small target definitions: one is absolute size definition, which defines small targets based on the absolute pixel size of the target. Taking the object definition of COCO, a commonly used dataset in the field of object detection, as an example, objects in the figure with a size smaller than 32×32 pixels are absolutely small targets. The other is relative size definition, which defines small targets based on the relative comparison between the target and the image. Target objects that are smaller than 10% of the image size or even smaller are relatively small targets.
[0004] The current target detection algorithms mainly include the classic two-stage method, such as SNIP, DetNe, the single-stage method SSD and the YOLO series of algorithms; Guo et al. proposed a new feature pyramid architecture AugFPN, and Gong et al. proposed a new concept "fusion factor" to control the amount of information transferred from deep layers to shallow layers. Bai et al. proposed a generative adversarial network to improve image resolution to obtain better small target detection performance; Junhyug Noh et al. proposed super-resolution feature maps to improve performance; Sean Bell et al. proposed an inner and outer network that uses a spatial recurrent neural network to integrate contextual information outside the region of interest. Summary of the invention
[0005] The technical problem solved by the present invention is to provide a small target detection method based on multi-layer attention fusion, which uses feature maps of different scales to extract attention weights respectively, and performs cross-layer multi-scale fusion to improve the performance of target detection network in detecting small targets.
[0006] The present invention is achieved through the following technical solutions:
[0007] A small target detection method based on multi-layer attention fusion includes the following operations:
[0008] 1) Construct a convolutional neural network consisting of a backbone network, a neck network, and a detection head, and combine it with a multi-layer attention fusion module to form a model; the backbone network reduces the dimension of the input image, captures features in the image including texture features, edge features, and color features, and outputs multi-scale feature maps;
[0009] The multi-layer attention fusion module uses spatial position information to extract feature maps of different scales across multiple layers, extracts attention weights respectively, and extracts the positioning information of the target to be detected; then these feature maps are upsampled to feature maps of the maximum size, and then a maximum pooling operation is performed to achieve fusion to obtain an attention weight map; the attention weight map is multiplied by the feature map that needs to pass the attention to obtain an output feature map that fuses multiple layers of attention;
[0010] The neck network adopts a feature pyramid structure to fuse feature maps of different scales extracted from different network depths and output feature maps fused with multiple layers of attention, and outputs the fusion result to the detection head;
[0011] The detection head outputs target detection result information, generates a bounding box and confidence information to determine the small targets present in the image;
[0012] 2) The model is trained with an image dataset containing small objects as input, the small objects are identified, and a bounding box is generated for each object for annotation. The annotation information includes category information, confidence level, and location.
[0013] 3) Evaluate the performance of the model based on the generated bounding boxes and optimize the model through multiple rounds of iterative training;
[0014] In each iteration, the training data is input into the model, and the loss function is calculated based on the comparison between the generated bounding box and the real annotation. Then, the loss signal is passed back to the model from the output layer through the back propagation algorithm to update the model parameters.
[0015] Repeat multiple rounds of iterative training to gradually reduce the value of the loss function, improve the average precision and recall rate, and obtain the optimized model;
[0016] 4) Use the optimized model to detect small targets in the image.
[0017] In the convolutional neural network, three detection heads of different scales are set with three scale feature maps of 160×160, 80×80, and 40×40 respectively to perform target detection.
[0018] The multi-layer attention fusion module extracts the attention weight as:
[0019] The input feature map is average pooled along the width and height directions to obtain two one-dimensional feature maps, which are fully connected and then deconvolved. After a convolution operation, each map is activated by the sigmoid activation function to obtain the attention weight.
[0020] Furthermore, three feature maps of different scales are used to generate different attention weights, and the attention weight feature map is obtained after scale transformation and pooling fusion; then it is multiplied with the feature map that needs to pass the attention to obtain the output feature map after fusing multiple layers of attention.
[0021] Furthermore, the attention weights for the feature map of size C×H×W are extracted as:
[0022] The feature map is averagely pooled along the width and height directions to obtain two one-dimensional feature maps with sizes of C×H×1 and C×1×W respectively;
[0023] The generated feature map is then fully connected and a 3×3 convolution kernel is used to perform a two-dimensional convolution operation to generate a feature map ;in, f represents the feature map matrix, r Indicates the downsampling ratio; C , H , W They are the number of channels, the height of the input feature map, and the width of the input feature map. R represents that the feature map is composed of real numbers.
[0024] The feature map After normalization, the full connection is removed, and a two-dimensional convolution is performed through a 3×3 convolution kernel to split the feature map into feature maps along the H direction. And the feature map along the W direction ; Use the sigmoid activation function to activate and get the final attention weight and ;
[0025] Apply this attention to the input feature map The feature map obtained by attention :
[0026] ;
[0027] in represents the attention weight obtained along the high direction, Represents the attention weight along the width direction.
[0028] The training set and test set of the model are both a data set of small flying bird targets under natural light; the data set contains dense and small-sized images of small flying bird targets under natural light.
[0029] Compared with the prior art, the present invention has the following beneficial technical effects:
[0030] The small target detection method based on multi-layer attention fusion provided by the present invention adds a multi-layer attention fusion module, which can help the model better learn the important features in the input data and selectively integrate these features into the final prediction results; by extracting multi-scale attention from multi-layer features in the network and fusing them, a cross-layer, multi-scale attention fusion scheme is implemented, and the attention mechanism is used to dynamically adjust the weights of different features. For different features, the attention mechanism will give multiple groups of different weights to distinguish which type of features is more efficient for network learning. By continuously adjusting the weights to obtain the best allocation method, the network's attention to small targets is further enhanced.
[0031] The present invention successfully improves the performance and prediction ability of the model by introducing a multi-layer attention fusion module, and has a wider application prospect in practical applications; the small target detection method based on multi-layer attention fusion provided by the present invention, after 100 iterative trainings, the MAP value of the model of the present invention on the training set is 0.249, while the MAP value of the model without the multi-layer attention fusion module is 0.144. This shows that the model of the present invention has stronger expression and generalization capabilities when processing complex data, and can better capture key information in the data for prediction. The high MAP value of the present invention shows that it can better understand the semantics of the input data, thereby producing more targeted and accurate prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of the process of building and training a neural network of the present invention;
[0033] Figure 2 Schematic diagram of the multi-layer attention fusion mechanism of the present invention;
[0034] Figure 3 Schematic diagram of the calculation method of attention weight;
[0035] Figure 4 Schematic diagram for generating feature maps through multi-layer fusion attention;
[0036] Figure 5 Schematic diagram of the prediction box of the output result;
[0037] Figure 6 Output of the neural network result without the introduction of the attention mechanism;
[0038] Figure 7 It is the output of the neural network result of multi-layer attention fusion. DETAILED DESCRIPTION
[0039] The present invention is further described in detail below in conjunction with the embodiments, which are intended to explain the present invention rather than to limit it.
[0040] A small target detection method based on multi-layer attention fusion includes the following operations:
[0041] 1) Construct a convolutional neural network consisting of a backbone network, a neck network, and a detection head, and combine it with a multi-layer attention fusion module to form a model; the backbone network reduces the dimension of the input image, captures features in the image including texture features, edge features, and color features, and outputs multi-scale feature maps;
[0042] The multi-layer attention fusion module uses spatial position information to extract feature maps of different scales across multiple layers, extracts attention weights respectively, and extracts the positioning information of the target to be detected; then these feature maps are upsampled to feature maps of the maximum size, and then a maximum pooling operation is performed to achieve fusion to obtain an attention weight map; the attention weight map is multiplied by the feature map that needs to pass the attention to obtain an output feature map that fuses multiple layers of attention;
[0043] The neck network adopts a feature pyramid structure to fuse feature maps of different scales extracted from different network depths and output feature maps fused with multiple layers of attention, and outputs the fusion result to the detection head;
[0044] The detection head outputs target detection result information, generates a bounding box and confidence information to determine the small targets present in the image;
[0045] 2) The model is trained with an image dataset containing small objects as input, the small objects are identified, and a bounding box is generated for each object for annotation. The annotation information includes category information, confidence level, and location.
[0046] 3) Evaluate the performance of the model based on the generated bounding boxes and optimize the model through multiple rounds of iterative training;
[0047] In each iteration, the training data is input into the model, and the loss function is calculated based on the comparison between the generated bounding box and the real annotation. Then, the loss signal is passed back to the model from the output layer through the back propagation algorithm to update the model parameters.
[0048] Repeat multiple rounds of iterative training to gradually reduce the value of the loss function, improve the average precision and recall rate, and obtain the optimized model;
[0049] 4) Use the optimized model to detect small targets in the image.
[0050] Specific examples are given below.
[0051] like Figure 1 As shown, the present invention as a whole can be divided into two parts. The first part is to build a model (deep neural network); the second part is to train and identify the built model;
[0052] like Figure 1 As shown, building a model (deep neural network) can be achieved in three steps:
[0053] Step 1: Build a deep convolutional neural network framework
[0054] (1) The convolutional neural network framework consists of a backbone network, a neck network, and a detection head. The backbone network is responsible for feature extraction. It uses a deep neural network to process the input image and reduce its dimension. Through the backbone network, the neural network can capture important features in the image, such as texture features such as spots and stripes; edge features such as the position and shape of edges and corners; and color features such as color or contrast that is different from the surrounding environment.
[0055] The neck network is responsible for further processing and fusing the features extracted from the backbone network. It uses a feature pyramid structure to fuse feature maps of different scales extracted from different network depths. The feature fusion network can comprehensively utilize feature information of multiple scales to better understand the image content and improve the performance of the network.
[0056] When fusing, the method of weighted summation of different features can be adopted;
[0057] Alternatively, a cascade fusion method is used to connect features from different levels or sources together according to the channel dimension to form a larger feature vector;
[0058] Alternatively, there are various fusion methods such as projection fusion method that projects features from different sources into a common representation space and then fuses them.
[0059] Furthermore, the attention mechanism is used to dynamically adjust the weights of different features, so that the model can pay more attention to the attention weights of important features, and further refine and enhance the feature maps extracted by the backbone network to further improve the performance of the network.
[0060] The detection head is responsible for outputting the result information of the target detection, such as the location and category of the target. It generates bounding boxes and confidence information to determine the objects present in the image. Through the detection head, the neural network is able to transform features into understandable results, thereby realizing the function of target detection.
[0061] (2) Setting the parameters of the neural network
[0062] In an embodiment, the parameter settings of the neural network include the number of layers of the backbone network, the fusion method of the neck network, the design of the detection head, and the size of the input image.
[0063] Specifically, the backbone network uses a 50-layer deep convolutional neural network to extract and reduce the features of the input image. The neck network uses a feature pyramid structure to fuse feature maps of different scales from the backbone network; and three different-scale detection heads are set up with three different-scale feature maps of 160×160, 80×80, and 40×40 for target detection.
[0064] Step 2: Design a multi-scale attention fusion module
[0065] The attention mechanism is a widely used technology in the field of machine learning. It imitates the attention allocation mechanism of humans when processing information, which can help the model better understand and process input data.
[0066] The basic idea of the attention mechanism is that when processing sequence data, information at different positions may contribute differently to the final result, so different weights need to be given to information at different positions. By introducing the attention mechanism, the model can automatically learn and selectively focus on the part of the input that is relevant to the current task.
[0067] The attention mechanism is also widely used in the field of image processing, such as spatial attention, channel attention, self-attention, multi-head attention, etc. Different attention extraction weights are different. Choosing a suitable calculation method can more effectively improve the overall performance of the network.
[0068] Based on the idea of attention mechanism, when detecting small targets, in the low-resolution, large-scale feature layer, a weight is assigned to each position of the feature map to distinguish the importance of each area of the feature map, and the region of interest that is effective for small targets is obtained; then this attention weight is applied to the deep feature map, so that the network pays more attention to the area to be detected where small targets exist.
[0069] In the multi-scale detection of the present invention, feature maps of different depths and scales have different information contributions. Therefore, we need to process these feature maps separately and fuse them together to obtain more complete target information.
[0070] like Figure 2As shown in the figure, feature maps of different scales (such as 160×160, 80×80, 40×40) are extracted and the attention mechanism is performed respectively. Then they are upsampled to the feature map of the largest size (160×160), and then the maximum pooling operation is performed to achieve fusion, and the attention weight map of size 160×160×1 is obtained. The fused attention weight can act on feature maps of any depth and any size.
[0071] On this basis, the present invention uses a spatial attention method, because in a convolutional neural network, shallow, high-resolution feature maps contain more position information, and the loss of position information is less. Therefore, using spatial position information to connect across multiple layers (for example, feature maps can be taken out from the 11th, 24th and 37th layers of the backbone network to extract attention weights) can maximize the effectiveness of attention. By using spatial convolution to capture the correlation of position information in the feature map, the attention calculation method can extract the positioning information of the target to be detected; and integrate it into the attention mechanism, that is, the extracted weights are applied to the feature map used for detection; thereby making the network pay more attention to the target area and improving the accuracy and robustness of target detection.
[0072] Step 3: Extracting attention weights (attention calculation method)
[0073] The multi-layer attention fusion module extracts the attention weights as:
[0074] The input feature map is average pooled along the width direction (Y direction) and the height direction (X direction) to obtain two one-dimensional feature maps, which are fully connected and then deconvolved. After a convolution operation, each is activated by the sigmoid activation function to obtain the attention weight.
[0075] like Figure 3 As shown, the input feature map of size C×H×W is averagely pooled along the width direction (Y direction) and the height direction (X direction) to obtain two one-dimensional feature maps, generating feature maps of size C×H×1 and C×1×W;
[0076] The generated feature map of size C×1×W is fully connected with the feature map of size C×H×1, and a two-dimensional convolution operation is performed using a 3×3 convolution kernel to generate a feature map ;in, f represents the feature map matrix, r Indicates the downsampling ratio; C , H , W They are the number of channels, the height of the input feature map, and the width of the input feature map respectively. R represents that the feature map is composed of real numbers.
[0077] Then the feature map After normalization, the full connection is removed and a 3×3 convolution kernel is used for two-dimensional convolution to split the feature map into feature maps along the H direction. And the feature map along the W direction ; Use sigmoid activation to get the final attention weight and ;
[0078] Apply this attention to the input feature map The feature map obtained by attention can be obtained :
[0079] ;
[0080] in Represents the output feature map after the attention is injected, Represents the input feature map that needs to be injected with attention, represents the attention weight obtained along the high direction, Represents the attention weight along the width direction.
[0081] On this basis, the present invention uses multiple input feature maps, among which feature maps of three different scales are used to generate different attention weights. After scale transformation and pooling fusion, the attention weight feature map is obtained, which is then multiplied with the feature map that needs to pass through attention (the fourth input) to obtain the output feature map after fusing multiple layers of attention; the output feature map replaces the feature map used as input in the original network, and subsequent operations are performed sequentially.
[0082] like Figure 4 As shown, inputs 1, 2, and 3 are attention feature maps with sizes of 160×160, 80×80, and 40×40, respectively. Input 4 is the feature map that needs to pass attention. After pooling and scaling, multiplying it with input 4 can obtain the feature map that passes the multi-layer fusion attention and output it; the output feature map continues to be transmitted backward in the main network.
[0083] Train the built model and realize the recognition of small targets:
[0084] The training set and test set of this model (neural network) are both based on a dataset of small flying bird targets under natural light. This dataset contains a large number of dense and small-sized images of small flying bird targets under natural light.
[0085] The trained network can be used as a detection network specifically for small target detection. The network takes as input an image dataset containing small targets. This dataset can be self-collected and annotated data or a public dataset containing small target data. It generates a bounding box for each target and annotates it. The annotation information includes: category information, confidence, including location (upper left corner coordinates x, y and bounding box length and width h, w). The bounding box is Figure 5 shown.
[0086] For example, when the network outputs: 0, 0.53, 0.7375, 0.48515625, 0.52265625, 0.76328125; it means that at the coordinates of x=0.7375 and y=0.48515625, there is an object with a length of 0.52265625 and a width of 0.76328125, and the probability that it is class 0 is 0.53. In this way, we can use the trained network to automatically detect small objects in the image.
[0087] When using the trained network for small object detection, we can evaluate the performance of the entire invented network based on the generated bounding box. If the bounding box accurately contains the object to be detected, and its category prediction and confidence are high, it means that the model detects correctly. Conversely, if the position or category prediction of the bounding box is wrong, or the confidence is low, it means that the model cannot detect the object.
[0088] In order to optimize the performance of the model, we can perform multiple rounds of iterative training. In each round of iteration, we input the training data into the model and calculate the loss function (such as cross entropy loss) based on the comparison of the generated bounding box with the true annotation. Then, through the back propagation algorithm, the loss signal is passed from the output layer back to the parameter layer of the model to update the parameters of the model. Repeating multiple rounds of iterative training can gradually reduce the value of the loss function and improve performance indicators such as mean average precision (MAP) and recall rate. In the end, we can get an optimized model with better small object detection capabilities.
[0089] The advantage of the model of the present invention is that a multi-layer attention fusion module is added. This module can help the model better learn the important features in the input data and selectively integrate these features into the final prediction results.
[0090] After 100 iterations of training, the MAP value of the model of the present invention is 0.249 on the training set, while the MAP value of the model without the multi-layer attention fusion module is 0.144. This shows that the model of the present invention has stronger expression and generalization capabilities when processing complex data.
[0091] Figure 6This is the output of the neural network result without the introduction of the attention mechanism. Figure 7 This is the output of the neural network result of the multi-layer attention fusion of the present invention; comparing the two, it can more intuitively show that the key information in the data is better captured and used for prediction.
[0092] It is worth noting that although the two models have the same good prediction accuracy, the MAP value of the model of the present invention is higher. This is because the MAP value not only takes into account the accuracy of the prediction results, but also the ranking quality of the prediction results. In other words, the higher the MAP value, the higher the ranking of the model's prediction results among all possible results, and the closer it is to the ranking of the real results.
[0093] Therefore, the high MAP value of the model of the present invention indicates that it can better understand the semantics of the input data, thereby producing more targeted and accurate prediction results; in general, the model of the present invention successfully improves the performance and prediction ability of the model by introducing a multi-layer attention fusion module, and has broader application prospects in practical applications.
[0094] The simulation experiment process and results of the present invention are given below.
[0095] When conducting simulation experiments, we first need to initialize the parameters of the model. This includes setting the number of layers of the neural network, the number of neurons in each layer, the weight matrix and the bias vector, etc. Then, by randomly initializing these parameters, we provide a starting point for the model. Next, we input the training data into the model for forward propagation, which means passing the input data through each layer of the neural network, from the input layer to the output layer, to produce the final prediction result.
[0096] Calculation of the error between the output result and the target value.
[0097] This is measured using a loss function, such as mean squared error (MSE) or cross entropy. The loss function compares the difference between the model's output and the true target value and generates a scalar value that measures the size of the error. Next, we use the backpropagation algorithm to update the parameters of each layer in the model. The backpropagation algorithm determines the direction in which the parameters are updated in each iteration by calculating the gradient of the loss function for each parameter. By adjusting the value of the parameter in the negative direction of the gradient, we can gradually reduce the loss function value of the model.
[0098] After completing one iteration of training, we can record the loss value, recall rate, accuracy rate, and MAP value on the training set and test set respectively. These indicators can help us evaluate the performance of the model and the progress of training. Repeat the above steps for 100 iterations of training. In each iteration of training, we record and print the indicator values on the training set and test set to track the training process and performance changes of the model.
[0099] Finally, after all 100 iterations of training are completed, we save the best performing model file. This can be the model with the lowest loss value or the highest accuracy on the test set. At the same time, we record the indicator values of each iteration in a txt file for subsequent analysis and comparison of performance differences between different iterations. Through this training process, we are able to gradually optimize the parameters of the model, improve the performance of the model, and find the best model configuration.
[0100] The present invention uses a small target data set of flying birds under natural light as verification. The detection of flying birds under natural light is more accurate. It can be applied in scenes such as airports where it is necessary to detect whether there are tiny flying objects in the air. The camera can be connected to detect the feedback picture in real time.
[0101] The above embodiments are preferred examples for implementing the present invention, and the present invention is not limited to the above embodiments. Any non-essential additions and substitutions made by those skilled in the art based on the technical features of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A small target detection method based on multi-layer attention fusion, It is characterized in that The following operations are included: 1) Construct a convolutional neural network consisting of a backbone network, a neck network, and a detection head, and combine it with a multi-layer attention fusion module to form a model; the backbone network reduces the dimension of the input image, captures features in the image including texture features, edge features, and color features, and outputs multi-scale feature maps; The multi-layer attention fusion module uses spatial position information to extract feature maps of different scales across multiple layers, extracts attention weights respectively to obtain attention weight feature maps, and extracts positioning information of the target to be detected; then these obtained attention weight feature maps are upsampled to the attention weight feature maps of the maximum size, and then the maximum pooling operation is performed to achieve fusion to obtain a fused attention weight map; the fused attention weight map is multiplied with the feature map that needs to pass the attention to obtain an output feature map that fuses multiple layers of attention; The multi-layer attention fusion module extracts the attention weights as: The input feature map is average pooled along the width and height directions to obtain two one-dimensional feature maps, which are fully connected and then deconvolved. After a convolution operation, each is activated by the sigmoid activation function to obtain the attention weight; the attention weight is applied to the input feature map to obtain the attention weight feature map; The neck network adopts a feature pyramid structure to fuse feature maps of different scales extracted from different network depths and output feature maps fused with multiple layers of attention, and outputs the fusion result to the detection head; The detection head outputs target detection result information, generates a bounding box and confidence information to determine the small targets present in the image; 2) The model is trained with an image dataset containing small objects as input, the small objects are identified, and a bounding box is generated for each object for annotation. The annotation information includes category information, confidence level, and location. 3) Evaluate the performance of the model based on the generated bounding boxes and optimize the model through multiple rounds of iterative training; In each iteration, the training data is input into the model, and the loss function is calculated based on the comparison between the generated bounding box and the real annotation. Then, the loss signal is passed back to the model from the output layer through the back propagation algorithm to update the model parameters. Repeat multiple rounds of iterative training to gradually reduce the value of the loss function, improve the average precision and recall rate, and obtain the optimized model; 4) Use the optimized model to detect small targets in the image.
2. The small target detection method based on multi-layer attention fusion as claimed in claim 1, It is characterized in that In the convolutional neural network, and The three scale feature maps set up three detection heads of different scales for object detection.
3. The small target detection method based on multi-layer attention fusion as claimed in claim 1, It is characterized in that Three feature maps of three different scales are used to generate three different attention weight feature maps, which are then scaled and pooled to obtain a fused attention weight map. The fused attention weight map is then multiplied with the feature map that needs to pass attention to obtain an output feature map that combines multiple layers of attention.
4. The small target detection method based on multi-layer attention fusion as claimed in claim 1, It is characterized in that For size The attention weights of the feature map are extracted as: The feature maps are averaged and pooled along the width and height directions, and the sizes are Two one-dimensional feature maps; The generated feature map is then fully connected and used The convolution kernel performs a two-dimensional convolution operation to generate a feature map in, f represents the feature map matrix, r Indicates the downsampling ratio; C , H , W They are the number of channels, the height of the input feature map, and the width of the input feature map. R represents that the feature map is composed of real numbers. After normalization, the full connection is removed and the The convolution kernel performs two-dimensional convolution to divide the feature map into feature maps along the H direction. And the feature map along the W direction Use the sigmoid activation function to activate and get the final attention weights Apply this attention weight to the input feature map The attention weight feature map obtained by attention in represents the attention weight obtained along the high direction, Represents the attention weight along the width direction.
5. The small target detection method based on multi-layer attention fusion as claimed in claim 1, It is characterized in that The training set and test set of the model are both based on a dataset of small flying bird targets under natural light; this dataset contains dense and small-sized images of small flying bird targets under natural light.
