Unmanned aerial vehicle real-time vegetation classification system and method based on lightweight AI model
Through lightweight AI model and edge computing technology, the problems of constrained computing resources and static flight paths in drone vegetation monitoring are solved, efficient and real-time vegetation classification and adaptive flight path adjustment are achieved, and the accuracy of vegetation analysis and data acquisition efficiency are improved.
Patent Information
- Application Number
- CN202510658445.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-08-22
AI Technical Summary
The existing UAV vegetation monitoring technology has shortcomings in terms of limited computing resources, large deep learning model size, low data processing efficiency, static flight path planning and inefficient energy management, making it difficult to achieve efficient and real-time vegetation classification and adaptive flight path adjustment.
Lightweight AI model is used combined with edge computing, and the calculation complexity is reduced through model quantization and pruning technology, feature extraction and flight paths are optimized, and adaptive flight adjustment and battery optimization management are combined to achieve efficient and real-time vegetation analysis and data acquisition.
Achieve efficient vegetation analysis under limited computing resources, improve classification accuracy and data collection efficiency, optimize resource utilization, reduce unnecessary flight time and energy consumption, and is suitable for agricultural monitoring, forestry management and ecological protection.
Smart Images

Figure CN120526334A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of vegetation monitoring and analysis technology, specifically to a real-time vegetation classification system and method for drones based on a lightweight AI model. Specifically, this system enables real-time analysis of vegetation type, density, and health within limited computing resources, while also enabling adaptive flight path adjustment and resource optimization. Background Art
[0002] Vegetation monitoring is a crucial component of ecological and environmental surveys, agricultural management, and natural resource conservation. In recent years, with the development of drone technology, drone-based vegetation monitoring methods have garnered increasing attention. Compared to traditional methods, drones offer advantages such as maneuverability, affordability, and high-resolution imaging. They can fly below cloud cover, unrestricted by weather conditions, and are therefore suitable for detailed vegetation monitoring in localized areas. Currently, drone vegetation monitoring primarily utilizes the following technical approaches:
[0003] One approach relies on post-processing, where the drone is solely responsible for data collection, transmitting the captured image data back to the ground for processing and analysis. While this approach can leverage powerful ground-based computing resources for complex analysis, it lacks real-time feedback and intelligent decision-making, hindering timely attention to areas with abnormal vegetation conditions and resulting in low efficiency.
[0004] The second approach involves real-time analysis based on simple indicators. This involves integrating a simple vegetation index calculation module into a drone to generate real-time distribution maps of indicators such as NDVI. While this approach can provide some real-time information, its analysis depth is limited, making it difficult to identify specific vegetation types and health conditions.
[0005] The third approach is to utilize complex analytical methods on high-performance computing platforms. This involves equipping drones with high-performance computing devices, such as GPUs, to run complex analytical algorithms. While this approach offers strong analytical capabilities, its high equipment cost, high power consumption, and short flight time limit its practical application.
[0006] With the development of edge computing and deep learning technologies, it has become possible to deploy lightweight AI models on drones for real-time vegetation analysis. However, existing technologies still face the following challenges:
[0007] 1. Limited computing resources: UAV platforms are limited in space, weight, and power consumption, making it difficult to carry high-performance computing equipment. Relying on cloud computing and processing, limited by network connection quality, makes it difficult to achieve true real-time response.
[0008] 2. Deep learning models are large in size: Conventional deep learning models have high computational complexity and large storage requirements, making them difficult to run efficiently on edge devices.
[0009] 3. Low data processing efficiency: The system focuses on collecting data along fixed flight paths, failing to dynamically adjust sampling strategies based on identification results. The real-time image data processing process is insufficiently optimized, making it difficult to meet real-time analysis requirements. Existing lightweight algorithms primarily identify specific plant species and lack a comprehensive classification system.
[0010] 4. Static flight path planning: The preset flight path is difficult to intelligently adjust based on the vegetation conditions discovered in real time.
[0011] 5. Inefficient energy management: Unable to dynamically optimize data collection strategies based on battery status and task priority.
[0012] Currently, there is no system that combines real-time vegetation classification with adaptive flight path adjustment based on the existing processing capabilities of drones. This combination could significantly improve data collection efficiency, optimize resource utilization, and enhance classification accuracy without increasing hardware costs. Therefore, there is an urgent need for a drone system that can perform efficient vegetation analysis under limited computing resources and has intelligent decision-making capabilities. Summary of the Invention
[0013] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a real-time vegetation classification system for drones based on a lightweight AI model and a method thereof. The present invention combines edge computing with an optimized deep learning model to achieve efficient vegetation analysis under resource-constrained conditions, and has adaptive flight path planning and resource optimization capabilities. Without relying on additional edge computing hardware, it solves the problems existing in the prior art and achieves high-efficiency and high-precision vegetation classification and data collection. The present invention can overcome the problem of low efficiency of traditional vegetation survey methods, optimize the data collection process, improve the accuracy and coverage efficiency of vegetation classification, and reduce unnecessary flight time and energy consumption. It is suitable for multiple fields such as agricultural monitoring, forestry management and ecological protection.
[0014] The specific technical solutions adopted in the present invention are as follows:
[0015] In a first aspect, the present invention provides a real-time vegetation classification system for drones based on a lightweight AI model, comprising:
[0016] The system configuration and initialization module is used to select the drone platform or integrate companion devices, configure the camera sensor, set the initial path parameters, load the optimized lightweight AI model, and establish a connection with the flight control system through the SDK;
[0017] A lightweight AI model development module for designing models, using 8-bit integer quantization to reduce computational requirements, applying pruning techniques to remove low-contribution neurons, optimizing compilation, and fine-tuning pre-trained models through transfer learning.
[0018] A real-time data processing module is used to acquire and preprocess the image data stream, apply the illumination correction algorithm, input the model inference to generate the vegetation type, density and health status classification results, and calculate the confidence distribution;
[0019] Vegetation feature system module, used to extract vegetation features, standardize them to eliminate dimensionality effects, and establish a geospatial database in combination with GPS;
[0020] Feature optimization and selection module, which is used to apply recursive feature elimination algorithm to evaluate importance, construct candidate feature subsets, test the performance of different combinations through cross-validation, and select the optimal feature subset to improve inference speed;
[0021] The model training and evaluation module is used to divide the data set by stratified random sampling, train lightweight AI models based on selected features, evaluate performance using metrics, and optimize parameters through cross-validation to balance performance and speed;
[0022] an adaptive flight adjustment module for formulating decision rules based on the classification results to dynamically adjust flight parameters, optimize sampling density based on area value, implement boundary tracking mode, and optimize acquisition strategy based on battery status;
[0023] System performance monitoring module, used to monitor inference latency, frame rate, and memory usage, automatically adjust parameters or resolution based on processing latency, monitor temperature adjustment frequency, and record low-confidence samples for later improvement;
[0024] The result mapping generation module is used to update the vegetation distribution map in real time, perform spatial clustering to generate distribution boundaries, create health status heat maps, mark abnormal area calculation ranges, and generate comprehensive analysis reports;
[0025] The battery optimization management module is used to monitor power levels to determine the order of area scans, dynamically adjust task priorities and sampling density, establish a value scoring mechanism to maximize the value of data collection, retain power for safe return, and provide a mission interruption recovery mechanism.
[0026] Preferably, the lightweight AI model development module is as follows:
[0027] Based on one or more lightweight convolutional neural network architectures selected from the MobileNet series, EfficientNet series, ShuffleNet series and SqueezeNet series, the model quantization technology that converts 32-bit floating-point weights into 8-bit integers reduces the computational complexity and memory usage by at least 50%; through the model pruning technology based on sensitivity analysis, the neuronal connections whose contribution to classification accuracy is lower than the predetermined threshold are removed; TensorFlow Lite, PyTorchMobile or ONNX Runtime mobile inference framework is used for computational graph optimization; operator fusion is implemented to reduce intermediate data transmission overhead; instruction set optimization is performed for ARM architecture processors to realize SIMD parallel computing; and a computational cache mechanism is applied to reduce repeated calculations.
[0028] Preferably, in the real-time data processing module, image preprocessing includes:
[0029] The acquired original image is scaled to the model input size while maintaining its aspect ratio; image partition sampling based on sliding window or grid partitioning is performed; pixel values are normalized using mean normalization or Z-score normalization method; an illumination unevenness correction algorithm based on histogram equalization is applied; and shadow detection and compensation processing is performed.
[0030] Preferably, in the vegetation feature system module, the vegetation features include:
[0031] The spectral feature subset includes the normalized difference vegetation index, enhanced vegetation index, red edge position index, photochemical reflectance index and greenness index; the texture feature subset includes energy, contrast, correlation and entropy derived from the gray-level co-occurrence matrix, edge density distribution, and local binary pattern features; the morphological feature subset includes crown size parameters, shape complexity index, boundary irregularity, fractal dimension and its growth pattern characteristics; the spatiotemporal feature subset includes multi-phase change rate and spatial continuity index.
[0032] Preferably, the feature optimization selection module is as follows:
[0033] The recursive feature elimination algorithm based on XGBoost is used to evaluate the importance of each feature to vegetation classification, and the contribution of each feature is evaluated by the feature importance calculation formula, which is:
[0034] Importance(i)=∑jGain(j,i) / ∑j∑kGain(j,k),
[0035] Where Importance(i) is the importance score of feature i, and Gain(j,i) is the gain contribution of feature i in decision tree j. Based on the descending order of feature importance, a candidate feature subset F_k = {f_1, f_2, ..., f_k} is gradually constructed, where k is the number of subset features. A five-fold cross-validation method is used to systematically test the classification performance and computational efficiency of different feature combinations on the validation set. The feature subset F_opt with the highest F1 score and lowest dimension on the validation set is selected to simplify the model complexity, reduce the amount of computation, and improve the real-time inference speed. A dynamic update mechanism for feature importance is maintained to regularly re-evaluate feature contributions based on newly collected samples to adapt to the seasonal changes in vegetation.
[0036] Preferably, the model training and evaluation module is as follows:
[0037] The vegetation sample datasets from the collected public datasets and self-collected datasets were stratified randomly sampled in a ratio of 8:2 to ensure that the distribution ratio of various vegetation samples in the training set and the validation set was consistent; based on the optimal feature subset F_opt selected by the feature optimization selection module, a lightweight classification model was trained; the focal loss function was applied to deal with the sample category imbalance problem. The loss function expression is:
[0038] FL(pt)=-αt(1-pt)^γlog(pt)
[0039] Where FL(pt) is the focal loss value, pt is the predicted probability of category t, αt is the weight factor of category t, and γ is the focus parameter;
[0040] The model performance is comprehensively evaluated using metrics including confusion matrix, precision P, recall R, and F1 score, where:
[0041] P = TP / (TP + FP), where P is the precision rate, TP is the true positive, and FP is the false positive;
[0042] R = TP / (TP + FN), R is the recall rate, TP is the true positive, and FN is the false negative;
[0043] F1 = 2·P·R / (P+R), where F1 is the F1 score, P is the precision, and R is the recall;
[0044] The Adam optimizer is used for model training. The initial learning rate is set to 0.001, and the cosine annealing strategy is used to dynamically adjust the learning rate. The adjustment formula is:
[0045] η_t=η_min+0.5(η_max-η_min)(1+cos(t·π / T)),
[0046] Where η_t is the learning rate of the tth iteration, η_min is the minimum learning rate, η_max is the maximum learning rate, and T is the total number of iterations. The model parameters are optimized through cross-validation to achieve the best balance between prediction accuracy and inference speed.
[0047] Preferably, the adaptive flight adjustment module is specifically as follows:
[0048] Based on the vegetation type importance score and health status abnormality, the comprehensive value coefficient of the current scanning area is calculated; for high-value areas whose value coefficient exceeds the first preset threshold, the flight altitude is reduced to the range of 15-30 meters, the flight speed is reduced to the range of 2-5 meters / second, and the image sampling interval is reduced to 30%-50% of the standard interval through the drone control interface; for low-value areas whose value coefficient is lower than the second preset threshold, the flight altitude is increased to the range of 50-80 meters, the flight speed is increased to the range of 8-12 meters / second, and the image sampling interval is increased to 150%-200% of the standard interval; when the system detects that the probability of vegetation type boundary transition exceeds the preset threshold, the boundary tracking mode is triggered and an S-shaped or Z-shaped scanning path along the boundary is executed; and the optimal remaining flight path is dynamically planned based on the battery remaining capacity percentage, the remaining mission area and the regional value distribution.
[0049] Preferably, the system performance monitoring module is as follows:
[0050] Build a real-time performance monitoring module that includes model inference delay, image processing frame rate, CPU / GPU utilization, memory occupancy and power consumption data; when the processing delay is continuously detected to exceed the preset threshold for a predetermined period, automatically trigger an adaptive degradation strategy, including reducing image acquisition resolution, reducing processing frame rate or switching to a lighter backup model; implement a dynamic frequency adjustment mechanism based on temperature thresholds, reduce the processor clock frequency when the system core temperature exceeds the first safety threshold, and suspend non-critical computing tasks when it exceeds the second safety threshold; automatically record image samples with classification confidence below 60% and their corresponding geographic location and environmental parameters for later model improvement; and dynamically select the optimal model configuration from the pre-configured model library based on ambient lighting conditions, temperature changes and task types.
[0051] Preferably, the result mapping generation module is specifically as follows:
[0052] Construct a GIS-compatible vector data layer based on the geolocation data and classification results; apply spatial clustering algorithms, including density-based DBSCAN or grid-based STING algorithms, to spatially aggregate the classification results and generate vegetation type distribution polygons with clearly defined boundaries;
[0053] Based on the health status classification results and severity scores, a vegetation health status heat map using a standardized color spectrum is constructed, in which different colors represent different health levels; a spatial anomaly detection algorithm is applied to mark and quantify abnormal areas that deviate from the normal distribution range, and their precise geographical range and area are calculated; and a multi-level comprehensive report is generated, including a vegetation type spatial distribution map, a species diversity index distribution map, a health status assessment heat map, and management recommendations based on a rule engine.
[0054] Preferably, the battery optimization management module is as follows:
[0055] The battery management system interface monitors the battery charge, discharge rate and remaining available time in real time, and triggers a priority reordering mechanism when the charge falls below a preset threshold of 30%; a dynamic programming algorithm is used to calculate and update the optimal remaining task execution sequence in real time based on the remaining charge, regional value distribution and estimated power consumption model; a regional value scoring mechanism based on multi-factor weighting is implemented, which comprehensively considers the rarity of vegetation types, the degree of abnormal health status, spatial distribution characteristics and user-defined priorities; the algorithm ensures that at least 20% of the remaining charge is used for safe return, and dynamically adjusts this safety threshold based on the current wind speed, flight altitude and distance; and a breakpoint resumption mechanism is constructed to record the precise location when the mission was interrupted, the remaining area boundaries and the quality assessment of the completed area, and automatically generate an optimized flight path when the mission is resumed to ensure the integrity and continuity of data collection.
[0056] In a second aspect, the present invention provides an adaptive flight path adjustment method using the real-time vegetation classification system for unmanned aerial vehicles according to any one of the first aspects, as follows:
[0057] Based on the system configuration and initialization module, select a computing platform with an ARM architecture processor, install a multispectral camera or RGB camera with a resolution of at least 1080p, and establish a communication interface with the flight control system to configure the UAV system;
[0058] A lightweight AI model trained and optimized based on the lightweight AI model development module; the model uses quantization compression and structural pruning to adapt to the resource constraints of the edge computing environment;
[0059] Based on the lightweight AI model development module, a real-time image data stream is captured by a camera at a predetermined frame rate; preprocessing operations are performed on the captured image data, including spatial resolution adjustment, geometric correction, radiometric correction, and feature enhancement processing; the preprocessed image data is input into the lightweight AI model, and forward reasoning calculations are performed to generate a multidimensional classification output including vegetation type identification results, cover density estimation, and health status rating.
[0060] Based on the adaptive flight adjustment module and the battery optimization management module, the value score of the current area is calculated according to the classification output and predefined decision rules, and the parameters including flight altitude, speed, heading and sampling interval are dynamically adjusted through the UAV control protocol accordingly;
[0061] Based on the result mapping generation module, the classification result data and geographic coordinate information are integrated to construct a vegetation distribution map with a spatial reference system, and a comprehensive report containing quantitative analysis results and management recommendations is generated;
[0062] The system configuration and initialization module serves as the starting point of the entire system. It establishes a direct connection with the lightweight AI model development module by loading the optimized lightweight AI model, and connects to the flight control system through the SDK interface to provide a basis for the adaptive flight adjustment module. The real-time data processing module receives the configured camera sensor data stream, inputs the pre-processed image into the AI model for inference, and the generated classification results flow to the vegetation feature system module and the adaptive flight adjustment module at the same time. The standardized features extracted by the vegetation feature system module are evaluated and screened by the feature optimization selection module to form the optimal feature subset, which is then used by the model training evaluation module to improve the AI model. performance; the adaptive flight adjustment module dynamically adjusts flight parameters according to the classification results, and works with the battery optimization management module to ensure maximum sampling efficiency and battery utilization; the system performance monitoring module continuously evaluates the operating status of each component, and provides feedback to the real-time data processing module and the adaptive flight adjustment module to optimize system parameters; the result mapping generation module uses information from real-time data processing and vegetation feature systems to create and update vegetation distribution maps, and at the same time provides regional importance assessments to the adaptive flight adjustment module; the entire system forms a closed-loop feedback mechanism, with each module supporting each other and operating in coordination, realizing efficient, intelligent and adaptive operation of the vegetation monitoring system.
[0063] Compared with the prior art, the present invention has the following beneficial effects:
[0064] (1) It achieves efficient deployment of lightweight deep learning models on resource-constrained UAV platforms. Through model quantization and pruning techniques, it significantly reduces computational complexity and storage requirements, making complex vegetation analysis possible. Lightweight AI model optimization fully utilizes existing UAV processor resources, eliminating the need for additional edge computing equipment and reducing cost and weight.
[0065] (2) A complete real-time processing flow from raw images to vegetation classification results was established, optimizing the efficiency of image preprocessing, feature extraction, and model inference, enabling real-time analysis of vegetation type, density, and health status. Through detailed inspections of high-value areas, higher-quality data was obtained, improving the accuracy of vegetation classification.
[0066] (3) Innovatively implement adaptive flight path adjustment based on classification results, dynamically adjust flight parameters for different value areas, improve data collection efficiency and focus; dynamically adjust flight parameters based on real-time vegetation classification results, optimize data collection strategies, and reduce unnecessary flight time;
[0067] (4) A comprehensive system performance monitoring and optimization mechanism has been designed to achieve intelligent management of computing resources, ensuring stable operation of the system under various conditions; intelligently adjust the flight path to reduce the total flight distance and detailed scanning of low-value areas, thereby extending the effective working time;
[0068] (5) Developed a battery optimization and mission management strategy that maximizes data collection value under limited power conditions while ensuring flight safety through regional value scoring and dynamic programming algorithms;
[0069] (6) A vegetation distribution mapping and result generation process was constructed, providing intuitive spatial distribution visualization and management suggestions to facilitate end-user understanding and decision-making;
[0070] (7) The system can be applied to multiple fields such as agricultural monitoring, forestry management, and ecological protection, and can meet the needs of various vegetation classifications through the deployment of different models. The lightweight model design supports deployment on drone platforms of different performance levels, from commercial high-end drones to low-cost DIY solutions.
[0071] The present invention is applicable to fields such as ecological surveys, precision agriculture, forestry management, and nature reserve monitoring. It can provide efficient and accurate vegetation analysis services and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 This is an architecture diagram of the system of the present invention;
[0073] Figure 2 Schematic diagram of an adaptive flight path adjustment strategy based on the system of the present invention;
[0074] Figure 3 Develop and optimize flowcharts for lightweight AI models;
[0075] Figure 4 Extracting a framework diagram for the vegetation feature system;
[0076] Figure 5 Flowchart for battery optimization and task management decision making;
[0077] Figure 6 Schematic diagram for system performance monitoring and optimization;
[0078] Figure 7This is a schematic diagram of the application of a commercial UAV platform for farmland crop monitoring in Example 1;
[0079] Figure 8 This is a schematic diagram of the low-cost solution for the Raspberry Pi companion computer in Example 2;
[0080] Figure 9 This is a schematic diagram of the forest ecosystem monitoring application in Example 3. DETAILED DESCRIPTION
[0081] The present invention will be further described and illustrated below with reference to the accompanying drawings and specific embodiments. The technical features of each embodiment of the present invention may be combined accordingly without conflict.
[0082] like Figure 1 The figure shows a real-time vegetation classification system for drones based on a lightweight AI model. The system primarily includes a system configuration and initialization module, a lightweight AI model development module, a real-time data processing module, a vegetation feature system module, a feature optimization and selection module, a model training and evaluation module, an adaptive flight adjustment module, a system performance monitoring module, a result mapping generation module, and a battery optimization and management module. The functions of each module are described in detail below.
[0083] S1, system configuration and initialization module, is used to select a UAV platform with appropriate computing power or integrate low-cost companion equipment on a conventional UAV, configure a multispectral or ordinary RGB camera for data acquisition, set initial path parameters, load an optimized lightweight AI model (i.e., a lightweight deep learning vegetation classification model), and establish a communication connection with the flight control system through the UAV SDK or Ardupilot interface.
[0084] As a preferred embodiment of the present invention, a DJI Matrice 300RTK drone platform equipped with a Zenmuse H20T multispectral camera can realize data collection, and edge computing capabilities are provided by a Jetson Nano companion computing device.
[0085] In actual use, system configuration can be achieved through the following methods:
[0086] 1) Select a DJI Matrice 300RTK or a drone platform with equivalent computing power, or integrate a low-cost companion computing device such as a Raspberry Pi 4B or Jetson Nano into a conventional drone; 2) Configure a DJI Zenmuse H20T multispectral camera or a conventional RGB camera for data acquisition; 3) Establish communication with the flight control system through the DJI Mobile SDK or ArduPilot MAVLink interface; 4) Load an optimized lightweight deep learning vegetation classification model; 5) Set the initial flight path and mission parameters.
[0087] S2, lightweight AI model development module, is used to design models, use 8-bit integer quantization to reduce computing requirements, apply pruning technology to remove low-contribution neurons, optimize compilation, and fine-tune pre-trained models through transfer learning.
[0088] As a preferred embodiment of the present invention, the lightweight AI model development module is specifically as follows:
[0089] Based on one or more lightweight convolutional neural network architectures selected from the MobileNet series, EfficientNet series, ShuffleNet series and SqueezeNet series, the model quantization technology that converts 32-bit floating-point weights into 8-bit integers reduces the computational complexity and memory usage by at least 50%; through the model pruning technology based on sensitivity analysis, the neuronal connections whose contribution to classification accuracy is lower than the predetermined threshold are removed; TensorFlow Lite, PyTorchMobile or ONNX Runtime mobile inference framework is used for computational graph optimization; operator fusion is implemented to reduce intermediate data transmission overhead; instruction set optimization is performed for ARM architecture processors to realize SIMD parallel computing; and a computational cache mechanism is applied to reduce repeated calculations.
[0090] If the vegetation classification model designed with the MobileNetV3 architecture is used, lightweighting can be achieved through the following steps:
[0091] 1) 8-bit integer quantization technology is used to convert 32-bit floating-point weights to INT8 format, reducing the model size to 25% of the original size; 2) Structured pruning technology is applied to remove neuron connections that contribute less than 0.5% to accuracy, reducing computational complexity; 3) The TensorFlow Lite framework is used for model conversion and optimization, ensuring an inference speed of more than 50FPS on the ARM Cortex-A72 processor.
[0092] In actual use, the steps are as follows: Figure 2 As shown in the figure, the complete model optimization process from basic model selection to transfer learning and fine-tuning is demonstrated:
[0093] 1) Design a vegetation classification model based on lightweight network architectures such as MobileNet V3 and EfficientNet-B0;
[0094] 2) Apply model quantization technology to convert 32-bit floating-point weights into 8-bit integers to reduce computation and storage requirements. The conversion formula is as follows:
[0095] q=round(f / s)+z
[0096] Where: q is the quantized integer value, f is the original floating-point value, s is the scaling factor, and z is the zero-point offset;
[0097] 3) Apply model pruning technology to remove neuron connections whose contribution is lower than the threshold t. The threshold calculation formula is as follows:
[0098] t=α·std(|W|)
[0099] Where: α is the pruning intensity coefficient, which usually ranges from [0.1, 0.5], and std(|W|) is the standard deviation of the absolute value of the weight;
[0100] 4) Use TensorFlow Lite or PyTorch Mobile for compilation and optimization to ensure efficient operation on ARM processors;
[0101] 5) Using transfer learning techniques, fine-tune the pre-trained model based on a small amount of labeled data. The loss function is as follows:
[0102] L=L_ce+λ·L_reg
[0103] Where: L_ce is the cross entropy loss, L_reg is the regularization term, and λ is the weight coefficient, which usually ranges from [0.001, 0.1].
[0104] S3, real-time data processing module, is used to access the camera stream through the drone SDK or Ardupilot interface to obtain the image data stream and perform preprocessing, apply the illumination correction algorithm to reduce the impact of shadows, input the preprocessed image into the model inference to generate vegetation type, density and health status classification results, and calculate the confidence of the classification results and the regional feature distribution.
[0105] As a preferred embodiment of the present invention, image preprocessing includes:
[0106] The original image is scaled to the model input size while maintaining its aspect ratio; image partition sampling is performed based on a sliding window or grid partitioning; pixel values are normalized using mean normalization or Z-score normalization; an illumination unevenness correction algorithm based on histogram equalization is applied; and shadow detection and compensation are performed. In actual use, the real-time image processing process is as follows:
[0107] 1) Obtain the real-time image stream from the H20T camera through the DJI Mobile SDK interface, with a capture resolution of 1280×720 pixels;
[0108] 2) Preprocess the acquired image, including scaling to an appropriate resolution (224×224 or 128×128 pixels), center cropping, and color normalization. The normalization formula is as follows:
[0109] I_norm=(I-μ) / σ
[0110] Where: I_norm is the normalized image, I is the original image, μ is the mean vector of each channel [0.485, 0.456, 0.406], and σ is the standard deviation vector of each channel [0.229, 0.224, 0.225];
[0111] 3) Apply the illumination correction algorithm to reduce the impact of shadows. Adopt an adaptive illumination correction algorithm based on histogram equalization. The correction formula is as follows:
[0112] I'(x,y)=α·I(x,y)+β·G(x,y)
[0113] Where: I'(x,y) is the corrected image, I(x,y) is the original image, G(x,y) is the image after Gaussian filtering, α and β are balance coefficients, usually α∈[0.7,0.9], β∈[0.1,0.3];
[0114] 4) For areas with strong light or shadow, the Retinex algorithm is additionally applied for enhancement. The formula is as follows:
[0115] I(x,y)=R(x,y)·L(x,y)
[0116] L'(x,y)=F[log(I(x,y))-log(L(x,y))]
[0117] Where: I is the original image, R is the reflected image, L is the illumination image, L' is the enhanced illumination image, and F is the correction function;
[0118] 5) Input the preprocessed image into the optimization model for inference to generate classification results of vegetation type, density and health status;
[0119] 6) Calculate the confidence of the classification results and the regional feature distribution. The confidence calculation formula is:
[0120] Conf=max(softmax(logits))
[0121] Where: Conf is the confidence score, logits is the unnormalized score output by the model, and softmax is the probability normalization function.
[0122] S4, vegetation feature system module, is used to extract vegetation features based on the collected image data, standardize the feature data to eliminate dimensionality effects, and establish a geographic spatial feature database in combination with GPS information.
[0123] As a preferred embodiment of the present invention, vegetation features include: a spectral feature subset including the normalized difference vegetation index (NDVI), the enhanced vegetation index (EVI), the red edge position index (REP), the photochemical reflectance index (PRI) and the greenness index (GI); a texture feature subset including energy, contrast, correlation and entropy derived from the gray-level co-occurrence matrix (GLCM), edge density distribution, and local binary pattern (LBP) features; a morphological feature subset including crown size parameters, shape complexity index, boundary irregularity, fractal dimension and its growth pattern characteristics; a spatiotemporal feature subset including multi-phase change rate and spatial continuity index.
[0124] In actual use, multi-dimensional feature data is extracted to establish a vegetation feature database, such as Figure 3 As shown in the figure, the overall framework of spectral feature, texture feature, morphological feature extraction and feature optimization and selection is presented, as well as the calculation formulas for various features. The specific steps are as follows:
[0125] 1) Extract spectral features based on the collected image data, including:
[0126] Calculation of vegetation index NDVI:
[0127] NDVI = (NIR-R) / (NIR+R)
[0128] Where: NDVI is the normalized vegetation index, NIR is the near-infrared band reflectance, and R is the red band reflectance;
[0129] Enhanced Vegetation Index EVI calculation:
[0130] EVI=2.5×(NIR-R) / (NIR+6×R-7.5×B+1)
[0131] Where: EVI is the enhanced vegetation index, NIR is the near-infrared band reflectance, R is the red band reflectance, and B is the blue band reflectance;
[0132] Greenness index calculation:
[0133] GI=G / R
[0134] Where: GI is the greenness index, G is the reflectance of the green band, and R is the reflectance of the red band;
[0135] 2) Extract texture features, including:
[0136] Gray-level co-occurrence matrix:
[0137] GLCM(i,j)=∑∑I(x,y,i,j)
[0138] Where: GLCM is the gray-level co-occurrence matrix, I(x,y,i,j) is the counting function from pixel (x,y) to pixel values i and j;
[0139] Edge Density:
[0140] ED=N_edge / A
[0141] Where: ED is the edge density, N_edge is the number of edge pixels, and A is the area of the region;
[0142] Local Binary Patterns:
[0143] LBP=∑s(g_p-g_c)·2^p
[0144] Where: LBP is the local binary pattern value, g_c is the grayscale value of the central pixel, g_p is the grayscale value of the neighboring pixel, and s(x) is the step function;
[0145] 3) Extract morphological features, including:
[0146] Crown size:
[0147] CS=π·(D_max·D_min) / 4
[0148] Where: CS is the crown size, D_max is the maximum diameter, and D_min is the minimum diameter;
[0149] Shape complexity:
[0150] SC=P^2 / (4π·A)
[0151] Where: SC is the shape complexity index, P is the perimeter, and A is the area;
[0152] Estimation of growth pattern characteristics;
[0153] 4) Standardize the characteristic data to eliminate the dimension effect:
[0154] X_norm=(X-μ) / σ
[0155] Where: X_norm is the standardized eigenvalue, X is the original eigenvalue, μ is the mean, and σ is the standard deviation;
[0156] 5) Establish a geospatial feature database based on GPS location information.
[0157] S5, the feature optimization and selection module, is used to apply a recursive feature elimination algorithm to evaluate the importance of each feature for vegetation classification; based on feature importance ranking, it gradually constructs a subset of candidate features; tests the classification performance of different feature combinations through cross-validation; and selects the feature subset with the best performance on the validation set to simplify model complexity and improve real-time inference speed. In actual use, the feature optimization and selection process is as follows:
[0158] 1) Apply the recursive feature elimination (RFE) algorithm based on XGBoost to evaluate the importance of each feature in vegetation classification;
[0159] 2) Calculate the importance score of each feature based on the feature importance calculation formula:
[0160] Importance(i)=∑j Gain(j,i) / ∑j∑k Gain(j,k)
[0161] Where: Importance(i) is the importance score of feature i, Gain(j,i) is the gain contribution of feature i in decision tree j, j represents the decision tree index, and k represents the index of all features;
[0162] 3) Gradually construct a candidate feature subset F_k = {f_1, f_2, ..., f_k}, where k is the number of features in the subset;
[0163] 4) Use the five-fold cross-validation method to test the classification performance of different feature combinations;
[0164] 5) Select the feature subset F_opt with the highest F1 score and lowest dimension on the validation set to simplify the model complexity and improve the real-time inference speed.
[0165] S6, the model training and evaluation module, is used to divide the vegetation sample dataset into training and validation sets using stratified random sampling. Based on the optimal feature subset selected in S5, a lightweight classification model is trained. Model performance is evaluated using metrics such as confusion matrix, precision, recall, and F1 score. Model parameters are optimized through cross-validation to ensure the model achieves the best balance between performance and inference speed under limited hardware resources. In actual use, the model training and evaluation process is as follows:
[0166] 1) The vegetation sample dataset was randomly sampled in a stratified manner with a ratio of 8:2 and divided into a training set and a validation set;
[0167] 2) Based on the optimal feature subset F_opt screened by S5, a lightweight classification model is trained;
[0168] 3) Apply the focal loss function to deal with the problem of sample category imbalance. The loss function expression is:
[0169] FL(pt)=-αt(1-pt)^γlog(pt)
[0170] Where: FL(pt) is the focal loss value, pt is the predicted probability of category t, αt is the weight factor of category t, which is used to balance the difference in the number of samples of different categories, and γ is the focus parameter, which controls the weight of difficult and easy samples and is usually set to 2;
[0171] 4) Use confusion matrix, precision (P), recall (R), F1 score and other indicators to evaluate model performance:
[0172] P=TP / (TP+FP)
[0173] R=TP / (TP+FN)
[0174] F1=2·P·R / (P+R)
[0175] Where: TP is true positive, FP is false positive, and FN is false negative;
[0176] 5) Use the Adam optimizer for model training, set the initial learning rate to 0.001, and use the cosine annealing strategy to dynamically adjust the learning rate. The learning rate adjustment formula is:
[0177] yη_t=η_min+0.5(η_max-η_min)(1+cos(t·π / T))
[0178] Where: η_t is the learning rate of the tth iteration, η_min is the minimum learning rate, η_max is the maximum learning rate, and T is the total number of iterations.
[0179] S7, the adaptive flight adjustment module, is used to formulate decision rules based on classification results and evaluate the importance of the current area; dynamically adjust flight parameters through the drone SDK or Ardupilot command interface; reduce flight altitude and speed to increase sampling density in high-value areas (such as rare plants or areas with abnormal health conditions); increase flight altitude and speed to reduce sampling density in low-value areas (such as uniform healthy vegetation); execute boundary tracking flight mode when vegetation type intersection areas are detected; and optimize data collection strategies within the remaining flight time in real time based on battery status.
[0180] As a preferred embodiment of the present invention, the adaptive flight adjustment module is specifically as follows:
[0181] Based on the importance score of vegetation type and health abnormality, the comprehensive value coefficient of the current scanning area is calculated; for high-value areas whose value coefficient exceeds the first preset threshold, the flight altitude is reduced to 15-30 meters, the flight speed is reduced to 2-5 meters / second, and the image sampling interval is reduced to 30%-50% of the standard interval through the drone control interface; for low-value areas whose value coefficient is lower than the second preset threshold, the flight altitude is increased to 50-80 meters, the flight speed is increased to 8-12 meters / second, and the image sampling interval is increased to 150%-200% of the standard interval; when the system detects that the probability of vegetation type boundary transition exceeds the preset threshold, the boundary tracking mode is triggered and an S-shaped or Z-shaped scanning path along the boundary is executed; and the optimal remaining flight path is dynamically planned based on the battery remaining capacity percentage, the remaining mission area and the regional value distribution. In actual use, the drone flight path is dynamically adjusted according to the real-time classification results, see Figure 4 ,The schematic diagram of the adaptive flight path adjustment strategy intuitively shows the flight altitude and speed adjustment strategy under different vegetation area characteristics. The specific steps are as follows:
[0182] 1) Formulate decision rules based on classification results and calculate regional importance scores:
[0183] Score(r)=w1×R(r)+w2×H(r)+w3×V(r)
[0184] Where: Score(r) is the importance score of region r, R(r) is the vegetation rarity coefficient of region r, ranging from [0, 1], H(r) is the health abnormality of region r, ranging from [0, 1], V(r) is the species diversity index of region r, ranging from [0, 1], w1, w2, and w3 are weight coefficients, and w1+w2+w3=1. The recommended values are w1=0.4, w2=0.4, and w3=0.2.
[0185] 2) Dynamically adjust flight parameters through the drone SDK or Ardupilot command interface:
[0186] When Score>0.7: reduce the flight altitude to 30 meters and decelerate to 3m / s, and increase the sampling density;
[0187] When Score < 0.3: Increase the flight altitude to 80 meters and accelerate to 8m / s, reducing the sampling density;
[0188] When 0.3≤Score≤0.7: Maintain the standard flight altitude of 50 meters and speed of 5m / s;
[0189] 3) When the boundary area of vegetation types is detected, a boundary tracking flight mode based on an improved sequential contour tracking algorithm is executed;
[0190] 4) Optimize the data acquisition strategy within the remaining flight time in real time based on the battery status, and use a dynamic programming algorithm to maximize information acquisition.
[0191] S8, system performance monitoring module, is used to monitor model inference delay, processing frame rate and memory usage in real time; when the processing delay exceeds the preset threshold, it automatically adjusts the model inference parameters or image acquisition resolution; monitors the system temperature and implements dynamic frequency regulation to prevent overheating; records the image and location information of low-confidence samples (confidence <60%) for later model improvement; and dynamically selects the optimal model configuration based on different environmental conditions and task requirements.
[0192] As a preferred embodiment of the present invention, the system performance monitoring module is specifically as follows:
[0193] Build a real-time performance monitoring module that includes model inference latency, image processing frame rate, CPU / GPU utilization, memory occupancy, and power consumption data; when the processing latency is continuously detected to exceed the preset threshold for a predetermined period, automatically trigger an adaptive degradation strategy, including reducing image acquisition resolution, reducing processing frame rate, or switching to a lighter backup model; implement a dynamic frequency adjustment mechanism based on temperature thresholds, reduce the processor clock frequency when the system core temperature exceeds the first safety threshold, and suspend non-critical computing tasks when it exceeds the second safety threshold; automatically record image samples with classification confidence below 60% and their corresponding geographic location and environmental parameters for later model improvement; and dynamically select the optimal model configuration from the pre-configured model library based on ambient lighting conditions, temperature changes, and task types. In actual use, monitor system performance indicators in real time and make dynamic adjustments, see Figure 5 , showing the core modules of system performance monitoring and dynamic optimization, including model inference monitoring, memory and storage monitoring, temperature monitoring and corresponding optimization strategies. The steps are as follows:
[0194] 1) Real-time monitoring of model inference latency, processing frame rate, and memory usage:
[0195] Inference delay target: <50 milliseconds / frame; processing frame rate target: >20 frames / second; memory usage limit: 70% of the system's available memory; 2) When the processing delay exceeds the preset threshold, automatically adjust the model inference parameters or image acquisition resolution: Delay >50 milliseconds for 5 consecutive frames: reduce the image resolution to 640×480; Delay >100 milliseconds for 5 consecutive frames: switch to a lighter backup model or reduce inference accuracy; 3) Use dynamic frequency adjustment to reduce the processor frequency by 20% and increase the cooling fan speed when the chip temperature exceeds 75°C; 4) Mark samples with a confidence level below 60% and store the original image for incremental learning to improve the model; 5) Dynamically select the optimal model configuration based on different environmental conditions and task requirements to achieve a balance between performance and accuracy.
[0196] S9, the result mapping generation module, is used to update the vegetation distribution map in real time based on the classification results and GPS data; spatially cluster the identification results to generate vegetation type distribution boundaries; create a vegetation health heat map based on the health status classification results; mark abnormal areas and calculate their geographic extent; and generate a comprehensive report containing vegetation type distribution, health status assessment, and management recommendations.
[0197] As a preferred embodiment of the present invention, the result mapping generation module is specifically as follows:
[0198] A GIS-compatible vector data layer is constructed based on the geolocation data and classification result data; spatial clustering algorithms, including density-based DBSCAN or grid-based STING algorithms, are applied to spatially aggregate the classification results to generate vegetation type distribution polygons with clearly defined boundaries; based on the health status classification results and severity scores, a vegetation health heat map using a standardized color spectrum is constructed, where different colors represent different health levels; a spatial anomaly detection algorithm is applied to mark and quantify abnormal areas that deviate from the normal distribution range and calculate their precise geographic range and area; and a multi-level comprehensive report is generated, including a vegetation type spatial distribution map, a species diversity index distribution map, a health status assessment heat map, and management recommendations based on a rule engine. In actual use, the vegetation distribution mapping and result generation method are as follows:
[0199] 1) Update vegetation distribution maps in real time based on classification results and GPS data;
[0200] 2) The DBSCAN spatial clustering algorithm was used to cluster the identification results and generate the vegetation type distribution boundary. The cluster distance threshold was set to 5 meters and the minimum number of points was 4.
[0201] 3) Create a heat map based on the vegetation health score. The scoring formula is:
[0202] H(p)=0.4×C(p)+0.3×D(p)+0.3×S(p)
[0203] Where: H(p) is the vegetation health score at point p, with a value range of [0, 1]; C(p) is the chlorophyll content index at point p, estimated by spectral characteristics, with a value range of [0, 1]; D(p) is the vegetation density index at point p, estimated by texture characteristics, with a value range of [0, 1]; S(p) is the structural integrity index at point p, estimated by morphological characteristics, with a value range of [0, 1];
[0204] 4) Mark areas with health scores below 0.4 as abnormal areas and calculate their geographical range:
[0205] A_anomaly=∑pi·ai
[0206] Where: A_anomaly is the total area of the abnormal area, pi is the actual geographical area corresponding to the pixel, ai is the abnormal area indicator function, when the pixel is an abnormal area, ai = 1, otherwise ai = 0;
[0207] 5) Generate a comprehensive report containing vegetation type distribution, health status assessment and management recommendations.
[0208] S10, battery optimization management module, is used to monitor the battery power in real time. When the power is lower than the preset threshold (usually 30%), it prioritizes scanning high-value areas; dynamically adjusts task priority and sampling density based on the remaining power; establishes a regional value scoring mechanism to maximize the value of data collection under limited energy conditions; reserves sufficient power (at least 20%) for safe return; and provides an intelligent recovery mechanism after mission interruption, which can resume the mission from the last interruption point.
[0209] As a preferred embodiment of the present invention, the battery optimization management module is specifically as follows:
[0210] The battery management system interface monitors the battery charge, discharge rate and remaining available time in real time, and triggers a priority reordering mechanism when the charge is below the preset threshold of 30%; a dynamic programming algorithm is used to calculate and update the optimal remaining task execution sequence in real time based on the remaining charge, regional value distribution and estimated power consumption model; a regional value scoring mechanism based on multi-factor weighting is implemented, which comprehensively considers the rarity of vegetation types, abnormal health status, spatial distribution characteristics and user-defined priorities; the algorithm ensures that at least 20% of the remaining charge is used for safe return, and dynamically adjusts this safety threshold based on the current wind speed, flight altitude and distance; and a breakpoint resumption mechanism is constructed to record the precise location when the mission was interrupted, the remaining area boundary and the quality assessment of the completed area, and automatically generate an optimized flight path when the mission is resumed to ensure the integrity and continuity of data collection. In actual use, the task priority is dynamically adjusted according to the battery status to ensure mission completion and safe return, see Figure 6 , showing the decision-making process based on different power levels. The steps are as follows:
[0211] 1) Real-time monitoring of battery power. When the battery power is below the preset threshold, high-value area scanning is prioritized:
[0212] Battery level <30%: Switch to high-value area priority mode; Battery level <25%: Reduce sampling density and increase flight speed; Battery level <20%: Abort the mission and execute safe return procedures;
[0213] 2) Dynamically adjust task priority and sampling density based on remaining power. The task priority calculation formula is:
[0214] Priority(r)=Score(r) / E(r)
[0215] Where: Priority(r) is the task priority of region r, Score(r) is the importance score of region r, and its value range is [0,1]. E(r) is the estimated percentage of power consumption after completing the scan of region r, and its value range is (0,1).
[0216] 3) Establish a regional value scoring mechanism to maximize the value of data collection under limited energy conditions; 4) Reserve sufficient power (at least 20%) for safe return; 5) Provide an intelligent recovery mechanism after mission interruption, which can resume the mission from the last interruption point. Breakpoint record data includes: the last completed grid coordinates; the priority ranking of unfinished areas; and the marking information of key areas.
[0217] Based on the above-mentioned UAV real-time vegetation classification system, the present invention also provides an adaptive flight path adjustment method, which is specifically as follows:
[0218] Based on the system configuration and initialization module, select a computing platform with an ARM architecture processor, install a multispectral camera or RGB camera with a resolution of at least 1080p, and establish a communication interface with the flight control system to configure the UAV system;
[0219] A lightweight AI model trained and optimized based on the lightweight AI model development module; the model uses quantization compression and structural pruning to adapt to the resource constraints of the edge computing environment;
[0220] Based on the lightweight AI model development module, a real-time image data stream is captured by a camera at a predetermined frame rate; preprocessing operations are performed on the captured image data, including spatial resolution adjustment, geometric correction, radiometric correction, and feature enhancement processing; the preprocessed image data is input into the lightweight AI model, and forward reasoning calculations are performed to generate a multidimensional classification output including vegetation type identification results, cover density estimation, and health status rating.
[0221] Based on the adaptive flight adjustment module and the battery optimization management module, the value score of the current area is calculated according to the classification output and predefined decision rules, and the parameters including flight altitude, speed, heading and sampling interval are dynamically adjusted through the UAV control protocol accordingly;
[0222] Based on the result mapping generation module, the classification result data and geographic coordinate information are integrated to construct a vegetation distribution map with a spatial reference system, and a comprehensive report containing quantitative analysis results and management recommendations is generated.
[0223] The method also includes the construction and optimization steps of a multidimensional vegetation feature system, specifically: extracting multidimensional feature vectors including spectral features, texture features, morphological features, and spatiotemporal features from the collected multispectral or RGB images; performing normalization on the extracted feature vectors to eliminate the influence of different feature dimensions on classification; applying the recursive feature elimination (RFE) algorithm combined with the L1 regularized feature selection method to evaluate the independent contribution of each feature to the classification performance;
[0224] Implement a cross-validation-based grid search to systematically evaluate the combined performance of feature subsets and identify the feature combination that achieves the optimal balance between accuracy and computational efficiency; perform principal component analysis (PCA) or linear discriminant analysis (LDA) on the selected optimal feature subsets to further reduce the dimension of the feature space and improve real-time inference efficiency; and establish a feature evaluation and update mechanism for subsequent model iterations, regularly re-evaluating the feature importance ranking based on newly collected samples.
[0225] The steps for dynamically adjusting the UAV's flight path and parameters include: designing and implementing a multi-level decision tree rule set based on vegetation classification results, mapping vegetation type, density distribution, and health status score into regional value coefficients; dividing the flight mission area into high-value, medium-value, and low-value areas based on the spatial distribution of the regional value coefficients; for high-value areas, setting the flight altitude to 15-30 meters relative to the ground and the flight speed to 2-5 meters per second through the UAV control interface, and adopting an "S"-shaped or grid-type fine scanning pattern; for medium-value areas, maintaining standard flight parameters and executing a conventional scanning pattern; for low-value areas, raising the flight altitude to 50-80 meters, increasing the flight speed to 8-12 meters per second, and adopting a linear fast scanning pattern; when a statistically significant vegetation type or health status transition boundary is detected, automatically switching to boundary tracking flight mode and performing a fine scanning along the detected boundary; and continuously optimizing the remaining flight path based on the remaining battery power, wind speed conditions, and mission priority to ensure maximum data collection coverage in high-value areas within energy constraints.
[0226] The battery optimization and mission management steps include: building a battery consumption prediction model to accurately estimate the battery consumption rate per unit time based on flight altitude, speed, wind conditions and computing load; implementing a real-time power monitoring mechanism to trigger the task priority reordering logic when the power drops to a preset threshold (usually 30%); applying a greedy algorithm or dynamic programming method based on the regional value score and the remaining power to calculate the flight path that can obtain the maximum information value within the remaining mission time; enforcing the safe return power retention rule at the algorithm level to ensure that at least 20% of the power is reserved for safe return, and dynamically adjusting the threshold based on the current meteorological conditions and return distance; designing and implementing a mission interruption point recording and recovery mechanism to record the precise geographic coordinates, flight parameters, completed area boundaries and priority ranking of unfinished areas at each key sampling location; and when the mission is resumed, recalculating the optimized flight path based on the interruption point recorded data and the latest environmental conditions to ensure the integrity of data collection and the accuracy of vegetation analysis results.
[0227] The system and method of the present invention will be described in detail below through examples.
[0228] Example 1
[0229] This embodiment is aimed at the application of commercial UAV platform for farmland crop monitoring. Figure 7When monitoring farmland from above, the DJI Matrice 300RTK drone can identify different types of farmland and implement adaptive flight paths and altitude adjustments based on regional characteristics. It can also fly along vegetation type boundaries in boundary tracking mode. The entire system's data processing flow, from RGB image acquisition to real-time flight path adjustment, relies on system hardware such as the Snapdragon 845 processor for computation, ensuring that model inference time meets real-time monitoring requirements.
[0230] 1. System configuration and initialization
[0231] (1) Hardware configuration: The DJI Matrice 300RTK drone platform is used, equipped with a Snapdragon 845 processor and 6GB of RAM; the drone's built-in RGB camera is used, with a resolution of 1920×1080 pixels; an optional Micasense RedEdge-MX multispectral camera is used to enhance vegetation monitoring capabilities; the DJI Mobile SDK is used for system development to enable access to the camera and flight control.
[0232] (2) Software preparation: Develop a lightweight classification model based on the MobileNetV2 architecture with an input size of 224×224 pixels; use TensorFlow Lite to quantize the model to 8-bit integers, reducing the model size to 9 MB; apply weight pruning technology to remove neural network connections whose absolute weights are lower than the threshold t = 0.01·std(|W|); integrate the TensorFlow Lite library in the DJI Mobile SDK environment; set an initial grid flight path to cover the farmland area, with an initial altitude of 30 meters and a flight speed of 7 meters per second.
[0233] 2. Lightweight AI model development and optimization
[0234] The initial model was trained using the PlantCLEF dataset and self-collected farmland image data (including 8 common crops and 3 major weeds);
[0235] Apply the following optimization techniques:
[0236] Weight quantization: Convert 32-bit floating-point weights to 8-bit integers according to the formula:
[0237] q=round(f / s)+z
[0238] q: quantized integer value f: original floating-point value, s: scaling factor, z: zero-point offset; calculation speed increased by 3 times;
[0239] Model pruning: removing connections with a contribution rate lower than 0.01, reducing the model size by 40%;
[0240] Activation function optimization: Use ReLU6 instead of ReLU to improve the accuracy of the quantization model;
[0241] Knowledge distillation: Use a pre-trained large model to guide lightweight model training. The loss function is L = L_ce + λ·L_kd, where L is the total loss, L_kd is the knowledge distillation loss, L_ce: cross entropy loss, and λ: weight coefficient.
[0242] After testing the optimized model on a Snapdragon 845 processor, the inference time dropped to 120ms / frame and the memory usage was reduced by 65%.
[0243] 3. Real-time data collection and processing
[0244] Use the DJI Mobile SDK interface to access the camera stream and obtain image data at 5 frames per second;
[0245] (1) Image preprocessing process: scale to 224×224 pixels to reduce the amount of calculation; perform color normalization, using channel mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225]; apply the Retinex illumination correction algorithm to reduce the shadow effect by I(x, y) = R(x, y) L(x, y), where I(x, y) is the original image, R(x, y) is the reflected image, and L(x, y) is the illuminated image; use a Gaussian filter to reduce the noise effect;
[0246] (2) Feature extraction and vegetation analysis: For multispectral cameras, the normalized difference vegetation index (NDVI) is calculated as (NIR-R) / (NIR+R), where NIR is the near-infrared band reflectance and R is the red band reflectance; for RGB cameras, the normalized difference vegetation index (NDVI) is calculated as (2G-RB) / (2G+R+B), where G is the green channel value, R is the red channel value, and B is the blue channel value; texture features are extracted, including gray-level co-occurrence matrix (GLCM) features and local binary pattern (LBP); morphological operations are used to extract crop row structure and density features;
[0247] (3) Model output includes: crop type (8 categories), growth status (3 categories: healthy, medium, poor) and weed invasion degree (3 levels); the processing results are stored in the memory buffer, retaining the analysis results of the most recent 100 frames and associated with the GPS location information.
[0248] 4. Adaptive flight path adjustment
[0249] (1) Formulate decision rules based on classification results:
[0250] Rule 1: When abnormal crop health (such as yellowing or wilting) is detected in three consecutive frames, "Detailed Inspection Mode" is executed; Rule 2: When healthy crops of the same type are detected in five consecutive frames, "Quick Scan Mode" is executed; Rule 3: When the boundary between crops and weeds is detected, "Border Tracking Mode" is executed;
[0251] (2) Regional importance assessment:
[0252] The region importance score (Is) is calculated as 0.4·Rt+0.3·Rd+0.3·Rh, where Rt is the crop type rarity coefficient, Rd is the density anomaly coefficient, and Rh is the health anomaly coefficient. The flight strategy is dynamically adjusted based on the Is value. "Detailed Inspection Mode": Sending commands via the DJI Mobile SDK lowers the flight altitude to 60% of its original altitude (approximately 18 meters), reduces the flight speed to 50% of its original speed (approximately 3.5 meters per second), increases the image acquisition frequency to 8 frames per second, and performs zigzag scans near region boundaries to increase boundary detail. "Fast Scan Mode": Increases the flight altitude to 150% of its original altitude (approximately 45 meters), increases the flight speed to 200% of its original speed (approximately 14 meters per second), reduces the image acquisition frequency to 3 frames per second, and uses a larger step size grid path to quickly cover a uniform area. "Border Tracking Mode": Maintains a moderate altitude and speed, performs detailed tracking along detected boundaries, and records precise GPS position data for later analysis.
[0253] (3) Battery optimization strategy: monitor the battery power in real time, and give priority to completing the high-value area scan when the power is lower than 30%; dynamically adjust the remaining flight time Tr = (B-Bmin)·k·(1 / P) according to the remaining power, where B is the current power percentage, Bmin is the minimum power required for return, k is the calibration coefficient, and P is the current power consumption; optimize the remaining tasks according to the area value V = 0.4·R+0.4·H+0.2·D, where R is the rarity, H is the health abnormality, and D is the data integrity requirement; reserve 20% of the power for safe return.
[0254] 5. System performance monitoring and optimization
[0255] (1) Real-time monitoring of system performance indicators: Inference latency target: <150 milliseconds / frame; Processing frame rate: >5 frames / second; Memory usage: controlled within 70% of available memory;
[0256] (2) Dynamic performance adjustment strategy: When the inference delay is greater than 200 milliseconds, the image resolution is automatically reduced to 192×192 or 128×128; when the processing temperature is greater than 65°C, the CPU frequency is reduced by 15% to prevent overheating; when the memory usage is greater than 80%, the number of cached frames is reduced;
[0257] (3) Error recovery mechanism: automatically restart the inference engine when a model inference error is detected;
[0258] Save checkpoints regularly to support resumption from the most recent point after a task is interrupted; record the image and location information of low-confidence samples (confidence < 60%) for later model improvement.
[0259] 6. Vegetation distribution mapping and result generation
[0260] (1) Update vegetation distribution maps in real time based on classification results and GPS data:
[0261] The DBSCAN (D, 5 meters, 10) algorithm was used to spatially cluster the identification results and generate crop type distribution boundaries. A crop health heat map was created, and the heat map value was calculated as H(x, y) = 0.5·VHI1(x, y) + 0.3·VHI2(x, y) + 0.2·VHI3(x, y), where VHI is the vegetation health index. Anomalies were marked and their geographic extent was calculated as A_anomaly = ∑pi·ai, where pi is the pixel area and ai is the anomaly indicator function.
[0262] (2) Generate a comprehensive analysis report: crop distribution ratio and spatial distribution statistics; health status assessment, including sub-healthy and suspected pest and disease areas; weed invasion level assessment and distribution map; and recommended intervention measures for abnormal areas;
[0263] (3) Export data format: vectorized GeoJSON format, compatible with mainstream GIS systems; high-resolution heat maps, suitable for precision agriculture management software; time series comparison data, used for long-term farmland monitoring.
[0264] Example 2
[0265] This embodiment is aimed at a low-cost solution using Raspberry Pi as a companion computer. Figure 8 The Hexacopter F550 drone and Raspberry Pi 4 computer integration solution utilizes a Pi Camera V2 camera and an Ardupilot flight controller, connecting components via GPIO and UART interfaces to ensure stable data transmission. The software architecture is based on Raspbian OS and integrates frameworks such as DroneKit-Python, OpenCV, and TensorFlow Lite. The system implements a complete data processing flow from image acquisition to flight command transmission, and utilizes optimization technologies such as model quantization, ARM NEON acceleration, and multithreading to improve system performance under resource-constrained conditions.
[0266] 1. System configuration and initialization
[0267] (1) Hardware configuration: Select an Ardupilot-supported drone platform (such as the Hexacopter F550); integrate a Raspberry Pi 4 (4GB RAM) as a companion computer; connect a Raspberry Pi Camera V2 module (8 megapixels); optionally use a low-cost near-infrared filter to enhance vegetation monitoring capabilities; use UART / USB serial communication to connect the Raspberry Pi to the flight controller; and add a GPS module to provide accurate geographic location information.
[0268] (2) Software preparation: Install the Raspbian operating system on the Raspberry Pi and optimize kernel parameters to improve real-time performance; install the DroneKit-Python library for communication with Ardupilot; install the optimized version of OpenCV 4.5.5 and enable NEON instruction set acceleration; deploy the EfficientNet-B0 or MobileNetV3-Small model optimized with TensorFlow Lite; and develop a lightweight task scheduler to manage data acquisition, processing, and communication tasks.
[0269] 2. Lightweight AI model development and optimization
[0270] Use the tree species classification dataset and vegetation health dataset to train the initial EfficientNet-B0 model;
[0271] (1) Optimizing the model for ARM processors:
[0272] Integer quantization was applied to convert the model to int8 format, and floating-point weights were quantized according to the formula q = round(f / s) + z, where q is the quantized integer value, f is the original floating-point value, s is the scaling factor, and z is the zero offset. TensorFlow Lite's ARM NEON acceleration technology was used to optimize matrix multiplication operations. ARM microarchitecture-specific optimization options were enabled, leveraging the Cortex-A72 instruction set. Model pruning was applied to remove connections whose absolute weights were less than t = 0.015 · std(|W|). Convolutional layers were optimized, using depthwise separable convolution instead of standard convolution.
[0273] (2) Model deployment optimization:
[0274] The TensorFlow Lite delegate mechanism is used to enable GPU acceleration; memory mapping technology is applied to reduce model loading time; and a model caching mechanism is designed to avoid frequent reloading. The optimized model's inference time on a Raspberry Pi 4 is controlled within 200ms / frame, and memory usage is reduced to 30% of the original model.
[0275] 3. Real-time data collection and processing
[0276] (1) Use the OpenCV interface to acquire 640×480 resolution images and optimize through multi-threading: the main thread is responsible for image acquisition and model inference; the auxiliary thread is responsible for GPS data recording and communication; a ring buffer design is used to smooth load fluctuations;
[0277] (2) Image preprocessing process: bilinear interpolation downsampling to 224×224 or 192×192; using lightweight Retinex algorithm to achieve illumination correction; applying adaptive histogram equalization to improve image quality under low light conditions;
[0278] (3) Feature extraction and analysis:
[0279] Calculate the RGB-based simulated vegetation index: Greenness Index: GI = G / R, where G is the green channel value and R is the red channel value; Vegetation Variation Index VARI = (GR) / (G+RB), where G is the green channel value, R is the red channel value, and B is the blue channel value; Use the mean hashing algorithm to extract image texture features; Apply a lightweight edge detection algorithm to extract morphological features; The model classifies and outputs multiple tree species and health status in real time;
[0280] (4) Use sliding window technology to aggregate multi-frame results and enhance classification stability: set a 5-frame window and adopt a weighted majority voting mechanism; use exponential weighted average to enhance temporal consistency; implement confidence threshold filtering to eliminate low-confidence predictions.
[0281] 4. Adaptive flight path adjustment
[0282] (1) Send MAVLink commands via DroneKit-Python to adjust flight parameters:
[0283] Use GUIDED mode to dynamically modify waypoints at key nodes; dynamically set new waypoints based on vegetation classification results; implement a smooth transition algorithm to avoid sudden flight path changes;
[0284] (2) Regional importance assessment:
[0285] Calculate the current area importance score Is = 0.3 Rt + 0.4 Rd + 0.3 Rh, where Rt is the tree species rarity coefficient, Rd is the density anomaly coefficient, and Rh is the health anomaly coefficient; automatically determine the flight strategy based on the Is value;
[0286] (3) Path adjustment strategies for different scenarios:
[0287] Normal survey: Maintain 15m altitude and 5m / s speed; High-value area (Is>0.7): Descend to 8m altitude and decelerate to 2m / s; Uniform area (Is<0.3): Raise to 25m altitude and accelerate to 10m / s; Boundary detection area: Execute boundary tracking flight mode and fly along the detected vegetation type boundary;
[0288] (4) Implement geo-fencing-based safety restrictions to ensure that the drone does not deviate from the predetermined area: set up multiple layers of safety boundaries, including soft boundaries and hard boundaries; implement automatic return trigger conditions, such as low battery, communication interruption, etc.; develop collision prediction algorithms to avoid obstacles.
[0289] 5. System performance monitoring and optimization
[0290] (1) Real-time monitoring of hardware performance indicators: CPU temperature, usage, and frequency; memory usage and swap partition usage; storage space and I / O load;
[0291] (2) Dynamic resource management: When the CPU temperature is >75°C, the CPU frequency is reduced to prevent overheating; when the memory usage is >85%, the number of image caches is reduced; according to the processing delay, the image resolution and sampling rate are dynamically adjusted;
[0292] (3) Develop a lightweight watchdog program to monitor the health status of the system: detect unresponsive programs and automatically restart services; record system exception logs for later analysis; and provide a remote diagnostic interface.
[0293] 6.Battery optimization and task management
[0294] (1) Developing intelligent power management strategies:
[0295] Real-time estimation of remaining flight time Tr = (B - Bmin) k (1 / P), where B is the current battery percentage, Bmin is the minimum battery required for return, k is the calibration factor, and P is the current power consumption; dynamically adjusts processor frequency and camera resolution based on battery status; automatically adjusts task priority based on mission importance and remaining battery;
[0296] (2) Task interruption recovery mechanism:
[0297] Periodically save task status and key data to persistent storage; record the coordinates of the last completed scan area;
[0298] Supports resuming from the interruption point at next startup;
[0299] (3) Regional value assessment mechanism:
[0300] Calculate the regional value V = 0.35·R + 0.45·H + 0.2·D, where R is the rarity, H is the health abnormality, and D is the data integrity requirement; when power is limited, prioritize high-value areas; build a regional priority queue to ensure data integrity in key areas.
[0301] 7. Feedback and result generation
[0302] (1) Transmitting real-time classification results to the ground station via the WebSocket protocol: Developing a lightweight Web interface to display classification results and flight status; providing a simple manual intervention interface; implementing a low-bandwidth data compression algorithm to adapt to weak network environments;
[0303] (2) Data processing and visualization: Use the DBSCAN spatial clustering algorithm to generate vegetation distribution boundaries; create a vegetation health heat map, the heat map value is calculated based on the weighted calculation of multiple health indicators; calculate the area of abnormal areas and their geographical boundaries;
[0304] (3) Export data in multiple formats: vegetation distribution map in GeoJSON format; vegetation health statistics in CSV format; low-resolution preview images for quick viewing; record classification results with GPS coordinates for generating detailed distribution maps; save high-value samples with latitude and longitude information for later model training.
[0305] Example 3
[0306] This embodiment is applied to forest ecosystem monitoring. Figure 9 The WingtraOne vertical take-off and landing fixed-wing drone can identify different tree species and vegetation layers during forest monitoring, employing a multi-layered flight strategy: maintaining an altitude of 120-150 meters in high-density areas, 80-100 meters in general areas, and descending to 60 meters for detecting rare tree species. It can also perform vertical profile scans of tree canopies. The system implements a complete multispectral data processing pipeline, combining the ResUNet++ segmentation model and various vegetation index calculation techniques to improve the accuracy and efficiency of forest monitoring.
[0307] 1. System configuration and initialization
[0308] (1) Hardware configuration:
[0309] Choose a long-endurance vertical take-off and landing fixed-wing drone (such as WingtraOne) with a flight time of up to 60 minutes; use a MicaSense Altum multispectral camera, including blue, green, red, red-edge and near-infrared bands, as well as a thermal infrared sensor; integrate a navigation-grade RTK-GPS module to improve positioning accuracy to the centimeter level; equip it with a high-performance computing module, such as the NVIDIA Jetson Xavier NX, for edge computing; and add an additional power management module to extend the operating time of the computing unit.
[0310] (2) Software preparation:
[0311] Build a ResUNet++-based segmentation model optimized for canopy identification; develop a multi-band data processing framework to support heterogeneous sensor fusion; design a layered scanning strategy to cover forest canopy layers at different heights; develop a specific preprocessing process for multispectral data; and establish a knowledge base of forest tree species and health status, including characteristics of 30 common tree species.
[0312] 2. Lightweight AI model development and optimization
[0313] (1) Using a network architecture optimized for multispectral data:
[0314] Modify the convolutional layer input channels to adapt to multispectral data (5+1 channel input);
[0315] The channel attention mechanism is introduced with the formula Ac=σ(MLP(AvgPool(F))+MLP(MaxPool(F))), which highlights the infrared band features, where σ is the sigmoid activation function, MLP is the multi-layer perceptron, AvgPool is the average pooling operation, MaxPool is the maximum pooling operation, and F is the feature map;
[0316] Design a channel weight adaptive layer to dynamically adjust the importance of each band according to seasonal changes;
[0317] Integrate spatial attention modules to enhance the representation of complex crown structures;
[0318] (2) Optimization of forest tree species classification model structure:
[0319] Special convolutional layers are designed for crown morphological characteristics, using deformable convolution to adapt to irregular crown shapes; robust representation of seasonal changes is achieved by integrating time series features; an ensemble learning strategy is used to combine the prediction results of multiple expert models; and knowledge distillation techniques are applied to extract core feature representations from large models.
[0320] (3) Optimization for edge devices:
[0321] Apply TensorRT for model optimization, utilizing half-precision (FP16) calculations; design a dynamic batching mechanism to adjust the batch size based on the computational load; implement an asynchronous inference pipeline to maximize hardware utilization; and perform model quantization and pruning to reduce the number of parameters by 90% while maintaining an accuracy rate above 90%.
[0322] 3. Real-time data collection and processing
[0323] (1) Multispectral data acquisition and fusion: Develop a sub-pixel multi-band alignment algorithm to correct for differences in sensor position; apply a sensor calibration process to ensure spectral response consistency between bands; implement automatic exposure adjustment to adapt to different lighting conditions; perform radiometric correction to eliminate atmospheric and lighting effects;
[0324] (2) Feature extraction and analysis:
[0325] a. Calculate multiple vegetation indices:
[0326] Normalized Difference Vegetation Index: NDVI = (NIR-R) / (NIR+R)
[0327] Enhanced Vegetation Index: EVI = 2.5 (NIR-R) / (NIR+6 R-7.5 B+1)
[0328] Red Edge Normalized Difference Index: NDRE = (NIR - RedEdge) / (NIR + RedEdge)
[0329] Water stress index: MSI = SWIR / NIR (water stress index)
[0330] b. Extract texture features:
[0331] Gray-level co-occurrence matrix feature GLCM(i,j)=∑∑I(x,y,i,j), where I(x,y,i,j) is the counting function from pixel (x,y) to pixel values i and j;
[0332] Local binary pattern LBP = ∑s(g_p-g_c)·2^p, where g_c is the grayscale value of the central pixel, g_p is the grayscale value of the neighboring pixel, s(x) is the step function, and p is the neighboring pixel position index;
[0333] Gabor filter features to capture textures of different directions and scales
[0334] c. Morphological characteristics analysis:
[0335] Crown size calculation CS = π·(D_max·D_min) / 4, where D_max is the maximum diameter and D_min is the minimum diameter;
[0336] Shape complexity SC = P^2 / (4π·A), where P is the perimeter, A is the area, and π is the ratio of the circumference to the circumference of a circle.
[0337] Crown density and branching complexity assessment
[0338] (3) Crown segmentation and individual identification:
[0339] A lightweight watershed segmentation algorithm is implemented to extract individual tree locations from the CHM; morphological operations are applied to separate adjacent crowns; a region growing algorithm is used to accurately define crown boundaries; and tree height estimation is implemented based on the difference between the digital surface model (DSM) and the digital elevation model (DEM).
[0340] 4. Adaptive flight path adjustment
[0341] (1) Specific strategies for forest characteristics: Generate flight paths along the vertical profile of the tree crown to provide three-dimensional vegetation structure information; automatically adjust altitude when changes in tree crown density are detected: in high-density areas, increase the flight altitude to 120-150 meters; in low-density areas, reduce the altitude to 80-100 meters; in edge transition areas, generate a smooth altitude change curve;
[0342] (2) Adaptive path planning for complex terrain: Terrain-aware navigation based on digital elevation models; maintaining a constant height relative to tree canopies; avoiding high-risk areas such as steep slopes or tall isolated trees;
[0343] (3) Regional importance assessment: Calculate the current regional importance score Is = 0.3·Rs + 0.3·Rd + 0.4·Rh, where Rs is the species diversity coefficient, Rd is the density anomaly coefficient, and Rh is the health anomaly coefficient; dynamically adjust the sampling density and flight parameters;
[0344] (4) Rare tree species monitoring mode: record the location of rare tree species and automatically generate a detailed scanning path; reduce the flight altitude to 60 meters and slow down the speed to 3m / s; increase the image overlap rate to 80% to improve the accuracy of 3D reconstruction; and build a high-precision 3D model for rare tree species.
[0345] (5) Battery optimization strategy: estimate the remaining flight time Tr = (B-Bmin)·k·(1 / P), where B is the current battery percentage, Bmin is the minimum battery required for return, k is the calibration coefficient, and P is the current power consumption; regional value score V = 0.3·Rs+0.3·Rh+0.2·Rd+0.2·D, where Rs is the species diversity coefficient, Rh is the health anomaly, Rd is the density anomaly coefficient, and D is the data integrity requirement; when the battery is less than 25%, priority is given to completing the scanning of high-value areas; retain 20% of the battery for safe return, taking into account terrain and wind conditions.
[0346] 5. System performance monitoring and optimization
[0347] (1) Hardware resource management: Monitor the power consumption, temperature, and computational load of the Jetson Xavier NX; implement dynamic power configuration to adjust GPU / CPU frequency according to processing needs; optimize memory usage to avoid frequent swapping; use CUDA streams to process multi-band data in parallel;
[0348] (2) Reasoning performance optimization:
[0349] Monitor model inference latency in real time, aiming to keep it within 200ms. When the temperature exceeds 70°C, reduce the core frequency and prioritize critical tasks. Dynamically adjust the sampling resolution and inference batch size based on processing latency. Implement a model fallback mechanism to switch to an ultra-lightweight backup model in extreme cases.
[0350] 6. Vegetation distribution mapping and result generation
[0351] (1) Generate a forest health heat map: fuse NDVI, NDRE, and thermal infrared data; calculate the heat map value H(x,y) = 0.4·NDVI(x,y) + 0.3·NDRE(x,y) + 0.3·TIR(x,y), where NDVI(x,y) is the Normalized Difference Vegetation Index, NDRE(x,y) is the Normalized Difference Red Edge Index, and TIR(x,y) is the thermal infrared data; mark potential pest and disease areas based on anomaly detection algorithms; calculate water stress areas for drought monitoring;
[0352] (2) Tree species distribution and structure analysis: Apply DBSCAN (D, 10 m, 15) spatial clustering to generate tree species distribution boundaries; calculate species diversity indices, including the Shannon index and the Simpson index; analyze canopy structure complexity and assess ecosystem stability; identify areas where invasive species spread and provide early warning;
[0353] (3) Time series analysis and change detection: compare with historical data to detect changes in tree canopy cover; identify forest degradation caused by deforestation, fire, or pests and diseases; calculate carbon storage changes to support carbon sink assessment; predict vegetation succession trends to assist long-term ecological monitoring;
[0354] (4) Results presentation and export: Generate a comprehensive report containing species composition, health status, and management recommendations; export data in GIS formats compatible with forestry management systems (Shapefile, GeoJSON, etc.); create high-resolution orthophotos with a resolution of up to 5 cm / pixel; generate crown height models (CHMs) and three-dimensional point cloud data.
[0355] 7. Long-term monitoring and data management
[0356] (1) Establish a forest ecosystem monitoring database: design a time series data storage structure to support efficient query; implement multi-resolution data storage to balance storage space and accuracy requirements; develop a metadata management system to record acquisition conditions and processing parameters; and implement an automatic data synchronization and backup mechanism.
[0357] (2) Analysis of long-term changes in ecosystems: Develop seasonal change compensation algorithms to improve the accuracy of time series comparisons; establish tree species phenology models to predict growth cycles; correlate meteorological data to analyze the impact of climate change; provide forest health trend forecasts to support early intervention.
[0358] The method of the present invention has the following advantages: (1) Lightweight and efficient. Through model quantization and pruning technology, real-time vegetation analysis can be achieved on low-cost UAV edge computing devices, significantly reducing hardware requirements and system costs;
[0359] (2) Intelligent self-adaptation. Dynamically adjust flight paths and parameters based on real-time classification results, and adopt differentiated sampling strategies for different value areas, significantly improving data collection efficiency;
[0360] (3) Resource optimization. Through battery management and task priority strategies, the acquisition of valuable data is maximized under limited energy conditions, solving the problem that traditional fixed-route methods cannot cope with complex vegetation distribution.
[0361] The embodiment described above is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Persons skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent substitution or equivalent transformation falls within the scope of protection of the present invention.
Claims
1. A real-time vegetation classification system for drones based on a lightweight AI model, characterized by: include: The system configuration and initialization module is used to select the drone platform or integrate companion devices, configure the camera sensor, set the initial path parameters, load the optimized lightweight AI model, and establish a connection with the flight control system through the SDK; A lightweight AI model development module for designing models, using 8-bit integer quantization to reduce computational requirements, applying pruning techniques to remove low-contribution neurons, optimizing compilation, and fine-tuning pre-trained models through transfer learning. A real-time data processing module is used to acquire and preprocess the image data stream, apply the illumination correction algorithm, input the model inference to generate the vegetation type, density and health status classification results, and calculate the confidence distribution; Vegetation feature system module, used to extract vegetation features, standardize them to eliminate dimensionality effects, and establish a geospatial database in combination with GPS; Feature optimization and selection module, which is used to apply recursive feature elimination algorithm to evaluate importance, construct candidate feature subsets, test the performance of different combinations through cross-validation, and select the optimal feature subset to improve inference speed; The model training and evaluation module is used to divide the data set by stratified random sampling, train lightweight AI models based on selected features, evaluate performance using metrics, and optimize parameters through cross-validation to balance performance and speed; an adaptive flight adjustment module for formulating decision rules based on the classification results to dynamically adjust flight parameters, optimize sampling density based on area value, implement boundary tracking mode, and optimize acquisition strategy based on battery status; System performance monitoring module, used to monitor inference latency, frame rate, and memory usage, automatically adjust parameters or resolution based on processing latency, monitor temperature adjustment frequency, and record low-confidence samples for later improvement; The result mapping generation module is used to update the vegetation distribution map in real time, perform spatial clustering to generate distribution boundaries, create health status heat maps, mark abnormal area calculation ranges, and generate comprehensive analysis reports; The battery optimization management module is used to monitor power levels to determine the order of area scans, dynamically adjust task priorities and sampling density, establish a value scoring mechanism to maximize the value of data collection, retain power for safe return, and provide a mission interruption recovery mechanism.
2. The UAV real-time vegetation classification system based on a lightweight AI model according to claim 1 is characterized in that: The lightweight AI model development module is as follows: Based on one or more lightweight convolutional neural network architectures selected from the MobileNet series, EfficientNet series, ShuffleNet series, and SqueezeNet series, the model quantization technology is used to convert 32-bit floating-point weights to 8-bit integers to reduce computational complexity and memory usage by at least 50%. The model pruning technology based on sensitivity analysis is used to remove neuronal connections whose contribution to classification accuracy is below a predetermined threshold. Use TensorFlow Lite, PyTorch Mobile, or ONNX Runtime mobile inference frameworks for computational graph optimization; implement operator fusion to reduce intermediate data transmission overhead; optimize the instruction set for ARM architecture processors to achieve SIMD parallel computing; and apply computational caching mechanisms to reduce repeated calculations.
3. The UAV real-time vegetation classification system based on a lightweight AI model according to claim 1 is characterized in that: In the vegetation feature system module, vegetation features include: The spectral feature subset includes the normalized difference vegetation index, enhanced vegetation index, red edge position index, photochemical reflectance index and greenness index; the texture feature subset includes energy, contrast, correlation and entropy derived from the gray-level co-occurrence matrix, edge density distribution, and local binary pattern features; the morphological feature subset includes crown size parameters, shape complexity index, boundary irregularity, fractal dimension and its growth pattern characteristics; the spatiotemporal feature subset includes multi-phase change rate and spatial continuity index.
4. The UAV real-time vegetation classification system based on a lightweight AI model according to claim 1 is characterized in that: The feature optimization selection module is specifically as follows: The recursive feature elimination algorithm based on XGBoost is used to evaluate the importance of each feature to vegetation classification, and the contribution of each feature is evaluated by the feature importance calculation formula, which is: Importance(i)=∑jGain(j,i) / ∑j∑kGain(j,k), Where Importance(i) is the importance score of feature i, and Gain(j,i) is the gain contribution of feature i in decision tree j. Based on the descending order of feature importance, a candidate feature subset F_k = {f_1, f_2, ..., f_k} is gradually constructed, where k is the number of subset features. A five-fold cross-validation method is used to systematically test the classification performance and computational efficiency of different feature combinations on the validation set. The feature subset F_opt with the highest F1 score and lowest dimension on the validation set is selected to simplify the model complexity, reduce the amount of computation, and improve the real-time inference speed. A dynamic update mechanism for feature importance is maintained to regularly re-evaluate feature contributions based on newly collected samples to adapt to the seasonal changes in vegetation.
5. The UAV real-time vegetation classification system based on a lightweight AI model according to claim 1 is characterized in that: The model training and evaluation module is as follows: The vegetation sample datasets from the collected public datasets and self-collected datasets were stratified randomly sampled at a ratio of 8:2 to ensure that the distribution ratios of various vegetation samples in the training set and the validation set were consistent; Based on the optimal feature subset F_opt screened by the feature optimization selection module, a lightweight classification model is trained; the focalloss loss function is applied to deal with the problem of sample category imbalance. The loss function expression is: FL(pt)=-αt(1-pt)^γlog(pt) Where FL(pt) is the focal loss value, pt is the predicted probability of category t, αt is the weight factor of category t, and γ is the focus parameter; The model performance is comprehensively evaluated using metrics including confusion matrix, precision P, recall R, and F1 score, where: P = TP / (TP + FP), where P is the precision rate, TP is the true positive, and FP is the false positive; R = TP / (TP + FN), R is the recall rate, TP is the true positive, and FN is the false negative; F1 = 2·P·R / (P+R), where F1 is the F1 score, P is the precision, and R is the recall; The Adam optimizer is used for model training. The initial learning rate is set to 0.001, and the cosine annealing strategy is used to dynamically adjust the learning rate. The adjustment formula is: η_t=η_min+0.5(η_max-η_min)(1+cos(t·π / T)), Where η_t is the learning rate of the tth iteration, η_min is the minimum learning rate, η_max is the maximum learning rate, and T is the total number of iterations. The model parameters are optimized through cross-validation to achieve the best balance between prediction accuracy and inference speed.
6. The UAV real-time vegetation classification system based on a lightweight AI model according to claim 1 is characterized in that: The adaptive flight adjustment module is specifically as follows: Based on the vegetation type importance score and health status abnormality, the comprehensive value coefficient of the current scanning area is calculated; for high-value areas whose value coefficient exceeds the first preset threshold, the flight altitude is reduced to the range of 15-30 meters, the flight speed is reduced to the range of 2-5 meters / second, and the image sampling interval is reduced to 30%-50% of the standard interval through the drone control interface; for low-value areas whose value coefficient is lower than the second preset threshold, the flight altitude is increased to the range of 50-80 meters, the flight speed is increased to the range of 8-12 meters / second, and the image sampling interval is increased to 150%-200% of the standard interval; when the system detects that the probability of vegetation type boundary transition exceeds the preset threshold, the boundary tracking mode is triggered and an S-shaped or Z-shaped scanning path along the boundary is executed; and the optimal remaining flight path is dynamically planned based on the battery remaining capacity percentage, the remaining mission area and the regional value distribution.
7. The UAV real-time vegetation classification system based on a lightweight AI model according to claim 1 is characterized in that: The system performance monitoring module is specifically as follows: Build a real-time performance monitoring module that includes model inference delay, image processing frame rate, CPU / GPU utilization, memory occupancy and power consumption data; when the processing delay is continuously detected to exceed the preset threshold for a predetermined period, automatically trigger an adaptive degradation strategy, including reducing image acquisition resolution, reducing processing frame rate or switching to a lighter backup model; implement a dynamic frequency adjustment mechanism based on temperature thresholds, reduce the processor clock frequency when the system core temperature exceeds the first safety threshold, and suspend non-critical computing tasks when it exceeds the second safety threshold; automatically record image samples with classification confidence below 60% and their corresponding geographic location and environmental parameters for later model improvement; and dynamically select the optimal model configuration from the pre-configured model library based on ambient lighting conditions, temperature changes and task types.
8. The UAV real-time vegetation classification system based on a lightweight AI model according to claim 1 is characterized in that: The result mapping generation module is specifically as follows: Construct a GIS-compatible vector data layer based on the geolocation data and classification results; apply spatial clustering algorithms, including density-based DBSCAN or grid-based STING algorithms, to spatially aggregate the classification results and generate vegetation type distribution polygons with clearly defined boundaries; Based on the health status classification results and severity scores, a vegetation health status heat map using a standardized color spectrum was constructed, where different colors represent different health levels; Apply spatial anomaly detection algorithms to mark and quantify abnormal areas that deviate from the normal distribution range, calculate their precise geographical range and area; and generate multi-level comprehensive reports including vegetation type spatial distribution maps, species diversity index distribution maps, health status assessment heat maps and management recommendations based on rule engines.
9. The UAV real-time vegetation classification system based on a lightweight AI model according to claim 1 is characterized in that: The battery optimization management module is specifically as follows: The battery management system interface monitors the battery charge, discharge rate and remaining available time in real time, and triggers a priority reordering mechanism when the charge falls below a preset threshold of 30%; a dynamic programming algorithm is used to calculate and update the optimal remaining task execution sequence in real time based on the remaining charge, regional value distribution and estimated power consumption model; a regional value scoring mechanism based on multi-factor weighting is implemented, which comprehensively considers the rarity of vegetation types, the degree of abnormal health status, spatial distribution characteristics and user-defined priorities; the algorithm ensures that at least 20% of the remaining charge is used for safe return, and dynamically adjusts this safety threshold based on the current wind speed, flight altitude and distance; and a breakpoint resumption mechanism is constructed to record the precise location when the mission was interrupted, the remaining area boundaries and the quality assessment of the completed area, and automatically generate an optimized flight path when the mission is resumed to ensure the integrity and continuity of data collection.
10. An adaptive flight path adjustment method using the UAV real-time vegetation classification system according to any one of claims 1 to 9, characterized in that: The details are as follows: Based on the system configuration and initialization module, select a computing platform with an ARM architecture processor, install a multispectral camera or RGB camera with a resolution of at least 1080p, and establish a communication interface with the flight control system to configure the UAV system; A lightweight AI model trained and optimized based on the lightweight AI model development module; the model uses quantization compression and structural pruning to adapt to the resource constraints of the edge computing environment; Based on the lightweight AI model development module, real-time image data stream is collected at a predetermined frame rate through a camera; Performing preprocessing operations on the acquired image data, the preprocessing operations including spatial resolution adjustment, geometric correction, radiation correction and feature enhancement processing; Inputting the pre-processed image data into the lightweight AI model to perform forward reasoning calculations to generate a multi-dimensional classification output including vegetation type identification results, cover density estimation, and health status rating; Based on the adaptive flight adjustment module and the battery optimization management module, the value score of the current area is calculated according to the classification output and predefined decision rules, and the parameters including flight altitude, speed, heading and sampling interval are dynamically adjusted through the UAV control protocol accordingly; Based on the result mapping generation module, the classification result data and geographic coordinate information are integrated to construct a vegetation distribution map with a spatial reference system, and a comprehensive report containing quantitative analysis results and management recommendations is generated; The system configuration and initialization module serves as the starting point of the entire system. By loading an optimized lightweight AI model, it establishes a direct connection with the lightweight AI model development module. It also connects to the flight control system through the SDK interface, providing a foundation for the adaptive flight adjustment module. The real-time data processing module receives the configured camera sensor data stream, inputs the pre-processed image into the AI model for inference, and the generated classification results are simultaneously fed into the vegetation feature system module and the adaptive flight adjustment module. The standardized features extracted by the vegetation feature system module are evaluated and screened by the feature optimization selection module to form the optimal feature subsets, which are then used by the model training and evaluation module to improve the performance of the AI model; the adaptive flight adjustment module dynamically adjusts the flight parameters according to the classification results, and works with the battery optimization management module to ensure maximum sampling efficiency and battery utilization; the system performance monitoring module continuously evaluates the operating status of each component, and provides feedback to the real-time data processing module and the adaptive flight adjustment module to optimize system parameters; the result mapping generation module uses information from real-time data processing and the vegetation feature system to create and update the vegetation distribution map, and at the same time provides the adaptive flight adjustment module with regional importance assessment; the entire system forms a closed-loop feedback mechanism, in which each module supports each other and operates in coordination, realizing the efficient, intelligent and adaptive operation of the vegetation monitoring system.
Citation Information
Cited By
Feature data processing method based on edge device and related device
CN120763718A
Edge device-based feature data processing method and related device
CN120763718B
Facility tomato water stress discrimination method fusing multi-modal information and neural network
CN121544585A
Vegetation coverage index algorithm and system based on unmanned aerial vehicle
CN121564534A
Unmanned aerial vehicle navigation method and system based on vision and reinforcement learning
CN121740052A
