An improved YOLOv8-based lightweight unmanned aerial vehicle small target detection method, device and medium
By improving the CA-MobileNetV3 framework and CoordAttention mechanism of YOLOv8, the problems of limited computing resources and insufficient small target detection on the UAV platform were solved, and efficient and accurate target detection was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIT 32002 OF THE CHINESE PEOPLES LIBERATION ARMY
- Filing Date
- 2024-12-31
- Publication Date
- 2026-07-28
AI Technical Summary
The existing YOLOv8 target detection algorithm has high computational complexity and a large number of parameters on UAV embedded platforms, making it difficult to deploy. It also has insufficient ability to detect small targets, affecting detection accuracy and real-time response.
The improved CA-MobileNetV3 framework is used to replace the backbone network. A feature pyramid network with a CoordAttention mechanism and a lightweight detection head are introduced. The network is trained using DFL loss function, CIOU loss function and cross-entropy loss function to optimize feature extraction and target localization.
It achieves lightweight target detection on the UAV platform, improves the accuracy and computational efficiency of small target detection, and ensures the accuracy and timeliness of reconnaissance missions.
Smart Images

Figure CN120032214B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a lightweight method, device, and medium for small target detection in unmanned aerial vehicles based on an improved YOLOv8. Background Technology
[0002] With the continuous maturation of drone technology, drones have become important tools in various fields such as modern military reconnaissance, traffic control, environmental monitoring, and disaster response. Drones can quickly and accurately identify and track small targets on the ground or in the air, and can be widely used in various mission scenarios such as monitoring urban traffic flow, assessing environmental changes, searching for missing persons, and monitoring crop growth. However, small targets (such as pedestrians, small vehicles, wild animals, and pests) typically have low resolution and insufficient features in drone aerial images, posing a significant challenge to drone target detection systems. Existing target detection technologies can meet basic requirements to a certain extent, but when deployed on embedded drone platforms, they often face limitations in computing resources and detection accuracy. These problems restrict the performance and efficiency of drones in practical applications, especially in situations requiring real-time response and accurate identification.
[0003] Currently, deep learning-based target detection algorithms have surpassed traditional target detection algorithms and are widely used, especially the YOLO series algorithms, which have received widespread attention due to their fast detection speed and high accuracy. YOLOv8, as an important version of this series, has achieved good performance in many application scenarios. Although YOLOv8 has high performance in the field of target detection, its application on UAV embedded platforms still has the following problems: (1) The computational complexity and number of parameters are large, making it difficult for UAV platforms to handle; (2) The detection capability for small targets is insufficient, which easily leads to missed detections and false detections; (3) The model has limited ability to capture spatial correlation in the multi-scale feature map fusion stage, which affects the accuracy of target localization and recognition. Summary of the Invention
[0004] To address the aforementioned issues, this invention proposes a lightweight UAV small target detection method, device, and medium based on an improved YOLOv8.
[0005] The technical solution of this invention is: a lightweight UAV small target detection method based on improved YOLOv8, which includes the following steps:
[0006] A target detection model based on YOLOv8 neural network is constructed, which includes: input end, backbone network, neck network and detection head;
[0007] The input end preprocesses the input image to obtain an input image of uniform size;
[0008] The backbone network adopts the CA-MobileNetV3 framework to perform multi-scale feature extraction on the input image;
[0009] The neck network introduces a feature pyramid network with a CoordAttention mechanism to capture spatial correlations at different locations on the feature map, and performs target localization and multi-scale feature map fusion based on spatial correlations.
[0010] The detection head has a bounding box regression prediction branch and a target prediction branch. The bounding box regression prediction branch is used to predict the location information of the target bounding box, and the target prediction branch locates the target bounding box and predicts the category of the target based on the predicted location information.
[0011] The target detection model is trained by using the DFL loss function and CIOU loss function as the loss function for the bounding box regression prediction branch, and the cross-entropy loss function as the loss function for the target prediction branch. When the values of the DFL loss function, CIOU loss function, and cross-entropy loss function are all less than a specified threshold, the training is completed and the target detection model is obtained.
[0012] The target detection model is used to perform target detection on the input image.
[0013] In one embodiment, the backbone network adopts the CA-MobileNetV3 framework to perform multi-scale feature extraction on the input image. The specific method is as follows:
[0014] The CA-MobileNetV3 framework includes multiple convolutional layers and a bneck layer. The bneck layer, as a CA-MobileNetV3 module, replaces the original SE attention module in the MobileNetV3 module with the CoordAttention attention mechanism module, thus obtaining the CA-MobileNetV3 module, which is used to extract the positional and channel information of the input image.
[0015] In one embodiment, the CA-MobileNetV3 module first maps the low-dimensional features of the input image to a high-dimensional space using a 1×1 convolutional layer; then, it extracts features from the input image using a 3×3 depthwise separable convolutional layer (Dwise), which includes a depthwise convolutional layer and a 1x1 point convolutional layer. The depthwise convolutional layer is used for spatial filtering, and the 1x1 point convolutional layer is used for feature generation; finally, the high-dimensional features are projected back to the low-dimensional space using a 1×1 convolutional layer to generate output multi-scale features.
[0016] In one embodiment, the intermediate connection layer between the 3×3 depthwise separable convolutional layer and the 1×1 convolutional layer is composed of a CoordAttention module, a ReLU activation function, and an h-swish activation function combined sequentially; wherein,
[0017] The CoordAttention module combines channel attention with spatial location information, enabling the model to capture the dependency between attention and spatial location while preserving the spatial location information.
[0018] The formula for calculating the ReLU activation function is as follows:
[0019] ReLU(x) = max(x,0)
[0020] Where x is the feature input, and ReLu(x) is the feature output after nonlinear transformation of the feature input;
[0021] The h-swish activation function is calculated using the following formula:
[0022]
[0023] Where x is the feature input, and h-swish[x] is the feature output after nonlinear transformation of the feature input.
[0024] In one embodiment, the CoordAttention module combines the channel attention mechanism with spatial location information in the following specific way:
[0025] The CoordAttention module first performs one-dimensional global pooling operations along the horizontal and vertical directions on the input feature map to obtain two feature maps that are aggregated for perception in two directions. Then, it performs feature concatenation and convolution operations along the spatial dimension to obtain a new feature map. The new feature map is then further divided into two feature maps along the spatial dimension and convolution and non-linear transformation are performed to obtain attention weights. The attention weights are then applied to the input feature map along the horizontal and vertical directions to achieve feature enhancement.
[0026] In one embodiment, the neck network incorporates a feature pyramid network with a CoordAttention mechanism to capture spatial correlations at different locations on the feature map. Based on these spatial correlations, target localization and multi-scale feature map fusion are performed to obtain the final feature map. The specific method is as follows:
[0027] The neck network uses a PAN-FPN structure, which uses a hierarchical feature pyramid network to fuse feature maps from different levels. A CoordAttention module is added after the PAN-FPN structure to capture the relationship between spatial location information and channels on the feature map, thereby enhancing the target localization and recognition capabilities.
[0028] In one embodiment, when training the object detection model, the specific forms of the DFL loss function, CIOU loss function, and cross-entropy loss function are as follows:
[0029] The formula for the DFL loss function is:
[0030] DFL(S i ,S i+1 )=-((y i+1 -y)log(S i )+(yy i )log(S i+1 ))
[0031] Among them, S i ,S i+1 These are the network's predicted value and its nearest neighbor predicted value, y and y', respectively. i y i+1 These are the actual value of the label, the label value, and the values of neighboring labels, respectively.
[0032] The CIOU loss function formula is:
[0033]
[0034] Where IOU represents the intersection-union ratio of the predicted box and the ground truth box, d is the square of the Euclidean distance between the center points of the predicted box and the ground truth box, c is the diagonal length of the minimum closure rectangle of the predicted box and the ground truth box, α is the weight coefficient, and υ is used to measure the similarity of aspect ratio.
[0035] The formula for the cross-entropy loss function is:
[0036]
[0037] Where y ij For the true value, is the predicted value, n is the number of samples, and c is the number of categories.
[0038] A lightweight UAV small target detection device based on an improved YOLOv8, comprising:
[0039] A target detection model based on YOLOv8 neural networks, comprising: an input end, a backbone network, a neck network, and a detection head;
[0040] The input end preprocesses the input image to obtain an input image of uniform size;
[0041] The backbone network adopts the CA-MobileNetV3 framework to perform multi-scale feature extraction on the input image;
[0042] The neck network introduces a feature pyramid network with a CoordAttention mechanism to capture spatial correlations at different locations on the feature map, and performs target localization and multi-scale feature map fusion based on spatial correlations.
[0043] The detection head has a bounding box regression prediction branch and a target prediction branch. The bounding box regression prediction branch is used to predict the location information of the target bounding box, and the target prediction branch locates the target bounding box and predicts the category of the target based on the predicted location information.
[0044] The target detection model is trained by using the DFL loss function and CIOU loss function as the loss function for the bounding box regression prediction branch, and the cross-entropy loss function as the loss function for the target prediction branch. When the values of the DFL loss function, CIOU loss function, and cross-entropy loss function are all less than a specified threshold, the training is completed and the target detection model is obtained.
[0045] The object detection model performs object detection on the input image.
[0046] A computer device includes: at least one processor and a memory storing computer instructions executable on the processor, the instructions being executed by the processor to implement the steps of a lightweight UAV small target detection method based on improved YOLOv8.
[0047] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the lightweight UAV small target detection method based on improved YOLOv8.
[0048] The advantages of this invention compared to the prior art are:
[0049] (1) This invention replaces the YOLOv8 backbone network with the CA-MobileNetV3 framework, which is an improvement on the MobileNetV3 framework, to achieve more efficient feature extraction from the input image. At the same time, it reduces the number of parameters and computation, thereby achieving model lightweighting and solving the problem of limited computing resources when deploying algorithms on UAV embedded platforms.
[0050] (2) This invention enhances target localization without significantly increasing computational burden by introducing a lightweight CoordAttention module during the feature map fusion stage, thus solving the problem of insufficient small target detection accuracy when the detection algorithm is deployed on an embedded UAV platform.
[0051] (3) This invention improves the detection capability of small-scale targets by adding a detection head that can handle larger feature map sizes in the model output stage. Attached Figure Description
[0052] Figure 1 This is a diagram of the overall architecture of the model of the present invention;
[0053] Figure 2 This is a diagram of the CA-MobileNetV3 framework.
[0054] Figure 3 Block diagram of CA-MobileNetV3 module;
[0055] Figure 4 Here is a diagram of the CoordAttention mechanism structure;
[0056] Figure 5 This is a diagram of the output structure of the detection head. Detailed Implementation
[0057] This invention proposes a lightweight UAV small target detection method, device, and medium based on an improved YOLOv8.
[0058] This invention is a lightweight UAV small target detection method based on improved YOLOv8, which can achieve efficient and accurate target detection on UAV platforms. Especially under the condition of limited computing resources, it can improve the UAV's ability to detect small targets and ensure the accuracy and timeliness of reconnaissance missions.
[0059] The overall architecture of the model proposed in this invention is as follows: Figure 1 As shown, the model can be divided into four parts: the input layer, the backbone network, the neck network, and the detection head. Each part has its own function. The input layer is used for image preprocessing, the backbone network is responsible for extracting multi-scale feature information from the input image, the neck structure serves as the feature fusion layer, and through feature fusion, it ensures that the network has better adaptability and generalization ability when processing targets of different sizes. YOLO v8 can utilize both shallow and deep features for target detection, maintaining high resolution while also acquiring features with higher semantic information, thus improving the detection capability for multi-scale targets. The detection head, as the output of the model, can be divided into two parts: category regression and boundary regression. It mainly uses the fused feature map information to generate the final target detection result.
[0060] The input end first performs data preprocessing on the input image, mainly using data augmentation techniques such as mosaic enhancement, random cropping, rotation, and flipping to make full use of the existing training data, reduce the dependence on large-scale labeled datasets, and adjust the image to a fixed input size for model processing.
[0061] The backbone network is responsible for extracting multi-scale feature maps from the input image. These feature maps contain multi-level information, including low-level feature details and high-level semantic information, which are applied to the feature fusion and detection parts of subsequent networks. The backbone of the model uses the CA-MobileNetV3 framework, an improved version of the MobileNetV3 framework, instead of the original backbone network. This allows for efficient feature extraction from the input image and reduces computational complexity, adapting to the deployment requirements of UAV platforms. The CA-MobileNetV3 framework fully leverages the lightweight nature of CoordAttention and its ability to simultaneously extract positional and inter-channel information, improving key MobileNetv3 network modules. This allows the model to better focus on a wide range of positional information without imposing excessive computational overhead. The network structure of the CA-MobileNetV3 framework is as follows: Figure 2 As shown.
[0062] As shown in the figure above, the CA-MobileNetV3 framework mainly consists of multiple convolutional layers and a bneck layer. The bneck layer is the CA-MobileNetV3 module. The CA-MobileNetV3 module mainly replaces the original SE attention module in the MobileNetV3 module with the CoordAttention attention mechanism module to achieve dual extraction of positional and channel information. Its model structure diagram is shown below. Figure 3 As shown.
[0063] The CA-MobileNetV3 module in the diagram employs an inverse residual structure. First, a 1×1 convolutional layer maps the low-dimensional input features to a high-dimensional space. This step enhances the model's expressive power. Next, a 3×3 depthwise separable convolutional layer (Dwise) is used. This effectively decomposes traditional convolution by separating spatial filtering from feature generation. It consists of two independent lightweight deep convolutional layers for spatial filtering and a heavier 1×1 point convolutional layer for feature generation. Since spatial operations are performed only on each channel, computational costs are reduced, allowing convolution operations to be performed in high-dimensional space. Finally, a 1×1 convolutional layer reprojects the high-dimensional features back to the low-dimensional space, avoiding the use of non-linear activation functions and thus retaining more useful information to generate the final output. The intermediate connection layer between the depthwise separable convolutional layer and the subsequent 1×1 convolutional layer consists of a CoordAttention module, a ReLU activation function, and an h-swish activation function. The ReLU activation function is a non-linear activation function used to enhance the non-linear expressive power of each layer of the deep neural network. The calculation formula is as follows:
[0064] ReLU(x) = max(x, 0) (1)
[0065] Where x is the feature input, and ReLU(x) is the feature output after nonlinear transformation of the feature input. The h-swish activation function is a simplified version of the Swish activation function. Compared to the original Swish activation function, h-swish is easier to compute, especially on embedded devices, reducing computational overhead, and performs better in quantized models. It is a linear activation function, and its calculation formula is as follows:
[0066]
[0067] Where x is the feature input, and h-swish[x] is the feature output after nonlinear transformation of the feature input. The CoordAttention module is a lightweight attention module that combines traditional channel attention mechanisms with location information, enabling the model to capture long-range dependencies and retain accurate spatial location information. The structure diagram is shown below. Figure 4 As shown.
[0068] As shown in the figure, the input feature map is first subjected to one-dimensional global pooling operations along the horizontal and vertical directions to obtain two feature maps aggregated for directional perception. Then, feature concatenation and convolution operations are performed along the spatial dimension to obtain new feature maps. These new feature maps are then further segmented into two feature maps along the spatial dimension and subjected to convolution and non-linear transformations to obtain attention weights. These attention weights are applied to the input feature map along the horizontal and vertical directions to achieve feature enhancement. The CA-MobileNetV3 module optimized through this attention mechanism can obtain richer feature representations and more accurate location information while maintaining lightweight design, thereby more accurately locating targets and improving model performance.
[0069] The neck network employs a feature pyramid network with a CoordAttention mechanism to capture spatial correlations at different locations on the feature map, performing target localization and multi-scale feature fusion based on these spatial correlations. The Neck part of the model, serving as the feature fusion layer, uses a PAN-FPN structure. Its function is to fuse feature maps from different levels through a hierarchical feature pyramid structure, forming feature maps with greater semantic information and multi-scale perception capabilities. This helps the model achieve multi-scale target detection and better capture the target's contextual information. YOLO v8 can utilize both shallow and deep features for target detection, maintaining high resolution while acquiring features with higher semantic information. Through the feature fusion stage, the model achieves good perception and understanding of multi-scale targets, thereby improving detection accuracy and robustness. This method also introduces [missing information - likely a specific mechanism or feature fusion method] in the multi-scale feature map fusion stage. Figure 4 The lightweight CoordAttention mechanism shown yields a new feature fusion network that integrates the lightweight CoordAttention mechanism. Specifically, a CoordAttention module is added after each C2f layer to effectively capture the relationship between spatial location information and channels, thereby enhancing the interaction and information flow between channels of the feature map. This captures the spatial correlation between different locations on the feature map, enhances target localization and recognition capabilities, and avoids increasing the computational burden.
[0070] Compared to the original YOLOv8 model output, the final Head section of the model adds a detection head capable of handling larger feature map sizes. This improves the detection capability for small-scale objects, ensuring effective detection of targets at different scales, such as... Figure 5 As shown.
[0071] The detection head output adopts an anchor-free approach, eliminating the need for predefined anchor boxes and better adapting to multi-scale targets. The detection head has two branches: a bounding box regression prediction branch, which predicts the location information of the target's bounding box, and a branch that predicts the target's category. These two branches are responsible for predicting the target's location and category information, respectively. The bounding box regression prediction branch primarily predicts the bounding box location of the target object through regression, including the center coordinates, width, and height of the target object's location. The output of this branch is typically a vector or matrix containing the target's bounding box location information. The loss functions used are the DFL loss function and the CIOU loss function, and their calculation formulas are as follows:
[0072] DFL(S i ,S i+1 )=-((y i+1 -y)log(S i )+(yy i )log(S i+1 (3)
[0073] Where S i ,S i+1 These are the network's predicted value and its nearest neighbor predicted value, respectively. i y i+1 These are the actual value of the label, the label value, and the values of neighboring labels, respectively.
[0074]
[0075] Where IOU represents the intersection-union ratio of the predicted and ground truth boxes, d is the square of the Euclidean distance between the center points of the predicted and ground truth boxes, c is the diagonal length of the minimum closure rectangle of the predicted and ground truth boxes, α is the weighting coefficient, and υ is used to measure the similarity in aspect ratio.
[0076] The target category prediction branch predicts the category to which the target object belongs, typically using a multi-class classification approach, outputting the probability distribution for each category. The output of this branch is usually a vector or matrix containing the probability of the target category, and the loss function used is the cross-entropy loss function, the formula of which is as follows:
[0077]
[0078] Where y ij For the true value, is the predicted value, n is the number of samples, and c is the number of categories.
[0079] This invention also proposes a lightweight UAV small target detection method based on an improved YOLOv8. This method first collects small target image data using a UAV, then replaces the YOLOv8 backbone network with a CA-MobileNetV3 framework (an improvement on the MobileNetV3 framework) to reduce parameters and computational load, thus achieving model lightweighting and adapting to the resource constraints of UAV platforms. Simultaneously, a lightweight CoordAttention mechanism is introduced into the multi-scale feature map fusion stage to enhance target localization without significantly increasing computational burden. Furthermore, a detection head capable of handling larger feature map sizes is added to improve the detection capability for small-scale targets, ultimately achieving efficient and accurate multi-scale target detection.
[0080] This invention also proposes a lightweight UAV small target detection device based on an improved YOLOv8, which includes:
[0081] A target detection model based on YOLOv8 neural networks, comprising: an input end, a backbone network, a neck network, and a detection head;
[0082] The input end preprocesses the input image to obtain an input image of uniform size;
[0083] The backbone network adopts the CA-MobileNetV3 framework to perform multi-scale feature extraction on the input image;
[0084] The neck network uses the CoordAttention mechanism to capture the spatial correlation at different locations on the feature map, and performs target localization and multi-scale feature fusion based on the spatial correlation.
[0085] The detection head has a bounding box regression prediction branch and a target prediction branch. The bounding box regression prediction branch is used to predict the location information of the target bounding box, and the target prediction branch locates the target bounding box and predicts the category of the target based on the predicted location information.
[0086] The target detection model is trained by using the DFL loss function and CIOU loss function as the loss function for the bounding box regression prediction branch, and the cross-entropy loss function as the loss function for the target prediction branch. When the values of the DFL loss function, CIOU loss function, and cross-entropy loss function are all less than a specified threshold, the training is completed and the target detection model is obtained.
[0087] The object detection model performs object detection on the input image.
[0088] The present invention also proposes a computer device comprising: at least one processor and a memory, the memory storing computer instructions executable on the processor, the instructions being executed by the processor as steps of the target detection method.
[0089] The present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the target detection method.
Claims
1. A lightweight UAV small target detection method based on improved YOLOv8, characterized in that, It includes the following steps: A target detection model based on YOLOv8 neural network is constructed, which includes: input end, backbone network, neck network and detection head; The input end preprocesses the input image to obtain an input image of uniform size; The backbone network uses the CA-MobileNetV3 framework to perform multi-scale feature extraction on the input image; the specific method is as follows: The CA-MobileNetV3 framework includes multiple convolutional layers and a bneck layer. The bneck layer, as a CA-MobileNetV3 module, replaces the original SE attention module in the MobileNetV3 module with the CoordAttention attention mechanism module to obtain the CA-MobileNetV3 module, which is used to extract the positional and channel information of the input image. The CA-MobileNetV3 module first maps the low-dimensional features of the input image to a high-dimensional space using a 1×1 convolutional layer; then, it uses a 3×3 depthwise separable convolutional layer (Dwise) to extract features from the input image. The Dwise convolutional layer includes a depthwise convolutional layer and a 1x1 point convolutional layer. The depthwise convolutional layer is used for spatial filtering, and the 1x1 point convolutional layer is used for feature generation; finally, a 1×1 convolutional layer projects the high-dimensional features back to the low-dimensional space to generate output multi-scale features. The intermediate connection layer between the 3×3 depthwise separable convolutional layer and the 1×1 convolutional layer is composed of a CoordAttention module, a ReLU activation function, and an h-swish activation function combined sequentially; wherein, The CoordAttention module combines channel attention with spatial location information, enabling the model to capture the dependency between attention and spatial location while preserving the spatial location information. The formula for calculating the ReLU activation function is as follows: in As feature input, The feature output is the feature output after performing a nonlinear transformation on the feature input; The h-swish activation function is calculated using the following formula: in As feature input, The feature output is the feature output after performing a nonlinear transformation on the feature input; A feature pyramid network with a CoordAttention mechanism is introduced into the neck network to capture spatial correlations at different locations on the feature map. Based on these spatial correlations, target localization and multi-scale feature map fusion are performed to obtain the final feature map. The specific method is as follows: The neck network uses a PAN-FPN structure, which uses a hierarchical feature pyramid network to fuse feature maps from different levels. A CoordAttention module is added after the PAN-FPN structure to capture the relationship between spatial location information and channels on the feature map, thereby enhancing the target localization and recognition capabilities. The detection head has a bounding box regression prediction branch and a target prediction branch. The bounding box regression prediction branch is used to predict the location information of the target bounding box, and the target prediction branch locates the target bounding box and predicts the category of the target based on the predicted location information. The target detection model is trained by using the DFL loss function and CIOU loss function as the loss functions for the bounding box regression prediction branch, and the cross-entropy loss function as the loss function for the target prediction branch. When the values of the DFL loss function, CIOU loss function, and cross-entropy loss function are all less than a specified threshold, the training is completed and the target detection model is obtained. The target detection model is used to perform target detection on the input image.
2. The lightweight UAV small target detection method based on improved YOLOv8 according to claim 1, characterized in that, The CoordAttention module combines channel attention mechanisms with spatial location information in the following specific way: The CoordAttention module first performs one-dimensional global pooling operations along the horizontal and vertical directions on the input feature map to obtain two feature maps that are aggregated for perception in two directions. Then, it performs feature concatenation and convolution operations along the spatial dimension to obtain a new feature map. The new feature map is then further divided into two feature maps along the spatial dimension and convolution and non-linear transformation are performed to obtain attention weights. The attention weights are then applied to the input feature map along the horizontal and vertical directions to achieve feature enhancement.
3. The lightweight UAV small target detection method based on improved YOLOv8 according to claim 2, characterized in that, When training the target detection model, the specific forms of the DFL loss function, CIOU loss function, and cross-entropy loss function are as follows: The formula for the DFL loss function is: in, These are the network's predicted value and its nearest neighbor predicted value, respectively. These are the actual value of the label, the label value, and the values of neighboring labels, respectively. The CIOU loss function formula is: in, IOU This represents the intersection-union ratio (IUU) between the predicted bounding boxes and the ground truth bounding boxes. d It is the square of the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. c It is the diagonal length of the smallest closure rectangle between the predicted bounding box and the ground truth bounding box. α These are weighting coefficients. Used to measure the similarity of aspect ratio; The formula for the cross-entropy loss function is: in For the true value, For predicted values, For the sample size, This represents the number of categories.
4. A lightweight UAV small target detection device based on an improved YOLOv8, characterized in that, It includes: A target detection model based on YOLOv8 neural networks, comprising: an input end, a backbone network, a neck network, and a detection head; The input end preprocesses the input image to obtain an input image of uniform size; The backbone network uses the CA-MobileNetV3 framework to perform multi-scale feature extraction on the input image; specifically: The CA-MobileNetV3 framework includes multiple convolutional layers and a bneck layer. The bneck layer, as a CA-MobileNetV3 module, replaces the original SE attention module in the MobileNetV3 module with the CoordAttention attention mechanism module to obtain the CA-MobileNetV3 module, which is used to extract the positional and channel information of the input image. The CA-MobileNetV3 module first maps the low-dimensional features of the input image to a high-dimensional space using a 1×1 convolutional layer; then, it uses a 3×3 depthwise separable convolutional layer (Dwise) to extract features from the input image. The Dwise convolutional layer includes a depthwise convolutional layer and a 1x1 point convolutional layer. The depthwise convolutional layer is used for spatial filtering, and the 1x1 point convolutional layer is used for feature generation; finally, a 1×1 convolutional layer projects the high-dimensional features back to the low-dimensional space to generate output multi-scale features. The intermediate connection layer between the 3×3 depthwise separable convolutional layer and the 1×1 convolutional layer is composed of a CoordAttention module, a ReLU activation function, and an h-swish activation function combined sequentially; wherein, The CoordAttention module combines channel attention with spatial location information, enabling the model to capture the dependency between attention and spatial location while preserving the spatial location information. The formula for calculating the ReLU activation function is as follows: in As feature input, The feature output is the feature output after performing a nonlinear transformation on the feature input; The h-swish activation function is calculated using the following formula: in As feature input, The feature output is the feature output after performing a nonlinear transformation on the feature input; A feature pyramid network with a CoordAttention mechanism is introduced into the neck network to capture spatial correlations at different locations on the feature map. Based on these spatial correlations, target localization and multi-scale feature map fusion are performed to obtain the feature map. The specific method is as follows: The neck network uses a PAN-FPN structure, which uses a hierarchical feature pyramid network to fuse feature maps from different levels. A CoordAttention module is added after the PAN-FPN structure to capture the relationship between spatial location information and channels on the feature map, thereby enhancing the target localization and recognition capabilities. The detection head has a bounding box regression prediction branch and a target prediction branch. The bounding box regression prediction branch is used to predict the location information of the target bounding box, and the target prediction branch locates the target bounding box and predicts the category of the target based on the predicted location information. The target detection model is trained by using the DFL loss function and CIOU loss function as the loss functions for the bounding box regression prediction branch, and the cross-entropy loss function as the loss function for the target prediction branch. When the values of the DFL loss function, CIOU loss function, and cross-entropy loss function are all less than a specified threshold, the training is completed and the target detection model is obtained. The object detection model performs object detection on the input image.
5. A computer device, characterized in that, include: At least one processor and a memory, the memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-3.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-3.