Small unmanned aerial vehicle detection method based on optimized YOLOv8 and attention mechanism
By introducing residual block convolutional block attention module and high-resolution detection head in the YOLOv8 model, combined with the attention mechanism, the problem of insufficient detection accuracy of small drones in complex environments is solved, and higher detection accuracy is achieved and robustness.
Patent Information
- Application Number
- CN202411434454.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-02-11
AI Technical Summary
When existing drone detection methods deal with background interference in small drones and complex environments, the detection accuracy is insufficient, making it difficult to meet the needs of efficient identification and accurate distinction.
The optimized YOLOv8 model is adopted and combined with the attention mechanism, by introducing the residual block convolutional block attention module into the neck of the YOLOv8 model and adding a high-resolution detection head to the detection head part, the model's detection of small drones is enhanced. ability.
It significantly improves the detection accuracy in complex scenarios, improves the reliability and robustness of the model, and makes the detection of small drones more accurate and efficient in long-distance and complex contexts.
Smart Images

Figure CN119418036A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of small drone identification, and in particular relates to a small drone detection method combining an optimized YOLOv8 with an attention mechanism. Background Art
[0002] In recent years, drone technology has expanded to many fields such as smart agriculture and logistics distribution. The application of drones in these industries has brought significant conveniences, such as efficient material distribution and accurate crop monitoring. However, with the popularization of drone use, society's attention to its safety has also increased significantly. If the problem of drone abuse is not effectively controlled, it may lead to a situation in the future where the sky is densely covered with drones, which in turn interferes with the operation of manned aircraft. Therefore, the development of an efficient drone identification system to accurately distinguish drones from other objects in real time has become an important issue that needs to be solved urgently.
[0003] Traditional drone detection methods usually rely on radar and infrared technology. However, with the rapid development of deep learning technology, modern drone detection systems tend to use deep learning-based methods that can automatically extract and learn target features from data. Deep learning is a branch of artificial intelligence (AI) that uses neural networks to process data. By training on large data sets, these networks can autonomously learn and recognize patterns, thereby simulating the functions of the human brain. Thanks to the availability of training data, advanced hardware and computing resources, the application of deep learning technology in the field of object detection has gradually increased, showing its advantages in drone detection.
[0004] To address the above challenges, drone detection technology based on deep learning has made significant progress in recent years. In particular, the application of convolutional neural networks (CNNs) in the field of object detection has shown great potential. Object detection generally includes two main tasks: object localization and classification. Object detection is divided into single-stage and dual-stage detectors. Single-stage detectors, such as YOLO (You Only Look Once) and SSD (Single Shot MultiBox Detector), directly predict bounding boxes and category labels in the same stage. On the other hand, dual-stage detectors, such as R-CNN (Region-based Convolutional Neural Networks), Fast R-CNN, and Faster R-CNN, use two stages to identify potential regions and classify objects in these regions. Studies have shown that while SSD performs better in detection ability, Faster R-CNN and YOLO have higher performance in recognition ability. YOLO is widely used because it provides a balance between speed and accuracy. YOLO overcomes the problem of slow inference speed by performing bounding box determination and classification at the same stage. Since YOLO was launched in 2015, its technology has continued to improve and spawn multiple versions. For small drone detection, the YOLOv4 and YOLOv5 models have performed well in terms of accuracy and speed.
[0005] Although deep learning technology has achieved remarkable results in drone detection, the small target characteristics of drones, the diversity of flight behaviors, and background interference in complex environments still pose challenges to detection accuracy. To address these challenges, the present invention proposes an optimized YOLOv8 model and combines the attention mechanism to enhance the detection capability of small drones. The purpose of the present invention is to improve the accuracy and robustness of the detection system in complex environments when facing small target drones, so as to overcome the shortcomings of traditional detection methods. Summary of the invention
[0006] In order to solve at least one of the above technical problems existing in the prior art, the present invention provides a small drone detection method combining an optimized YOLOv8 with an attention mechanism.
[0007] The present invention is implemented by the following technical solution: an optimized YOLOv8 combined with attention mechanism small drone detection method, comprising the following steps:
[0008] S1: Introduce the residual block convolution block attention module in the neck part of the YOLOv8 model;
[0009] S2: Add a high-resolution detection head to the detection head of the YOLOv8 model;
[0010] S3: Build the P2-ResCBAM-YOLOv8 network based on the above improvements;
[0011] S4: Build a dataset of images of small drones in complex backgrounds to train and validate the new YOLOv8 model;
[0012] S5: Identify small drone targets in complex backgrounds based on the optimized YOLOv8 model.
[0013] Preferably, the residual block convolution block attention module includes:
[0014] A channel attention module, which is used to generate a channel attention map through global average pooling and global maximum pooling operations, and perform weighted processing on each channel of the input feature map;
[0015] A spatial attention module is used to generate a spatial attention map through a two-dimensional convolution operation and perform weighted processing on the feature map after channel attention adjustment in the spatial dimension.
[0016] Preferably, the residual block convolution block attention module adds the input feature map to the feature map processed by channel attention and spatial attention through a residual connection mechanism.
[0017] Preferably, the resolution of the added high-resolution detection head is 160×160 pixels, and the multi-level detection head structure combines low-level and high-level feature information to detect targets at different scales.
[0018] Preferably, the low-level and high-level feature information includes low-resolution spatial features and high-level semantic features.
[0019] Preferably, the backbone network of the YOLOv8 model adopts a novel C2f convolution module, and an anchor-free box detection mechanism is introduced in the head of the YOLOv8 model to directly detect from the center point of the target.
[0020] Preferably, the image dataset undergoes data enhancement operations of geometric transformation and exposure adjustment, the training batch size of the P2-ResCBAM-YOLOv8 network is 16, the training is repeated for 100 rounds, and the SGD optimizer is selected.
[0021] Preferably, the training process of the model is optimized by adjusting the momentum and weight decay hyperparameters; mosaic enhancement is turned off in the last 10 epochs of training in the YOLOv8 model.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] The P2-ResCBAM-YOLOv8 model can accurately identify the position of drones in complex scenes, showing extremely high detection accuracy, and significantly improving the reliability and accuracy of detection. The residual block convolutional block attention module and high-resolution detection head introduced in the present invention enable the model to better identify target objects with slight differences when extracting target features. Whether in long-distance monitoring scenarios with high flight altitudes or in complex backgrounds with a large number of interfering objects, the model can maintain high detection accuracy, and can significantly improve the accuracy, efficiency and robustness of the YOLOv8 model in small drone detection tasks, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present invention 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 It is a network structure diagram proposed by the present invention;
[0026] Figure 2 is a graph showing changes in network training loss of the present invention;
[0027] Figure 3 This is the structural diagram of the attention mechanism module of the YOLOv8 model;
[0028] Figure 4 It is a structural diagram of the residual block convolution block attention module of the present invention;
[0029] Figure 5 It is a display diagram of the recognition effect of the present invention. DETAILED DESCRIPTION
[0030] In conjunction with the drawings in the embodiments of the present invention, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0031] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification so that people familiar with this technology can understand and read them. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention. It should be noted that in this specification, relational terms such as first and second are only used to distinguish one entity from several other entities, and do not necessarily require or imply any actual relationship or order between these entities.
[0032] The present invention provides an embodiment:
[0033] like Figures 1 to 5 As shown in the figure, the YOLOv8 model can be divided into three main parts in terms of architecture: the backbone network (Backbone), the neck (Neck) and the head (Head). The backbone network adopts a new C2f convolution module to replace the traditional C3 module. The C2f module is based on the concept of ELAN (Efficient Layer Aggregation Network) and improves the efficiency and speed of feature extraction by combining the outputs of all bottleneck layers. This design is similar to ResNet Block and enhances the feature extraction ability of the network. The neck is responsible for multi-feature fusion, ensuring the effective combination of features extracted from different layers and optimizing the information integration process. The head uses an anchor-free detection mechanism to make predictions directly from the center of the target, simplifying the post-processing steps and accelerating the non-maximum suppression (NMS) process, thereby improving the prediction efficiency and accuracy.
[0034] The main innovations of YOLOv8 include the introduction of the C2f module to increase the speed of feature extraction, the use of anchor-free box detection technology to reduce overlapping prediction boxes and speed up processing, and the disabling of mosaic enhancement in the last 10 epochs of training to prevent performance degradation. These innovations make YOLOv8 superior in target detection, especially when dealing with small targets. After testing on the Microsoft COCO and Robof low 100 datasets, YOLOv8 surpassed YOLOv5 and YOLOv7 in both accuracy and performance, demonstrating its efficiency and robustness in practical applications.
[0035] Improvements to the feature fusion module:
[0036] CBAM (Convolutional Block Attention Module) is a lightweight attention mechanism module that aims to enhance the feature expression ability of convolutional neural networks (CNNs) by introducing channel attention and spatial attention mechanisms. CBAM is designed to help the network focus on target information more accurately in complex backgrounds and improve the performance of the model in tasks such as object detection. Figure 3 As shown in Figure 1, CBAM consists of two main parts: Channel Attention Module and Spatial Attention Module. These two modules focus on different dimensions of feature maps respectively, so as to process the feature maps more finely.
[0037] Channel attention module: The purpose of channel attention is to determine which channels are more important for the detection of target objects by analyzing the information of each channel. It generates a channel attention map by performing global average pooling (GAP) and global maximum pooling (GMP) on the feature map and combining the results of the two pooling operations. This attention map is used to adjust the importance of each channel, strengthen useful channel features, and suppress irrelevant channel features. The formula is as follows:
[0038]
[0039] Among them, F is the input feature map, M C (F) is the attention map generated by the channel attention module. represents element-by-element multiplication, and F′ is the feature map after channel attention adjustment.
[0040] Spatial attention module: performs spatial attention calculations on the feature map processed by the channel attention module. The spatial attention module generates a spatial attention map by performing a two-dimensional convolution on the feature map to focus on the important areas in the feature map. The formula is as follows:
[0041]
[0042] Among them, M S (F') is the attention map generated by the spatial attention module, and F" is the feature map after spatial attention adjustment.
[0043] The overall working mechanism of CBAM can be expressed as: output =F+F".
[0044] Residual Block is a key component in deep learning, used to solve the vanishing gradient problem in deep networks. The core idea is to learn the residual between the input and the target output by introducing skip connections. The input feature map x is processed through a series of convolution operations, activation functions, and normalization layers to obtain the processed feature map F(x). The input feature map x is directly added to the feature map F(x) after the convolution operation to alleviate the vanishing gradient problem.
[0045] The ResCBAM module in the present invention combines the advantages of CBAM and residual blocks. The structure of the ResCBAM module is as follows: Figure 4 As shown in the figure. First, the important information in the feature map is enhanced through channel attention and spatial attention, and then the original information in the input feature map is retained through the residual connection mechanism, and finally the enhanced feature map is output. The effective fusion of these two mechanisms can achieve fine adjustment and optimization of the feature map. By introducing ResCBAM in the neck part of the YOLOv8 model, this module can significantly improve the detection accuracy of small drones and enhance the robustness of the detection system in complex environments.
[0046] Improvements to the detection head:
[0047] In order to further improve the detection accuracy of small targets, the present invention adds a high-resolution detection head, the P2 detection head, to the head part of the YOLOv8 model to handle small target detection. This improvement aims to improve the ability to capture low-resolution targets, especially the detection of small drones in complex backgrounds or long-distance scenes.
[0048] Design of high-resolution detection head: YOLOv8 originally used three layers of detection heads in the head part, which were used to detect targets of different scales. In order to enhance the detection performance of small objects, this invention added a high-resolution detection head with a resolution of 160×160 pixels. This detection head can capture more detailed spatial features, such as edges, corners, and texture information, thereby improving the recognition accuracy of small drones.
[0049] Multi-layer detection head structure: The newly added detection head works together with the original multi-layer detection head to process objects of different scales at the same time. This multi-level detection mechanism allows the model to combine low-level spatial features and high-level semantic features, which is more superior when detecting small drones. With the additional high-resolution detection head, the model has a stronger resolution capability when detecting small targets, significantly improving the detection accuracy at long distances and in complex scenes.
[0050] By introducing the ResCBAM module and the high-resolution detection head, the present invention enhances the detection performance of small UAVs while retaining the real-time and high efficiency of the original YOLOv8 model. The model structure is shown in the figure below: Figure 1 The ResCBAM module effectively solves the gradient vanishing problem in deep learning and improves the ability to focus on target objects through the attention mechanism. The newly added high-resolution detection head further improves the model's detection accuracy for small targets in complex scenes.
[0051] The specific model building process is as follows:
[0052] 1. Adding Residual Block Convolutional Attention Module (ResCBAM) to YOLOv8 Network
[0053] In order to deal with a large number of small targets in the data set, the present invention introduces the residual block convolutional attention module (ResCBAM) at the neck of the YOLOv8 model. This module combines the channel attention and spatial attention mechanisms, and enhances the model's ability to focus on the key features of the target through global average pooling and maximum pooling operations. In addition, the introduction of ResBlock residual connections effectively solves the gradient vanishing problem in deep networks and further improves the stability of model training.
[0054] 2. Improve the detection head of the YOLOv8 model (P2 detection head)
[0055] The present invention adds a high-resolution detection head to the detection head part of the YOLOv8 model, and the detection head is specifically used for the detection of small targets. By adding a detection head with a resolution of 160×160 pixels, the present invention can better process low-level features and high-resolution feature maps to ensure the detection effect of small targets in complex backgrounds. The multi-layer detection head structure can effectively combine low-level spatial features and high-level semantic features to improve the recognition accuracy of small objects. Add steps 1 and 2 of the embodiment to the YOLOv8 network to complete the construction of the network, and the network is named P2-ResCBAM-YOLOv8.
[0056] 3. Training and Validation
[0057] In order to verify the effectiveness of the proposed model, a self-built dataset containing micro-UAVs was used for training. The dataset was subjected to data enhancement operations such as geometric transformation and exposure adjustment to ensure the robustness of the model in different scenarios.
[0058] The operating system used in the experiment is Windows 10 version, the deep learning framework is Pytorch 2.3.0, the language version is Python 3.8, the GPU is NVIDIA RTX 4070SUPER, the CPU is Intel Core i7-13700KF, and the Cuda version is 12.1. The training batch size of P2-ResCBAM-YOLOv8 of the present invention is 16, and the training is repeated for 100 rounds. The SGD optimizer is selected, and mixed precision training is not used to ensure the stability of the training process and the reproducibility of the results. The loss and accuracy changes of the training results are shown in Figure 2. Figure 2 After 100 rounds of training, the precision and recall of the model validation set can reach above 0.9.
[0059] 4. Results
[0060] Table 1 shows the training results of different models, including YOLOv5n, YOLOv6, YOLOv7, YOLOv8, and the improved model P2-ResCBAM-YOLOv8 proposed in this invention, and compares their performance on multiple evaluation indicators (Precision, Recall, mAP).
[0061] Table 1
[0062] Model Precision Recall mAP YOLOv5n 0.892 0.868 0.898 YOLOv6 0.883 0.866 0.901 YOLOv7 0.859 0.856 0.857 YOLOv8 0.909 0.864 0.903 P2—ResCBAM-YOLOv8 0.915 0.879 0.926
[0063] Table 1 compares the performance of different models, and uses the following three core indicators to evaluate their performance. Precision refers to the proportion of samples that are actually positive among the samples predicted by the model as positive. A high precision means that the model has a high accuracy in detecting the target and reduces false positives. Recall refers to the proportion of samples that are actually correctly detected as positive among all positive samples. A high recall means that the model can find more target objects and reduce missed detections. mAP (mean average precision) is an indicator that combines precision and recall, and is mainly used to evaluate the overall performance of the model in the detection task. A high mAP value means that the model has a good overall performance in the detection task.
[0064] The improved model P2-ResCBAM-YOLOv8 proposed in this paper performs best in various indicators. Its precision, recall and mAP are higher than other models, especially in mAP (92.6%) and precision (91.5%), showing excellent performance.
[0065] Figure 5The small drone detection effect in the validation set is demonstrated, where the validation set selects small drone targets in various scenarios including night scenes and long distances. The results show that the P2-ResCBAM-YOLOv8 model can accurately identify the location of drones in these complex scenes, showing extremely high detection accuracy. In addition, for some drone identification tasks with complex background interference, the P2-ResCBAM-YOLOv8 model can accurately distinguish the specific location of the drone from the background with its enhanced feature extraction capabilities, significantly improving the reliability and accuracy of detection.
[0066] The present invention introduces the residual block convolutional block attention module (ResCBAM) and high-resolution detection head, which enables the model to better identify target objects with slight differences when extracting target features. Whether in long-distance monitoring scenarios with high flight altitudes or in complex backgrounds with a large number of interfering objects, the model can maintain high detection accuracy, significantly improving the accuracy, efficiency and robustness of the YOLOv8 model in small drone detection tasks, and has broad application prospects.
[0067] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. An optimized YOLOv8 combined with attention mechanism small drone detection method, characterized in that: The following steps are involved: S1: Introduce the residual block convolution block attention module in the neck part of the YOLOv8 model; S2: Add a high-resolution detection head to the detection head of the YOLOv8 model; S3: Build the P2-ResCBAM-YOLOv8 network based on the above improvements; S4: Build a dataset of images of small drones in complex backgrounds to train and validate the new YOLOv8 model; S5: Identify small drone targets in complex backgrounds based on the optimized YOLOv8 model.
2. According to claim 1, an optimized YOLOv8 combined with attention mechanism small drone detection method is characterized by: The residual block convolution block attention module includes: A channel attention module, which is used to generate a channel attention map through global average pooling and global maximum pooling operations, and perform weighted processing on each channel of the input feature map; A spatial attention module is used to generate a spatial attention map through a two-dimensional convolution operation and perform weighted processing on the feature map after channel attention adjustment in the spatial dimension.
3. According to claim 2, an optimized YOLOv8 combined with attention mechanism small drone detection method is characterized by: The residual block convolutional block attention module adds the input feature map to the feature map processed by channel attention and spatial attention through the residual connection mechanism.
4. The small drone detection method based on an optimized YOLOv8 combined with an attention mechanism according to claim 1, characterized in that: The resolution of the added high-resolution detection head is 160×160 pixels. The multi-level detection head structure combines low-level and high-level feature information to detect targets at different scales.
5. The small drone detection method based on an optimized YOLOv8 combined with an attention mechanism according to claim 4, characterized in that: The low-level and high-level feature information includes low-resolution spatial features and high-level semantic features.
6. The small drone detection method based on an optimized YOLOv8 combined with an attention mechanism according to claim 1, characterized in that: The backbone network of the YOLOv8 model adopts a novel C2f convolution module and introduces an anchor-free box detection mechanism at the head of the YOLOv8 model to detect directly from the center point of the target.
7. The small drone detection method based on an optimized YOLOv8 combined with an attention mechanism according to claim 1, characterized in that: The image dataset has undergone data augmentation operations such as geometric transformation and exposure adjustment. The training batch size of the P2-ResCBAM-YOLOv8 network is 16, and the training is repeated for 100 rounds. The SGD optimizer is selected.
8. The small drone detection method based on an optimized YOLOv8 combined with an attention mechanism according to claim 7, characterized in that: Optimize the model training process by adjusting momentum and weight decay hyperparameters; Disable mosaic augmentation in the last 10 epochs of training in the YOLOv8 model.
Citation Information
Cited By
Unmanned aerial vehicle image recognition method and device based on YOLOv8 lightweight network model
CN120564083A