Multi-rotor unmanned aerial vehicle target accurate identification and release system and method based on YOLOv8
The YOLOv8-based multi-rotor UAV target recognition and delivery system solves the problems of inaccurate dataset construction, insufficient model robustness, static circular domain parameters, and poor hardware adaptability. It realizes automatic and accurate UAV target recognition and delivery, and improves the system's environmental adaptability and recognition accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-12
- Publication Date
- 2026-06-12
AI Technical Summary
Existing multi-rotor UAV target recognition and delivery systems suffer from problems such as inaccurate dataset construction, insufficient model robustness, static circular domain parameters, insufficient module coordination, and poor hardware adaptability. These issues result in low recognition accuracy, large delivery offset, and weak environmental adaptability, failing to meet the requirements of unmanned operations.
The YOLOv8 model is used for target detection. Combined with the onboard hardware and software units of a multi-rotor UAV, through closed-loop control of dataset construction, model training, real-time recognition and calibration, and deployment execution, dynamic dual-circle domain computation and ROS1-MAVLink collaboration are achieved. Hardware adaptation is optimized, a lightweight model is built and deployed in ONNX format, and automatic and accurate target recognition and deployment are realized.
It improves target recognition accuracy, reduces the risk of delivery deviation, enhances environmental adaptability and module collaboration capabilities, meets the real-time recognition and delivery needs of UAVs, and realizes automated operation in multiple scenarios.
Smart Images

Figure CN122186433A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of unmanned aerial vehicle (UAV) target recognition technology, and in particular to a system and method for accurate target recognition and deployment of multi-rotor UAVs based on YOLOv8. Background Technology
[0002] With the rapid iteration of artificial intelligence and unmanned systems technologies, multi-rotor drones have become the core carrier of unmanned operations. Accurate target identification and delivery, as a key operational capability, directly determines the application effectiveness and scope of application for drones. However, existing multi-rotor drone target identification and delivery systems still face many insurmountable challenges in both technical implementation and practical application, specifically manifested as follows: First, inaccurate dataset construction leads to significant biases in the basic delivery process. Traditional delivery systems generally employ a "whole coverage" strategy for labeling delivery targets. For example, when labeling a cylindrical target, the bounding box covers the entire body, opening, and even the base. However, actual delivery requires focusing on the "core delivery area." This labeling bias causes pixel offsets between the center point of the target detection box and the actual delivery location, resulting in a relative spatial offset. Furthermore, the missed detection rate for cylindrical targets increases significantly with height. If the training set images are not captured at the typical operating altitude of drones, and instead are mostly taken at close range, the model will not adequately learn the features of distant targets. In addition, the lack of emphasis on "joint training of easily confused targets" means that the target to be delivered and objects with similar shapes / colors in the scene are not included in the same training system. The model is prone to misclassifying easily confused targets as delivery targets, increasing the misidentification rate and leading to incorrect delivery.
[0003] Secondly, the robustness of target detection models is insufficient, and data augmentation methods are simplistic and difficult to adapt to complex environments. Existing systems mostly use traditional models such as YOLOv5, without optimizing training strategies for harsh conditions such as strong light, darkness, and flight vibrations in drone operations. Furthermore, data augmentation often relies on separately written code, which is cumbersome and disconnected from the training process. Although some systems integrate data augmentation, the parameter configuration lacks specificity and fails to cover key operations such as brightness adjustment, Gaussian noise, and perspective transformation, resulting in a significant drop in recognition accuracy in extreme environments. The training parameter configuration also lacks specificity, failing to use the AdamW optimizer (to mitigate gradient explosion in small samples) and cosine learning rate scheduling (to improve convergence stability), making it prone to overfitting in the later stages of training and resulting in a large difference between the accuracy of the validation set and the test set. At the same time, the models are not adapted to the computing power of edge devices, and the training parameters are not adapted to lightweight model deployment. They use model variants with a large number of parameters, resulting in inference speeds of less than 15fps after deployment to edge devices, which cannot meet the requirements for real-time recognition.
[0004] Third, the static parameters of the circular domain lead to poor scene adaptability. In existing technologies, the diameter and center point of the "circular domain" triggered by deployment are manually preset fixed values, without dynamic adjustment based on the drone's altitude and the camera's field of view. When the drone's altitude increases from 1m to 2m, the coverage area of the fixed circular domain in the actual space expands, increasing the probability of deployment failure. When the altitude decreases from 2m to 1m, the fixed circular domain has too small a coverage area, leading to missed target detection. More importantly, the "servo-camera physical deviation" is not compensated for—there is an actual offset between the deployment port of the dual MG996 servo and the center of the D435 depth camera, but this deviation is not incorporated into the calculation of the circular domain center point through coordinate transformation, further exacerbating the deployment offset. At the same time, a unified center point logic is not designed for "single servo corresponding to dual circular domains," resulting in the same servo having a deployment position deviation at different altitudes.
[0005] Fourth, the lack of coordination between "identification-calibration-deployment" results in weak closed-loop control capabilities. Existing technologies often operate core modules such as target identification, flight control, and deployment execution independently, lacking MAVLink collaborative communication between ROS and flight control. Servo control is mostly implemented directly through GPIO interfaces, failing to utilize flight control channel resources, leading to poor compatibility and stability. The target identification module only outputs target bounding box coordinates without linking with the flight control module to calculate offsets. The flight control module only executes preset waypoints and cannot dynamically adjust based on real-time target positions. The deployment execution module only receives a single trigger signal and does not determine whether the target is stable within the deployment area, resulting in frequent misoperations such as "deploying the target even though it has deviated" and "not descending even though the target is stable within the area," leading to a low deployment success rate. In multi-servo scenarios, the lack of a "time-sharing control + status locking mechanism for flight control channels" easily leads to repeated deployments of the same target or target omissions, requiring manual intervention and failing to meet the requirements of fully automated operations.
[0006] Fifth, poor hardware compatibility and high difficulty in engineering implementation. Existing systems have not optimized models and code for specific airborne hardware: the models have not been converted to ONNX format, resulting in excessive memory consumption after deployment; some systems have not clearly defined the communication logic between hardware, resulting in high servo control latency and stuttering; the servo control is not matched with the PWM parameters of MG996, resulting in the failure of deployment actions.
[0007] While YOLOv8, as a next-generation object detection model, boasts advantages such as lightweight and efficient feature extraction and fast inference, existing technologies have not deeply integrated it with dynamic dual-circle domain computation, ROS1-MAVLink collaboration, dual-servo time-sharing deployment, and specified hardware. Furthermore, they have not optimized dataset construction and training strategies for "generalized precise deployment," making it difficult to meet the core requirements of unmanned operations for multi-rotor UAVs. Therefore, this invention, through multi-dimensional technological innovation, constructs an integrated system to address the pain points of existing technologies and promote the engineering application of technological achievements. Summary of the Invention
[0008] The purpose of this invention is to provide a YOLOv8-based system and method for precise target identification and delivery of multi-rotor UAVs, which solves the problems of low target identification accuracy, large delivery offset, weak environmental adaptability, and insufficient module coordination in existing technologies. It achieves automatic and accurate identification and real-time positioning of the target to be delivered. By constructing a closed-loop control of "identification-calibration-delivery", it provides precise guidance and triggering commands for the UAV flight control system, thereby realizing universal and automated precise delivery operations in multiple scenarios.
[0009] To achieve the above objectives, the present invention provides the following solution: A YOLOv8-based multi-rotor UAV target precision identification and delivery system includes an airborne hardware unit and an airborne software unit deployed thereon; The airborne hardware unit includes at least: a multi-rotor UAV platform, a flight controller, an onboard computer, a downward-looking depth camera, and at least one delivery device driven by a servo motor; the airborne software unit runs on the Robot Operating System (ROS) framework installed on the onboard computer, and the onboard computer communicates with the flight controller based on the MAVLink protocol. The airborne software unit includes at least: Data acquisition and preprocessing module: used to perform projection area annotation and image preprocessing on the acquired image data of targets and easily confused objects to obtain a preprocessed dataset; The object detection model training module is used to build a YOLOv8 model based on the Ultralytics framework. It trains the YOLOv8 model using a preprocessed dataset, performs data augmentation by integrating multi-scale inputs and terminal commands during training, and generates a model weight file to adapt for deployment on an airborne computer, thus obtaining a trained object detection model. Waypoint Flight Reconnaissance Module: Used to issue position control commands via ROS to control the UAV to fly in the reconnaissance area according to preset waypoints, and simultaneously activate the downward-looking camera to collect real-time images; the preset waypoint altitude is set to the first altitude, and the waypoint data is stored in the ROS parameter server; Real-time recognition and positioning calibration module: Used to detect targets in real-time images using a target detection model to obtain the position information of the targets in the images, and adjust the attitude and position of the UAV through a position calibration algorithm; Decision control module: Used to determine whether the deployment conditions are met based on the target's position in the image and the drone's real-time altitude information, and to generate control commands; Drop Execution Module: If the control command is a drop command, drive the drop device to complete the target drop action; the drop action is achieved by controlling the rotation of the servo motor, and the servo motor control signal is issued by the ROS node. After the drop is completed, the UAV returns to the preset waypoint.
[0010] Furthermore, the easily confused object is an object whose shape, outline, and surface color are similar to the target being deployed; The conditions for image acquisition include maintaining a preset working distance from the target; The target area is labeled as follows: For each target category, use the LabelImg tool to mark the label box in the target target area; The image preprocessing is data enhancement processing, including brightness adjustment, noise addition, rotation, cropping, HSV color space adjustment, and perspective transformation; the image acquisition conditions include maintaining a preset working distance from the target; Before model training, the preprocessed dataset is divided into training set, validation set and test set according to a set ratio.
[0011] Furthermore, the position calibration algorithm includes: target localization in the image coordinate system, dual-threshold circular domain judgment, and position adjustment based on offset; The target localization in the image coordinate system is as follows: based on the target detection results of the target detection model, the coordinates of the center point of the target detection box are obtained. The dual-threshold circular domain determination is as follows: a first circular domain and a second circular domain are set in the image, which correspond to the flight control and deployment preparation conditions of the UAV at the first altitude and the second altitude, respectively. The radius and center coordinates of the first circular domain and the second circular domain are calculated based on the current altitude of the UAV, the field of view of the camera, and the actual hardware deviation distance. The position adjustment based on offset is as follows: a UAV position adjustment command is generated according to the offset between the target center point and the center of the circular area, so that the target center point gradually approaches the center of the circular area. The adjustment amount is proportional to the offset amount, and the proportionality coefficient is set according to the dynamic characteristics of the UAV such as maximum flight speed and load weight.
[0012] Furthermore, the judgment logic for generating control commands is as follows: When the drone is at the first altitude and the target center point falls into the first circular area and remains there for a time greater than or equal to a preset time, a descent command is generated; when the drone descends to the second altitude and the target center point falls into the second circular area and remains there for a time greater than or equal to the preset time, a deployment command is generated; after deployment, if there is an undeployed servo, switch to the corresponding servo and resume waypoint flight; after both servos are deployed, a return-to-home command is generated. Furthermore, the onboard computer is equipped with the ROS Noetic system, runs YOLOv8 ROS nodes to subscribe to camera image topics, synchronously starts waypoint control nodes to adjust positions, and uses the CvBridge tool for image conversion.
[0013] This invention also provides a method for accurate target identification and deployment for multi-rotor drones based on YOLOv8, applied to the aforementioned YOLOv8-based multi-rotor drone target identification and deployment system, comprising the following steps: S1. Dataset Construction: Collect image data of the target and easily confused objects for model training, perform projection area annotation and image preprocessing to obtain a preprocessed dataset; S2. Model Training: A YOLOv8 model is built based on the Ultralytics framework. The YOLOv8 model is trained using a preprocessed dataset. During the training process, data augmentation is performed by integrating multi-scale inputs and terminal commands. A model weight file is generated to adapt it for deployment on an airborne computer, resulting in a trained object detection model. S3. Waypoint reconnaissance: The UAV is controlled to fly in the reconnaissance area according to the preset waypoints by issuing position control commands through ROS, and the downward-looking camera is simultaneously activated to collect real-time images; the preset waypoint altitude is set to the first altitude, and the waypoint data is stored in the ROS parameter server. S4. Real-time recognition and calibration: For the acquired real-time images, a target detection model is used to detect targets to obtain the position information of the targets in the images, and the attitude and position of the UAV are adjusted through a position calibration algorithm; S5. Layered decision-making: Based on the target's position in the image and the UAV's real-time altitude information, determine whether the deployment conditions are met and generate control commands; S6. Drop Execution: If the control command is a drop command, drive the drop device to complete the target drop action; the drop action is achieved by controlling the rotation of the servo motor. The servo motor control signal is issued by the ROS node. After the drop is completed, the UAV returns to the preset waypoint.
[0014] Furthermore, in S2, model training specifically includes: Before model training, image preprocessing and enhancement operations are performed on the dataset. During image training, the initialization model of YOLOv8s.pt is used as the pre-trained model, and the model weights are initialized. The training parameters were set to batch=16, epochs=100, imgsz=1280, the optimizer was AdamW, the learning rate was 0.0002, and the cosine learning rate was used for scheduling. Export the weight file. When the weight file achieves an accuracy of at least 95% on the validation set and at least 80% on the test set under extreme conditions, convert the weight file to ONNX format and deploy it to the onboard computer.
[0015] Furthermore, in S4, real-time identification and calibration specifically include: Target localization in image coordinate system: The onboard computer runs YOLOv8 ROS nodes, detects targets in real-time images through a trained target detection model, filters targets with confidence scores < 0.6, and obtains the coordinates of the center point of the target detection box with the highest confidence score; Dual-threshold circular domain judgment: Set a first circular domain and a second circular domain in the image, which correspond to the flight control and deployment preparation conditions of the drone at the first altitude and the second altitude, respectively. The diameter and center coordinates of the first and second circular domains are calculated based on the drone's current altitude, the camera's field of view, and the actual hardware deviation distance. Position adjustment based on offset: The position adjustment command of the UAV is generated according to the offset between the target center point and the center of the circular area, so that the target center point gradually approaches the center of the circular area. The adjustment amount is proportional to the offset amount, and the proportional coefficient is set according to the dynamic characteristics of the UAV such as maximum flight speed and payload weight.
[0016] Furthermore, in the dual-threshold circular domain determination: The diameters of the first and second circular regions are calculated based on the actual diameter of the target, the drone's altitude, and the camera's field of view. The formula for calculating the diameter of the circular region is: Where d is the actual diameter of the target, h is the height of the UAV, and FOV is the horizontal field of view of the camera; The center coordinates of the first and second circular regions are calculated based on the offset between the center point of the deployment port of the actual servo motor deployment system and the center point of the camera. The center coordinates are: ,in, h、 Here, x and y are the image width and height, respectively, and x and y are the offset values after scaling the camera view and the actual image. The scaling is based on the camera coordinate transformation formula: ; Among them, f x f y These are the camera's focal lengths along the x and y axes, respectively. w Y w Let be the three-dimensional coordinate components of the target point in the real world, h be the flight altitude of the UAV, cx and cy be the coordinates of the center point of the camera optical center on the x and y axes of the image pixel coordinate system, and u and v be the camera image coordinates.
[0017] Furthermore, in S6, the release action is achieved by rotating and releasing the released object through dual MG996 servos. The servo rotation angle is the PWM output, which is output by flight control channel 5 / 6 via the MAVLink protocol.
[0018] As can be seen from the above technical solution, compared with the prior art, the YOLOv8-based method for accurate target identification and deployment of multi-rotor UAVs provided by the present invention has the following beneficial effects: (1) Accurate dataset construction lays the foundation for deployment: Adopting a deployment area labeling strategy avoids the center point offset problem caused by traditional overall labeling, ensuring that the target detection and the actual deployment location are accurately matched; Incorporating easily confused targets for joint training, combined with multi-dimensional data augmentation, improves the model's adaptability to complex scenarios and reduces the false recognition rate; Constructing a dataset ensures the scientific nature and generalization ability of model training.
[0019] (2) Model performance optimization to meet real-time recognition requirements: A lightweight model is built based on the YOLOv8 algorithm. The yolov8s.pt pre-trained model is loaded for transfer learning. The AdamW optimizer and cosine learning rate scheduling are used to optimize the training strategy, which effectively alleviates overfitting and improves the robustness of the model. The model is converted to ONNX format for deployment. The inference speed is no less than 20fps, which meets the timeliness requirements of real-time recognition and deployment of UAVs. It still maintains a high accuracy rate in extreme environments such as strong light and darkness.
[0020] (3) Dynamic parameters of dual circular domains improve scene adaptability: The diameter of the circular domain is dynamically calculated based on the actual size of the target, the height of the UAV, and the field of view of the camera. The center point of the circular domain compensates for the physical deviation between the servo and the camera, solving the problem of poor adaptability of traditional static circular domains. The same servo maintains the same center point logic at different heights, ensuring the stability of the deployment position and greatly reducing the risk of deployment deviation.
[0021] (4) Closed-loop collaborative control to achieve fully automated operation: Construct a ROS1-MAVLink collaborative communication architecture to achieve closed-loop control of the entire process of "identification-calibration-deployment"; Control the dual servos for time-sharing deployment through flight control channels 5 / 6, and combine hierarchical decision logic to ensure that the target is stable in the deployment area before performing the descent and deployment actions, avoiding misoperation; After deployment, automatically switch servos and resume waypoint flight, and automatically return to home after the dual servos are deployed, without manual intervention, improving operational efficiency and reliability.
[0022] (5) Strong hardware adaptability and low engineering implementation cost: Deeply adapted to hardware such as ZD550 rack, Intel NUC onboard computer, Pixhawk4mini flight controller, Intel D435 depth camera, and dual MG996 servos, clarifying the communication logic and layout scheme between hardware; servo control matches PWM parameters, and model deployment optimizes memory usage, reducing the difficulty and cost of engineering implementation, and can be widely applied to various unmanned precision operation scenarios: In the field of emergency rescue, medical kits, food and other emergency supplies can be precisely delivered to areas with complex terrain; in the agricultural field, fertilizers and biological pesticides can be delivered to specific crop areas to achieve precise plant protection; in the industrial field, positioning markers can be delivered to equipment inspection points to assist in subsequent maintenance; in the field of people's livelihood, small emergency equipment such as lifebuoys can be delivered to designated areas.
[0023] This invention solves the key problems of traditional systems, such as "low recognition accuracy, large deployment offset, weak environmental adaptability, insufficient MAVLink collaboration, and limited hardware compatibility". It provides key technical support for the upgrade of multi-rotor UAVs from "general flight platform" to "precision operation platform". It is especially suitable for scenarios with clear requirements for deployment accuracy, real-time performance and automation, and has broad engineering application value and scenario adaptability. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a diagram illustrating the architecture of the YOLOv8-based multi-rotor UAV target precision identification and deployment system of this invention. Figure 2 This is a decision logic diagram of the YOLOv8-based multi-rotor UAV target precision identification and deployment system of the present invention; Figure 3 This is a schematic diagram of dataset annotation in an embodiment of the present invention, where (a) shows incorrect annotations and (b) shows correct annotations; Figure 4 This is a hardware layout diagram of the UAV according to an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the correlation between YOLOv8 precision and confidence in an embodiment of the present invention. Figure 6This is a schematic diagram of the training and validation loss curves of YOLOv8 in this embodiment of the invention. (a) is the training set bounding box regression loss curve, reflecting the changing trend of the difference between the model's predicted and actual bounding box values during training. As the number of training rounds increases, this loss value gradually decreases and tends to stabilize, indicating that the model's prediction accuracy for target locations is continuously improving. (b) is the training set classification loss curve, reflecting the change in the model's judgment error for target categories during training. The loss value continuously decreases as the number of training rounds increases, indicating that the model's ability to recognize target categories is gradually enhancing. (c) is the training set distribution focus loss curve, used to optimize the model's learning effect on difficult-to-classify samples. This curve decreases with each training round and fluctuates relatively little, indicating that the model's learning of difficult-to-classify samples is effective. The model performs well and the training process is stable. (d) is the bounding box regression loss curve on the validation set, which is used to verify the model's prediction accuracy of the target bounding box on unseen validation data. Its trend is basically consistent with the bounding box regression loss curve on the training set and the values are close, indicating that the model has not overfitted and has good generalization ability on new data. (e) is the classification loss curve on the validation set, which reflects the model's recognition error of the target category on the validation data. Its trend is similar to that of the classification loss curve on the training set, further proving that the model has good generalization performance. (f) is the focal loss curve on the validation set, which verifies the model's effect on handling difficult samples on the validation data. The curve decreases steadily and the numerical difference with the focal loss curve on the training set is small, indicating that the model has strong generalization ability in handling difficult samples. Figure 7 This is a screenshot of the code for calculating the diameter of a dynamic circular domain in an embodiment of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] The purpose of this invention is to provide a method for accurate target identification and delivery system for multi-rotor UAVs based on YOLOv8, aiming to solve the technical pain points of existing systems such as "delivery area labeling offset, misidentification of easily confused targets, static circular domain parameters, insufficient ROS collaboration, and poor hardware adaptation". This system uses an Intel NUC onboard computer, an Intel D435 depth camera, and dual MG996 servos as core hardware. Through a complete process of "accurate dataset construction - YOLOv8 model optimization training - dynamic dual circular domain adaptation - ROS1 real-time identification, calibration, and delivery closed-loop system - dual servo time-sharing execution", it achieves universal and accurate target delivery: based on the D435 camera coordinate transformation model, the dual circular domain parameters are dynamically calculated; in the Ubuntu 20.04 ROS1 environment, the YOLOv8 model identifies targets in real time and calculates offsets, generating UAV position adjustment commands. Once the target falls into the circular domain and the duration is greater than or equal to a preset threshold, a descent or delivery command is triggered, and the dual servos execute the delivery action in a time-sharing manner and automatically connect to subsequent tasks. This invention combines versatility and precision, significantly improving delivery accuracy. It is highly adaptable to hardware and has low engineering implementation costs, making it widely applicable to unmanned operation scenarios such as emergency relief material delivery, precision plant protection pesticide application, and industrial target marker delivery.
[0028] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0029] Example 1 like Figures 1 to 4 As shown, the present invention provides a YOLOv8-based multi-rotor UAV target precision identification and delivery system, comprising an airborne hardware unit and an airborne software unit deployed thereon; the airborne hardware unit includes at least: a multi-rotor UAV platform, a flight controller (Pixhawk4mini), an airborne computer (Intel NUC), a downward-looking depth camera (Intel D435i), and at least one delivery device driven by a servo motor (MG996); the airborne software unit runs under the ROS framework of the robot operating system installed on the airborne computer, and the airborne computer communicates with the flight controller based on the MAVLink protocol, and includes at least: a data acquisition and preprocessing module, a target detection model training module, a waypoint flight reconnaissance module, a real-time identification and positioning calibration module, a decision control module, and a delivery execution module.
[0030] The specific descriptions of each module are as follows: 1. Data Acquisition and Preprocessing Module This module provides a high-quality data foundation for object detection, and its core features include accurate annotation, easily confused joints, environment adaptation, data augmentation, and integrated training.
[0031] This module is used to label the collected image data of targets and easily confused objects. The labeling strategy is to label the target's delivery area, rather than the entire target, for delivery-type targets. When acquiring images, the distance from the target is maintained at a preset working distance (set according to the target recognition accuracy and camera imaging range). The preprocessing is data augmentation processing, including brightness adjustment, noise addition, rotation, cropping, HSV color space adjustment, and perspective transformation. Easily confused objects are those whose shape, outline, and surface color are similar to the delivery target.
[0032] When acquiring images of the target and easily confused targets, the data acquisition and preprocessing module maintains a preset working distance of approximately 2 meters, acquiring 1000 dataset images covering typical scenarios such as strong light, darkness, and slight shaking. The total dataset images are divided into training, validation, and test sets in an 8:1:1 ratio. Labeling is performed using the LabelImg tool, strictly adhering to the "deployment area labeling" strategy—labeling only the opening area of the barrel, with the bounding box completely covering the opening and leaving a 1-2 pixel margin at the edge to avoid interference from the barrel body. Easily confused landing pads are also categorized and labeled, stored in YOLO format, prohibiting bounding box offsets, category confusion, and duplicate labeling. After labeling, manual verification is performed to ensure an accuracy rate of ≥99%. Data preprocessing employs an integrated enhancement mode based on training instructions, eliminating the need for separate code writing. It integrates operations such as brightness adjustment (brightness=0.3), contrast adjustment (contrast=0.2), HSV color space perturbation (hsv_h=0.01, hsv_s=0.4, hsv_v=0.6), Gaussian noise addition (gaussian_noise=0.01), and geometric transformations (rotation degrees=10, horizontal flip fliplr=0.5, vertical flip flipud=0.2, perspective transformation perspective=0.001, crop_fraction=0.9) via user-provided YOLOv8 training terminal instructions. The enhancement process runs concurrently with training, resulting in a simple and efficient workflow.
[0033] 2. Object Detection Model Training Module This module builds a lightweight, robust model based on YOLOv8 and adapted to Intel NUC, with the core implementation of "terminal command integration enhancement + transfer learning + lightweight deployment". It loads a pre-trained weight model (YOLOv8s.pt) with lightweight and efficient feature extraction, avoiding overfitting on small datasets, for weight initialization, and strengthens the learning of class differences between buckets and drone landing pads. Input size imgsz=1280, optimizer=AdamW, initial learning rate lr0=0.0002, weight decay=0.0005, learning rate scheduling cos_lr=True, warmup epochs=3, weight save period=10; training employs a transfer learning strategy; L2 regularization and a Dropout layer are introduced during training, with a dropout probability of 0.2 in the backbone layer; the validation set loss is monitored, and an early stopping mechanism is triggered when the loss does not decrease for 10 consecutive epochs; after training, the best.pt weight file is exported. Furthermore, the following performance indicators must be met for the weight file to be deployed to the drone recognition node and used: the weight file must achieve an accuracy of ≥95% on the validation set, ≥82% accuracy in strong light environments, and ≥80% accuracy in dark environments; the weight file meeting these conditions must be converted to ONNX format, and the inference speed after deployment must be greater than or equal to 15 FPS to ensure the timeliness of real-time recognition and deployment decisions; the training loss curve is as follows. Figure 6 As shown, convergence occurred after epoch 80, with no overfitting.
[0034] 3. Waypoint Flight Reconnaissance Module This module issues position control commands via ROS to control the UAV to fly within the reconnaissance area according to preset waypoints, while simultaneously activating the downward-facing camera to capture real-time images. The preset waypoint altitude is set to the first altitude (the flight altitude of the UAV when performing initial positioning, set according to the reconnaissance range and recognition accuracy), and the waypoint data is stored in the ROS parameter server. The target detection model training module loads the yolov8s.pt pre-trained model for transfer learning. When the exported weight file achieves an accuracy of no less than 95% on the validation set and no less than 80% on the test set under extreme environments such as strong light and darkness, the weight file is converted to ONNX format and deployed to the UAV's onboard computer for use by the flight recognition nodes. The model inference speed on the onboard computer must be no less than 20fps.
[0035] Specifically, this module, based on ROS1 and the MAVLink protocol, enables autonomous waypoint flight of the UAV and synchronous startup of the D435 camera, and is compatible with the ZD550 frame and Pixhawk4mini flight controller. It configures "rectangular coverage" waypoints via the ROS parameter server, setting four corner waypoints and some intermediate waypoints according to the size of the reconnaissance area, with the waypoint altitude set to the first altitude. A `waypoint_flight_node` ROS node is created, and during initialization, it establishes communication with the Pixhawk4mini flight controller via the MAVLink protocol. After confirming that the flight controller is in OFFBOARD mode, it publishes the `PoseStamped` waypoint command to the ` / mavros / setpoint_position / local` topic at a frequency of 10Hz. The node obtains the UAV's current position by subscribing to the ` / mavros / local_position / pose` topic. When the distance to the target waypoint is ≤0.5m, it is considered that the waypoint has been reached, and it switches to the next waypoint. After all waypoints have been cycled, it triggers the return-to-home preparation state. When waypoint flight is initiated, the node starts the Intel D435 camera via the rosservice call / d435 / start_camera service. The camera publishes the / d435 / image_raw and / d435 / depth topics at a frequency of 30fps. The camera installation position is adapted to the center of gravity distribution of the ZD550 rack to avoid affecting flight stability, while ensuring that all reconnaissance areas can be covered during waypoint reconnaissance.
[0036] This module, based on ROS1 and PX4 firmware, enables the drone to perform autonomous waypoint flight and synchronize the startup of the D435 camera. Configure "rectangular coverage" waypoints via the ROS parameter server, setting waypoints according to the size of the reconnaissance area and setting the waypoint altitude to the first altitude; create a waypoint_flight_node ROS node, which loads waypoints from the parameter server during initialization and publishes waypoint commands to the Pixhawk4mini flight controller at a frequency of 10Hz via the / mavros / setpoint_position / local topic. The commands include waypoint coordinates and horizontal attitude, adapting to the MAVLink protocol of the PX4 firmware; the node subscribes to the / drone / waypoint_reached topic, and switches to the next waypoint when it receives an arrival signal. After all waypoints are completed, it triggers return-to-home preparation; when waypoint flight starts, the D435 camera is started via the ROS service / d435 / start_camera. The camera publishes the / d435 / image_raw (RGB image) and / d435 / depth topics to provide data sources for subsequent real-time identification; when the real-time identification module detects a target, the node subscribes to the / drone / flight_stop command to pause waypoint flight and switch to target tracking mode, achieving seamless integration of waypoint reconnaissance and target tracking.
[0037] 4. Real-time identification and positioning calibration module This module performs target detection on the acquired real-time images to obtain the target's position information in the images, and adjusts the UAV's attitude and position through a position calibration algorithm. The position calibration algorithm includes: target localization in the image coordinate system, dual-threshold circular domain judgment, and position adjustment based on offset. The target localization in the image coordinate system is: detecting the target using the YOLOv8 model and obtaining the coordinates of the center point of the target detection box. The dual-threshold circular domain judgment is: setting a first circular domain and a second circular domain in the image, corresponding to the UAV's flight control and deployment preparation conditions at the first and second altitudes (the flight altitude of the UAV when performing the deployment action, set according to the deployment accuracy and the device's working range), and the radii and center coordinates of the first and second circular domains are calculated based on the UAV's current altitude, the camera's field of view, and the actual hardware deviation distance. The position adjustment based on offset is: generating a UAV position adjustment command based on the offset between the target center point and the center of the circular domain, so that the target center point gradually approaches the center of the circular domain. The adjustment amount is proportional to the offset amount, and the proportionality coefficient is set according to the UAV's maximum flight speed, payload weight, and other dynamic characteristics.
[0038] In the real-time identification and positioning calibration module, the UAV's onboard computer is equipped with the ROS Noetic system, which runs a YOLOv8 ROS node to subscribe to camera image topics and synchronously starts waypoint control nodes to adjust the position. Image conversion is performed using the CvBridge tool, and the target detection box confidence threshold is set to 0.6. The threshold can be set to different values according to different actual situations.
[0039] This module is the core innovation module, which realizes a closed loop of "target recognition - circular domain calculation - position calibration" based on the D435 camera coordinate transformation model, and is adapted to the computing power characteristics of Intel NUC. Specifically, it includes three parts: coordinate transformation model derivation, dual circular domain parameter calculation, and ROS1 real-time recognition and calibration code implementation. 4.1 Derivation of Coordinate Transformation Model Suppose the intrinsic parameter matrix of the D435 camera obtained by Zhang Zhengyou's calibration method is: , where f x =910.0、f y = 910.0 is the focal length along the x / y axis, c x = 640.0, c y = 360.0 is the coordinate of the center point of the image's x / y axis (resolution 1280×720), with a horizontal field of view (FOV) of 69°; the camera is mounted on the lower part of the tail, facing the ground. Let the three-dimensional coordinates of the target point in the real world be (X... w ,Y w Z w(with the camera's optical center as the origin, X) w Right, Y w Downward, Z w Forward, Z w = h is the UAV's flight altitude), and the camera image coordinates are (u,v). Therefore, the transformation relationship from real-world coordinates to camera image coordinates is: After unfolding, the pixel coordinates can be calculated: This formula provides a theoretical basis for the dynamic calculation of the diameter and center point parameters of the double circular domain, and solves the mapping problem between actual space and image pixels.
[0040] 4.2 Calculation of parameters in the double circular domain 4.2.1 Calculation of the diameter of the circular region: Assuming the actual diameter of the target to be deployed is d = 15cm, and the drone's flight altitude is h1 = 2m, h2 = 1m, to allow for drone flight jitter, the diameter of the circular area needs to cover 1.2 times the target deployment area. Combining the D435 horizontal field of view (FOV) of 69° and the image width of 1280 pixels, the formula for calculating the diameter of the circular area is derived based on the principle of similar triangles: (3) In the formula, the unit of d is meters (m), and the unit of h is meters (m). Substituting d=0.15m and h=2m, we get D ≈ 128 pixels; substituting h=1m, we get D ≈ 256 pixels, which matches the actual requirement.
[0041] 4.2.2 Calculation of the center point of the circular region There is an actual physical deviation between the dual MG996 servos and the D435 camera (the deviation between servo 1 and the camera). Deviation between servo motor 2 and camera (obtained by hardware measurement), based on the inverse operation of formulas (1) and (2), the actual deviation is converted into image compensation amount, and combined with the camera center point (640, 360), the calculation formula for the center point of the circular domain is derived: (4) (5) Substituting the servo motor deviation (0.1m, 0.05m) and h = 2m, we get... , The center point is (686, 372). Substituting the servo motor deviation (-0.1m, 0.05m), we get the center point (594, 372), which matches the actual hardware deviation. The center point of the same servo motor remains consistent at different heights, ensuring stable deployment position.
[0042] 4.3 ROS1 Real-time Identification and Calibration Codes During initialization, a YOLOv8 model in ONNX format is loaded, and the circular domain calculation function (derived from the actual target diameter, UAV altitude, camera field of view, and hardware deviation) is called to initialize the dual circular domain parameters at the first altitude. After subscribing to D435 camera images, the cylindrical target is identified in real time using YOLOv8, and its center point coordinates are calculated. The offset is obtained by comparing the center point of the circular domain. If the target is not in the domain, the pixel offset is converted into the actual position offset of the UAV based on the inverse operation of formulas (1) and (2), and a speed adjustment command is generated. If the target is in the domain, the duration is recorded. The circular domain parameters are updated in real time by subscribing to altitude topics, and the center point is updated by subscribing to servo switching commands, realizing a closed loop of 'identification-calibration-servo adaptation'. The core logic includes image callback, calibration calculation, and status release. The visualization part displays the target box, circular domain, and center point in real time on an external monitor connected to the Intel NUC.
[0043] 5. Decision Control Module This module determines whether the deployment conditions are met based on the target's position in the image and the drone's real-time altitude information, and generates control commands accordingly; the decision logic is as follows: Figure 2 As shown, the judgment logic is as follows: when the UAV is at the first altitude and the target center point falls into the first circular area and maintains this position for a time greater than or equal to a preset time (referring to the minimum duration for determining target positioning stability, set according to the UAV's flight stability requirements), a descent command is generated; when the UAV descends to the second altitude and the target center point falls into the second circular area and maintains this position for a time greater than or equal to the preset time, a deployment command is generated; after deployment, if there is an undeployed servo, the corresponding servo is switched and waypoint flight is resumed; after both servos are deployed, a return-to-home command is generated.
[0044] 6. Deployment Execution Module This module receives control commands and drives the delivery device to complete the target delivery action; the delivery action is achieved by controlling the rotation of the servo motor, and the servo motor control signal is issued by the ROS node. After the delivery is completed, the UAV returns to the preset waypoint.
[0045] Specifically, this module receives the release command from the decision control module, controls the flight control channel to output PWM signals via the MAVLink protocol, precisely controls the servo motors, and drives the release device to complete the target release action. Moreover, this module consists of two MG996 servo release devices, which use time-sharing release, meaning that the two servo motors release different targets.
[0046] The above modules achieve hardware collaboration and data interaction through ROS1: Dataset construction: Completed multi-dimensional data augmentation including image acquisition of a 15cm diameter cylinder and a circular landing pad, precise labeling of the deployment area, and integration of training instructions; Divided the training set, validation set, and test set in an 8:1:1 ratio. Model training: Based on the YOLOv8s.pt pre-trained model, 100 epochs were trained using user-provided terminal commands. Weight files with a validation set accuracy of ≥95% under normal conditions and ≥80% under adverse conditions were selected, exported as ONNX weights, and deployed to IntelNUC. Waypoint reconnaissance: The UAV loads a rectangular waypoint at a height of 2m and flies autonomously, activating the D435 depth camera at the lower tail to release images and depth data; Real-time identification and calibration: The YOLOv8 model identifies the target in real time, calculates the offset between the target's center point and the first circular area, generates speed commands to adjust the UAV's position, and the target falls into the circular area and remains there for 1.5 seconds. The system employs a tiered decision-making and deployment mechanism. After the target stabilizes in the domain at the first altitude, a descent command is issued to 1m. After the target stabilizes in the domain at the second altitude, servo 1 on flight control channel 5 is deployed via the MAVLink protocol. After deployment, the system switches to servo 2 on channel 6 and resumes waypoint flight to continue searching for the target. This process is repeated until both servos are deployed, triggering a return-to-home mechanism. The entire process requires no manual intervention, achieving full automation of "reconnaissance-identification-calibration-deployment-coupling".
[0047] In specific implementation, the YOLOv8-based multi-rotor UAV target precision identification and deployment system of this invention is achieved through the following scheme: (1) Hardware selection and deployment The multi-rotor drone uses a ZD550 frame and a Holybro Pixhawk4mini flight controller, providing stable waypoint and speed control. The visual sensor is an Intel D435 depth camera, mounted on the lower tail of the ZD550 frame, facing the ground. It connects to an Intel NUC via a USB 3.0 interface, with a resolution of 1280×720 and a frame rate of 30fps. Internal parameters are obtained after calibration. The release mechanism consists of dual MG996 servos, connected to channels 5 and 6 of the Pixhawk 4mini flight controller respectively. It receives PWM commands via the MAVLink protocol. The servos are fixed to both sides of the frame, with the release compartment opening facing downwards. The computing module is an onboard computer with an Intel NUC11WSKV5 processor (Intel Core i5-1135G7, 8GB DDR4, 512GB SSD), running Ubuntu 20.04 ROS1 Noetic and enabling OpenVINO to accelerate YOLOv8 inference. The communication module is a 2.4G wireless data transmitter, mounted on the top of the nose, transmitting ROS topics and MAVLink commands. The ROS topic transmission latency is <10ms. The power supply is a 6S 5500mAh lithium battery, installed on the bottom of the fuselage, providing a single flight time of ≥20 minutes. The hardware layout is as follows. Figure 4 As shown.
[0048] (2) Dataset construction and preprocessing 1000 images were collected, including 800 images of a cylindrical barrel with a diameter of 15cm and a height of 30cm, and 200 images of a circular landing pad. The shooting distance was about 2m. The LabelImg tool was used for labeling. Only the opening area of the barrel was labeled and the category was set to "pail" (1). The landing pad was labeled as "CUADC" (0). YOLO format label files were generated. Data augmentation was achieved through the integration of YOLOv8 training terminal instructions. The instructions included operations such as brightness adjustment, Gaussian noise, and perspective transformation. After augmentation, the number of training set images was doubled.
[0049] (3) Object detection model training and deployment: The YOLOv8s.pt pre-trained model was loaded based on the Ultralytics framework. During the training process, the TensorBoard loss curve was monitored in real time (as shown in Figure 6). According to the sub-figures (a)-(f) in Figure 6, after epoch 80, the training classification loss stabilized at 0.42 and the validation classification loss was 0.51, with no overfitting. After training, the best.pt weight file was exported. The accuracy was 95.2% on the validation set, 82.3% in strong light environment, and 80.5% in dark environment. The export function of Ultralytics was used, yolo export model=best.pt format=onnx imgsz=1280, to convert the weights to ONNX format and deploy them to Intel NUC. The OpenVINO Runtime was used to accelerate the inference speed, which was ≥20fps.
[0050] (4) The waypoint flight reconnaissance module creates a waypoint_flight_node on the Intel NUC and configures four corner waypoints and some intermediate waypoints in a 10m×10m reconnaissance area through the ROS parameter server to ensure that the camera view can scan the entire reconnaissance area. The parameter configuration file is loaded by the command rosparam load waypoint_params.yaml / drone. During node initialization, communication is established with the flight controller via the MAVLink protocol, the flight controller is set to OFFBOARD mode and unlocked, and waypoint commands are published to the / mavros / setpoint_position / local topic at a frequency of 10Hz. The current position of the UAV is obtained by subscribing to the / mavros / local_position / pose topic. When the distance to the target waypoint is ≤0.5m, it is determined to have arrived and the waypoint is switched. When waypoint flight starts, the node starts the D435 camera and publishes the / d435 / image_raw and / d435 / depth topics. The D435 camera is installed under the tail, and the Intel NUC communicates stably with the D435 depth camera via USB 3.0.
[0051] (5) Real-time identification and positioning calibration module implementation The node calls the dynamic circular domain diameter calculation logic (such as...). Figure 7 The dynamic circular domain diameter calculation code and the circular domain center point calculation logic are based on the following formula: Initialize the circular region parameters at the first height (2m): a target with a diameter of 15cm corresponds to a circular region diameter of 128 pixels, and the center point coordinates of servo 1 are (686, 372). After the node subscribes to the / d435 / image_raw topic, it converts the image format and inputs it into the YOLOv8 model for inference, extracts the target center point, calculates the offset from the circular region center point, converts it into the actual position offset, and then generates the velocity command. When the height drops to 1m, the circular region diameter is updated to 256 pixels, while the center point remains unchanged. The core logic includes image callback, calibration calculation, and status release. The visualization part displays the target bounding box, circular region, and center point in real time on an external monitor connected to the Intel NUC.
[0052] (6) After the decision control module starts the decision_control_node, it first subscribes to the / drone / circle_status data published by the YOLOv8 real-time identification and calibration module through the ROS topic. This data includes the target's status in the domain (1 = in the domain, 0 = not in the domain) and duration, forming a closed data flow loop of "identification and calibration - decision". This is consistent with... Figure 1The arrows pointing from "Real-time Identification and Positioning Calibration Module → Decision Control Module" are completely consistent. When the UAV is at its first altitude (2m) and the target remains in the domain for ≥1.5s, the node issues a descent command via the ` / mavros / setpoint_position / local` topic, precisely setting the Z-axis altitude to 1m, and simultaneously issues the ` / drone / flight_stop` command to pause waypoint flight—this logic echoes the hierarchical decision-making process and also... Figure 1 The control flow of the "Decision Control Module → Waypoint Flight Reconnaissance Module" ensures that the UAV focuses on target tracking and avoids waypoint flight interference with deployment preparation. When the UAV descends to the second altitude (1m) and the target's duration in the domain meets the threshold, the node determines whether a servo has been deployed based on self.servo_state: servo 1 (flight control channel 5) is triggered first, and after deployment, the / drone / servo_switch command is used to switch to servo 2 (flight control channel 6), and waypoint flight resumes to find the next target. After both servos are deployed, the / drone / return_home command is issued to trigger the return home. The core branch logic of the hierarchical decision-making includes key links such as altitude descent command issuance, servo trigger judgment, and channel switching, which directly correspond to the technical characteristics of "the decision control module generating altitude descent / deployment / return home commands". MAVLink protocol adaptation is indirectly achieved through topic communication with the flight control, ensuring the stability and compatibility of command transmission.
[0053] (7) After the servo_execute_node node is started, the delivery execution module first sets the Pixhawk4mini flight controller to OFFBOARD mode and unlocks it through the set_mode_srv and arm_srv services. This is a prerequisite for controlling the servos through the flight control channel. The servo control signals are published by the ROS node, which is different from the traditional direct GPIO control and has stronger compatibility. When the node subscribes to the / drone / servo_trigger command (1 = servo 1, 2 = servo 2), it executes the standardized process of "reset → delivery → hold → reset": first, it sends a PWM signal to the flight control channel 5 / 6 to turn off the servos through the set_servo_pwm function to ensure the initial state is correct; then, it sends a PWM signal to turn on the servos and holds it for 1 second to ensure that the supplies are completely released; finally, it restores the servos to complete the reset. The core communication protocol for deployment execution is the MAVLink command with command=204, where param1 specifies the channel number and param2 specifies the PWM value, ensuring that the command is accurately transmitted to the flight controller; at the same time, by subscribing to the / mavros / rc / out topic, the channel PWM output value is fed back in real time, forming a closed-loop verification to ensure the accuracy of the deployment action. Example 2 This invention also provides a method for accurate target identification and deployment for multi-rotor drones based on YOLOv8, applied to the aforementioned YOLOv8-based multi-rotor drone target identification and deployment system, comprising the following steps: S1. Dataset Construction: Image data of the target and easily confused objects for model training are collected, and the projection area is labeled and the images are preprocessed to obtain a preprocessed dataset. During image acquisition, the distance to the target is maintained at a preset working distance. The LabelImg tool is used to label the projection area, generating YOLO format label files. Before model training, training samples are processed using data augmentation integrated from training terminal commands. This data augmentation includes brightness adjustment (brightness=0.3), noise addition (gaussian_noise=0.01), rotation (degrees=10), cropping (crop_fraction=0.9), HSV color space adjustment (hsv_h=0.01, hsv_s=0.4, hsv_v=0.6), and perspective transformation (perspective=0.001). The augmented data is then divided into training, validation, and test sets in an 8:1:1 ratio.
[0054] S2. Model Training: A YOLOv8 model is built based on the Ultralytics framework. The YOLOv8 model is trained using a pre-processed dataset. During training, multi-scale input and terminal instruction integration data augmentation is performed. A model weight file is generated to adapt for deployment on an onboard computer, resulting in a trained object detection model. Specifically, a YOLOv8 model is built based on the Ultralytics framework using the dataset labeled in step S1. Before model training, image preprocessing and augmentation operations are performed on the data. During image training, the YOLOv8s.pt initialization model, which features lightweight, efficient feature extraction, and fast training and inference, is used for pre-training. The model weights are initialized. The training parameters are batch=16, epochs=100, imgsz=1280, the optimizer is AdamW, the learning rate is 0.0002, and cosine learning rate scheduling is used. The weight file is exported. When the weight file achieves an accuracy of at least 95% on the validation set and at least 80% on the test set under extreme environments such as strong light and darkness, the weight file is converted to ONNX. After formatting, deploy it to the drone's onboard computer.
[0055] S3. Waypoint Reconnaissance: The ROS issues position control commands to control the UAV to fly in the reconnaissance area according to the preset waypoints. Simultaneously, the UAV's downward-facing camera is activated to collect environmental images and depth data in real time. The camera publishes RGB image and depth data topics. The commands are adapted to the PX4 firmware of the Holybro Pixhawk4mini flight controller. The preset waypoint altitude is set to the first altitude, and the waypoint data is stored in the ROS parameter server.
[0056] S4. Real-time Identification and Calibration: For the acquired real-time images, a target detection model is used to detect targets and obtain their position information in the images. A position calibration algorithm is then used to adjust the UAV's attitude and position. S4. Real-time Identification and Calibration specifically includes: Target localization in image coordinate system: The onboard computer runs YOLOv8 ROS nodes, detects targets in real-time images through a trained target detection model, filters targets with confidence scores < 0.6, and obtains the coordinates of the center point of the target detection box with the highest confidence score; Dual-threshold circular domain judgment: Set a first circular domain and a second circular domain in the image, which correspond to the flight control and deployment preparation conditions of the drone at the first altitude and the second altitude, respectively. The diameter and center coordinates of the first and second circular domains are calculated based on the drone's current altitude, the camera's field of view, and the actual hardware deviation distance. Position adjustment based on offset: The position adjustment command of the UAV is generated according to the offset between the target center point and the center of the circular area, so that the target center point gradually approaches the center of the circular area. The adjustment amount is proportional to the offset amount, and the proportional coefficient is set according to the dynamic characteristics of the UAV such as maximum flight speed and payload weight.
[0057] In the dual-threshold circular domain determination: The diameters of the first and second circular regions are calculated based on the actual diameter of the target, the drone's altitude, and the camera's field of view. The formula for calculating the diameter of the circular region is: Where d is the actual diameter of the target, h is the height of the UAV, and FOV is the horizontal field of view of the camera; The center coordinates of the first and second circular regions are calculated based on the offset between the center point of the deployment port of the actual servo motor deployment system and the center point of the camera. The center coordinates are: ,in, h、 Here, x and y are the image width and height, respectively, and x and y are the offset values after scaling the camera view and the actual image. The scaling is based on the camera coordinate transformation formula: ; Among them, f x fy These are the camera's focal lengths along the x and y axes, respectively. w Y w Here, h represents the three-dimensional coordinate components of the target point in the real world, and c represents the drone's flight altitude. x c y Let u and v be the coordinates of the camera's optical center on the x and y axes of the image pixel coordinate system, and u and v be the camera image coordinates.
[0058] In step S4, the onboard computer of the drone installs the ROS Noetic system and runs YOLOv8 ROS. The node subscribes to camera image topics and simultaneously starts waypoint control nodes to adjust its position.
[0059] S5. Layered Decision: Based on the target's position in the image and the UAV's real-time altitude information, determine whether the deployment conditions are met and generate control commands. Specifically, if the target's center point remains in the first circular region for a duration greater than or equal to a preset time, control the UAV to descend to a second altitude. At the second altitude, calculate the diameter and center point of the second circular region based on the camera coordinate transformation formula. If the target's center point enters the second circular region and the duration is greater than or equal to the preset time, issue MAVLink protocol commands via the ROS node to control the Holybro Pixhawk4mini flight controller's channel 5 / 6 to output PWM signals, triggering the deployment action. After deployment, if there are any undeployed servos, switch to the corresponding servo's circular region parameters and return to step S3 to find a new target. If both servos have been deployed, the UAV returns to a preset waypoint for subsequent tasks or returns to the return point.
[0060] S6. Drop Execution: If the control command is a drop command, drive the drop device to complete the target drop action; the drop action is achieved by controlling the rotation of the servo motors. The servo motor control signal is issued by the ROS node. After the drop is completed, the UAV returns to the preset waypoint. The drop action is achieved by rotating the dual MG996 servo motors to release the dropped object. The servo motor rotation angle is the PWM output, which is output by flight control channel 5 / 6 through the MAVLink protocol to achieve precise control.
[0061] In summary, this invention provides a YOLOv8-based system and method for accurate target identification and deployment of multi-rotor UAVs. The dataset annotation focuses on the core deployment area, solving the problem of frame center point offset. Joint training of easily confused targets, combined with multi-dimensional data enhancement integrated from terminal commands, reduces the false recognition rate and improves model generalization ability. Dual circular domain parameters are dynamically adjusted with altitude and target size to compensate for physical deviations between the servo motors and the camera, adapting to different flight scenarios. A closed-loop "identification-calibration-deployment" mechanism is constructed in ROS1-MAVLink, using flight control channels 5 / 6 to control the dual servo motors for time-sharing deployment, improving compatibility and stability. Deep adaptation is achieved to the ZD550 frame, Intel NUC, D435 depth camera, Pixhawk4mini flight controller, and dual MG996 servo motors, optimizing hardware layout and communication logic. The system adapts to multiple target types, achieving universal and accurate deployment, avoiding reliance on a single target scenario.
[0062] Matters not covered in this invention are common knowledge.
[0063] Those skilled in the art will understand that, in addition to implementing the system and its modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its modules provided by this invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; alternatively, the modules for implementing various functions can be considered as both software programs implementing the method and structures within the hardware component.
[0064] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A multi-rotor UAV target precision identification and delivery system based on YOLOv8, characterized in that, It includes airborne hardware units and airborne software units deployed on them; The airborne hardware unit includes at least: a multi-rotor UAV platform, a flight controller, an onboard computer, a downward-looking depth camera, and at least one delivery device driven by a servo motor; the airborne software unit runs on the Robot Operating System (ROS) framework installed on the onboard computer, and the onboard computer communicates with the flight controller based on the MAVLink protocol. The airborne software unit includes at least: Data acquisition and preprocessing module: used to perform projection area annotation and image preprocessing on the acquired image data of targets and easily confused objects to obtain a preprocessed dataset; The object detection model training module is used to build a YOLOv8 model based on the Ultralytics framework. It trains the YOLOv8 model using a preprocessed dataset, performs data augmentation by integrating multi-scale inputs and terminal commands during training, generates model weight files to adapt for deployment on an airborne computer, and obtains a trained object detection model. Waypoint Flight Reconnaissance Module: Used to issue position control commands via ROS to control the UAV to fly in the reconnaissance area according to preset waypoints, and simultaneously activate the downward-looking camera to collect real-time images; the preset waypoint altitude is set to the first altitude, and the waypoint data is stored in the ROS parameter server; Real-time recognition and positioning calibration module: Used to detect targets in real-time images using a target detection model to obtain the position information of the targets in the images, and adjust the attitude and position of the UAV through a position calibration algorithm; Decision control module: Used to determine whether the deployment conditions are met based on the target's position in the image and the drone's real-time altitude information, and to generate control commands; Drop Execution Module: If the control command is a drop command, drive the drop device to complete the target drop action; the drop action is achieved by controlling the rotation of the servo motor, and the servo motor control signal is issued by the ROS node. After the drop is completed, the UAV returns to the preset waypoint.
2. The YOLOv8-based multi-rotor UAV target precision identification and delivery system according to claim 1, characterized in that, The easily confused objects are those whose shape, outline, and surface color are similar to the target object. The conditions for image acquisition include: maintaining a preset working distance from the target; The target area is labeled as follows: For each target category, use the LabelImg tool to mark the label box in the target target area; The image preprocessing is data enhancement processing, including brightness adjustment, noise addition, rotation, cropping, HSV color space adjustment, and perspective transformation; Before model training, the preprocessed dataset is divided into training set, validation set and test set according to a set ratio.
3. The YOLOv8-based multi-rotor UAV target precision identification and delivery system according to claim 1, characterized in that, The position calibration algorithm includes: target localization in the image coordinate system, dual-threshold circular domain judgment, and position adjustment based on offset. The target localization in the image coordinate system is as follows: based on the target detection results of the target detection model, the coordinates of the center point of the target detection box are obtained. The dual-threshold circular domain determination is as follows: a first circular domain and a second circular domain are set in the image, which correspond to the flight control and deployment preparation conditions of the UAV at the first altitude and the second altitude, respectively. The radius and center coordinates of the first circular domain and the second circular domain are calculated based on the current altitude of the UAV, the field of view of the camera, and the actual hardware deviation distance. The offset-based position adjustment is as follows: a UAV position adjustment command is generated based on the offset between the target center point and the center of the circular area, so that the target center point gradually approaches the center of the circular area. The adjustment amount is proportional to the offset amount, and the proportional coefficient is set according to the dynamic characteristics of the UAV, including the maximum flight speed and the payload weight.
4. The YOLOv8-based multi-rotor UAV target precision identification and delivery system according to claim 3, characterized in that, The logic for determining the generation of control commands is as follows: When the UAV is at the first altitude and the target center point falls into the first circular area and remains there for a time greater than or equal to a preset time, a descent command is generated; when the UAV descends to the second altitude and the target center point falls into the second circular area and remains there for a time greater than or equal to the preset time, a deployment command is generated; after deployment, if there is an undeployed servo, switch to the corresponding servo and resume waypoint flight; after both servos are deployed, a return-to-home command is generated.
5. The YOLOv8-based multi-rotor UAV target precision identification and delivery system according to claim 1, characterized in that, The onboard computer is equipped with the ROS Noetic system, runs YOLOv8 ROS nodes to subscribe to camera image topics, and synchronously starts waypoint control nodes to adjust positions. Image conversion is performed using the CvBridge tool.
6. A method for accurate target identification and deployment of multi-rotor drones based on YOLOv8, applied to the YOLOv8-based multi-rotor drone target identification and deployment system as described in any one of claims 1-5, characterized in that, Includes the following steps: S1. Dataset Construction: Collect image data of the target and easily confused objects for model training, perform projection area annotation and image preprocessing to obtain a preprocessed dataset; S2. Model Training: A YOLOv8 model is built based on the Ultralytics framework. The YOLOv8 model is trained using a preprocessed dataset. During the training process, data augmentation is performed by integrating multi-scale inputs and terminal commands. A model weight file is generated to adapt it for deployment on an airborne computer, resulting in a trained object detection model. S3. Waypoint reconnaissance: The UAV is controlled to fly in the reconnaissance area according to the preset waypoints by issuing position control commands through ROS, and the downward-looking camera is simultaneously activated to collect real-time images; the preset waypoint altitude is set to the first altitude, and the waypoint data is stored in the ROS parameter server. S4. Real-time recognition and calibration: For the acquired real-time images, a target detection model is used to detect targets to obtain the position information of the targets in the images, and the attitude and position of the UAV are adjusted through a position calibration algorithm; S5. Layered decision-making: Based on the target's position in the image and the UAV's real-time altitude information, determine whether the deployment conditions are met and generate control commands; S6. Drop Execution: If the control command is a drop command, drive the drop device to complete the target drop action; the drop action is achieved by controlling the rotation of the servo motor. The servo motor control signal is issued by the ROS node. After the drop is completed, the UAV returns to the preset waypoint.
7. The method for accurate target identification and deployment of multi-rotor UAVs based on YOLOv8 according to claim 6, wherein in step S2, model training specifically includes: Before model training, image preprocessing and enhancement operations are performed on the dataset. During image training, the initialization model of YOLOv8s.pt is used as the pre-trained model, and the model weights are initialized. The training parameters were set to batch=16, epochs=100, imgsz=1280, the optimizer was AdamW, the learning rate was 0.0002, and the cosine learning rate was used for scheduling. Export the weight file. When the weight file achieves an accuracy of at least 95% on the validation set and at least 80% on the test set under extreme conditions, convert the weight file to ONNX format and deploy it to the onboard computer.
8. The method for accurate target identification and deployment of multi-rotor UAVs based on YOLOv8 according to claim 6, wherein in step S4, real-time identification and calibration specifically includes: Target localization in image coordinate system: The onboard computer runs YOLOv8 ROS nodes, detects targets in real-time images through a trained target detection model, filters targets with confidence scores < 0.6, and obtains the coordinates of the center point of the target detection box with the highest confidence score; Dual-threshold circular domain judgment: Set a first circular domain and a second circular domain in the image, which correspond to the flight control and deployment preparation conditions of the drone at the first altitude and the second altitude, respectively. The diameter and center coordinates of the first and second circular domains are calculated based on the drone's current altitude, the camera's field of view, and the actual hardware deviation distance. Position adjustment based on offset: The position adjustment command of the UAV is generated according to the offset between the target center point and the center of the circular area, so that the target center point gradually approaches the center of the circular area. The adjustment amount is proportional to the offset amount, and the proportional coefficient is set according to the dynamic characteristics of the UAV, including the maximum flight speed and the payload weight.
9. The method for accurate target identification and deployment of multi-rotor UAVs based on YOLOv8 according to claim 8, wherein in the dual-threshold circular domain judgment: The diameters of the first and second circular regions are calculated based on the actual diameter of the target, the drone's altitude, and the camera's field of view. The formula for calculating the diameter of the circular region is: in, d is the actual diameter of the target, h is the height of the drone, and FOV is the horizontal field of view of the camera; The center coordinates of the first and second circular regions are calculated based on the offset between the center point of the deployment port of the actual servo motor deployment system and the center point of the camera. The center coordinates are: in, h、 Here, x and y are the image width and height, respectively, and x and y are the offset values after scaling the camera view and the actual image. The scaling is based on the camera coordinate transformation formula: ; Among them, f x f y These are the camera's focal lengths along the x and y axes, respectively. w Y w Here, h represents the three-dimensional coordinate components of the target point in the real world, and c represents the drone's flight altitude. x c y Let u and v be the coordinates of the camera's optical center on the x and y axes of the image pixel coordinate system, and u and v be the camera image coordinates.
10. The method for precise target identification and delivery of a multi-rotor UAV based on YOLOv8 according to claim 6, in step S6, the delivery action is achieved by rotating and releasing the delivered object through dual MG996 servo motors, and the servo motor rotation angle is the PWM output, which is output by flight control channel 5 / 6 through the MAVLink protocol.