Improved YOLOv8 for China UAV Aerial Detection

In recent years, China UAV technology has been widely applied in fields such as smart city construction, disaster rescue, agricultural monitoring, and traffic management. The images captured by China UAV are characterized by complex backgrounds, dense small targets, and varying scales, posing significant challenges to existing object detection algorithms. To address these issues, I propose an improved algorithm based on YOLOv8, named YOLOv8-A, specifically designed for China UAV aerial detection. The contributions of this work include three key modifications: introducing a Global Channel-Spatial Attention (GCSA) module to enhance feature representation, replacing the SPPF module in the neck with the AIFI module from RT-DETR to improve context information capture, and adopting the Wise-IoU (WIoU) loss function to stabilize bounding box regression for difficult samples. Extensive experiments on the VisDrone2019 dataset demonstrate that the proposed method achieves a 2.1% improvement in mean average precision (mAP) compared to the baseline YOLOv8s, while maintaining competitive inference speed. Additionally, comparisons with mainstream algorithms such as YOLOv4, YOLOv5s, YOLOXs, and YOLOv11s confirm the superiority of YOLOv8-A for China UAV imagery.

1. Introduction

China UAV equipped with optical sensors can flexibly collect low-altitude remote sensing images, which are essential for various civilian and commercial applications. However, the automatic analysis of these images, particularly object detection, is hindered by the small size of targets, occlusion, and cluttered backgrounds. Traditional hand-crafted feature methods like HOG and DPM have been largely replaced by deep learning approaches. Among them, the YOLO family has become the dominant paradigm due to its balance between speed and accuracy. YOLOv8, the latest iteration in this series, provides robust performance but still suffers from missed and false detections when applied to China UAV data. Therefore, I focus on improving YOLOv8s to better suit the characteristics of China UAV aerial detection. The main improvements are: (1) a GCSA attention module to capture both channel and spatial dependencies; (2) the AIFI module to enhance long-range context modeling in the neck; (3) the WIoU loss to improve localization of low-quality and small objects.

2. Methodology

2.1 Overview of YOLOv8s Baseline

YOLOv8s consists of four parts: input preprocessing, backbone (CSPDarkNet53 with C2F and SPPF modules), neck (FPN+PAN), and head (decoupled for classification and regression). The baseline uses CIoU as the bounding box loss. The architecture is designed for general object detection, but its performance on small objects in complex scenarios is limited.

2.2 Global Channel-Spatial Attention (GCSA)

To strengthen the dependency between channels and spatial locations, a Global Channel-Spatial Attention (GCSA) module is inserted into the backbone. The structure involves a channel attention branch followed by a channel shuffle operation and a spatial attention branch. The process can be mathematically expressed as:

$$ F_{channel} = \sigma \left( MLP \left( Permute(F_{input}) \right) \right) \odot F_{input} $$
$$ F_{shuffle} = ChannelShuffle(F_{channel}) $$
$$ F_{spatial} = \sigma \left( Conv(BN(ReLU(Conv(F_{shuffle})))) \right) \odot F_{shuffle} $$

where \(\sigma\) denotes the Sigmoid function, \(\odot\) is element-wise multiplication, and \(Permute\) transposes dimensions. This module helps the network focus on both important channels and informative spatial regions, particularly beneficial for small targets in cluttered backgrounds.

2.3 AIFI Module in Neck

The original SPPF module in the neck is replaced by the AIFI module from RT-DETR. The AIFI module is a Transformer encoder that applies multi-head self-attention on high-level features. It processes the feature map from the deepest layer (S5) by first linearizing it into a sequence, then passing it through a MultiheadAttention layer, layer normalization, a MLP, and another normalization. The output is reshaped back to a feature map. This design captures long-range dependencies and reduces redundant convolution, as illustrated in the following operations:

$$ F_5 = AIFI(S_5) $$

The enhanced feature \(F_5\) is then fused with lower-level features S4 and S3 via the FPN+PAN structure. The AIFI module improves the ability to extract contextual information without significantly increasing parameters.

2.4 WIoU Loss Function

CIoU loss is sensitive to target aspect ratios and leads to insufficient optimization for low-quality samples. I adopt the Wise-IoU (WIoUv1) loss, which introduces a dynamic focusing mechanism based on IoU. The definition is:

$$ L_{IoU} = 1 – \frac{W_i H_i}{w h + w_{gt} h_{gt} – W_i H_i} $$
$$ R_{WIoU} = \exp \left( \frac{(x – x_{gt})^2 + (y – y_{gt})^2}{W_g^2 + H_g^2} \right) $$
$$ L_{WIoUv1} = R_{WIoU} \cdot L_{IoU} $$

Here, \((x,y)\) and \((x_{gt},y_{gt})\) are coordinates of predicted and ground-truth boxes, \(W_i, H_i\) represent intersection dimensions, and \(W_g, H_g\) are the dimensions of the smallest enclosing box. This loss reduces the penalty for large overlaps and focuses more on difficult samples, thereby improving the localization accuracy of small objects in China UAV imagery.

2.5 Overall Architecture of YOLOv8-A

The improved network, YOLOv8-A, integrates GCSA in the backbone, replaces SPPF with AIFI, and employs WIoU as the bounding box loss. Table 1 summarizes the configurations of different ablation variants.

Table 1: Ablation configurations
Variant Components
A YOLOv8s (baseline)
A+B YOLOv8s + GCSA
A+C YOLOv8s + AIFI
A+D YOLOv8s + WIoU
A+B+C YOLOv8s + GCSA + AIFI
A+B+C+D (Ours) YOLOv8s + GCSA + AIFI + WIoU

3. Experiments and Results

3.1 Dataset and Implementation Details

The VisDrone2019 dataset, a benchmark for China UAV object detection, is used. It contains 6,471 training images, 1,580 test images, and 548 validation images. Over 60% of targets are small objects. All images are resized to 640×640 pixels. Training is performed on a single RTX 4090D GPU with PyTorch, using SGD optimizer, initial learning rate 0.01 (later optimized to 0.1), momentum 0.937, batch size 16, and 200 epochs with early stopping. Metrics include Precision (P), Recall (R), mAP@0.5, parameter count, FLOPs, and FPS.

3.2 Ablation Study

Systematic ablation experiments are conducted to evaluate each component. The results are shown in Table 2.

Table 2: Ablation results on VisDrone2019 (all values in %)
Method P R mAP Params (×10⁶) FLOPs (G) FPS (ms)
A (baseline) 49.1 36.6 37.3 11.12 28.5 33.03
A+B 49.4 37.8 38.9 17.68 33.7 29.34
A+C 49.8 37.8 38.1 10.57 27.7 26.19
A+D 50.8 37.2 38.5 11.13 28.5 30.04
A+B+C 49.8 37.4 38.3 17.13 33.0 22.74
A+B+C+D 50.1 37.9 39.4 17.13 33.0 31.13

From Table 2, it is clear that each individual improvement contributes positively. The full model (A+B+C+D) achieves the highest mAP of 39.4%, an increase of 2.1% over the baseline. The GCSA module (A+B) alone boosts mAP by 1.6% due to better spatial and channel attention. The AIFI module (A+C) reduces parameters by 0.55 million while still improving mAP by 0.8%. The WIoU loss (A+D) improves precision and mAP, especially for hard categories like pedestrian and car. When combining GCSA and AIFI (A+B+C), the mAP is lower than A+B, but after adding WIoU (full model), the synergy recovers and surpasses all other variants. The FPS of the full model is 31.13 ms, only 5.7% slower than baseline, which is acceptable for real-time deployment on China UAV platforms.

3.3 Per-Class Performance Analysis

Table 3 presents the per-class mAP scores for selected categories. The full model shows consistent improvements over the baseline, especially for small and occluded objects like pedestrian, bicycle, and car. For example, pedestrian mAP rises from 40.4% to 42.8%, car from 76.4% to 79.8%, and van from 42.4% to 45.3%.

Table 3: Per-class mAP comparison (%)
Category Baseline YOLOv8-A
Pedestrian 40.4 42.8
People 31.2 32.7
Bicycle 11.4 12.2
Car 76.4 79.8
Van 42.4 45.3
Truck 35.2 37.0
Tricycle 26.1 27.2
Awning-tricycle 14.1 14.8
Bus 53.3 52.3
Motor 41.9 43.8

3.4 Learning Rate Optimization

To determine the optimal learning rate for YOLOv8-A, I test values from 0.001 to 0.1 under the same settings. Table 4 shows that the highest mAP is achieved at 0.1, which is selected for final experiments.

Table 4: Effect of learning rate on YOLOv8-A (%)
Learning Rate mAP P R
0.001 28.5 39.3 29.6
0.01 39.4 50.1 37.9
0.03 40.3 51.9 38.8
0.05 40.8 51.2 39.0
0.07 40.9 52.3 39.1
0.1 41.2 52.4 39.5

3.5 Comparison with State-of-the-Art Methods

Table 5 compares YOLOv8-A with several mainstream detectors on VisDrone2019. The proposed method outperforms all competitors in mAP (39.4%), surpassing YOLOv4 (38.8%), YOLOv5s (38.5%), YOLOXs (32.5%), and YOLOv11s (38.2%). Although YOLOXs has higher precision (81.7%), its recall is only 18.2%, indicating severe missed detections. YOLOv8-A maintains a good balance between precision and recall while achieving the highest mAP, making it particularly suitable for China UAV applications.

Table 5: Comparison with state-of-the-art methods (%)
Method mAP P R
YOLOv4 38.8 49.6 37.8
YOLOv5s 38.5 49.4 37.9
YOLOXs 32.5 81.7 18.2
YOLOv11s 38.2 50.3 37.0
YOLOv8s 37.3 49.1 36.6
YOLOv8-A 39.4 50.1 37.9

3.6 Validation on Custom Dataset

To evaluate generalization, I construct a custom dataset containing 1000 images of pedestrians on urban roads captured by China UAV. The split is 800 training, 160 testing, 40 validation. Only one class (pedestrian) is used. As shown in Table 6, YOLOv8-A achieves the highest mAP of 62.1%, a 3.0% improvement over baseline YOLOv8s (59.1%). This confirms the robustness and applicability of the proposed method across different China UAV scenarios.

Table 6: Results on custom pedestrian dataset (%)
Method mAP P R
YOLOv4 59.3 56.1 58.8
YOLOv5s 59.0 55.0 61.6
YOLOv8s 59.1 57.1 59.0
YOLOv11s 58.9 57.2 59.2
YOLOv8-A 62.1 62.8 58.6

4. Conclusion

In this work, I propose an improved YOLOv8-based detection algorithm specifically tailored for China UAV aerial imagery. By integrating the GCSA attention module, the AIFI context module, and the WIoU loss function, the proposed YOLOv8-A achieves a significant 2.1% mAP improvement on the VisDrone2019 dataset while maintaining real-time processing speed. Experiments on self-collected pedestrian data further demonstrate its generalization capability. The method effectively addresses the challenges of small objects and complex backgrounds in China UAV images. Future work will focus on lightweight model design to reduce computational cost while preserving high accuracy, facilitating deployment on embedded platforms such as edge devices used with China UAV.

Note: All experiments were conducted using the same hardware and software environment. The code and configurations will be made publicly available to support further research on China UAV detection.

Scroll to Top