Two-stage small sample target detection method based on optimized CBAM attention mechanism

By introducing the optimized CBAM attention mechanism into the small sample target detection model, the problem of insufficient perception of features of different scales and overfitting of the model is solved, and the detection accuracy and robustness are improved.

CN118570603AActive Publication Date: 2024-08-30TONGJI UNIV

Patent Information

Application Number
CN202410528585.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-29
Publication Date
2024-08-30
Estimated Expiration
2044-04-29

AI Technical Summary

Technical Problem

Existing small-sample target detection models are prone to over-fitting problems and have insufficient perceptual capabilities when processing features of different scales. They cannot effectively alleviate the adverse effects of sparse target scale distribution in small-sample data sets.

Method used

The optimized CBAM attention mechanism is introduced into the feature extraction backbone network. Through the improvement of the channel attention and spatial attention parts, multi-scale convolution and pooling proportion parameters are added, and the improved attention mechanism is inserted into the key layer of the feature extraction network. CBAM module, combined with residual connections, enhances information transfer and gradient flow.

Benefits of technology

It improves the sensitivity and generalization ability of the model to features of different scales, reduces the impact of scale correlation, alleviates the over-fitting problem, and improves detection accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570603A
    Figure CN118570603A
Patent Text Reader

Abstract

The invention relates to the field of small sample target detection, in particular to a two-stage small sample target detection method based on an optimized CBAM attention mechanism, and the method comprises the following steps: training a two-stage target detection network Faster-RCNN through employing a base class data set, and obtaining a base class detection model; freezing parameters of a feature extraction backbone network in the base class detection model; a CBAM attention mechanism optimization module; placing the optimized CBAM attention module in a feature extraction backbone network, constructing a detection network, then taking a new-class small sample data set with a small amount of annotation information as input, and performing fine tuning on parameters of a detection head part of the detection network; and inputting the to-be-detected data set into the detection network to obtain a detection result. Compared with the prior art, the method has the advantages of inhibiting the influence of unimportant spatial information, improving the attention to important spatial information, enhancing the sensitivity to different scale features, having strong generalization ability and robustness and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of small sample target detection, and in particular to a two-stage small sample target detection method based on optimizing the CBAM attention mechanism. Background Art

[0002] Object detection refers to selecting any number of objects of interest in an image and identifying their categories. It is a key area of ​​computer vision. However, objects in real environments have a long-tail distribution, and samples of many categories are difficult to obtain. At the same time, labeling samples and training models require a lot of resources. Object detection based on a small number of samples is of great practical significance. In this regard, small sample object detection refers to training a base class detection model using a base class dataset with sufficient annotation information, and then using a new class dataset with only limited annotation information and the prior knowledge of the base class model to predict new class objects.

[0003] Due to the significant imbalance in the amount of data between the base class and the new class, the small sample model is prone to overfitting problems. To meet this challenge, most algorithms directly introduce the existing attention mechanism into the backbone network. This strategy fails to effectively improve the network's perception of features of different scales, and does not alleviate the adverse effects of the sparse distribution of target scales in small sample data sets. In the prior art, the Chinese patent with publication number: CN 116977716 A discloses a small sample remote sensing image target detection method. The invention directly cascades the CBAM attention mechanism module in the feature extraction backbone network, and successively passes the feature map through the channel attention and spatial attention mechanisms to alleviate the problem of difficulty in representing small targets in remote sensing images. However, the invention does not adjust the model for the small scale characteristics of the remote sensing task target, resulting in the model being not flexible enough, and the performance still has a large room for improvement. Therefore, in order to improve the network's sensitivity to features of different scales and the attention to important spatial information, the present invention provides a two-stage small sample target detection method based on optimizing the CBAM attention mechanism. Summary of the invention

[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a two-stage small sample target detection method based on optimizing the CBAM attention mechanism.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] The present invention provides a two-stage small sample target detection method based on optimizing the CBAM attention mechanism, comprising the following steps:

[0007] Step S1, use the base class data set to train the two-stage object detection network Faster-RCNN to obtain a base class detection model;

[0008] Step S2, freezing the parameters of the feature extraction backbone network in the base class detection model;

[0009] Step S3, optimizing the CBAM attention mechanism module;

[0010] Step S4: Place the optimized CBAM attention module in the feature extraction backbone network to build a detection network, and then use the new class small sample data set with a small amount of annotation information as input to fine-tune the parameters of the detection head part of the detection network;

[0011] Step S5: input the data set to be tested into the detection network to obtain the detection result.

[0012] The step S1 specifically includes:

[0013] Step S11, constructing a base class data set;

[0014] Step S12, model selection: select the two-stage object detection network Faster-RCNN as the basic model, and load the pre-trained VGG16 network as the feature extraction backbone network;

[0015] Step S13, model construction: construct a Faster-RCNN model, including a region proposal network, an object classifier, and a bounding box regressor, and set the hyperparameters of the model;

[0016] Step S14, define the loss function: select classification cross entropy loss as classification loss, select smooth L1 loss as bounding box regression loss;

[0017] Step S15, model training: input the base class data set into the model, update the model parameters through the back propagation algorithm to minimize the loss function, and dynamically adjust the hyperparameters of the model.

[0018] Furthermore, placing the optimized CBAM attention module in the feature extraction backbone network includes: placing the optimized CBAM attention mechanism module between two convolutional layers in which the number of channels in the feature extraction backbone network changes.

[0019] Furthermore, the two convolutional layers specifically include: CBAM modules with a set number of channels are inserted between the 2nd and 3rd layers, between the 5th and 6th layers, and between the 9th and 10th layers of the VGG16 network structure, and the structure of the feature extraction network is conv3-64, conv3-64, A-64, conv3-128, conv3-128, A-128, conv3-256, conv3-256, conv3-256, A-256, conv3-512, conv3-512, conv3-512, conv3-512, conv3-512, conv3-512, FC-4096, FC-4096, and FC-1000.

[0020] Freezing the feature extraction backbone network parameters includes: setting its “required_grad” attribute to “False”.

[0021] The optimizing CBAM attention mechanism module comprises: optimizing the channel attention part and the spatial attention part of the CBAM attention mechanism module, and adding a residual connection;

[0022] Step S31, in the channel attention part of the optimized CBAM attention mechanism module, group convolution is used to evenly divide the input feature map X into two groups in the channel dimension, and convolution operations are performed on each group using convolution kernels of different sizes; the two groups of input feature maps are subjected to global maximum pooling and global average pooling based on width and height respectively; and then they are respectively sent to a two-layer neural network; the output features are feature fused based on element-wise addition operations, and the two groups of feature maps are concat spliced ​​to obtain the weight of the channel attention part; the channel attention part weight and the input feature map X are element-wise multiplied to generate the input features required for the spatial attention part;

[0023] Step S32, in the optimization of the spatial attention part, firstly, the input feature map X is subjected to maximum pooling and average pooling operations based on the feature dimension; the pooling weight parameter is introduced to adjust the ratio of the maximum pooling feature and the average pooling feature; the two pooled feature maps are channel-joined based on the channel dimension to obtain a jointed feature map, and the channel dimension is reduced to 1 by convolution operation to obtain the weight of the spatial attention part; the reduced-dimensional feature map is element-wise multiplied with the input feature generated in step S31 to obtain the fused final feature X s ;

[0024] Step S33: introduce residual connection into the optimized CBAM module to merge the final feature X s Add it to the input feature map X.

[0025] Furthermore, the channel attention part weight is calculated using the following formula:

[0026] A c1 =sigmoid(MLP(AvgPool(X1))+MLP(MaxPool(X1)))

[0027] A c2 =sigmoid(MLP(AvgPool(X2))+MLP(MaxPool(X2)))

[0028] A c =concat([A c1 ,A c2 ], dim=1)

[0029] Among them, A c1 , A c2 are the weights of the two groups, A c is the weight of the channel attention part.

[0030] Furthermore, the weight of the spatial attention part is calculated using the following formula:

[0031] A s =sigmoid(conv 7×7 (concat[ωAvgPool(X),(1-ω)MaxPool(X)]))

[0032] Among them, X is the input feature map, AvgPool(X) is the average pooling, MaxPool(X) is the maximum pooling, and ω is the pooling weight parameter.

[0033] The number of samples contained in each category of the new class small sample dataset with a small amount of annotation information is specified by the task.

[0034] Furthermore, the number of samples contained in each category is set to: 1, 2, 3, 5, and 10 respectively.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] 1) The present invention adds multi-scale convolution to the channel attention part of the original CBAM attention module, which helps the model to obtain multi-level and multi-scale feature information, improves the recognition and generalization capabilities of the target detection model for targets of different scales, enhances feature expression, reduces the impact of scale correlation, and improves sensitivity to features of different scales, thereby alleviating the scale sparsity problem of small sample target detection.

[0037] 2) The present invention adds a pooling ratio parameter to the spatial attention part of the original CBAM attention module, and flexibly and dynamically adjusts the weight of the two pooling methods. This helps the model obtain richer information during feature extraction, improves the attention of important spatial information, and comprehensively considers the importance of local saliency and global context based on the characteristics of small sample targets, thereby improving the robustness and generalization ability of the model.

[0038] 3) The present invention introduces residual connections in the optimized CBAM attention module, which effectively strengthens information transmission and gradient flow, alleviates the optimization difficulty, maintains the balance between model depth and performance, promotes model training convergence, improves the expressiveness of the model, and can effectively alleviate the overfitting problem that is common in small sample target detection and improve detection accuracy.

[0039] 4) The present invention places the improved CBAM attention mechanism module between two convolutional layers where the number of channels changes in the feature extraction backbone network, making full use of the information changes in the channel dimension, which helps to establish an effective association between the low-level features and high-level semantic features of the model, enabling the module to effectively learn the correlation between features and improve the performance of small sample target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a flow chart for the implementation of the present invention;

[0041] Figure 2 It is the overall framework diagram of the present invention;

[0042] Figure 3 This is a structural diagram of the improved feature extraction backbone network of the present invention;

[0043] Figure 4 The overall structure diagram of the improved CBAM module of the present invention;

[0044] Figure 5 It is a partial structural diagram of the improved CBAM module channel of the present invention;

[0045] Figure 6 This is a structural diagram of the spatial portion of the improved CBAM module of the present invention. DETAILED DESCRIPTION

[0046] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0047] Example

[0048] This embodiment provides a two-stage small sample target detection method based on optimizing the CBAM attention mechanism. Figure 1 and Figure 2 As shown, the following steps are included:

[0049] Step 1: Use the base class dataset with a lot of labeled information to train the two-stage object detection network Faster-RCNN to obtain the base class detection model.

[0050] Specifically, the base class detection model in step 1 is obtained by the following calculation method:

[0051] Step 11) Construct a base class data set. This embodiment conducts experiments based on the PASCAL VOC 2012 data set. The PASCAL VOC 2012 data set contains 20 categories in total, from which 15 categories are selected as the base classes in this experimental example. Specifically, the selected 15 base classes are: aeroplane, bicycle, boat, bottle, car, cat, chair, dining table, dog, horse, person, potted plant, sheep, train, and tv monitor. For each base class, the number of samples is greater than 300.

[0052] Step 12) Model selection: Select the two-stage object detection network Faster-RCNN as the base model and load the pre-trained VGG16 network as the feature extraction backbone network.

[0053] Step 13) Model construction. Build the Faster-RCNN model, which includes the region proposal network (RPN), the object classifier, and the bounding box regressor. And set the hyperparameters of the model, including: the initial value of the learning rate is set to 0.001, and the batch size is set to 16.

[0054] Step 14) Define the loss function. Select the classification cross entropy loss as the classification loss and the smooth L1 loss as the bounding box regression loss. Specifically:

[0055]

[0056]

[0057] in, Represents the model's predicted probability of the target category, depending on the target's true category; represents the bounding box location predicted by the model, Represents the true bounding box position.

[0058] Step 15) Model training: Input the base class dataset into the model and update the model parameters through the back propagation algorithm to minimize the loss function and dynamically adjust the model's hyperparameters.

[0059] Step 2: Freeze the parameters of the feature extraction backbone network, RPN, and RoI in the base class detection model. Specifically, set the "required_grad" attribute in the above parameters to "False".

[0060] Step 3: Optimize the CBAM attention mechanism module, such as Figure 4 As shown, it includes optimizing the channel attention part and the spatial attention part of the CBAM attention mechanism module, and adding residual connections.

[0061] Specifically, the CBAM module in step 3 is optimized by the following calculation method:

[0062] Step 3.1) In the channel attention part, such as Figure 5 As shown, the input feature map X is evenly grouped along the channel dimension and divided into two sub-features, which are passed through two different convolutional layers, each of which uses convolution kernels of different scales (in this embodiment, convolution kernels of sizes 5 and 7 are used respectively), but the channel dimension size is not changed. Specifically, the input feature map is X, and the dimension of X is C×H×W, then the dimension of the two sub-feature maps is C / 2×H×W.

[0063] Assume the input feature map is Where C is the number of channels, H and W are the height and width of the feature map, and the two groups of features are divided into

[0064] The calculation formula of the convolution process is:

[0065] X1=conv1(X1)

[0066] X2=conv2(X2)

[0067] Among them, Conv1 and Conv2 represent convolution operations with different convolution kernel sizes.

[0068] Step 3.2) The two sub-feature maps are subjected to global maximum pooling and global average pooling based on width and height, respectively. Specifically, after this step, four output features are obtained, and their dimensions are all C / 2×1×1.

[0069] Step 3.3) The pooled features are fed into a two-layer neural network (MLP), each MLP contains two fully connected layers to learn the nonlinear mapping of features. After this step, the four feature dimensions of the output do not change.

[0070] Step 3.4) Feature fusion. Perform an element-wise addition operation on the features output by the MLP, and finally concatenate the two sets of features to obtain the weight A. c . Specifically, A c The dimension is C×1×1.

[0071] Step 3.5) A c Perform element-wise multiplication with the input feature map X to generate the input features required by the spatial attention module. In summary, the calculation formula for the channel part attention weight is:

[0072] A c1 =sigmoid(MLP(AvgPool(X1))+MLP(MaxPool(X1)))

[0073] A c2 =sigmoid(MLP(AvgPool(X2))+MLP(MaxPool(X2)))

[0074] A c =concat([A c1 ,A c2 ], dim=1)

[0075] Among them, A c1 , A c2 are the weights of the two groups, A c is the weight of the channel attention part.

[0076] Step 3.6) In the spatial attention part, such as Figure 6 As shown in FIG. 1 , firstly, the input feature map X is subjected to the maximum pooling and average pooling operations based on the channel dimension to obtain two pooled feature maps. Specifically, the input feature map is denoted as X, and the dimension of X is C×H×W, then the dimension of the two pooled feature maps is 1×H×W.

[0077] Step 3.7) introduces the pooling weight parameter, which ranges from 0 to 1, to adjust the ratio between the maximum pooling feature and the average pooling feature, and control the importance of different pooling features. After this step, the dimensions of the two features do not change.

[0078] Step 3.8) The two pooled feature maps are concatenated based on the channel dimension to obtain a concatenated feature map with a dimension of 2×H×W. The channel dimension is then reduced to 1 through a convolution operation to obtain the weight A. s , A s The dimensions are 1×H×W.

[0079] Step 3.9) Multiply the reduced feature map by the input feature of the module element by element to obtain the fused feature, which is also the final output feature X of the improved CBAM module. s In summary, the calculation formula for the attention weight of the spatial part is:

[0080] A s =sigmoid(conv 7×7 (concat[ωAvgPool(X),(1-ω)MaxPool(X)]))

[0081] Among them, X is the input feature map, AvgPool(X) is the average pooling, MaxPool(X) is the maximum pooling, and ω is the pooling weight parameter.

[0082] Step 3.10) Compare the feature map X of the input CBAM module with the feature map X of the final output s Perform addition operation and construct residual connection.

[0083] Step 4: Place the optimized CBAM attention module obtained in step S3 in the feature extraction backbone network, build a detection network, and then use the new class small sample dataset with a small amount of annotation information as input to fine-tune the parameters of the detection head part of the detection network.

[0084] Specifically, the location of the optimized CBAM attention module in the feature extraction backbone network can be found in Figure 3 , insert an improved CBAM module with 64 input channels between the 2nd and 3rd layers of the original VGG16 network structure; insert an improved CBAM module with 128 input channels between the 5th and 6th layers of the original VGG16 network structure; insert an improved CBAM module with 256 input channels between the 9th and 10th layers of the original VGG16 network structure. After adding, the structure of the feature extraction network is conv3-64, conv3-64, A-64, conv3-128, conv3-128, A-128, conv3-256, conv3-256, conv3-256, A-256, conv3-512, conv3-512, conv3-512, conv3-512, conv3-512, conv3-512, FC-4096, FC-4096, FC-1000, with a total of 19 layers. Among them, conv3-xxx refers to the convolution layer with a convolution kernel size of 3×3 and xxx number of channels, FC-xxx refers to the fully connected layer with xxx nodes, and A-xxx refers to the improved CBAM attention mechanism module with xxx number of input channels.

[0085] Specifically, the new class small sample data set consists of 5 categories other than the 15 categories of the base class in the PASCAL VOC 2012 data set, namely: cow, bus, motorbike, sofa, and bird.

[0086] Step 5: Input the test data set with new class samples into the test network to obtain the test results. Specifically, the test data set contains both base class data and new class data, but when calculating the detection accuracy, the detection accuracy of the base class and the new class will be counted separately to intuitively understand the network's detection of small sample categories.

[0087] The number of samples contained in each category of the new class small sample dataset with a small amount of annotation information is specified by the task. In the k-shot task, each category of the small sample dataset will contain k samples, and k is usually equal to 5, 10, 30, etc., which is much smaller than the size of the base class dataset.

[0088] In this embodiment, the PASCAL VOC 2012 dataset is used as the test data, and the number of samples in each small sample category is set to 1, 2, 3, 5, and 10 in sequence. Following the conventional settings of the small sample target detection task, the detection accuracy results are shown in Tables 1 to 5. Furthermore, the experimental conditions and operations of the so-called "before improvement" are basically the same as those of the "after improvement", except that no improvement is made to the CBAM module inserted into the feature extraction backbone network, and other experimental conditions and operations are exactly the same.

[0089] Table 1 Comparison of accuracy before and after improvement under 1-shot setting

[0090] Cow Motorbike Bus Sofa Bird AP (before improvement) (%) 49.12 38.89 37.98 8.01 3.75 AP (after improvement) (%) 49.25 37.48 41.53 8.55 2.69

[0091] Table 2 Comparison of accuracy before and after improvement under 2-shot setting

[0092] Cow Motorbike Bus Sofa Bird AP (before improvement) (%) 61.73 50.11 37.28 22.54 6.49 AP (after improvement) (%) 62.36 50.02 37.77 20.48 9.57

[0093] Table 3 Comparison of accuracy before and after improvement under 3-shot setting

[0094] Cow Motorbike Bus Sofa Bird AP (before improvement) (%) 60.18 55.24 49.52 24.13 15.68 AP (after improvement) (%) 60.84 56.86 47.48 28.91 13.36

[0095] Table 4 Comparison of accuracy before and after improvement under 5-shot setting

[0096] Cow Motorbike Bus Sofa Bird AP (before improvement) (%) 60.52 54.24 51.18 35.91 16.00 AP (after improvement) (%) 57.97 55.83 53.78 37.82 17.80

[0097] Table 5 Comparison of accuracy before and after improvement under 10-shot setting

[0098]

[0099]

[0100] This embodiment compares the new class detection accuracy before and after improvement under five conditions where the number of new class samples is 1, 2, 3, 5, and 10. The improved results show that the detection accuracy before improvement is significantly lower than the detection accuracy after improvement. Among them, the mAP of the method proposed in this embodiment increases by 0.35%, 0.41%, 0.54%, 1.07%, and 1.73% respectively when the number of new class samples is 1, 2, 3, 5, and 10 compared with the mAP before improvement. This shows that the method proposed in this embodiment can effectively improve the network's ability to detect targets when the number of samples is sparse, and improve detection accuracy.

[0101] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A two-stage small sample target detection method based on optimizing the CBAM attention mechanism, characterized in that: The following steps are involved: Step S1, use the base class data set to train the two-stage object detection network Faster-RCNN to obtain a base class detection model; Step S2, freezing the parameters of the feature extraction backbone network in the base class detection model; Step S3, optimizing the CBAM attention mechanism module; Step S4: Place the optimized CBAM attention module in the feature extraction backbone network to build a detection network, and then use the new class small sample data set with a small amount of annotation information as input to fine-tune the parameters of the detection head part of the detection network; Step S5: input the data set to be tested into the detection network to obtain the detection result.

2. According to claim 1, a two-stage small sample target detection method based on optimizing the CBAM attention mechanism is characterized in that: The step S1 specifically includes: Step S11, constructing a base class data set; Step S12, model selection: select the two-stage object detection network Faster-RCNN as the basic model, and load the pre-trained VGG16 network as the feature extraction backbone network; Step S13, model construction: construct a Faster-RCNN model, including a region proposal network, an object classifier, and a bounding box regressor, and set the hyperparameters of the model; Step S14, define the loss function: select classification cross entropy loss as classification loss, select smooth L1 loss as bounding box regression loss; Step S15, model training: input the base class data set into the model, update the model parameters through the back propagation algorithm to minimize the loss function, and dynamically adjust the hyperparameters of the model.

3. A two-stage small sample target detection method based on optimizing the CBAM attention mechanism according to claim 2, characterized in that: Placing the optimized CBAM attention module in the feature extraction backbone network includes: placing the optimized CBAM attention mechanism module between two convolutional layers in which the number of channels in the feature extraction backbone network changes.

4. According to claim 3, a two-stage small sample target detection method based on optimizing the CBAM attention mechanism is characterized in that: Specifically, between the two convolutional layers, a CBAM module with a set number of channels is inserted between the 2nd and 3rd layers, between the 5th and 6th layers, and between the 9th and 10th layers of the VGG16 network structure, and the structure of the feature extraction network is conv3-64, conv3-64, A-64, conv3-128, conv3-128, A-128, conv3-256, conv3-256, conv3-256, A-256, conv3-512, conv3-512, conv3-512, conv3-512, conv3-512, conv3-512, FC-4096, FC-4096, and FC-1000.

5. A two-stage small sample target detection method based on optimizing the CBAM attention mechanism according to claim 1, characterized in that: Freezing the feature extraction backbone network parameters includes: setting its "required_grad" attribute to "False".

6. A two-stage small sample target detection method based on optimizing the CBAM attention mechanism according to claim 1, characterized in that: The optimizing CBAM attention mechanism module comprises: optimizing the channel attention part and the spatial attention part of the CBAM attention mechanism module, and adding a residual connection; Step S31, in the channel attention part of the optimized CBAM attention mechanism module, group convolution is used to evenly divide the input feature map X into two groups in the channel dimension, and convolution operations are performed on each group using convolution kernels of different sizes; the two groups of input feature maps are subjected to global maximum pooling and global average pooling based on width and height respectively; and then sent to a two-layer neural network respectively; the output features are subjected to feature fusion based on element-wise addition operation, and the two groups of feature maps are concat spliced ​​to obtain the weight of the channel attention part; the channel attention part weight and the input feature map X are subjected to element-wise multiplication operation to generate the input features required for the spatial attention part; Step S32, in the optimization of the spatial attention part, firstly, the input feature map X is subjected to maximum pooling and average pooling operations based on the feature dimension; the pooling weight parameter is introduced to adjust the ratio of the maximum pooling feature and the average pooling feature; the two pooled feature maps are channel-joined based on the channel dimension to obtain a jointed feature map, and the channel dimension is reduced to 1 by convolution operation to obtain the weight of the spatial attention part; the reduced-dimensional feature map is element-wise multiplied with the input feature generated in step S31 to obtain the fused final feature X s ; Step S33: introduce residual connection into the optimized CBAM module to merge the final feature X s Add it to the input feature map X.

7. A two-stage small sample target detection method based on optimizing the CBAM attention mechanism according to claim 6, characterized in that: The channel attention weight is calculated using the following formula: A c1 =sigmoid(MLP(AvgPool(X1))+MLP(MaxPool(X1))) A c2 =sigmoid(MLP(AvgPool(X2))+MLP(MapPool(X2))) A c =concat([A c1 ,A c2 ],dim=1) Among them, A c1 , A c2 are the weights of the two groups, A c is the weight of the channel attention part.

8. A two-stage small sample target detection method based on optimizing the CBAM attention mechanism according to claim 6, characterized in that: The weight of the spatial attention part is calculated using the following formula: A s =sigmoid(conv 7×7 (concat[ωAvgPool(X),(1-ω)MaxPool(X)])) Among them, X is the input feature map, AvgPool(X) is the average pooling, MaxPool(X) is the maximum pooling, and ω is the pooling weight parameter.

9. A two-stage small sample target detection method based on optimizing the CBAM attention mechanism according to claim 1, characterized in that: The number of samples contained in each category of the new class small sample dataset with a small amount of annotation information is specified by the task.

10. A two-stage small sample target detection method based on optimizing the CBAM attention mechanism according to claim 9, characterized in that: The number of samples contained in each category is set to: 1, 2, 3, 5, and 10 respectively.

Citation Information

Patent Citations

  • Small target detection method based on attention mechanism

    CN114202672A

  • Small sample remote sensing image target detection method and system, computer and readable storage medium

    CN116977716A

  • Grape fruit target detection method based on improved YOLOv5x model

    CN117671378A

Cited By

  • Small sample farmland weed target detection method based on color prior and discriminant feature enhancement

    CN122714995A

  • Computer vision learning and object detection for long-tailed data distributions

    US20260154953A1