Aerial image small target detection method and system based on improved YOLOv8 algorithm, medium and processor

By introducing a global attention mechanism and an improved feature pyramid structure into the YOLOv8 detection algorithm, combined with the Focaler-CIoU loss function, the problem of low detection accuracy of small targets in aerial images of drones is solved, and more efficient small target detection is achieved.

CN119625269APending Publication Date: 2025-03-14GUILIN UNIV OF ELECTRONIC TECH

Patent Information

Application Number
CN202411711888.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

There are a large number of small targets in the aerial images of the drone, and the target distribution is uneven and there is occlusion, resulting in low target detection accuracy.

Method used

The global attention mechanism GAM is introduced into the Backbone network of the YOLOv8 detection algorithm, and a CSPOmniKernel model is added to the Neck network to improve the feature pyramid structure and adopt the Focaler-CIoU loss function to improve the accuracy and speed of small object detection.

Benefits of technology

By improving the network architecture of the YOLOv8 algorithm, the accuracy and speed of small object detection are significantly improved, especially in experiments on the Visdrone dataset, the detection accuracy has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625269A_ABST
    Figure CN119625269A_ABST
Patent Text Reader

Abstract

The invention provides an aerial image small target detection method based on an improved YOLOv8 algorithm, and the method comprises the steps: S1, obtaining an aerial image data set, converting the aerial image data set into a YOLO format, and dividing the data set into a training data set and a test data set; s2, an improved YOLOv8 detection model is built; s3, inputting the training data set into the improved YOLOv8 detection model, and training to convergence to obtain a final improved YOLOv8 detection model; s4, a test data set is input into the improved YOLOv8 detection model for testing, and the mAP value of the improved YOLOv8 detection model on the data set is recorded; and S5, inputting the aerial image into the tested improved YOLOv8 detection model, and carrying out small target detection. Therefore, the accuracy of target detection is improved, the global to local effective features of the small target image are effectively extracted, and the detection precision of the small target is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of small target detection in aerial images, and in particular to a method, system, medium and processor for small target detection in aerial images based on an improved YOLOv8 algorithm. Background Art

[0002] With the continuous development of science and technology, target detection technology has demonstrated its wide application value in many practical scenarios, covering the fields of intelligent vehicles, robot vision recognition, and high-definition surveillance cameras. In recent years, the widespread use of drone technology has gradually penetrated into people's daily lives. Today, drones are playing an increasingly important role in logistics distribution, transportation, aerial photography and other fields.

[0003] The current deep learning-based drone image target detection methods can be divided into two categories: two-stage and single-stage. The two-stage method is represented by Faster-RCNN, which first generates candidate regions through the region proposal network (RPN) and then classifies them. This algorithm processes a single feature map, resulting in a high degree of compression of the spatial information in the image, which is not conducive to the recognition of small targets.

[0004] The single-stage algorithm is represented by YOLOv8, which directly and densely predicts the category and bounding box of the target on the input image. It has a faster processing speed and is more suitable for real-time detection. When facing the special environment of drone aerial photography, the target detection method based on YOLOv8 faces the following two difficulties: First, there are a large number of small targets in drone aerial images, and the targets are unevenly distributed and there are occlusions between targets. These factors interfere with target detection and reduce detection accuracy. Secondly, since drones are photographed from high altitudes, the targets are usually small targets, and the proportion of pixels they occupy in the image is small, so detection is more difficult. Therefore, on the premise of improving the original accuracy, it is necessary to improve the network architecture of the YOLOv8 detection algorithm to improve the detection accuracy and speed of small targets.

[0005] In view of this, a method, system, medium and processor for detecting small targets in aerial images based on an improved YOLOv8 algorithm are needed. Summary of the invention

[0006] In view of the problem that the proportion of pixels occupied by small targets in the prior art is small and the detection is difficult, the present invention provides a method, system, medium and processor for detecting small targets in aerial images based on an improved YOLOv8 algorithm, which can solve the problem that the detection of small targets is difficult. The specific technical solution is as follows:

[0007] A method for detecting small targets in aerial images based on an improved YOLOv8 algorithm, comprising:

[0008] S1: Obtain the aerial image dataset and convert it into YOLO format, and divide the dataset into training dataset and test dataset;

[0009] S2: Build an improved YOLOv8 detection model; the improved YOLOv8 detection model includes a Backbone network, a Neck network and a Head network connected in sequence; the Backbone network includes P1, P2, P3, P4 and P5 extraction layers connected in sequence, and a global attention mechanism GAM is added after the C2f module of the P4 and P5 extraction layers to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; a CSPOMniKernel model is added to the Neck network to integrate the extracted features;

[0010] S3: Input the training data set into the improved YOLOv8 detection model and train it until convergence to obtain the final improved YOLOv8 detection model;

[0011] S4: Test the improved YOLOv8 detection model by inputting the test data set, and record the mAP value of the improved YOLOv8 detection model on the data set;

[0012] S5: Input the aerial image into the tested improved YOLOv8 detection model to perform small target detection.

[0013] Furthermore, the Backbone network also includes the following construction steps:

[0014] Construct a P1 extraction layer that only contains convolution modules to perform preliminary extraction and scale adjustment of image features;

[0015] Construct the P2, P3, P4, and P5 extraction layers, which contain convolutional modules and C2f modules respectively;

[0016] Add an SPPF module in the P5 extraction layer to enhance the detection network's ability to detect objects of different scales;

[0017] Each layer extracts small target information features from the aerial image in turn, and transmits the extracted feature information to the improved Neck network.

[0018] Furthermore, the CSPOMniKernel model includes a global branch, a large branch, a local branch, and Conv modules connected to the input and output ends of the above three branches respectively; the global branch includes a DCAM module and a FSAM module connected in sequence, which are used to capture global context information, which helps the model understand the overall layout and scene of the image; the large branch includes several DConv modules arranged in parallel, which are used to focus on larger targets or feature areas, which helps to improve the detection performance of large targets, and may also indirectly help small targets to be better detected through contextual relationships; the local branch includes a single DConv module, which focuses on local details, especially small targets and edge information; the three branches work together to effectively learn feature representations from global to local, thereby improving the detection performance of small targets.

[0019] Furthermore, the Neck network also includes an SPDConv module connected to the C2f module of the P2 extraction layer; after being processed by the SPDConv module, the small target information in the P2 extraction layer is significantly enhanced, and is fused with the extracted information of the P3 extraction layer before entering the CSPOMniKernel model for integration.

[0020] Furthermore, the improved YOLOv8 detection model adopts an enhanced loss function Focaler-CIoU; the enhanced loss function Focaler-CIoU formula is as follows:

[0021] L Focaler-CIoU =L CIoU +IoU-IoU Focaler ;

[0022]

[0023] In the above formula, IoU is the intersection-over-union ratio of the predicted box and the real box; IoU focaler Represents the reconstructed Focaler-IoU; [d,u]∈(0,1), by adjusting the values ​​of d and u, the IoU focaler Focus on different regression samples; L CIoU is the CIoU loss function value; L Focaler-CIoU is the Focaler-CIoU loss function value.

[0024] Furthermore, step S4 also includes the following steps: when testing the improved YOLOv8 detection model input test data set, the test effect is evaluated by average precision, correctness and recall.

[0025] A small target detection system for aerial images based on an improved YOLOv8 algorithm is applied to the above-mentioned small target detection method for aerial images based on an improved YOLOv8 algorithm, comprising:

[0026] An acquisition module is used to acquire an aerial image dataset and convert it into the YOLO format, and divide the dataset into a training dataset and a test dataset;

[0027] A building module, which is used to build an improved YOLOv8 detection model; the improved YOLOv8 detection model includes a Backbone network, a Neck network and a Head network connected in sequence; the Backbone network includes P1, P2, P3, P4 and P5 extraction layers connected in sequence, and a global attention mechanism GAM is provided behind the C2f module of the P4 and P5 extraction layers to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; a CSPOMniKernel model is added to the Neck network to integrate the extracted features;

[0028] A training module is used to input the training data set into the improved YOLOv8 detection model and train it until convergence to obtain the final improved YOLOv8 detection model;

[0029] A testing module is used to test the improved YOLOv8 detection model by inputting a test data set, and record the mAP value of the improved YOLOv8 detection model on the data set;

[0030] The detection module is used to input the aerial image into the tested improved YOLOv8 detection model for small target detection.

[0031] Furthermore, the CSPOMniKernel module includes a global branch, a large branch and a local branch to effectively learn feature representations from global to local, thereby improving the detection performance of small targets; the global branch includes a DCAM module and a FSAM module connected in sequence to capture global context information, which helps the model understand the overall layout and scene of the image; the large branch includes several DConv modules arranged in parallel to focus on larger targets or feature areas, which helps to improve the detection performance of large targets, and may also indirectly help small targets to be better detected through contextual relationships; the local branch includes a single DConv module, which focuses on local details, especially small targets and edge information; the three branches work together to effectively learn feature representations from global to local, thereby improving the detection performance of small targets; the Neck network transmits the integrated feature information to the Head network for target prediction.

[0032] A computer-readable storage medium includes a stored program, wherein when the program is run, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned aerial image small target detection method based on the improved YOLOv8 algorithm.

[0033] A processor is used to run a program, wherein the program executes the above-mentioned aerial image small target detection method based on the improved YOLOv8 algorithm when running.

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

[0035] 1. A method for detecting small targets in aerial images based on the improved YOLOv8 algorithm is proposed. The GAM attention mechanism is introduced in the C2f module in the Backbone network to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; the feature pyramid is improved in the Neck network, and the Smalltarget improve Pyramid (STIP) is proposed based on the original PAFPN structure to effectively extract effective features from the global to local aspects of the small target image, thereby improving the detection accuracy of small targets. Focaler-CIoU is used to replace the original CIoU to focus on regression samples of different difficulties and improve the detection accuracy. The detection accuracy of small targets has been improved through the experimental results on the Visdrone dataset, proving the effectiveness of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.

[0037] Figure 1 This is a flowchart of a method for detecting small targets in aerial images based on the improved YOLOv8 algorithm;

[0038] Figure 2 To improve the YOLOv8 detection model structure diagram;

[0039] Figure 3 This is a schematic diagram of the BackBone network structure;

[0040] Figure 4 It is a structural diagram of the convolution module Conv;

[0041] Figure 5 It is a schematic diagram of the structure of the C2f module;

[0042] Figure 6 It is a schematic diagram of the structure of the CSP-OmniKernel model;

[0043] Figure 7This is a schematic diagram of the structure of the OmniKernel module. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0046] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0047] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0048] Embodiment 1

[0049] like Figure 1 The figure shows a flowchart of a method for detecting small targets in aerial images based on an improved YOLOv8 algorithm, including:

[0050] S1: Obtain a drone aerial image dataset and convert it into YOLO format, and divide the dataset into a training dataset and a test dataset.

[0051] Furthermore, the drone aerial image dataset is the VisDrone dataset, which is used to train the model.

[0052] S2: Build an improved YOLOv8 detection model, such as Figure 2 , Figure 3As shown, based on the YOLOv8 detection model, the backbone network, Neck network and loss function of the YOLOv8 detection model are modified by combining the global attention mechanism GAM, the improved feature pyramid network SOEP and the use of Focaler-CIoU to replace CIoU; the improved YOLOv8 detection model includes three parts, namely, an improved Backbone network, an improved Neck network and a Head network, which are connected in sequence; the Backbone network includes P1, P2, P3, P4 and P5 extraction layers which are connected in sequence, and a global attention mechanism GAM is added behind the C2f module of the P4 and P5 extraction layers to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; a CSPOMniKernel model is added to the Neck network to integrate the extracted features.

[0053] In the specific implementation, the Backbone network is responsible for extracting rich feature representations from the input image; the Neck network is responsible for fusing the features extracted by the Backbone network at different stages, and the Head network uses the fused features to predict the target of the image.

[0054] In a specific implementation, the Backbone network also includes the following construction steps:

[0055] Construct a P1 extraction layer that only contains convolution modules to perform preliminary extraction and scale adjustment of image features;

[0056] Construct the P2, P3, P4, and P5 extraction layers, which contain convolutional modules and C2f modules respectively;

[0057] Add an SPPF module in the P5 extraction layer to enhance the detection network's ability to detect objects of different scales;

[0058] Each layer extracts small target information features from the aerial image in turn, and transmits the extracted feature information to the improved Neck network.

[0059] Build the backbone network (Backbone) of the improved YOLOv8 detection model as follows Figure 3As shown in the figure, the input image passes through the Backbone network and then outputs to the Neck network, and it has to go through five extraction layers from P1 to P5. The P1 extraction layer only contains one convolution module Conv, which performs preliminary extraction and scale adjustment of image features to prepare for subsequent stages. The P2, P3, P4 and P5 extraction layers contain one convolution module Conv and one C2f module, and a global attention mechanism GAM is added after the C2f module in the P4 and P5 extraction layers to enhance the model's ability to focus on important feature areas. Furthermore, the P5 extraction layer, based on this, contains an SPPF module to enhance the network's ability to detect objects of different scales.

[0060] In the specific implementation, the detailed design diagram of the convolution module Conv is as follows Figure 4 As shown in the figure, it consists of a two-dimensional convolution, a batchNorm2d and an activation function Silu. The convolution kernel size of the two-dimensional convolution is 3*3; the role of BatchNorm2d is that for each small batch of data, it will calculate the mean and variance of all samples in the batch on the same feature map, and then use these statistics to normalize the feature map. After that, it will scale and translate the normalized data through a learnable parameter and offset to restore the expressiveness of the data; the activation function SiLu can introduce nonlinearity, improve the expressiveness of the model, and can also alleviate the gradient disappearance problem and achieve self-regularization effect. The formula of the activation function Silu is as follows:

[0061]

[0062] As an optimized version of ReLU, the Silu(x) activation function has the advantage of showing a smooth transition characteristic in the near-zero region, which effectively alleviates the gradient vanishing problem that may be caused by ReLU. In addition, Silu(x) subtly limits the range of network output to between 0 and 1 by introducing the sigmoid function. This feature not only enriches the nonlinear capabilities of the model, but also brings more flexible data processing capabilities to the network architecture of this solution, ensuring that the network can efficiently capture and accurately express complex data patterns.

[0063] In the specific implementation, the C2f module is an improved design based on the C3 module of YOLOv5, aiming to improve the performance and efficiency of the model. Compared with the C3 module, the C2f module has more skip-layer connections and additional Split operations. The specific structure of the C2f module is as follows: Figure 5As shown, it first consists of a convolutional block Conv, which receives the input feature map and generates an intermediate feature map; the generated intermediate feature map is split into two parts, one part is directly passed to the final Concat block, and the other part is passed to multiple Bottleneck blocks for further processing; in the C2f module, the number of Bottleneck modules is defined by the depth multiple parameter of the model, which means that the depth and computational complexity of the module can be flexibly adjusted according to needs. The two parts will finally be spliced ​​in a Concat block, and the feature map will be input into a final convolutional block Conv for further processing to generate the final output feature map. The C2f module can be improved here. For example, this solution inserts a global attention mechanism GAM after the first convolution block of the C2f module of the P4 and P5 extraction layers of the BackBone network. This improved module can enhance the model's ability to focus on important feature areas.

[0064] Furthermore, the global attention mechanism GAM retains information to promote global cross-dimensional interactions, and is committed to solving problems that may arise in traditional attention mechanisms. It combines the channel attention module and the spatial attention module to amplify the global interaction representation while reducing information loss. By processing information in both channel and spatial dimensions, GAM can more comprehensively retain important information in the input feature map, reduce losses in the process of information transmission, and thus improve the accuracy of small target detection.

[0065] The feature fusion network C2f-GAM with GAM attention mechanism is introduced to capture global information to enhance the expressiveness of features. GAM attention mechanism can amplify global dimensional interaction features while reducing information diffusion. Sequential channel-spatial attention mechanism is adopted and CBAM submodule is redesigned.

[0066] Furthermore, the SPPF module is also known as spatial pyramid pooling, which is a flexible mechanism designed to map feature maps of any size into feature vectors of fixed length. Its workflow is finely divided into several steps. First, the input feature map is divided into three different levels of regional blocks according to the desired output feature dimension; in each level, a maximum pooling operation is performed, that is, the maximum value is selected from each block as the feature representation of the block. This step ensures that no matter how the size of the input feature map changes, each level can contribute a fixed number of feature values; finally, these feature values ​​from all levels are combined into a single, fixed-length feature vector through a splicing operation. This approach not only simplifies the feature processing process, but also enhances the model's adaptability to inputs of different sizes.

[0067] The feature maps of drone aerial images of different scales obtained by the improved backbone network BackBone network are input into the Neck network in the improved YOLOv8 detection model.

[0068] The detection capability and accuracy of small targets in drone aerial images are limited on the normal P3, P4, and P5 extraction layers. The improvement approach is to add a P2 extraction layer to the Neck network to improve the detection capability. However, while this approach brings improvements, it is also accompanied by a series of problems, mainly including increased computational complexity and increased post-processing time. The P2 extraction layer is located in the shallower layers of the network, and its feature map resolution is usually higher. This means that when performing feature extraction and detection in the P2 extraction layer, more pixels need to be processed, thereby increasing the amount of calculation; after adding the P2 detection head, the total number of detection heads increases from the original 3 (P3, P4, P5) to 4 (P2, P3, P4, P5), and each detection head needs to perform independent feature extraction and detection operations, which further increases the overall amount of calculation.

[0069] The above problems increasingly stimulate the need to develop new effective feature pyramids for small targets. Based on PAFPN, we have made improvements and proposed the Small target improve Pyramid (STIP). The solution is not to directly increase the P2 extraction layer, but to enhance the detection capability of small targets by improving the feature extraction and fusion methods. In the specific implementation, the Neck network also includes an SPDConv module connected to the C2f module of the P2 extraction layer. After being processed by the SPDConv module, the small target information in the P2 extraction layer is significantly enhanced, and after being fused with the extracted information of the P3 extraction layer, it enters the CSPOMniKernel model for integration. In order to further improve the feature representation capability, STIP uses the CSP (Cross Stage Partial) idea and the OmniKernel module proposed by AAAI to improve the CSP-OmniKernel for feature integration. The CSP-OmniKernel model structure is as follows: Figure 6 shown.

[0070] The CSP-OmniKernel model enhances feature learning capabilities through cross-stage partial connections, reduces the amount of computation, and increases the network's utilization of features. The CSP-OmniKernel model divides the input feature maps into two parts, each of which undergoes a different processing path. One part is feature data processed by the Conv module, and the other part is feature data processed by the OmniKernel module. The processed feature data is then fused to improve network performance and detection accuracy. The OmniKernel module is a powerful feature integration module, and its structure is shown in the figure below. Figure 7 As shown in the figure, after 1×1 convolution processing, the feature information is input into three branches, namely: the global branch, which captures global context information and helps the model understand the overall layout and scene of the image; the large branch, which focuses on larger objects or feature areas, helps improve the detection performance of large objects, and may also indirectly help small objects get better detection through contextual relationships; the local branch, which focuses on local details, especially small objects and edge information, which is crucial for small object detection. The results of the last three branches are fused by addition and modulated by another 1×1 convolution. In the following, we will introduce the internal components of each branch. In the global branch, dual-domain processing is adopted to increase the ability of global modeling. Specifically, the global branch consists of a dual-domain channel attention module (DCAM) and a frequency-based spatial attention module (FSAM). A 31×31 deep convolution is used in the large branch to pursue a larger receptive field, and 1×31 and 31×1 deep convolutions are used in parallel to collect context information. A 1×1 deep convolution layer is used in the local branch to process local information. Through the collaborative work of these three branches, the CSP-OmniKernel module can effectively learn feature representation from global to local, provide rich feature information for small target detection, and improve the accuracy of small target detection.

[0071] Furthermore, the CSPOMniKernel model includes a global branch, a large branch, a local branch, and Conv modules connected to the input and output ends of the above three branches respectively; the global branch includes a DCAM module and a FSAM module connected in sequence, which are used to capture global context information, which helps the model understand the overall layout and scene of the image; the large branch includes several DConv modules arranged in parallel, which are used to focus on larger targets or feature areas, which helps to improve the detection performance of large targets, and may also indirectly help small targets to be better detected through contextual relationships; the local branch includes a single DConv module, which focuses on local details, especially small targets and edge information; the three branches work together to effectively learn feature representations from global to local, thereby improving the detection performance of small targets.

[0072] In the specific implementation, YOLOv8 uses CIoU as the loss function, but CIoU requires accurate target box and prediction box information, including center point coordinates, aspect ratio, etc. in the calculation process. However, in practical applications, due to the accuracy limitations of data set annotations and the uncertainty of model output, this information may be difficult to guarantee complete accuracy, thus affecting the training effect of the model. The formula of CIoU is as follows, where IoU is the intersection of the predicted box and the true box, and the value range of IoU is between 0 and 1. When the IoU value is larger, it means that the degree of overlap between the predicted box and the true box is higher, that is, the more accurate the prediction result of the model is. On the contrary, the smaller the IoU value is, the greater the difference between the predicted box and the true box is, and the lower the prediction accuracy of the model is. The formula of IoU is as follows. CIoU usually uses the same loss function and weight for all samples, without distinguishing the difference between difficult samples and easy samples.

[0073]

[0074]

[0075]

[0076]

[0077] α is a parameter used to adjust the trade-off between completeness and overlap metrics, v is used to measure the similarity of aspect ratios, IoU represents intersection over union, b represents the center point of the predicted box, and b gt It represents the center point of the real box; ρ is used to calculate the Euclidean distance between the two center points; c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the real box; h represents the length and ω represents the width.

[0078] The improved YOLOv8 detection model described in this application adopts the enhanced loss function Focaler-CIoU, which improves the CIoU loss function. Focaler-CIoU dynamically adjusts the weight of the sample in the regression process according to the difficulty of the sample by designing a linear interval mapping mechanism. Specifically, for difficult samples with lower IoU, higher weights are given to make their contribution to the loss function greater; for easy samples with higher IoU, the weights are appropriately reduced to avoid the model from paying too much attention to these samples that have performed well. This design enables the model to focus more on areas that need improvement, thereby improving the overall detection accuracy and robustness. Especially when dealing with small target detection in complex scenes, the detection accuracy can be improved. The formula of Focaler-CIoU is as follows:

[0079] L Focaler-CIoU =L CIoU +IoU-IoUFocaler ;

[0080]

[0081]

[0082] In the above formula, L CIoU is the CIoU loss function value; IoU is the intersection-over-union ratio of the predicted box and the real box; IoU focaler Represents the reconstructed Focaler-IoU; [d,u]∈(0,1), by adjusting the values ​​of d and u, the IoU focaler Focus on different regression samples. In order to focus on different detection tasks in different regression samples, the linear interval mapping method is used to reconstruct the IoU (intersection over union) loss to improve the effect of edge regression. The formula is as above. By dynamically adjusting the IoU loss, more attention can be paid to samples that have a greater impact on the detection effect in different detection tasks, thereby improving the overall detection performance.

[0083] To improve the loss function, YoLov8 uses CIoU as the loss function. However, since the CIoU loss function only considers the overlap degree and size difference between the target boxes, but does not consider the shape difference of the bounding box, when dealing with targets of different scales, especially small targets, it will be affected by the scale change, resulting in a decrease in detection accuracy. Therefore, Focaler-CIoU is used to replace CIoU to focus on regression samples of different difficulties to improve detection accuracy.

[0084] S3: Input the VisDrone training set image dataset into the improved YOLOv8 detection model and train it until convergence to obtain the final improved YOLOv8 detection model.

[0085] The specific training steps are as follows: the programming language used is Python 3.8, CUDA is 11.3, the network optimizer is SGD optimizer, the BatchSize size is set to 8, the learning rate is set to 0.01, and the number of training rounds is 300.

[0086] S4: Test the improved YOLOv8 detection model by inputting the test data set, and record the mAP value of the improved YOLOv8 detection model on the data set.

[0087] Furthermore, step S4 further includes the following steps: when testing the improved YOLOv8 detection model by inputting the test data set, the test effect is evaluated by the average precision, correctness and recall. The specific calculation formula is as follows:

[0088] The formula for average precision is as follows:

[0089]

[0090] The formula for accuracy is as follows:

[0091]

[0092] The formula for recall is as follows:

[0093]

[0094] Among them, TP refers to the number of samples correctly predicted as positive categories by the model; FP refers to the number of samples incorrectly predicted as positive categories by the model; FN refers to the probability that the model incorrectly predicts as negative categories; the average precision (mAP) comprehensively considers the accuracy (P) and recall (R) of m categories, and more comprehensively reflects the performance of the network; P(R) is the accuracy; R is the recall.

[0095] Comparing the experimental results with the baseline model, the mAp@0.5 of this scheme increased by 3.8%, and the mAp@0.5:0.95 increased by 2.6%, and the detection accuracy was improved.

[0096] In addition, the present invention uses mean average precision (mAP) and the fluctuation of precision and recall as indicators for evaluating the performance of multi-label image detection. mAP is obtained by drawing a PR curve, which is a two-dimensional curve with precision as the ordinate and recall as the abscissa. Among them, precision reflects the accuracy of model detection, and recall represents the model's ability to recognize real targets. The fluctuation of precision and recall can reflect the quality of training effect: small fluctuation usually means better training effect, and if the performance is good, the PR curve shows a steadily rising trend.

[0097] S5: Input the aerial image into the tested improved YOLOv8 detection model to perform small target detection.

[0098] This application solution can better suit the task of detecting small targets in drone aerial photography, and effectively improves the accuracy of small target detection. Compared with the basic model YOLOv8, mAp@0.5 increased by 3.8%, and mAp@0.5:0.95 increased by 2.6%. This solution method addresses the problem of small targets and target occlusion in drone aerial image target detection, reduces target missed detection and false detection, and proves that the method of the present invention is applicable.

[0099] The present invention proposes a method for detecting small targets in drone aerial images based on YOLOv8. The GAM attention mechanism is introduced in the C2f layer in Backbone to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection. The feature pyramid is improved in the Neck part, and the Smalltarget improve Pyramid (STIP) is proposed based on the original PAFPN structure to effectively extract global and local effective features of small target images, thereby improving the detection accuracy of small targets. Focaler-CIoU is used to replace the original CIoU to focus on regression samples of different difficulties to improve the detection accuracy. The detection accuracy of small targets has been improved through evaluation of experimental results on the Visdrone dataset, proving the effectiveness of the present invention.

[0100] Embodiment 2

[0101] A small target detection system for aerial images based on an improved YOLOv8 algorithm is applied to the above-mentioned small target detection method for aerial images based on an improved YOLOv8 algorithm, comprising:

[0102] An acquisition module is used to acquire an aerial image dataset and convert it into the YOLO format, and divide the dataset into a training dataset and a test dataset;

[0103] A building module, which is used to build an improved YOLOv8 detection model; the improved YOLOv8 detection model includes a Backbone network, a Neck network and a Head network connected in sequence; the Backbone network includes P1, P2, P3, P4 and P5 extraction layers connected in sequence, and a global attention mechanism GAM is provided behind the C2f module of the P4 and P5 extraction layers to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; a CSPOMniKernel model is added to the Neck network to integrate the extracted features;

[0104] A training module is used to input the training data set into the improved YOLOv8 detection model and train it until convergence to obtain the final improved YOLOv8 detection model;

[0105] A testing module is used to test the improved YOLOv8 detection model by inputting a test data set, and record the mAP value of the improved YOLOv8 detection model on the data set;

[0106] The detection module is used to input the aerial image into the tested improved YOLOv8 detection model for small target detection.

[0107] Furthermore, the CSPOMniKernel module includes a global branch, a large branch and a local branch to effectively learn feature representations from global to local, thereby improving the detection performance of small targets; the global branch includes a DCAM module and a FSAM module connected in sequence to capture global context information, which helps the model understand the overall layout and scene of the image; the large branch includes several DConv modules arranged in parallel to focus on larger targets or feature areas, which helps to improve the detection performance of large targets, and may also indirectly help small targets to be better detected through contextual relationships; the local branch includes a single DConv module, which focuses on local details, especially small targets and edge information; the three branches work together to effectively learn feature representations from global to local, thereby improving the detection performance of small targets; the Neck network transmits the integrated feature information to the Head network for target prediction.

[0108] Embodiment 3

[0109] A computer-readable storage medium includes a stored program, wherein when the program is run, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned aerial image small target detection method based on the improved YOLOv8 algorithm.

[0110] Embodiment 4

[0111] A processor is used to run a program, wherein the program executes the above-mentioned aerial image small target detection method based on the improved YOLOv8 algorithm when running.

[0112] The present application proposes a method for detecting small targets in aerial images based on an improved YOLOv8 algorithm, including: S1: obtaining an aerial image dataset and converting it into a YOLO format, and dividing the dataset into a training dataset and a test dataset; S2: building an improved YOLOv8 detection model; the improved YOLOv8 detection model includes a Backbone network, a Neck network, and a Head network connected in sequence; the Backbone network includes P1, P2, P3, P4, and P5 extraction layers connected in sequence, and a global attention mechanism GA is added behind the C2f modules of the P4 and P5 extraction layers M, to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; the CSPOMniKernel model is added to the Neck network to integrate the extracted features; S3: the training data set is input into the improved YOLOv8 detection model, and trained until convergence to obtain the final improved YOLOv8 detection model; S4: the improved YOLOv8 detection model is input into the test data set for testing, and the mAP value of the improved YOLOv8 detection model on the data set is recorded; S5: the aerial image is input into the tested improved YOLOv8 detection model for small target detection. The GAM attention mechanism is introduced into the C2f module in the Backbone network to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; the feature pyramid is improved in the Neck network, and the Small target improve Pyramid (STIP) is proposed based on the original PAFPN structure to effectively extract the global to local effective features of the small target image, thereby improving the detection accuracy of the small target. Focaler-CIoU is used to replace the original CIoU to focus on regression samples of different difficulty levels and improve detection accuracy. The detection accuracy of small targets is improved through evaluation of experimental results on the Visdrone dataset, proving the effectiveness of the present invention.

[0113] Those of ordinary skill in the art will appreciate that the units of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition of each example has been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0114] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored, etc.

[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0116] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-0nlyMemory), random access memory (RAM, RandomAccessMemory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.

[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

Claims

1. A method for detecting small targets in aerial images based on an improved YOLOv8 algorithm, characterized in that: include: S1: Obtain the aerial image dataset and convert it into YOLO format, and divide the dataset into training dataset and test dataset; S2: Build an improved YOLOv8 detection model; the improved YOLOv8 detection model includes a Backbone network, a Neck network and a Head network connected in sequence; the Backbone network includes P1, P2, P3, P4 and P5 extraction layers connected in sequence, and a global attention mechanism GAM is added after the C2f module of the P4 and P5 extraction layers to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; a CSPOMniKernel model is added to the Neck network to integrate the extracted features; S3: Input the training data set into the improved YOLOv8 detection model and train it until convergence to obtain the final improved YOLOv8 detection model; S4: Test the improved YOLOv8 detection model by inputting the test data set, and record the mAP value of the improved YOLOv8 detection model on the data set; S5: Input the aerial image into the tested improved YOLOv8 detection model to perform small target detection.

2. The method for detecting small targets in aerial images based on the improved YOLOv8 algorithm according to claim 1, characterized in that: The Backbone network also includes the following construction steps: Construct a P1 extraction layer that only contains convolution modules to perform preliminary extraction and scale adjustment of image features; Construct the P2, P3, P4, and P5 extraction layers, which contain convolutional modules and C2f modules respectively; Add an SPPF module in the P5 extraction layer to enhance the detection network's ability to detect objects of different scales; Each layer extracts small target information features from the aerial image in turn, and transmits the extracted feature information to the improved Neck network.

3. The method for detecting small targets in aerial images based on the improved YOLOv8 algorithm according to claim 1, characterized in that: The CSPomniKernel model includes a global branch, a large branch, a local branch and Conv modules connected to the input and output ends of the above three branches respectively; the global branch includes a DCAM module and a FSAM module connected in sequence, which are used to capture global context information, which helps the model understand the overall layout and scene of the image; the large branch includes several DConv modules arranged in parallel, which are used to focus on larger targets or feature areas, which helps to improve the detection performance of large targets, and may also indirectly help small targets to be better detected through contextual relationships; the local branch includes a single DConv module, which focuses on local details, especially small targets and edge information; the three branches work together to effectively learn feature representations from global to local, thereby improving the detection performance of small targets.

4. The method for detecting small targets in aerial images based on the improved YOLOv8 algorithm according to claim 1, characterized in that: The Neck network also includes an SPDConv module connected to the C2f module of the P2 extraction layer; after being processed by the SPDConv module, the small target information in the P2 extraction layer is significantly enhanced, and is fused with the extracted information of the P3 extraction layer before entering the CSPOMniKernel model for integration.

5. The method for detecting small targets in aerial images based on the improved YOLOv8 algorithm according to claim 1, characterized in that: The improved YOLOv8 detection model adopts the enhanced loss function Focaler-CIoU; the enhanced loss function Focaler-CIoU formula is as follows: L Focaler-CIoU =L CIoU +IoU-IoU Focaler ; In the above formula, IoU is the intersection-over-union ratio of the predicted box and the real box; IoU focaler Represents the reconstructed Focaler-IoU; [d,u]∈(0,1), by adjusting the values ​​of d and u, the IoU focaler Focus on different regression samples; L CIoU is the CIoU loss function value; L Focaler-CIoU is the Focaler-CIoU loss function value.

6. The method for detecting small targets in aerial images based on the improved YOLOv8 algorithm according to claim 1, characterized in that: Step S4 also includes the following steps: when testing the improved YOLOv8 detection model input test data set, the test effect is evaluated by average precision, correctness and recall.

7. A small target detection system for aerial images based on an improved YOLOv8 algorithm, characterized in that: The method for detecting small targets in aerial images based on the improved YOLOv8 algorithm as described in any one of claims 1 to 6 comprises: An acquisition module is used to acquire an aerial image dataset and convert it into the YOLO format, and divide the dataset into a training dataset and a test dataset; A building module, which is used to build an improved YOLOv8 detection model; the improved YOLOv8 detection model includes a Backbone network, a Neck network and a Head network connected in sequence; the Backbone network includes P1, P2, P3, P4 and P5 extraction layers connected in sequence, and a global attention mechanism GAM is provided behind the C2f module of the P4 and P5 extraction layers to enhance the model's ability to focus on important feature areas, thereby improving the accuracy of target detection; a CSPOMniKernel model is added to the Neck network to integrate the extracted features; A training module is used to input the training data set into the improved YOLOv8 detection model and train it until convergence to obtain the final improved YOLOv8 detection model; A testing module is used to test the improved YOLOv8 detection model by inputting a test data set, and record the mAP value of the improved YOLOv8 detection model on the data set; The detection module is used to input the aerial image into the tested improved YOLOv8 detection model for small target detection.

8. The aerial image small target detection system based on the improved YOLOv8 algorithm according to claim 7, characterized in that: The CSPOMniKernel module includes a global branch, a large branch and a local branch to effectively learn feature representations from global to local, thereby improving the detection performance of small targets; the global branch includes a DCAM module and a FSAM module connected in sequence to capture global context information, which helps the model understand the overall layout and scene of the image; the large branch includes several DConv modules arranged in parallel to focus on larger targets or feature areas, which helps to improve the detection performance of large targets, and may also indirectly help small targets to be better detected through contextual relationships; the local branch includes a single DConv module, which focuses on local details, especially small targets and edge information; the three branches work together to effectively learn feature representations from global to local, thereby improving the detection performance of small targets; the Neck network transmits the integrated feature information to the Head network for target prediction.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the aerial image small target detection method based on the improved YOLOv8 algorithm as described in any one of claims 1 to 7.

10. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the method for detecting small targets in aerial images based on the improved YOLOv8 algorithm as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Improved yolov8-based unmanned aerial vehicle aerial image target detection method

    CN117372898A

  • Lightweight unmanned aerial vehicle intrusion detection method

    CN118196426A

  • Aerial image small target detection method based on improved YOLOv8

    CN118865180A

  • Traffic sign small target detection method based on improved SSPDO-YOLO

    CN118942071A

Cited By

  • Automatic driving target detection method based on improved YOLOv8 network

    CN120182727A

  • An autonomous driving target detection method based on improved YOLOv8 network

    CN120182727B

  • Target detection method and system and computer readable storage medium

    CN120655892A

  • Condenser condensation pipe plug identification and positioning method and system based on deep learning

    CN120726037A

  • Condenser condensing pipe plug identification and positioning method and system based on deep learning

    CN120726037B