Remote sensing small target detection method and device
By using the Focal_WIoU loss function and global attention mechanism in remote sensing small object detection, the problems of complex calculations and high resource consumption are solved, the detection accuracy and stability are improved, and efficient small object detection is achieved.
Patent Information
- Application Number
- CN202411730292.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing remote sensing small object detection methods have complex computing and high resource consumption, especially in application scenarios where large-scale image data sets or real-time responses are required, which affects detection performance.
The Focal_WIoU loss function is used to replace the CIoU loss function in the baseline algorithm, and the global attention mechanism (GAM) module is introduced in the YOLOv8 model, including the channel attention submodule and the spatial attention submodule, and the feature map is paid attention to through the double-layer attention mechanism. key area information to reduce resource consumption.
It improves the accuracy and stability of remote sensing small object detection, reduces calculation complexity and resource consumption, improves detection performance, and solves the problem of sample imbalance during training.
Smart Images

Figure CN119229098A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of remote sensing image target detection, and in particular to a remote sensing small target detection method and device. Background Art
[0002] At present, common remote sensing small target detection algorithms include faster region-based convolutional neural network (Faster R-CNN), YOLO (You Only Look Once), single shot multibox detector (SSD), etc. Among them, Faster R-CNN improves the detection ability of small targets by optimizing RPN or subsequent classification networks; YOLO series algorithms improve the detection ability of small targets by improving network structure, loss function, data enhancement, etc.; SSD improves the detection performance of small targets through preset anchor boxes.
[0003] In recent years, in the field of target detection optimization, the introduction of attention mechanism has become a research hotspot in order to solve the problem of background complexity. For example, LIM et al. proposed an attention mechanism that integrates the target context information, so that the network focuses on the required part to reduce the interference of background information and indirectly enhance the required small target feature information. In addition, there are optimization methods that directly enhance the features of small targets to solve the problem of target diversity, mainly in the following categories: designing a generative adversarial network (GAN), such as the SOD-MTGAN proposed by BAI et al., the enhanced super-resolution generative adversarial network proposed by RABBI et al., etc., which are all improvements on the GAN method; data enhancement for training data sets, such as the method proposed by KISANTAL et al. to increase the number of small target copies, which increases the amount of network training for small targets; the reinforcement learning method proposed by ZOPH et al., which first screens good quality data and then trains, effectively improves the detection performance; because feature maps of different scales have different feature information, the detection accuracy can also be effectively improved by fusing multi-scale feature maps. There are many improvements based on the classic feature fusion network-feature pyramid network, such as the hollow space pyramid pooling balanced feature pyramid network proposed by ZENG et al., which innovatively uses jump connections and greatly improves the multi-scale feature fusion effect. These methods have solved the problems of target diversity, background complexity and interference to a certain extent, but they all have the problems of complex calculation and high resource consumption.
[0004] For specific remote sensing small target detection tasks, the attention mechanism that integrates target context information, Enhanced Super-Resolution GANs (ESRGAN), data augmentation, reinforcement learning, and atrous spatial pyramid pooling balanced feature pyramid networks have to some extent solved problems such as target diversity, background complexity, and interference.
[0005] However, as the context information increases, the complexity and computational complexity of the attention mechanism that integrates the target context information will increase significantly, which in turn affects the training and reasoning speed of the model.
[0006] Enhanced super-resolution generative adversarial networks usually contain more complex network structures, such as multi-level residual networks in the generator and relative average discriminators in the discriminator, which require higher computing resources during training and reasoning. Therefore, ESRGAN may be limited by computational complexity in processing large-scale image datasets or in application scenarios that require real-time response.
[0007] Data enhancement and reinforcement learning will increase the amount of training during model training, thereby increasing the complexity of calculations.
[0008] The hollow spatial pyramid pooling balanced feature pyramid network needs to construct feature maps of multiple scales and perform multiple feature fusions and predictions, which increases the computational complexity and memory consumption of the model.
[0009] It can be seen that the above remote sensing small target detection methods also have problems of complex calculations and high resource consumption. Summary of the invention
[0010] The purpose of this application is to provide a remote sensing small target detection method and device to solve the problems of complex calculation, high resource consumption and poor detection performance of existing remote sensing small target detection methods.
[0011] To achieve the above objectives, this application provides the following solutions.
[0012] In a first aspect, the present application provides a remote sensing small target detection method, comprising the following steps.
[0013] The CIoU loss function in the baseline algorithm is replaced by the Focal_WIoU loss function to determine the improved baseline algorithm; the Focal_WIoU loss function includes the Focal loss function and the WIoU loss function; the Focal loss function is used to introduce a modulation factor to adjust the weight of the sample; the WIoU loss function is used to measure the similarity between target boxes.
[0014] An improved YOLOv8 model is trained using the improved baseline algorithm; the improved YOLOv8 model includes a backbone network, a neck network and a detection head; a GAM module is added after the second context-aware cross-layer fusion module of the neck network; the GAM module includes a channel attention submodule and a spatial attention submodule; the channel attention submodule is used to retain cross-dimensional information; and the spatial attention submodule is used to fuse spatial information.
[0015] The improved YOLOv8 model is used to detect small remote sensing targets in remote sensing images.
[0016] In a second aspect, the present application provides a remote sensing small target detection device, comprising the following modules.
[0017] The baseline algorithm improvement module is used to replace the CIoU loss function in the baseline algorithm with the Focal_WIoU loss function to determine the improved baseline algorithm; the Focal_WIoU loss function includes the Focal loss function and the WIoU loss function; the Focal loss function is used to introduce a modulation factor to adjust the weight of the sample; the WIoU loss function is used to measure the similarity between target boxes.
[0018] A training module is used to train an improved YOLOv8 model using an improved baseline algorithm; the improved YOLOv8 model includes a backbone network, a neck network and a detection head; a GAM module is added after the second context-aware cross-layer fusion module of the neck network; the GAM module includes a channel attention submodule and a spatial attention submodule; the channel attention submodule is used to retain cross-dimensional information; the spatial attention submodule is used to fuse spatial information.
[0019] The remote sensing small target detection module is used to detect remote sensing small targets in remote sensing images using the improved YOLOv8 model.
[0020] According to the specific embodiments provided by the present application, the present application discloses the following technical effects: the present application replaces the CIoU loss function in the baseline algorithm with the focal_weighted intersection-over-union (WIoU) loss function, and uses the improved baseline algorithm to train the improved YOLOv8 model, combines the focal and weighted intersection-over-union loss functions, considers the importance of different regions, and gives different weights to different regions, thereby solving the imbalance problem of samples that are easy to correctly classify and samples that are difficult to correctly classify during training, reduces the computational complexity of increasing the amount of training for data enhancement and reinforcement learning during model training, and more accurately measures the similarity between target frames, further improving the algorithm's detection accuracy and stability of target position and size, thereby improving the accuracy of the trained improved YOLOv8 model; in addition, the present application also improves the YOLOv8 model, and the improved YOLOv8 model includes a backbone network, a neck network, and a detection head; wherein, a global attention mechanism is added after the second context-aware cross-layer fusion module of the neck network. mechanism, GAM) module; the GAM module includes a channel attention submodule and a spatial attention submodule, thereby forming a double-layer attention in the spatial dimension and the channel dimension, amplifying the cross-dimensional effect, and attracting and fusing the feature information of the channel and the space in a global manner, so that when performing remote sensing small target detection, more attention is paid to the key area information of the feature map. This application does not require too much context information and a complex network structure, nor does it require the construction of feature maps of multiple scales. Instead, through the cross-dimensional GAM module, a simple network structure can be used to accurately identify remote sensing small targets, thereby reducing resource consumption and improving the detection performance of remote sensing small targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 This is a flow chart of a remote sensing small target detection method in one embodiment of the present application.
[0023] Figure 2 A schematic diagram of the overall network structure of the improved YOLOv8 model provided in one embodiment of the present application.
[0024] Figure 3 for Figure 2 Schematic diagram of the GAM module structure.
[0025] Figure 4 for Figure 3 Schematic diagram of the channel attention submodule of .
[0026] Figure 5 for Figure 4 Schematic diagram of the two-layer MLP structure.
[0027] Figure 6 for Figure 3 Schematic diagram of the spatial attention submodule.
[0028] Figure 7 Schematic diagram of the confusion matrix of the YOLOv8n algorithm.
[0029] Figure 8 This is a schematic diagram of the confusion matrix of the YOLOv8n-GAM-Focal_WIoU algorithm shown in this application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0032] like Figure 1 As shown, an embodiment of the present application provides a remote sensing small target detection method, which is executed by a computer device, and can be specifically executed by a computer device such as a terminal or a server alone, or can be executed by a terminal and a server together. The method includes the following steps 101 to 103.
[0033] Step 101: Use the Focal_WIoU loss function to replace the CIoU loss function in the baseline algorithm to determine an improved baseline algorithm; the Focal_WIoU loss function includes the Focal loss function and the WIoU loss function; the Focal loss function is used to introduce a modulation factor to adjust the weight of the sample; the WIoU loss function is used to measure the similarity between target boxes.
[0034] Step 102: Train an improved YOLOv8 model using the improved baseline algorithm; the improved YOLOv8 model includes a backbone network, a neck network, and a detection head; a GAM module is added after the second context-aware cross-layer fusion module of the neck network; the GAM module includes a channel attention submodule and a spatial attention submodule; the channel attention submodule is used to retain cross-dimensional information; and the spatial attention submodule is used to fuse spatial information.
[0035] Step 103: Detecting small remote sensing targets in the remote sensing image using the improved YOLOv8 model. The small remote sensing targets refer to targets in the remote sensing image whose target size does not exceed 10% of the image size.
[0036] Yolo is a single-stage target detection algorithm. YOLOv8 can be used for tasks such as image classification, object detection, and instance segmentation. YOLOv8 is the current best performance model. Its specific innovations include a new backbone network, a new anchor-free detection head, and a new loss function. It can run on a variety of hardware platforms from CPU to GPU. The overall structure of YOLOv8 consists of three parts: the backbone, the neck network, and the detection head. According to specific needs, the model is divided into five models according to the size of the network model: YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, and YOLOv8x.
[0037] In this embodiment, improvements are made based on YOLOv8n. The overall network structure of the improved YOLOv8 model is as follows: Figure 2 shown.
[0038] In an exemplary embodiment, the Focal_WIoU loss function is a target detection strategy that combines the focal loss function and the weighted intersection-over-union (WioU) loss function, which optimizes the model training process and improves the detection performance of the model by introducing modulation factors and regional weights.
[0039] The Focal loss function is proposed to solve the problem of imbalance between difficult and easy samples in target detection. By introducing a modulation factor on the standard cross entropy loss function, the modulation factor will reduce the loss value of samples that are easy to classify, and increase the loss value of samples that are difficult to classify, thereby improving the classification ability of the model.
[0040] The loss function of the original YOLOv8n algorithm is a weighted combination of three loss functions of classification loss (cross entropy loss function) and regression loss (CIoU Loss+DFL Loss). In order to solve the problem that the complete intersection-over-union (CIoU) loss function in the original algorithm does not consider the balance of difficult and easy samples, it may be unstable for small target detection. This application uses the Focal_WIoU loss function to replace the CIoU loss function in the original baseline algorithm, so that the model pays more attention to those samples that are difficult to classify but have a greater impact on detection performance during training, thereby improving the detection accuracy and robustness of the model.
[0041] Among them, the Focal loss function is: ;in, is the focal loss function value; is the coefficient factor; is the predicted probability of the true category of the sample, which refers to the small remote sensing target in the training set; is the hyperparameter of the modulation factor; For categories; p is the predicted probability of the true category of the sample.
[0042] The coefficient factor introduced in the Focal loss function is When there is no coefficient factor, the Focal loss function is in the standard cross entropy form. The introduced coefficient factor adjusts the contribution of the sample to the loss according to the difference between the predicted result and the true label. When the difference is smaller, the prediction is more accurate and the loss weight is reduced; otherwise, the loss weight is increased. The larger it is, the greater the adjustment force.
[0043] WIoU is a variant of the intersection-over-union loss function, which is used to measure the overlap between the predicted box and the true box. Unlike the traditional IoU, WIoU considers the importance of different regions when calculating and gives them different weights. In WIoU, the intersection and union between the predicted box and the true box are given different weights.
[0044] The WIoU loss function is: ;in, is the intersection-over-union loss function value; TP is the number of true positives; FP is the number of false positive examples; FN is the number of false counterexamples; 1 is the weight.
[0045] By adjusting the value of the weight parameter, this helps the model better focus on areas that have a greater impact on detection performance, such as object boundaries.
[0046] In an exemplary embodiment, the target detection attention mechanism draws on the human attention mechanism. Human vision obtains the target area that needs to be focused on by quickly scanning the global image. This is generally referred to as the focus of attention, and then invests more attention resources in this area to obtain more detailed information about the target that needs to be focused on, thereby suppressing other useless information. GAM is a mechanism designed to reduce information loss and amplify the interactive features of the global dimension. At the same time, GAM is also a sequential channel-space double-layer attention mechanism, such as Figure 3 As shown in the figure, GAM first focuses on channel attention and then on spatial attention. This sequential processing enables the model to first focus on the most important channel information and then integrate spatial information based on this information.
[0047] In order to improve the detection accuracy of small remote sensing targets and solve the problem of missed or false detection of small targets, this application adds a GAM module after the second context-aware cross-layer fusion module of the neck network in the YOLOv8 model. Experiments show that the introduction of the attention mechanism effectively improves the detection accuracy of small remote sensing targets.
[0048] The two channel attention submodules and the spatial attention submodule in GAM do not contain pooling operations, so the shape of the output tensor is equal to the shape of the input tensor. During the training process of the improved YOLOv8 model, the feature map F 1 Input to the channel attention submodule and output feature map F 2 , the feature map F 2 Input to the spatial attention submodule and output feature map F 3 ;in, , ; M C For channel attention; M S for spatial attention; is the Kronecker product.
[0049] In an exemplary embodiment, Figure 4 As shown in the figure, in the channel attention submodule, cross-dimensional information retention is achieved. GAM uses 3D arrangement to retain information across three dimensions (channel, spatial width and height), and enhances the channel-space dependency across dimensions through a two-layer multilayer perceptron (MLP). MLP is able to model the nonlinear relationship between channels, so the parameters capture more relationships between channels.
[0050] The channel attention submodule specifically includes: a permutation unit, a two-layer MLP, a reverse permutation unit, and a first sigmoid activation function connected in sequence; the permutation unit is used to preserve the feature map F across channels, spatial width, and height 1 The double-layer MLP is used to enhance the channel-space dependency across dimensions; the reverse permutation unit is used to transform the feature map F 1 The dimension is converted to the original dimension, that is, the dimension conversion is restored; the first sigmoid activation function is used to convert the feature map F 1 to classify.
[0051] For a two-layer MLP, the model of the two-layer MLP is as follows Figure 5 As shown in the figure, the h module between x and y is a hidden layer; after the MLP operation, a nonlinear relationship between multiple channels of the feature map is established.
[0052] The operation process of the two-layer MLP is: .
[0053] .
[0054] .
[0055] Among them, x[g] is the input feature map, g is the input layer neuron number, g=1,2,3; w[i,j] is the input feature map weight, i is the input layer neuron number, i=1,2,3; j is the hidden layer neuron number, j=1,2,3; b[p] is the bias, p is the hidden layer neuron number, p=0,1; h[q] is the output feature of the hidden layer, q is the hidden layer neuron number, q=1,2; v[k] is the parameter of the activation function, k is the hidden layer neuron number, k=1,2; y is the output feature map; f( ) is a nonlinear function, i.e., an activation function, and the sigmoid function is used in this application.
[0056] In an exemplary embodiment, Figure 6 As shown in Figure 1, spatial information fusion is implemented in the spatial attention submodule. C is the number of image channels, H is the image height, and W is the image width. GAM uses two convolutional layers to fuse spatial information and removes the maximum pooling operation that may reduce information. This helps the model better focus on spatial information. Convolution of 7, two 7s The convolution of 7 can model 7 The nonlinear relationship between pixels in the 7-block enables parameter features to capture more relationships between pixel spaces.
[0057] The spatial attention submodule specifically includes: two convolutional layers connected in sequence and a second sigmoid activation function; two convolutional layers are used to fuse feature maps F 2 The second sigmoid activation function is used to F 2 to classify.
[0058] The following experiment is conducted using a remote sensing image dataset of an engineering vehicle to illustrate the remote sensing small target detection method of this application.
[0059] The image pixel of the engineering vehicle remote sensing image is 1024 1024, the target is a small target with a size less than 1 / 10 of the image size, with a total of 415 images, of which 375 are used for training and 40 are used for verification. The images are taken by the visible light camera carried by the spacecraft, including remote sensing images of engineering vehicles in various application scenarios, engineering vehicles in a stationary state and in an operating state; and the background contains houses, trees and other vehicles besides engineering vehicles.
[0060] Evaluation criteria: Performance evaluation indicators include mAP@0.5, mAP@0.5∶0.95, parameter quantity and GFLOPs. Among them, mAP@0.5 represents the average detection accuracy of the target to be detected when the intersection-over-union ratio threshold is 0.5. The higher the value, the higher the detection accuracy; mAP@0.5∶0.95 represents the average detection accuracy of the target to be detected when the intersection-over-union ratio threshold is 0.5-0.95. The higher the value, the higher the detection accuracy; parameter quantity and GFLOPs are used to measure the complexity of the algorithm. The higher the value, the higher the computational complexity.
[0061] Comparative experiment: In order to prove the advanced nature of this application, a comparative experiment was conducted. Using the engineering vehicle remote sensing image dataset, each algorithm was trained for 200 rounds. The results of the comparative experiment are shown in Table 1, where bold indicates the optimal value. From the results, it can be seen that the average detection accuracy of the target to be detected by the YOLOv8n-GAM-Focal_WIoU algorithm is 3.6 percentage points higher than that of the YOLOv8n algorithm when the intersection-over-union ratio threshold is 0.5; the average detection accuracy of the target to be detected is increased by 2.9 percentage points when the intersection-over-union ratio threshold is 0.5-0.95; the algorithm calculation complexity remains basically unchanged, and the detection performance is better than other algorithms.
[0062] Table 1 Comparative experimental results
[0063] Figure 7 This is a diagram of the confusion matrix of the YOLOv8n algorithm. Figure 7 It can be seen that among the 125 samples, 86 samples were correctly detected, with an accuracy rate of 68.8%. Among them, the number of samples where the background was predicted to be an engineering vehicle was 13, and the number of samples where the engineering vehicle was predicted to be the background was 26; Figure 8 This is a diagram of the confusion matrix of the YOLOv8n-GAM-Focal_WIoU algorithm shown in this application. Among the 131 samples, 94 samples were correctly detected with an accuracy of 71.8%. Among them, the number of samples where the background was predicted to be an engineering vehicle was 19, and the number of samples where the engineering vehicle was predicted to be the background was 18. This application effectively improves the accuracy of detection.
[0064] Ablation experiment: In order to prove the optimization degree of the performance of each improvement proposed in this application, an ablation experiment is conducted.
[0065] Using the engineering vehicle remote sensing dataset, each algorithm was trained for 200 rounds. The experimental results are shown in Table 2, where the bold represents the optimal value. Based on the YOLOv8n algorithm, this application proposes the YOLOv8n-GAM algorithm, the YOLOv8n-Focal_WIoU algorithm, and the YOLOv8n-GAM-Focal_WIoU algorithm.
[0066] Among them, the YOLOv8n-GAM algorithm is improved by introducing the GAM attention mechanism; the YOLOv8n-Focal_WIoU algorithm is improved by optimizing the loss function; and the YOLOv8n-GAM-Focal_WIoU algorithm is improved by integrating the first two.
[0067] Experiments show that the YOLOv8n-GAM structure has increased mAP@0.5 by 1.7 percentage points, mAP@0.5:0.95 by 0.2 percentage points, and the algorithm complexity remains basically unchanged; the YOLOv8n-Focal_WIoU structure has increased mAP@0.5 by 1.6 percentage points, mAP@0.5:0.95 by 1.7 percentage points, and the algorithm complexity remains unchanged; the YOLOv8n-GAM-Focal_WIoU structure has increased mAP@0.5 by 3.6 percentage points, mAP@0.5:0.95 by 2.9 percentage points, and the algorithm complexity remains basically unchanged. The new algorithm has significantly improved two indicators for specific types of remote sensing small target detection.
[0068] Through experiments, after introducing GAM attention into the original model and replacing CIoU loss function with Focal and WIoU loss functions, the model accuracy is effectively improved and the computational complexity remains basically unchanged. This is due to the introduction of the GAM attention mechanism, which forms attention in two dimensions: channel and space. The engineering vehicle remote sensing dataset has a complex background and small target size. The GAM attention mechanism focuses on channel and spatial information; the Focal_WIoU loss function considers the importance of different areas and gives them different weights. The larger the modulation factor, the more attention the model pays to samples that are difficult to classify but have a greater impact on detection performance during training, which improves the stability of small target detection.
[0069] Table 2 Ablation experiment results
[0070] Compared with the YOLOv8n algorithm, the YOLOv8n-GAM algorithm, the YOLOv8n-Focal_WIoU algorithm, and the YOLOv8n-GAM-Focal_WIoU algorithm accurately identified the target for smaller engineering vehicle targets. The confidence of small target detection increased significantly for each improved model compared to the original model. This is because after the improved model replaced the loss function, the imbalance problem of samples that are easy and difficult to correctly classify during training was solved, more attention was paid to samples that are difficult to classify, and the stability of the detection model for small target detection was increased. From the experimental visualization results, it can be seen that the detection accuracy and stability of the newly proposed algorithm are effectively improved, proving the effectiveness of the model in this application.
[0071] This application integrates the GAM module with the newer YOLOv8 model to form a double-layer attention in space and channel, amplify the cross-dimensional interaction, attract and fuse the feature information of channel and space in a global way, so that the detection focuses on the key area information of the feature map, and improves the small target detection performance; at the same time, the regression loss function is improved, and the focus and weighted intersection loss functions are combined to solve the imbalance problem of samples that are easy to correctly classify and samples that are difficult to correctly classify during training, and the similarity between target frames is measured more accurately, further improving the algorithm's detection accuracy and stability for target position and size.
[0072] Based on the same inventive concept, the embodiment of the present application also provides a remote sensing small target detection device for implementing the remote sensing small target detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the remote sensing small target detection device provided below can refer to the limitations of the remote sensing small target detection method above, and will not be repeated here.
[0073] In an exemplary embodiment, a remote sensing small target detection device is provided, comprising: The baseline algorithm improvement module is used to replace the CIoU loss function in the baseline algorithm with the Focal_WIoU loss function to determine the improved baseline algorithm; the Focal_WIoU loss function includes the Focal loss function and the WIoU loss function; the Focal loss function is used to introduce a modulation factor to adjust the weight of the sample; the WIoU loss function is used to measure the similarity between target boxes.
[0074] A training module is used to train an improved YOLOv8 model using an improved baseline algorithm; the improved YOLOv8 model includes a backbone network, a neck network and a detection head; a GAM module is added after the second context-aware cross-layer fusion module of the neck network; the GAM module includes a channel attention submodule and a spatial attention submodule; the channel attention submodule is used to retain cross-dimensional information; the spatial attention submodule is used to fuse spatial information.
[0075] The remote sensing small target detection module is used to detect remote sensing small targets in remote sensing images using the improved YOLOv8 model.
[0076] This application uses Focal and WIoU loss functions to replace the CIoU loss function in the baseline algorithm, uses the improved baseline algorithm to train the improved YOLOv8 model, and introduces GAM attention into the YOLOv8 model, so that the accuracy of the improved YOLOv8 model is effectively improved, and the computational complexity remains basically unchanged.
[0077] This is due to the introduction of the GAM attention mechanism, which forms attention in two dimensions: channel and space. For targets with complex backgrounds and small target sizes, the GAM attention mechanism focuses on channel and spatial information; the Focal_WIoU loss function considers the importance of different regions and gives them different weights. The larger the modulation factor, the more attention the model pays to samples that are difficult to classify but have a greater impact on detection performance during training, which improves the stability of small target detection.
[0078] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0079] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A remote sensing small target detection method, characterized in that: The remote sensing small target detection method comprises: The CIoU loss function in the baseline algorithm is replaced by the Focal_WIoU loss function to determine the improved baseline algorithm; the Focal_WIoU loss function includes the Focal loss function and the WIoU loss function; the Focal loss function is used to introduce a modulation factor to adjust the weight of the sample; the WIoU loss function is used to measure the similarity between target frames; The improved baseline algorithm is used to train an improved YOLOv8 model; the improved YOLOv8 model includes a backbone network, a neck network and a detection head; a GAM module is added after the second context-aware cross-layer fusion module of the neck network; the GAM module includes a channel attention submodule and a spatial attention submodule; the channel attention submodule is used to retain cross-dimensional information; the spatial attention submodule is used to fuse spatial information; The improved YOLOv8 model is used to detect small remote sensing targets in remote sensing images.
2. The remote sensing small target detection method according to claim 1, characterized in that: The Focal loss function is: ; in, is the focal loss function value; is the coefficient factor; is the predicted probability of the true category of the sample; is the hyperparameter of the modulation factor; For categories; p is the predicted probability of the true category of the sample.
3. The remote sensing small target detection method according to claim 1, characterized in that: The WIoU loss function is: ; in, is the intersection-over-union loss function value; TP is the number of true positives; FP is the number of false positive examples; FN is the number of false counterexamples; is the weight.
4. The remote sensing small target detection method according to claim 1, characterized in that: During the training process of the improved YOLOv8 model, the feature map F 1 Input to the channel attention submodule, output feature map F 2. The feature map F 2 Input to the spatial attention submodule and output feature map F 3; in, , ; M C For channel attention; M S for spatial attention; is the Kronecker product.
5. The remote sensing small target detection method according to claim 4, characterized in that: The channel attention submodule specifically includes: a permutation unit, a two-layer MLP, a reverse permutation unit and a first sigmoid activation function connected in sequence; The permutation unit is used to preserve the feature information of the feature map F1 across channels, spatial width and height; The two-layer MLP is used to enhance channel-space dependencies across dimensions; The reverse permutation unit is used to transform the feature map F The dimension of 1 is converted to the original dimension; The first sigmoid activation function is used to F 1. Classify; The operation process of the two-layer MLP is as follows: ; ; ; in, is the input feature map; w[i,j] is the input feature map weight; and i is the neuron number of the input layer, =1,2,3, i=1,2,3; b[p] is the bias; h[q] is the output feature of the hidden layer; v[k] is the parameter of the activation function; j, p, q and k are the numbers of the neurons in the hidden layer, j=1,2,3, p=0,1, q=1,2, k=1,2; y is the output feature map; f( ) is a nonlinear function.
6. The remote sensing small target detection method according to claim 4, characterized in that: The spatial attention submodule specifically includes: two convolutional layers connected in sequence and a second sigmoid activation function; Two convolutional layers are used to fuse feature maps F 2. Spatial information; The second sigmoid activation function is used to F 2 for classification.
7. A remote sensing small target detection device, characterized in that: The remote sensing small target detection device comprises: A baseline algorithm improvement module is used to replace the CIoU loss function in the baseline algorithm with the Focal_WIoU loss function to determine the improved baseline algorithm; the Focal_WIoU loss function includes the Focal loss function and the WIoU loss function; the Focal loss function is used to introduce a modulation factor to adjust the weight of the sample; the WIoU loss function is used to measure the similarity between target frames; A training module, used for training an improved YOLOv8 model using an improved baseline algorithm; the improved YOLOv8 model includes a backbone network, a neck network, and a detection head; a GAM module is added after the second context-aware cross-layer fusion module of the neck network; the GAM module includes a channel attention submodule and a spatial attention submodule; the channel attention submodule is used to retain cross-dimensional information; the spatial attention submodule is used to fuse spatial information; The remote sensing small target detection module is used to detect remote sensing small targets in remote sensing images using the improved YOLOv8 model.
Citation Information
Patent Citations
Ground disaster remote sensing detection method and device based on YOLOv8 model and medium
CN118570663A
Unmanned aerial vehicle aerial image detection method based on YOLOv8s-GElAN
CN118799293A
Cited By
Remote sensing image target detection method based on improved YOLOv9s
CN121305030A