Unmanned aerial vehicle small target detection algorithm based on improved YOLOv8

By improving the YOLOv8 algorithm, the correlation between each target pixel in the image and other pixel points is calculated, and the CBAM module of dynamic attention is added, which solves the problem of insufficient detection capabilities of small targets in the drone shooting images, achieving higher detection accuracy and robustness.

CN120198822APending Publication Date: 2025-06-24CHINA TELECOM UNMANNED TECHNOLOGY (JIANGSU) CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510248046.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

YOLOv8 lacks the ability to detect small objects in images taken by drones, lacks context information, and the model does not pay enough attention to important features, resulting in a decrease in detection accuracy.

Method used

The YOLOv8 algorithm is improved, and the correlation between each target pixel point in the multi-scale feature map and other pixel points is formed, and a CBAM module for dynamic attention is added to dynamically adjust the feature attention area.

Benefits of technology

Through dynamic CBAM and non-local mechanisms, the model can more effectively capture the global features and spatial correlation of small targets, improve detection accuracy, reduce missed and missed detection, and enhance the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198822A_ABST
    Figure CN120198822A_ABST
Patent Text Reader

Abstract

The invention provides an unmanned aerial vehicle small target detection algorithm based on improved YOLOv8, and the algorithm comprises the steps: combining the features of a related pixel point related to a target pixel point to the target pixel point, generating an enhanced feature map, adding a CBAM module of dynamic attention, dynamically generating an attention weight, generating a redistribution feature map, and inputting a detection head of the YOLOv8. And marking a corresponding bounding box, a category and a confidence label at each to-be-detected target, and the like. Through a non-local mechanism and introduction of a dynamic CBAM module, the model can automatically adjust a feature attention area according to the specific feature of each image, in the feature extraction process, through the global pixel correlation degree in a modeling feature map, compared with a local pixel correlation module, the features of a small target can be recognized by a global view angle, and the feature extraction efficiency is improved. And the model is helped to more effectively pay attention to a fine and easily-confused target area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of unmanned aerial vehicles, and more particularly, to an algorithm for detecting small targets of unmanned aerial vehicles based on improved YOLOv8. Background Art

[0002] The rapid development of unmanned aerial vehicle technology has enabled its wide application in fields such as surveillance, search and rescue, agriculture, and urban planning. Especially in the detection of small targets of unmanned aerial vehicles, with the progress of computer vision technology, object detection algorithms based on deep learning have become an important part of the unmanned aerial vehicle vision system. As an efficient object detection algorithm, the YOLO series has been widely used in the task of detecting small targets from the perspective of unmanned aerial vehicles. Representative versions of the YOLO series algorithms include YOLOv3, YOLOv5, and YOLOv8, etc. Each version has been improved to varying degrees in terms of detection accuracy, speed, and multi-scale object detection capabilities.

[0003] YOLOv8 uses a lightweight CSPDarknet backbone network for feature extraction. Through multiple convolutional networks and max pooling layers, it extracts features of different scales, especially high-level semantic information. Then, by introducing FPN (Feature Pyramid Network) and PAN (Path Aggregation Network), YOLOv8 can aggregate feature maps of different resolutions, thereby capturing targets on feature maps of different scales. This feature is of great significance for detecting targets of different sizes in images captured by unmanned aerial vehicles, especially those that become smaller due to long-distance shooting. The detection head can simultaneously classify the target and perform bounding box regression, and output detection results at different scales.

[0004] Although the YOLOv8 algorithm performs well in object detection tasks, especially in detecting small targets in images captured by unmanned aerial vehicles, it still faces some technical challenges.

[0005] Insufficient small target detection ability: YOLOv8 improves the detection ability of small targets by introducing a multi-scale feature pyramid network (FPN) and a path aggregation network (PAN). However, small targets occupy fewer pixels in high-resolution images and are prone to losing key information during the downsampling process of the network. For images captured by unmanned aerial vehicles, the background is complex and the targets are often far away, which exacerbates the difficulty of detecting small targets.

[0006] Lack of context information: Existing algorithms often ignore the spatial correlation between targets when capturing local features. For example, adjacent pixels or regions may have a certain degree of correlation. Especially when detecting small targets in dense scenes, the loss of spatial context information will lead to misjudgment or missed detection by the model, which is particularly important for images captured by unmanned aerial vehicles because the targets in the images are often unevenly distributed and of different sizes.

[0007] Insufficient attention to important features by the model: The YOLO model has made some progress in feature extraction. However, the model still lacks the ability to dynamically adjust which features are more important and which need to be enhanced. Especially in drone images with complex backgrounds, the model is prone to focusing its attention on irrelevant regions while ignoring small targets or local key features, resulting in a decrease in detection accuracy, particularly in the small target detection task in complex scenarios. Summary of the Invention

[0008] To make up for the above deficiencies, the present invention provides a drone small target detection algorithm based on improved YOLOv8, aiming to improve the above problems.

[0009] The present invention provides a drone small target detection algorithm based on improved YOLOv8, including the following steps:

[0010] S1. Perform preprocessing with consistent formatting on the received images taken by the drone, and input the preprocessed images into the backbone network of YOLOv8 for feature extraction to generate multi-scale feature maps.

[0011] S2. Calculate the correlation degree between each target pixel point and other pixel points in the generated multi-scale feature maps to form a global correlation matrix, and perform weighted summation on the formed global correlation matrix to combine the features of all associated pixel points related to the target pixel point to generate an enhanced feature map.

[0012] S3. Add a CBAM module with dynamic attention. The CBAM module includes channel attention and spatial attention, and the channel attention and spatial attention are adaptively adjusted according to the generated enhanced feature map to dynamically generate attention weights to generate a reallocation feature map.

[0013] S4. Input the generated reallocation feature map into the detection head of YOLOv8. The detection head generates the bounding box, category, and confidence information of each target to be detected through a fully connected layer and a prediction layer mechanism, and projects the generated bounding box, category, and confidence information back to the original images taken by the drone, and marks the corresponding bounding box, category, and confidence labels at each target to be detected.

[0014] As a further improvement of the present invention, the correlation degree between each target pixel point and other pixel points in the generated multi-scale feature maps in step S2 is calculated by the following formula (1)

[0015]

[0016] Where:

[0017] F iand F j respectively represent the original feature vectors of pixels i and j in the feature map,

[0018] <F i , F j > is the inner product between feature vectors, representing their similarity degree,

[0019] ||F i || and ||F j || are the norms of the feature vectors.

[0020] As a further improvement of the present invention, the formation of the global correlation matrix is constructed through the similarity between pairwise pixels, and the calculation formula (2) is:

[0021]

[0022] Where:

[0023] M ij is an element of the correlation matrix, representing the correlation degree between pixel i and pixel j,

[0024] ||F i -F j || 2 is the Euclidean distance, measuring the difference between feature vectors,

[0025] σ is the smoothing parameter of the Gaussian distribution, used to control the weight decay of the correlation.

[0026] As a further improvement of the present invention, in step S2, the associated pixel points related to the target pixel point are judged through the following steps:

[0027] If the similarity Similarity(i, j) or M ij between it and the target pixel point exceeds the preset threshold T, then it is considered that there is an association between this pixel point and the target pixel point, otherwise it is an irrelevant pixel point.

[0028] As a further improvement of the present invention, the weighted calculation of the formed global correlation matrix in step S2 includes the following steps:

[0029] Use the correlation weights of all pixel points to enhance the features of the target pixel point, and the formula (3) is:

[0030]

[0031] Where:

[0032] F′ i is the enhanced feature vector of the target pixel point i,

[0033] M ijis the degree of association between pixel i and pixel j,

[0034] F j is the original feature vector of pixel point j.

[0035] As a further improvement of the present invention, the preprocessing of the image for format consistency includes normalizing, scaling, and data augmentation of the received images captured by the drone, ensuring that the processed images have a consistent format to meet the input requirements of the YOLOv8 model.

[0036] As a further improvement of the present invention, the process of generating the multi-scale feature maps in step S1 includes using CSP (Cross Stage Partial) and C2f modules to generate multi-scale feature maps through convolutional layers and downsampling operations as the basis for analyzing information of different-scale targets.

[0037] As a further improvement of the present invention, the multi-scale feature maps include low-level feature maps and high-level feature maps.

[0038] As a further improvement of the present invention, the adaptive adjustment of the channel attention and spatial attention according to the generated enhanced feature maps includes dynamically generating weights for the channel attention and spatial attention according to the dynamic changes in the shape, color, and size of the target to be detected in the enhanced feature maps.

[0039] As a further improvement of the present invention, after step S3, the following steps are further included: inputting the generated reassigned feature maps into a feature pyramid network for feature fusion.

[0040] As a further improvement of the present invention, the feature fusion includes fusing features from different scales through a feature pyramid network so that targets of different sizes can be processed simultaneously.

[0041] The present invention also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned drone small target detection algorithm based on the improved YOLOv8 are implemented.

[0042] The beneficial effects of the present invention are:

[0043] 1. Dynamic CBAM attention mechanism: The dynamic CBAM combines adaptive channel attention and spatial attention, enabling the model to automatically adjust the feature attention area according to the specific features of each image. During the feature extraction process, the dynamic CBAM will select the channels most beneficial for target detection and focus on the significant regions in the image, thereby enhancing the recognition of small targets.

[0044] Improving Detection Accuracy: Dynamic CBAM can more flexibly highlight the features of small targets and suppress background noise. When detecting small targets in the drone scenario, the dynamically adjusted attention distribution can effectively improve the detection accuracy of the model.

[0045] Dynamic Adaptability: Different from CBAM with a fixed attention distribution, dynamic CBAM allocates attention based on the content of the input feature map, which can more efficiently handle complex scene changes such as lighting and background during drone flight, making the detection more robust.

[0046] Technical Means: Dynamic CBAM first selects the most distinguishable feature channels in the channel attention module, and then highlights the key regions of the image in the spatial attention module. The dynamically adjusted two-level attention not only reduces the interference of irrelevant features but also further optimizes the saliency of small targets in complex backgrounds, improving the applicability of YOLOv8 in drone applications.

[0047] 2. Non-local Mechanism: The non-local mechanism models the global pixel correlation in the feature map. Compared with the module of local pixel correlation, the non-local mechanism enables the features of small targets to be recognized from a global perspective, helping the model to more effectively focus on small and confusing target regions.

[0048] Enhancing the Global Feature Representation of Small Targets: Existing YOLOv8 has certain limitations in identifying small targets in complex backgrounds, while the non-local mechanism enables the model to capture the global semantic relationships of small targets, thereby improving its detection effect in complex drone scenarios.

[0049] Reducing Missed and False Detections: The non-local mechanism associates the pixel information of the entire image, making the detection of small targets no longer limited to local information, effectively reducing missed and false detection phenomena when the background interference is large, thereby improving the detection coverage rate and accuracy.

[0050] Technical Means: The non-local mechanism enhances the model's ability to recognize target edge and regional features by calculating the global pixel correlation of the image. In the image processing task from the drone perspective, the non-local mechanism helps to highlight the regional features of small targets, making the detection more stable in dense targets and complex backgrounds, and meeting the detection requirements of complex small targets for drones. Brief Description of the Drawings

[0051] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0052] Figure 1 It is a schematic diagram of the process of a small target detection algorithm for drones based on improved YOLOv8 described in the present invention;

[0053] Figure 2 It is another schematic diagram of the process of a small target detection algorithm for drones based on improved YOLOv8 described in the present invention;

[0054] Figure 3 It is a schematic diagram of an image example collected by a drone in the present invention;

[0055] Figure 4 is Figure 3 A schematic diagram of an image example after being processed by the algorithm of the present invention. Specific implementation manners

[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0057] Such as Figure 1-2 shown, this embodiment provides a small target detection algorithm for drones based on improved YOLOv8, including the following steps.

[0058] S1. Perform formatting consistency preprocessing on the received images captured by the drone, and input the preprocessed images into the backbone network of YOLOv8 for feature extraction to generate multi-scale feature maps.

[0059] The formatting consistency preprocessing of the images includes standardizing, scaling, and data augmentation processing on the received images captured by the drone to ensure that the processed images have a consistent format to meet the input requirements of the YOLOv8 model. It should be noted that since the input data captured by the drone usually has inconsistent resolutions and formats, the algorithm will first perform standardizing, scaling, and data augmentation processing on them to meet the input requirements of the YOLOv8 model (such as a fixed size of 640x640). The core of this step is to ensure that the images have a consistent format when input into the network, so that the subsequent feature extraction process is more stable and efficient.

[0060] In this embodiment, the process of generating multi-scale feature maps includes using CSP (Cross Stage Partial) and C2f modules to generate multi-scale feature maps through convolutional layers and downsampling operations, so as to capture information of targets at different scales as the basis for analysis. In the specific implementation process, these feature maps can capture information of targets at different scales: the low-level feature maps retain details and are suitable for detecting small targets from the perspective of drones, while the high-level feature maps extract global semantic information to support large targets. The purpose of feature extraction is to provide multi-level image representations for the detection task as the basis for subsequent analysis.

[0061] S2. Calculate the correlation degree between each target pixel point and other pixel points in the generated multi-scale feature maps to form a global correlation matrix, and perform weighted summation on the formed global correlation matrix to combine the features of all associated pixel points related to the target pixel point to generate an enhanced feature map.

[0062] In this embodiment, in order to calculate the correlation degree between each target pixel point and other pixel points in the generated multi-scale feature maps, it is calculated through formula (1).

[0063]

[0064] Where: F i and F j respectively represent the original feature vectors of pixels i and j in the feature map, <F i , F j > is the inner product between the feature vectors, indicating their similarity degree, ||F i || and ||F j || are the norms of the feature vectors.

[0065] After calculating the correlation degrees between each pixel point, a global correlation matrix is constructed through the similarity between pairwise pixels, and the calculation formula (2) is:

[0066]

[0067] Where:

[0068] M ij is an element of the correlation matrix, indicating the correlation degree between pixel i and pixel j, ||F i -F j || 2 is the Euclidean distance, measuring the difference between feature vectors, and σ is the smoothing parameter of the Gaussian distribution, used to control the weight decay of the correlation. After the above steps of calculation, an N*N global correlation matrix M is formed, where N is the total number of pixel points.

[0069] Then, it is first determined whether there is a correlation between the target pixel and other pixels. The specific determination method is as follows:

[0070] If the similarity Similarity(i, j) or M with the target pixel ij exceeds the preset threshold T, it is considered that there is a correlation between this pixel and the target pixel; otherwise, it is an uncorrelated pixel. The determination can be made through the following formula (4).

[0071]

[0072] Then, the formed global correlation matrix is weighted to combine the features of all correlated pixels related to the target pixel into this target pixel, generating an enhanced feature map. Among them, the feature of the target pixel is enhanced using the correlation weights of all pixels. The formula (3) is:

[0073]

[0074] Where:

[0075] F′ i is the enhanced feature vector of the target pixel i,

[0076] M ij is the degree of correlation between pixel i and pixel j,

[0077] F j is the original feature vector of pixel j.

[0078] In this embodiment, compared with the local convolution operation, the method and algorithm used in this step can span a larger spatial range, capture the correlation of distant pixels, and make the features of small targets more prominent.

[0079] During the flight of the drone, small targets in the captured images are often surrounded by complex backgrounds or blocked by other similar objects. The method and algorithm in this step can more accurately identify similar target areas in the image through global correlation, even if these areas are far apart. For example, when there are multiple small targets in the image, the method and algorithm in this step can automatically enhance the features of similar pixels, avoiding missed detection and false detection of small targets in complex scenes. It is not limited to calculating the correlation between pixels through convolution operations in the horizontal and vertical directions, but directly calculates the global pixel correlation, which has more advantages in drone images because the similarity between small targets in different positions is more fully expressed, can cope with the interference of complex backgrounds, and improve the detection accuracy.

[0080] S3. The CBAM module with dynamic attention. The CBAM module includes channel attention and spatial attention, and the channel attention and spatial attention are adaptively adjusted according to the generated enhanced feature map to dynamically generate attention weights to generate a reallocated feature map.

[0081] In this embodiment, the channel attention dynamically adjusts the weights of different channels by focusing on the global information of each channel. The specific calculation steps are as follows:

[0082] Perform global average pooling and global max pooling on the input feature F to obtain two global description vectors, as shown in formula (5):

[0083] F avg = AvgPool(F),, F max = MaxPool(F) (5),

[0084] Input the two global description vectors into a multi-layer perceptron (MLP) to calculate the weights, as shown in formula (6):

[0085] W channel = σ(MLP(F avg ) + MLP(F max )) (6),

[0086] The generated channel weight W channel is used to reallocate the features of each channel, as shown in formula (7):

[0087] F channel = W channel ·F (7),

[0088] where σ is the sigmoid activation function.

[0089] The spatial attention dynamically adjusts the weights by focusing on the important regions in space. The specific calculation steps are as follows:

[0090] Perform global average pooling and max pooling on each channel of the input feature F to generate two spatial feature maps, as shown in formula (8):

[0091]

[0092] After concatenating the two spatial feature maps, calculate the spatial weights through convolution, as shown in formula (9):

[0093]

[0094] The generated spatial weight W spatial is used to adjust the features at each spatial position, as shown in formula (10):

[0095] F spatial= W spatial · F(10).

[0096] Finally, through the weights of channel and spatial attention, the dynamic adjustment of features is completed, as shown in Equation (11):

[0097] F final = F channel · F spatial (11).

[0098] In this embodiment, a dynamic CBAM module (i.e., a CBAM module with dynamic attention) is introduced. This module further enhances the attention to features, especially for the key regions of small targets. The CBAM module includes channel attention and spatial attention. By reallocating feature weights, it guides the network to focus on more significant target regions. In dynamic CBAM, the channel and spatial attention are not fixed, but adaptively adjusted according to the input feature map, that is, the attention weights are dynamically generated. In this way, for different image scenes, the attention mechanism can be adjusted in real time to adapt to the changing features of small targets and improve the detection accuracy.

[0099] The adaptive adjustment of the channel attention and spatial attention according to the generated enhanced feature map includes that the channel attention and spatial attention dynamically generate weights according to the dynamic changes in the shape, color, and size of the target to be detected in the enhanced feature map. In specific application scenarios, the weight allocation of the traditional CBAM module for the feature map is often fixed. However, in the detection of small targets by drones, the targets may undergo rapid changes in shape, color, and size. Dynamic CBAM introduces an adaptive mechanism, enabling the channel and spatial attention to dynamically generate weights according to the target changes, avoiding excessive or insufficient attention in the feature map. For example, when small targets appear in complex backgrounds, dynamic CBAM can quickly increase the weights of relevant channels and regions, making the targets more prominent.

[0100] Compared with ordinary CBAM, the dynamic CBAM module has stronger adaptability to different scenarios, especially suitable for complex environments in the detection of small targets by drones. The attention weights of the ordinary CBAM module are relatively fixed after training and are difficult to adapt to real-time changing targets. While dynamic CBAM realizes dynamic weight generation through a lightweight prediction network, which not only improves the detection effect but also enhances the robustness of the model in complex scenarios.

[0101] S4. The generated reallocated feature map is input into the detection head of YOLOv8. The detection head generates the bounding box, category, and confidence information of each target to be detected through a fully connected layer and a prediction layer mechanism, and projects the generated bounding box, category, and confidence information back to the original image captured by the drone, and marks the corresponding bounding box, category, and confidence labels at each target to be detected.

[0102] The detection head, through the fully connected layer and the prediction layer, and the prediction layer, through the Anchor-Free mechanism, without relying on predefined anchor boxes, directly generates the bounding boxes, categories, and confidences of each target. The detection head makes accurate predictions based on the feature map processed by the associated pixel domain and the CBAM module, and maps the position and category of each target back to the original image captured by the drone. The result output in this step is the final detection result, showing the specific positions and categories of each small target in the image captured by the drone.

[0103] Then, the detection result is projected back into the original input image, marking the bounding boxes and category labels of the targets. For small targets in the drone scenario, the detection result can highlight their positions and come with a confidence assessment to ensure the accuracy of the detection result.

[0104] In a specific application scenario, to better optimize the result, after S3, the following steps are also included: inputting the generated reassigned feature map into a feature pyramid network for feature fusion, and the feature fusion includes fusing features from different scales through the feature pyramid network so that different-sized targets to be detected can be processed simultaneously.

[0105] The feature map processed by CBAM is input into the Feature Pyramid Network (FPN). The main role of FPN is to fuse features from different scales so that the model can process targets of different sizes simultaneously. For drone small target detection, small targets may appear at different scales in the image, so multi-scale features are needed to capture them. FPN ensures that both small and large targets can be efficiently detected by the model by fusing high-resolution detail information and low-resolution global semantic information at multiple levels.

[0106] The introduction of the dynamic CBAM and non-local mechanisms significantly enhances the effect of drone small target detection. These mechanisms effectively capture the correlation of target pixels and, by focusing on specific channels and spatial regions, reduce the false detection and missed detection phenomena in complex backgrounds, ultimately improving the accuracy and robustness of the YOLOv8 model in drone small target detection.

[0107] The present invention also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the steps of the above-mentioned drone small target detection algorithm based on the improved YOLOv8.

[0108] As Figure 3 shown, taking the traffic road scenario as an example, Figure 3 For the image transmitted back by the drone, it is necessary to capture, identify, and mark non-motor vehicles and motor vehicles in the image. Figure 4is the image processed by the algorithm of the present invention. It can be clearly seen from Figure 4 that for non-motor vehicles and motor vehicles in the image, bounding boxes are all delimited, and category and confidence labels are marked on the corresponding bounding boxes, which provides a reliable prerequisite for subsequent steps such as the positioning and tracking of small targets in this area. At the same time, in the case where there are multiple small targets arranged overlappingly, it is still possible to clearly identify and demarcate the precise positions of each small target and mark the corresponding labels on the processed image.

[0109] Finally, the algorithm provided by this embodiment can achieve the following technical effects.

[0110] Dynamic CBAM combines adaptive channel attention and spatial attention, enabling the model to automatically adjust the feature attention area according to the specific features of each image. During the feature extraction process, dynamic CBAM will select the channels that are most beneficial to object detection and focus on the significant regions in the image, thereby enhancing the recognition rate of small targets.

[0111] Dynamic CBAM can more flexibly highlight the features of small targets and suppress background noise. When detecting small targets in the drone scenario, the dynamically adjusted attention distribution can effectively improve the detection accuracy of the model.

[0112] Different from CBAM with a fixed attention distribution, dynamic CBAM allocates attention based on the content of the input feature map, and can more efficiently cope with complex scene changes such as illumination and background during drone flight, making the detection more robust.

[0113] Dynamic CBAM first screens out the most distinguishable feature channels in the channel attention module, and then highlights the key regions of the image in the spatial attention module. The dynamically adjusted two-level attention not only reduces the interference of irrelevant features, but also further optimizes the saliency of small targets in complex backgrounds, improving the applicability of YOLOv8 in drone applications.

[0114] By modeling the global pixel correlation in the feature map, compared with the module of local pixel correlation, the non-local mechanism enables the features of small targets to be recognized from a global perspective, helping the model to more effectively focus on small and easily confused target regions.

[0115] Existing YOLOv8 has certain limitations in identifying small targets in complex backgrounds, while the non-local mechanism enables the model to capture the global semantic relationships of small targets, thereby improving its detection effect in complex drone scenarios.

[0116] The non-local mechanism associates pixel information across the entire image, enabling the detection of small targets to no longer be limited to local information, effectively reducing the phenomena of missed detection and misdetection when the background interference is large, thereby improving the detection coverage rate and accuracy.

[0117] The non-local mechanism enhances the model's ability to recognize target edge and regional features by calculating the pixel correlation across the entire image. In the image processing task from the perspective of an unmanned aerial vehicle (UAV), the non-local mechanism helps to highlight the regional features of small targets, making the detection more stable under dense targets and complex backgrounds, and meeting the complex small target detection requirements of UAVs.

[0118] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A UAV small target detection algorithm based on improved YOLOv8, characterized in that: The following steps are involved: S1. Perform format consistency preprocessing on the received images taken by the drone, input the preprocessed images into the backbone network of YOLOv8 for feature extraction, and generate multi-scale feature maps; S2, calculating the correlation between each target pixel and other pixels in the generated multi-scale feature map to form a global correlation matrix, performing weighted summation on the formed global correlation matrix to combine the features of all associated pixels associated with the target pixel to the target pixel, and generating an enhanced feature map; S3, adding a CBAM module with dynamic attention, the CBAM module includes channel attention and spatial attention, the channel attention and spatial attention are adaptively adjusted according to the generated enhanced feature map, and the attention weight is dynamically generated to generate a redistributed feature map; S4. The generated reallocated feature map is input into the detection head of YOLOv8. The detection head generates the bounding box, category and confidence information of each target to be detected through the fully connected layer and prediction layer mechanism, and projects the generated bounding box, category and confidence information back to the original image taken by the drone, and marks the corresponding bounding box, category and confidence label at each target to be detected.

2. The UAV small target detection algorithm based on improved YOLOv8 according to claim 1 is characterized in that: The image formatting consistency preprocessing includes standardizing, scaling and data enhancement processing of the received drone-photographed images, ensuring that the processed images have a consistent format to meet the input requirements of the YOLOv8 model.

3. The UAV small target detection algorithm based on improved YOLOv8 according to claim 2 is characterized in that: The process of generating a multi-scale feature map in step S1 includes using CSP (Cross Stage Partial) and C2f modules to generate a multi-scale feature map through convolutional layers and downsampling operations to capture information of targets of different scales as a basis for analysis.

4. The UAV small target detection algorithm based on improved YOLOv8 according to claim 3 is characterized in that: The multi-scale feature map includes a low-level feature map and a high-level feature map.

5. The UAV small target detection algorithm based on improved YOLOv8 according to claim 1, characterized in that: The correlation between each target pixel and other pixels in the multi-scale feature map generated in step S2 is calculated by the following formula (1): in: F i and F j Represent the original feature vectors of pixels i and j in the feature map, respectively. <F j , F j > is the inner product between eigenvectors, indicating their similarity. ||F i || and ||F j || is the modulus of the eigenvector.

6. According to claim 5, a UAV small target detection algorithm based on improved YOLOv8 is characterized in that: The global correlation matrix is ​​constructed by the similarity between two pixels, and the calculation formula (2) is: in: M ij is the element of the association matrix, indicating the degree of association between pixel i and pixel j. ||F i -F j || 2 is the Euclidean distance, which measures the difference between feature vectors, σ is the smoothing parameter of the Gaussian distribution and is used to control the associated weight decay.

7. According to claim 6, a UAV small target detection algorithm based on improved YOLOv8 is characterized in that: In step S2, the associated pixel points associated with the target pixel point are determined by the following steps: If the similarity between the target pixel and the pixel point is Similarity(i, j) or M ij If it exceeds the preset threshold T, it is considered that the pixel is associated with the target pixel, otherwise it is an irrelevant pixel.

8. According to claim 7, a UAV small target detection algorithm based on improved YOLOv8 is characterized in that: The weighted calculation of the formed global correlation matrix in step S2 includes the following steps: The associated weights of all pixels are used to enhance the features of the target pixel. Formula (3) is: in: F i ′ is the enhanced feature vector of target pixel i, M ij is the degree of association between pixel i and pixel j, F j is the original feature vector of pixel j.

9. The UAV small target detection algorithm based on improved YOLOv8 according to claim 1, characterized in that: The channel attention and the spatial attention are adaptively adjusted according to the generated enhanced feature map, including dynamically generating weights of the channel attention and the spatial attention according to dynamic changes in the shape, color and size of the target to be measured in the enhanced feature map.

10. The UAV small target detection algorithm based on improved YOLOv8 according to claim 1, characterized in that: After S3 is completed, the following steps are also included: inputting the generated reallocated feature map into the feature pyramid network for feature fusion.

11. The UAV small target detection algorithm based on improved YOLOv8 according to claim 10, characterized in that: The feature fusion includes fusing features from different scales through a feature pyramid network so that objects to be detected of different sizes can be processed simultaneously.

Citation Information

Cited By

  • Power equipment intelligent detection method for power engineering site

    CN120635081A

  • Anti-unmanned aerial vehicle intelligent identification and tracking system based on multi-source data fusion

    CN120850103A

  • Gradient layered multi-branch air-to-air unmanned aerial vehicle target detection method

    CN120932143A

  • A gradient layered multi-branch air-to-air unmanned aerial vehicle target detection method

    CN120932143B