An unmanned aerial vehicle aerial vehicle detection method based on improved YOLOv8n
By improving the feature fusion network, detection head, and loss function of the YOLOv8n model, the problems of small target recognition and deformable target recognition in UAV aerial vehicle detection are solved, improving detection accuracy and reducing false detection rate, making it suitable for real-time UAV detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 刘润涵
- Filing Date
- 2026-05-13
- Publication Date
- 2026-07-31
AI Technical Summary
The original YOLOv8n model is insufficient in extracting features of small targets in drone aerial vehicle detection, has difficulty identifying deformed targets, and has a high false detection rate in complex backgrounds.
RepNCSPFPN is used as the feature fusion network, LiteShiftHead is used as the detection head, and WIoU loss function is used to improve the YOLOv8n model to improve the detection accuracy of small targets and reduce the false detection rate.
It improves the detection accuracy of vehicle targets in UAV aerial images, reduces the false negative and false positive rates, and maintains the lightweight nature of the model, making it suitable for real-time detection by UAVs.
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and target detection technology, and in particular to a method for vehicle detection in drone aerial photography based on an improved YOLOv8n. Background Technology
[0002] With the rapid development of drone technology, using drones for aerial image target detection has become an important technical means in fields such as intelligent transportation and urban management. YOLOv8n, as one of the most popular lightweight target detection models, has advantages such as fast inference speed and convenient deployment, and is widely used in drone real-time detection scenarios.
[0003] However, when the original YOLOv8n model is directly applied to vehicle detection in drone aerial photography, the following problems exist: 1. Vehicle targets in drone aerial images are usually small. The original YOLOv8n model is not capable of extracting features from small targets, resulting in low detection accuracy and high false negative rate. 2. Drone aerial photography uses a top-down perspective, which causes severe perspective distortion of vehicle targets, making it difficult for the original model to accurately identify the distorted targets; 3. Aerial images often have complex backgrounds, including trees, buildings, road markings, and other interfering factors, which can easily lead to false detections.
[0004] Therefore, targeted improvements are needed to the YOLOv8n model to enhance its performance in drone aerial vehicle detection scenarios. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a UAV aerial vehicle detection method based on an improved YOLOv8n. By improving the feature fusion network, detection head and loss function of the model, the detection accuracy of small and deformable targets in aerial images is improved and the false detection rate in complex backgrounds is reduced.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: A method for vehicle detection in drone aerial photography based on an improved YOLOv8n includes the following steps: S1: Acquire road images taken by drone and preprocess the images; S2: Input the preprocessed image into the improved YOLOv8n object detection model for feature extraction and object detection; S3: Outputs the detection results of vehicle targets, including target category, location coordinates, and confidence level; The improved YOLOv8n target detection model uses RepNCSPFPN as the feature fusion neck network, LiteShiftHead as the detection head, and WIoU as the loss function.
[0007] Furthermore, the RepNCSPFPN neck network, based on the original YOLOv8n PAN structure, replaces all C2f modules with RepNCSPELAN4 modules, while retaining the bidirectional feature fusion paths from top to bottom and bottom to top, which can better fuse feature information of different scales and improve the small target detection capability.
[0008] Furthermore, the LiteShiftHead detection head replaces the original YOLOv8n Detect detection head. By introducing shift convolution operations, it reduces the number of parameters and computational load, improving model inference speed while maintaining detection accuracy, thus meeting the real-time detection needs of UAVs.
[0009] Furthermore, the WIoU loss function replaces the original YOLOv8n CIoU loss function, and by introducing a weighting factor, it addresses the problem of large differences in target scale in UAV aerial images, thereby improving the detection accuracy of vehicle targets of different sizes.
[0010] The beneficial effects of this invention are: by improving the neck network, detection head and loss function of the YOLOv8n model, the detection accuracy of vehicle targets in UAV aerial images is effectively improved, the false negative rate and false positive rate are reduced, and the lightweight characteristics of the model are maintained, making it suitable for deployment on UAV embedded devices. Detailed Implementation
[0011] The present invention will be further described in detail below with reference to specific embodiments.
[0012] In this embodiment, YOLOv8n is used as the base model, and the following three aspects are improved upon: 1. Construct the RepNCSPFPN feature fusion neck network: Replace all C2f modules in the original YOLOv8n neck network with RepNCSPELAN4 modules, retain the original bidirectional feature fusion structure, and enhance the model's ability to fuse multi-scale features; 2. Replace the detection head: Replace the original Detect head with the LiteShiftHead detection head, and introduce a shift convolution operation to reduce the number of model parameters; 3. Replace the loss function: Replace the original CIoU loss function with the WIoU loss function to optimize the target box regression process.
[0013] During model training, the internationally recognized VisDrone drone aerial photography dataset was used. Training parameters were set as follows: input image size imgsz=640, training epochs=300, batch size=32, data loading threads (workers=8), and SGD optimizer. In the last 10 epochs, mosaic data augmentation was disabled (close_mosaic=10), and resume training was not enabled (resume=False). Training results were saved to the project path runs / train / YOLOv8-RepNCSPFPN-LiteShiftHead-WIoU-visdrone, using multi-class detection mode (single_cls=False), and dataset caching was disabled (cache=False). After training, the model was deployed to a drone-borne computing platform for real-time detection.
Claims
1. An improved YOLOv8n-based unmanned aerial vehicle aerial vehicle detection method, characterized in that, Includes the following steps: S1: Acquire road images taken by drone and preprocess the images; S2: Input the preprocessed image into the improved YOLOv8n object detection model for feature extraction and object detection; S3: Outputs the detection results of vehicle targets, including target category, location coordinates, and confidence level; The improved YOLOv8n target detection model uses RepNCSPFPN as the feature fusion neck network, LiteShiftHead as the detection head, and WIoU as the loss function.
2. The method for detecting vehicles using drone aerial photography according to claim 1, characterized in that, The RepNCSPFPN neck network, based on the original YOLOv8n PAN structure, replaces all C2f modules with RepNCSPELAN4 modules, while retaining the bidirectional feature fusion paths from top to bottom and bottom to top.
3. The method for detecting vehicles by drone aerial photography according to claim 1, characterized in that, The LiteShiftHead detection head replaces the original YOLOv8n Detect detection head, and reduces the number of parameters and computation by introducing shift convolution operations, thereby improving the model inference speed.
4. The method for detecting vehicles by drone aerial photography according to claim 1, characterized in that, The WIoU loss function replaces the original YOLOv8n CIoU loss function, and solves the problem of large target scale differences in UAV aerial images by introducing weighting factors.