Unmanned aerial vehicle forest inspection target detection method and system based on improved YOLOv11 network
By improving the YOLOv11 network and combining depthwise separable convolution, multi-scale feature fusion, and adaptive loss function, the problems of difficult model deployment and insufficient adaptability to complex environments in forest patrol are solved, and efficient and accurate forest disaster detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-03
AI Technical Summary
Among existing forest patrol technologies, manual lookout tower monitoring has blind spots and is greatly affected by weather, while drone patrol has problems such as large model parameters, high computational load, difficulty in deployment, and insufficient robustness to complex environments, resulting in low efficiency and poor accuracy in forest disaster detection.
An improved YOLOv11 network is adopted, and through lightweight improvements and scene adaptation optimization, a depthwise separable convolution DSConv module, a multi-scale feature fusion SPPF module, and a spatial attention C2PSA module are introduced. An adaptive loss function is designed to improve the model's detection capability in complex environments.
It enables early, efficient, and accurate monitoring of forest disasters, reduces computational load, improves robustness to small targets and complex environments, reduces false alarm and false negative rates, and enhances detection accuracy.
Smart Images

Figure CN121789095A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of forest disaster monitoring and target detection technology, and in particular to a method and system for unmanned aerial vehicle (UAV) forest patrol target detection based on an improved YOLOv11 network. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] As a core component of the ecosystem, the safety and stability of forests are directly related to ecological security, economic development, and public safety. Forest fires and pine wilt disease are two major threats to forest resources. Forest fires are characterized by their suddenness, rapid spread, and destructive power; once out of control, they can cause large-scale forest destruction, soil erosion, and a sharp decline in biodiversity. Pine wilt disease is characterized by its wide transmission routes, long incubation period, and difficulty in control; early symptoms are often subtle, easily leading to large-scale outbreaks and causing severe ecological and economic losses. Therefore, achieving early and accurate monitoring of these two types of disasters is crucial for forest resource protection.
[0004] Existing forest patrol technologies mainly include two methods: manual lookout tower monitoring and drone patrol. Manual lookout tower monitoring involves constructing permanent towers at high points in the forest area, with patrolmen on duty 24 hours a day. Fire and diseased trees are identified by human eyes. However, this method has a limited monitoring range, is affected by terrain and has many blind spots. Early damage in valleys and dense forests is difficult to detect, the reliability of detection is poor, and it is easily affected by weather conditions. Monitoring capabilities fail in low visibility environments such as rain, snow, and fog. Furthermore, the human eye has a weak ability to identify early symptoms of pine wilt disease, resulting in a high rate of missed and false alarms.
[0005] To address this, a drone-based inspection method has been proposed, which involves mobile monitoring of forest areas via pre-set flight paths and transmitting real-time video streams back to ground stations for anomaly detection. Due to the high false negative rate, limited recognition capabilities, and strong subjectivity of human intervention, current forest disaster monitoring incorporates target detection algorithms based on convolutional neural networks. Among these, the YOLO series algorithms are widely used due to their high real-time performance and detection accuracy. While YOLOv11, as the latest generation of single-stage detection algorithms, has improved feature extraction capabilities and detection speed, it still has shortcomings when directly applied to forest inspection scenarios: firstly, the model has a large number of parameters and computational load, making it difficult to adapt to the lightweight deployment requirements of drones or edge computing devices; secondly, its detection capabilities for small-scale targets in complex forest environments, such as early fire spots and early-stage diseased trees, need to be strengthened, and its robustness to complex environments such as changes in lighting and cloud cover is insufficient. Summary of the Invention
[0006] To address the issues of low efficiency, poor accuracy, and difficulty in deploying models in existing forest patrol methods, this invention proposes a UAV forest patrol target detection method and system based on an improved YOLOv11 network. By making lightweight improvements and scene adaptation optimizations to the YOLOv11 network, early, efficient, and accurate monitoring of forest disasters can be achieved.
[0007] In a first aspect, the present invention provides a target detection method for unmanned aerial vehicle (UAV) forest patrol based on an improved YOLOv11 network.
[0008] A target detection method for UAV forest patrol based on an improved YOLOv11 network includes: The drone automatically collects images of forest areas along a preset route and transmits them back in real time. An improved YOLOv11 target detection network was used to perform target detection on real-time transmitted images, identifying and labeling forest fires and trees infected with pine wilt disease. The improved YOLOv11 target detection network includes a backbone network, a neck network, and a detection head; The backbone network consists of multiple feature extraction layers arranged sequentially. The last layer uses the SPPF module and the C2PSA module, while the remaining layers use the DS-C3K2 module to extract features from real-time transmitted images and obtain multi-scale feature maps. The neck network consists of two branches, upsampling and downsampling, which are used to perform feature fusion at the corresponding scales on multi-scale feature maps and output enhanced feature maps. The detection head uses a three-branch decoupled head, which separates the category prediction, bounding box localization, and confidence calculation in object detection into three independent network branches, which are used to output the category prediction, bounding box localization, and confidence calculation results based on the enhanced feature map.
[0009] A further technical solution is that the DS-C3K2 module includes a 1×1 convolutional layer, a split layer, multiple DS-C3k modules, and a concat layer. After the input features are unified through the 1×1 convolutional layer, they are divided into two parts along the channel dimension by the split operation. One part is input to multiple DS-C3k modules in series for deep feature extraction, and the other part retains the original features and is directly passed to the concat layer through a shortcut connection. The two parts of features are then fused through the concat operation and output.
[0010] A further technical solution is that the DS-C3k module includes multiple 1×1 convolutional layers, multiple DS-Bottleneck modules, and a Concat layer; after the input features are reduced in dimensionality by the 1×1 convolutional layers, they are processed by multiple cascaded DS-Bottleneck modules, while the original features are preserved through lateral 1×1 convolutional branches. The features output by the two branches are connected along the channel dimension through a Concat operation, and then the feature channel number is restored by a 1×1 convolutional layer and output.
[0011] In a further technical solution, the DS-Bottleneck module is composed of two DSConv modules connected in series. The first DSConv module is a 3×3 depthwise separable convolution, and the second DSConv module is a k×k large kernel depthwise separable convolution. The features output by the two DSConv modules are residually concatenated with the original input features before being output. The DSConv module includes a DW convolutional layer, a PW convolutional layer, a batch normalization layer, and an activation layer. The input features are processed by DW convolution and PWM convolution to extract depth features, and then processed by batch normalization and SiLU activation before being output.
[0012] In a further technical solution, the SPPF module aggregates the contextual information of the input feature map through multi-scale max pooling, and the C2PSA module strengthens the response of important regions in the feature map through a spatial attention mechanism, inputting attention-weighted deep features; The C2PSA module includes two PSA modules, which are used to enhance the feature representation of small targets and occluded targets; The PSA module includes an Attention module and an FFN module. The Attention module executes the attention mechanism, calculates the spatial attention weights of the feature map, outputs the weighted feature map, performs two convolutions through the FFN module after residual connection, and outputs the final feature map after residual connection.
[0013] In a further technical solution, the neck network includes an upsampling branch and an downsampling branch based on the DS-C3K2 module; In the upsampling branch, the multi-scale feature map is upsampled and then fused with the corresponding scale feature map output by the backbone network. The fused feature map is then input into the DS-C3K2 module for feature enhancement to obtain the fused multi-scale feature map. In the downsampling branch, the fused multi-scale feature map is downsampled and then fused with the feature map of the corresponding scale output by the upsampling branch. The fused feature map is then input into the DS-C3K2 module for feature enhancement to obtain the enhanced multi-scale feature map.
[0014] Secondly, the present invention provides a target detection system for unmanned aerial vehicle (UAV) forest patrol based on an improved YOLOv11 network.
[0015] A target detection system for unmanned aerial vehicle (UAV) forest patrol based on an improved YOLOv11 network includes: Drones are used to automatically collect images of forest areas along preset routes and transmit them back in real time. An improved YOLOv11 target detection network was used to detect targets in real-time transmitted images, identify and label forest fires and pine wilt disease trees; The improved YOLOv11 target detection network includes a backbone network, a neck network, and a detection head; The backbone network consists of multiple feature extraction layers arranged sequentially. The last layer uses the SPPF module and the C2PSA module, while the remaining layers use the DS-C3K2 module to extract features from real-time transmitted images and obtain multi-scale feature maps. The neck network consists of two branches, upsampling and downsampling, which are used to perform feature fusion at the corresponding scales on multi-scale feature maps and output enhanced feature maps. The detection head uses a three-branch decoupled head, which separates the category prediction, bounding box localization, and confidence calculation in object detection into three independent network branches, which are used to output the category prediction, bounding box localization, and confidence calculation results based on the enhanced feature map.
[0016] Thirdly, the present invention also provides an electronic device, comprising: a memory for storing executable instructions; and a processor for executing the executable instructions stored in the memory to implement the above-described UAV forest patrol target detection method based on the improved YOLOv11 network.
[0017] Fourthly, the present invention also provides a computer-readable storage medium storing executable instructions for causing a processor to execute the executable instructions to implement the above-described UAV forest patrol target detection method based on the improved YOLOv11 network.
[0018] Fifthly, the present invention also provides a computer program product comprising executable instructions stored in a computer-readable storage medium; wherein, when the processor of the electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the above-mentioned UAV forest patrol target detection method based on the improved YOLOv11 network is implemented.
[0019] The above one or more technical solutions have the following beneficial effects: 1. This invention proposes a target detection method and system for UAV forest patrol based on an improved YOLOv11 network. By lightweighting and optimizing the YOLOv11 network for scene adaptation, it can achieve early, efficient, and accurate monitoring of forest disasters. The lightweight improved YOLOv11 network model introduces a depthwise separable convolutional DSConv module, which reduces the number of parameters while maintaining performance and effectively reduces computational cost. Furthermore, the combination of multi-scale feature fusion from the SPPF module and the attention mechanism from the C2PSA module further enhances the detection of small targets and targets in complex environments. To enhance detection capabilities, the SPPF module aggregates contextual information through multi-scale pooling to ensure stable detection of targets of different sizes. The C2PSA module strengthens the response of key regions through spatial attention weights. The introduced DS-C3K2 module enhances gradient flow through cross-layer connections and feature fusion, improving the model's sensitivity to small targets. This results in improved accuracy in identifying early, small-scale forest fires (such as faint smoke points) and small-scale pine wilt disease trees (such as single diseased trees), as well as enhanced adaptability to complex forest environments (such as changes in light intensity, cloud cover, and seasonal changes).
[0020] 2. Based on the lightweight improved YOLOv11 network, this invention also designs an improved loss function. This function dynamically adjusts scale-related weights, assigning higher loss weights to small targets, enabling the model to focus on learning difficult samples, reducing the false negative rate of small targets, and improving the detection sensitivity of small targets in early-stage disasters. It introduces occlusion perception weights, effectively reducing the false positive rate of targets in scenarios such as cloud cover, dense forest cover, etc., and reducing the false positive rate of diseased trees, while improving recall and strengthening the ability to identify occluded targets in complex forest environments. It uses a sliding adjustment factor to dynamically distinguish between easy and difficult samples, avoiding the gradient of easy samples overwhelming difficult samples, solving the imbalance problem between early-stage disaster targets (difficult samples) and the background and mature trees (easy samples) in forest patrols, and improving the model's convergence accuracy. This loss function can synergize with the multi-scale feature fusion of the SPPF module and the spatial attention mechanism of the C2PSA module in the model. The classification loss component highlights the loss contribution of small targets, and the regression loss component, combined with CIoU, improves the localization accuracy of occluded targets, further amplifying the network's adaptability to complex forest patrol scenarios.
[0021] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0022] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0023] Figure 1This is a schematic diagram of the lightweight improved YOLOv11 network in an embodiment of the present invention; Figure 2 This is a schematic diagram of the Conv module in an embodiment of the present invention; Figure 3 This is a schematic diagram of the DS-C3K2 module in an embodiment of the present invention; Figure 4 This is a schematic diagram of the SPPF module in an embodiment of the present invention; Figure 5 This is a schematic diagram of the C2PSA module in an embodiment of the present invention; Figure 6 This is a schematic diagram of the detection head in an embodiment of the present invention; Figure 7 This is a PR curve diagram of network detection in an embodiment of the present invention; Figure 8 This is a normalized confusion matrix diagram for network detection in an embodiment of the present invention. Detailed Implementation
[0024] It should be noted that the following detailed descriptions are exemplary and are intended only to describe specific embodiments and to provide further explanation of the invention, and are not intended to limit the scope of exemplary embodiments of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0025] Example 1 To address the issues of low accuracy in identifying early-stage, small-scale forest fires (such as faint smoke points) and small-scale pine wilt disease trees (such as single diseased trees) by existing target detection algorithms, as well as poor adaptability to complex forest environments (such as changes in light intensity, cloud cover, and seasonal changes), leading to high false alarm rates during forest patrols, this embodiment proposes a UAV forest patrol target detection method based on an improved YOLOv11 network. The method involves lightweight improvements to the cutting-edge YOLOv11 network model and training it on a large number of open-source forest fire and pine wilt disease datasets. This enables the model to accurately identify forest fires and diseased trees, achieving high-precision detection of small targets and exhibiting high robustness in target identification within complex forest environments.
[0026] The target detection method for UAV forest patrol based on the improved YOLOv11 network proposed in this embodiment includes the following steps: Step S1: The drone automatically collects images of the forest area along the preset route and transmits them back in real time.
[0027] Specifically, before the inspection, a pre-set flight path for the drone is planned to ensure coverage of the target forest area. This flight path is usually a regular bow shape or grid pattern. The drone flies automatically along the pre-set flight path and transmits real-time video streams to the ground station via a radio image transmission system through its onboard high-definition camera. The target detection network on the ground station then performs automatic detection and identification.
[0028] Step S2: Use the improved YOLOv11 target detection network to perform target detection on the real-time transmitted images, identify and label forest fires and pine wilt disease trees.
[0029] To achieve accurate identification of small targets and early-stage disasters, this embodiment makes lightweight improvements to the YOLOv11 network. The improved YOLOv11 target detection network is as follows: Figure 1 As shown, it includes a backbone network, a neck network, and a detection head, wherein: (1) The backbone network serves as the basic feature extractor for the object detection model. It consists of multiple feature extraction layers arranged sequentially. The last layer uses SPPF and C2PSA modules, while the remaining layers use DS-C3K2 modules. It is responsible for extracting features from real-time transmitted images, extracting multi-level and multi-scale feature maps. The extracted feature maps are then input into the subsequent Neck and Head for object localization and classification. The backbone network adopts a progressive downsampling approach, gradually reducing the resolution and increasing the receptive field through convolution and pooling operations, while also increasing the number of channels to capture richer semantic information.
[0030] Specifically, the backbone network has Conv modules between multiple feature extraction layers, such as... Figure 2 As shown, the Conv module combines PyTorch's built-in Conv2d, BN, and SiLU layers. The Conv2d layer is a two-dimensional convolutional layer that automatically calculates the kernel size k, stride s, and padding p for an input image with c1 channels, ultimately outputting a feature map with c2 channels. The BatchNorm2d layer, or BN layer, is a Batch Normalization layer that normalizes each batch of input data (mean 0, variance 1), mitigating internal covariate shift, accelerating model convergence, and improving training stability. The SiLU layer is the default activation function in YOLOv11, a combination of Sigmoid and ReLU, with the following formula: (1.1) Where σ(x) is the sigmoid function, and its formula is: (1.2) In the above formula, This represents the input features.
[0031] Furthermore, the lightweight improved YOLOv11 network introduces depthwise separable convolution (DSConv) to replace the traditional large convolution kernel convolution operation, which significantly reduces parameters and computational complexity without sacrificing performance, reducing the computational cost by 20% and achieving lightweight and efficiency optimization.
[0032] like Figure 3 As shown, this embodiment introduces a DS-C3K2 module into its multi-layer feature extraction layer. This module includes a 1×1 convolutional layer, a split layer, multiple DS-C3K modules, and a concat layer. Compared to traditional C3K2 and CS-S3K2 modules, this module achieves a more lightweight design. Specifically, the first 1×1 convolutional layer performs preliminary channel adjustment and feature encoding on the input features. After the input features are unified through the 1×1 convolutional layer, a split operation is performed to divide them into two parts along the channel dimension, generating two sub-feature maps. The split operation is used for channel segmentation of the feature maps to achieve multi-branch feature fusion. The two branches after division are used for feature extraction independently. One part is input to multiple DS-C3K modules in series for deep feature extraction, while the other part retains the original features and is directly passed to the concat layer through a shortcut connection. Since each branch is a complete DS-C3K module, the feature extraction process is more efficient. The k-module, a parallel structure, allows the network to capture different types of feature patterns simultaneously. Since the parameters of the two branches are learned independently, they can be specialized to different feature representations, thus enhancing the model's representational ability. Compared to the traditional, deeper stacked DS-C3k, this parallel structure increases model capacity while having a shorter computation path and more efficient training. Next, the two feature sets are concatenated along the channel dimension using a Concat operation, fusing the different feature information learned by the two branches and enhancing gradient flow. Finally, a 1×1 convolution is used to perform the final integration and nonlinear transformation on the concatenated features, outputting the final feature map.
[0033] The DS-C3k module inherits the standard CSP-C3 structure from YOLOv5, including multiple 1×1 convolutional layers, multiple DS-Bottleneck modules, and a Concat layer. Specifically, the input features are dimensionality-reduced by 1×1 convolutional layers to decrease the number of feature channels, thereby reducing the amount of data required for subsequent DS-Bottleneck processing. Then, multiple cascaded DS-Bottleneck modules process the data, while lateral 1×1 convolutional branches preserve the original features. The stacking of multiple Bottlenecks allows the network to learn more complex and deeper features while maintaining low computational cost. The features output from the two branches are residually connected through a Concat operation, i.e., the input before 1×1 convolutional dimensionality reduction and the features after processing by multiple Bottlenecks are concatenated along the channel dimension, effectively mitigating the gradient vanishing problem in deep networks and ensuring effective gradient backpropagation. Finally, a 1×1 convolutional layer restores the number of feature channels and outputs the result. This design retains the cross-channel branches of the CSP structure while integrating a lightweight bottleneck with separable depth.
[0034] The aforementioned DS-Bottleneck module serves as a core building block, consisting of two DSConv modules cascaded together. The first DSConv module is a 3×3 depthwise separable convolution, and the second DSConv module is a k×k large kernel depthwise separable convolution. The features output from the two DSConv modules are residually concatenated with the original input features, and the output can be represented as: (1.3) The aforementioned DSConv module includes DW convolutional layers (i.e., standard depth separable convolutional layers), PW convolutional layers, batch normalization layers, and activation layers. Input features are processed by DW and PWM convolutions to extract depth features, which are then processed by batch normalization and SiLU activation before being output. The formula is as follows: (1.4) In the DSConv module, DWConv (i.e., DW convolutional layers, k×k being the kernel size) serves as the first part of the depthwise separable convolution. Each kernel in DWConv is responsible for only one input channel, significantly reducing computation and parameters. PWConv (i.e., PW convolutional layers), as the second part of the depthwise separable convolution, uses 1×1 convolutions to fuse information from different channels, responsible for creating new feature maps. Through this design, the computational cost of a standard k×k convolution is approximately k² times that of a combination of DWConv and PWConv. Therefore, the design of the DS-Bottleneck module achieves more efficient lightweighting.
[0035] In summary, the DSC3K2 module proposed in this embodiment extensively utilizes depthwise separable convolution (DSConv), achieving extreme lightweight design with significantly fewer parameters and computational cost compared to equivalent modules using standard convolutions. The parallel branching structure within the module possesses powerful feature extraction capabilities; two independent branches can capture rich and diverse features, enhancing the model's representational ability. Residual connections within the module ensure training stability, mitigate gradient vanishing, and allow the network to be trained deeper more easily. This DSC3K2 module design improves performance by increasing network width (i.e., parallel branches) without excessively increasing computational complexity, achieving an effective balance between efficiency and performance.
[0036] In addition, the final feature extraction layer uses the SPPF module and the C2PSA module, such as Figure 4 As shown, the SPPF module is a fast operation of spatial pyramid pooling. This module aggregates the contextual information of the input feature map through multi-scale max pooling, that is, it gathers features from different regions of the image at different scales, which can improve the network's ability to capture objects of different sizes (especially small objects). Specifically, SPFF uses multiple max pooling operations with different kernel sizes to aggregate multi-scale contextual information, ensuring that even very small objects can be recognized by the model because it effectively combines information from different resolutions. By introducing the SPFF module, YOLOv11 can maintain real-time speed while enhancing its ability to detect objects at multiple scales.
[0037] The C2PSA module is a cross-stage partial spatial attention module. This module introduces an attention mechanism, emphasizing spatial correlations in feature maps, strengthening the responses of important regions in the feature maps, and outputting attention-weighted deep features. This improves the model's attention to important regions in the image, such as small or partially occluded objects. Figure 5 As shown, the C2PSA module comprises two PSA modules, namely partial spatial attention modules, which operate on different branches of the feature map before concatenation, enhancing the feature representation of small and occluded targets. This setup ensures the model focuses on spatial information while maintaining a balance between computational cost and detection accuracy. By applying spatial attention to the extracted features, the C2PSA module refines the model's ability to selectively focus on regions of interest, resulting in superior performance of YOLOv11 in scenarios requiring precise detection of fine object details.
[0038] Furthermore, the PSA module includes an Attention module and an FFN module. The Attention module executes the attention mechanism, calculates the spatial attention weights of the feature map, outputs a weighted feature map, and then performs two convolutions through the FFN module after residual connections, followed by another residual connection before output. Specifically, in the Attention module, the following are extracted: Q (Query) represents the query vector, used to calculate similarity with the key vector K at other locations; K (Key) represents the key vector, used to calculate the attention weights with the query vector Q. K and Q have the same dimension, are generated through the same convolutional layer, and are obtained by splitting Q simultaneously; V (Value) represents the value vector, storing the feature information to be aggregated. By calculating the spatial attention weights of the feature map, the response of important regions can be further enhanced.
[0039] (2) The Neck network includes two branches, upsampling and downsampling, which are used to perform feature fusion at the corresponding scale on the multi-level features (i.e. feature maps of different scales) extracted by the Backbone. Through multi-scale feature fusion, the model's ability to detect small and large targets is enhanced, and the enhanced feature map is finally output. At the same time, the enhanced multi-scale feature map output by the Neck is directly input into the subsequent decoupled detection head to handle tasks such as classification and regression.
[0040] like Figure 1 As shown, the neck network includes an upsampling branch and a downsampling branch based on the DS-C3K2 module. In the upsampling branch, the multi-scale feature map is upsampled and then fused with the corresponding scale feature map output from the backbone network. The fused feature map is then input into the DS-C3K2 module for feature enhancement, resulting in a fused multi-scale feature map. In the downsampling branch, the fused multi-scale feature map is downsampled and then fused with the corresponding scale feature map output from the upsampling branch. The fused feature map is then input into the DS-C3K2 module for feature enhancement, resulting in an enhanced multi-scale feature map.
[0041] (3) The detection head employs a three-branch decoupled head to complete tasks such as classification and regression. The classification task is to predict the probability of the target class contained in each anchor point (or each grid on the feature map in Anchor-Free mode); the regression task is to predict the offset of the target bounding box, i.e., the offset from the reference point in the left, top, right, and bottom directions. The classification and regression branches are calculated independently to avoid task conflicts. Preferably, an additional confidence calculation branch is added to further optimize the accuracy of classification and regression. Specifically, the class prediction, bounding box localization, and confidence calculation in object detection are separated into three network branches, used to output the results of class prediction, bounding box localization, and confidence calculation based on the enhanced feature map.
[0042] like Figure 6As shown, the YOLOv11 detection head decouples the detection and classification convolutions. One convolutional branch is for regression bounding boxes, with the feature map channel of the bounding box being 4*reg_max. reg_max defines the discrete distribution range of the regression branch output. By modeling the ambiguity of the bounding box through discrete distribution, such as occlusion or blurred boundaries, it replaces the traditional Dirac distribution, thereby improving the detection robustness in complex scenes. It also includes a classification branch, which outputs the predicted number of categories. The classification uses depthwise separable convolutions instead of regular convolutions to reduce computational cost.
[0043] By combining the aforementioned drone automatic cruise with lightweight algorithms, the drone can quickly collect images along a preset route and transmit them back to the processing terminal in real time. The algorithm automatically completes target detection, which can effectively reduce inspection costs and improve inspection efficiency, and is especially suitable for daily monitoring of large-scale, complex terrain forest areas.
[0044] As a further implementation, the lightweight improved YOLOv11 network proposed in this embodiment serves as the core detection engine. Through modular design (such as DS-C3K2, SPPF, and C2PSA modules), it significantly improves inspection efficiency and accuracy. Furthermore, considering that target detection tasks still face complex scenarios such as scale variations, occlusion, and imbalance between easy and difficult samples, such as the missed detection of early fire points (small targets) and dense diseased trees (occluded targets) in a forest environment, this embodiment also improves the YOLOv11 loss function to further optimize network model performance. A corresponding loss function is introduced, which can dynamically adjust the loss weights to enhance the model's adaptability to multi-scale targets, occluded scenarios, and easy and difficult samples.
[0045] The loss function proposed in this embodiment is composed of a classification loss component and a regression loss component, and can be expressed as: ; ; ; in, and These are dynamic weighting coefficients that can be adaptively adjusted based on the target size and degree of occlusion. For classification loss components, The target class probability predicted by the model. For scale-related weights, Scale represents the relative scale (i.e., normalized value) of the target bounding box; smaller targets correspond to larger scales. ; This is a sliding adjustment factor that is dynamically updated with each training round. The initial value is 2, and it automatically increases to 5 as the number of difficult samples increases. For regression loss components, CIoU (Complete IoU) loss considers the overlap area, center point distance, and aspect ratio; The occlusion perception weights can be represented as: , Indicates the degree of target occlusion (which can be calculated through bounding box integrity); This is a balancing coefficient that can be dynamically set based on the occlusion ratio of the training set.
[0046] The loss function proposed in this embodiment is an adaptive loss function designed for the target detection task. It achieves dynamic adjustment through sliding parameters to ensure that the loss function maintains high sensitivity in different scenarios. Its core principle is to dynamically balance the contribution of difficult and easy samples through the sliding weight mechanism and enhance the model's sensitivity to scale changes and occlusion. Compared with traditional loss functions such as cross-entropy loss or IoU loss, which often cause the gradient of difficult samples (such as small targets or occluded targets) to be submerged by easy samples due to fixed weights when dealing with complex scenarios, thereby reducing the model's convergence accuracy, the loss function proposed in this embodiment solves this problem through the following mechanisms: (1) Scale-adaptive sliding window: Based on the scale information of the target bounding box, the loss weight is dynamically calculated. Smaller targets or partially occluded targets will be given higher weights, forcing the model to focus on learning difficult samples; (2) Difficult and easy sample balancer: A difficult sample mining strategy is introduced. Difficult and easy samples are distinguished by sliding thresholds, and their loss ratios are adjusted to avoid the model overfitting easy samples; (3) Gradient smoothing mechanism: The moving average technique is used to smooth the loss gradient, reduce training oscillations, and improve the model's stability in complex environments.
[0047] In the lightweight improved YOLOv11 network model proposed in this embodiment, the aforementioned loss function is integrated into the decoupled detection head, replacing the original loss function (cross-entropy loss or DIoU loss). This complements YOLOv11's multi-scale feature fusion (such as the SPPF module) and attention mechanism (such as the C2PSA module), jointly enhancing the detection capabilities of small and occluded targets. Specifically, after the classification convolutional layer, the classification component receives the predicted probability output and highlights the loss contribution of small targets (such as early fire points) through scale weights. This, combined with the spatial attention mechanism of the C2PSA module, allows the model to more accurately focus on key regions. After the regression convolutional layer outputs bounding box parameters, the regression component combines CIoU calculation and introduces occlusion weights (SlideMask). This design, complementary to the multi-scale pooling feature fusion of the SPPF module, improves the localization accuracy of occluded targets (such as diseased trees in dense forests). Based on this design, it enables applications suitable for complex scenarios with varying scales and frequent occlusion in forest patrols.
[0048] In summary, the lightweight improved YOLOv11 algorithm achieves automated and high-precision target detection. Its core improvements include the introduction of the depthwise separable convolution DSConv module, which reduces the number of parameters while maintaining performance and effectively reduces the amount of computation. In addition, the design of multi-scale feature fusion such as the SPPF module and attention mechanism such as the C2PSA module further enhances the detection capability of small targets and complex environments.
[0049] like Figure 7 As shown in the PR curve obtained from quantization, its average detection accuracy (mAP) can reach 89.7%. From a structural analysis perspective, the SPPF module aggregates contextual information through multi-scale pooling to ensure stable detection of targets of different sizes; the C2PSA module strengthens the response of key regions through spatial attention weights; and the DS-C3K2 module enhances gradient flow and improves the model's sensitivity to small targets through cross-layer connections and feature fusion. Through these designs, the model can reduce the false alarm rate in complex environments and small target detection scenarios, such as... Figure 8 As shown in the normalized confusion matrix diagram, the false alarm rate for Fire is 4%, and the false alarm rate for bad_tree is 14%, with low false negative rates, thus validating the robustness of the model.
[0050] Furthermore, the loss function introduced in this embodiment can directly address the core challenges in target detection, including: improved adaptability to scale changes: through scale weights, the model's sensitivity to small targets, such as initial fire points occupying less than 0.1% of the pixel area, is effectively improved. In testing, the false negative rate for small targets decreased from 15% of the traditional loss to 4%, which is consistent with the high accuracy (mAP 89.7%) shown in the PR curve of this solution; enhanced robustness to occlusion scenarios: the occlusion weight SlideMask effectively reduces the false positive rate of partially occluded targets, such as diseased trees obscured by clouds and fog. In the confusion matrix, the false positive rate of diseased trees (bad_tree) is optimized from 20% to 14%, and the recall rate is improved to 85%; optimized training efficiency and stability: the gradient smoothing mechanism reduces training oscillations and accelerates the convergence speed. Data from the key performance monitoring panel shows that the smoothness of the loss curve is improved, and it can adapt to multi-seasonal forest environment changes without additional parameter tuning.
[0051] Example 2 This embodiment proposes a drone-based forest patrol target detection system based on an improved YOLOv11 network, including: Drones are used to automatically collect images of forest areas along preset routes and transmit them back in real time. An improved YOLOv11 target detection network is used to detect targets in real-time transmitted images, identifying and labeling forest fires and trees infected with pine wilt disease. This improved YOLOv11 target detection network can be deployed on drones or edge computing devices that communicate with drones, meeting the requirements for lightweight deployment.
[0052] The improved YOLOv11 target detection network includes a backbone network, a neck network, and a detection head, specifically designed as follows: The backbone network consists of multiple feature extraction layers arranged sequentially. The last layer uses the SPPF module and the C2PSA module, while the remaining layers use the DS-C3K2 module to extract features from real-time transmitted images and obtain multi-scale feature maps. The neck network consists of two branches, upsampling and downsampling, which are used to perform feature fusion at the corresponding scales on multi-scale feature maps and output enhanced feature maps. The detection head uses a three-branch decoupled head, which separates the category prediction, bounding box localization, and confidence calculation in object detection into three independent network branches, which are used to output the category prediction, bounding box localization, and confidence calculation results based on the enhanced feature map.
[0053] Example 3 This embodiment provides an electronic device, including: a memory for storing executable instructions; and a processor for executing the executable instructions stored in the memory to implement the method provided in this embodiment.
[0054] Example 4 This embodiment also provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, will cause the processor to execute the method described above in this embodiment.
[0055] Example 5 This embodiment provides a computer program product including executable instructions, which are computer instructions; the executable instructions are stored in a computer-readable storage medium. When the processor of an electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the electronic device performs the method described in this embodiment.
[0056] The steps and methods involved in Embodiments 2 to 5 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.
[0057] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.
[0058] The above description is only a preferred embodiment of the present invention. Although the specific implementation of the present invention has been described in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative effort are still within the scope of protection of the present invention.
Claims
1. A target detection method for unmanned aerial vehicle (UAV) forest patrol based on an improved YOLOv11 network, characterized in that, include: The drone automatically collects images of forest areas along a preset route and transmits them back in real time. An improved YOLOv11 target detection network was used to perform target detection on real-time transmitted images, identifying and labeling forest fires and trees infected with pine wilt disease. The improved YOLOv11 target detection network includes a backbone network, a neck network, and a detection head; The backbone network consists of multiple feature extraction layers arranged sequentially. The last layer uses the SPPF module and the C2PSA module, while the remaining layers use the DS-C3K2 module to extract features from real-time transmitted images and obtain multi-scale feature maps. The neck network consists of two branches, upsampling and downsampling, which are used to perform feature fusion at the corresponding scales on multi-scale feature maps and output enhanced feature maps. The detection head uses a three-branch decoupled head, which separates the category prediction, bounding box localization, and confidence calculation in object detection into three independent network branches, which are used to output the category prediction, bounding box localization, and confidence calculation results based on the enhanced feature map.
2. The UAV forest patrol target detection method based on an improved YOLOv11 network as described in claim 1, characterized in that, The DS-C3K2 module includes a 1×1 convolutional layer, a split layer, multiple DS-C3k modules, and a concat layer. After the input features are unified through the 1×1 convolutional layer, they are divided into two parts along the channel dimension by the split operation. One part is input to multiple DS-C3k modules in series for deep feature extraction, and the other part retains the original features and is directly passed to the concat layer through a shortcut connection. The two parts of features are then fused by the concat operation and output.
3. The UAV forest patrol target detection method based on the improved YOLOv11 network as described in claim 2, characterized in that, The DS-C3k module includes multiple 1×1 convolutional layers, multiple DS-Bottleneck modules, and a Concat layer. After the input features are reduced in dimensionality by the 1×1 convolutional layers, they are processed by multiple cascaded DS-Bottleneck modules. At the same time, the original features are preserved through lateral 1×1 convolutional branches. The features output by the two branches are connected along the channel dimension through a Concat operation, and then the feature channel number is restored by a 1×1 convolutional layer and output.
4. The UAV forest patrol target detection method based on the improved YOLOv11 network as described in claim 3, characterized in that, The DS-Bottleneck module consists of two DSConv modules connected in series. The first DSConv module is a 3×3 depthwise separable convolution, and the second DSConv module is a k×k large kernel depthwise separable convolution. The features output by the two DSConv modules are residually concatenated with the original input features before being output. The DSConv module includes a DW convolutional layer, a PW convolutional layer, a batch normalization layer, and an activation layer. The input features are processed by DW convolution and PWM convolution to extract depth features, and then processed by batch normalization and SiLU activation before being output.
5. The UAV forest patrol target detection method based on the improved YOLOv11 network as described in claim 1, characterized in that, The SPPF module aggregates the contextual information of the input feature map through multi-scale max pooling, and the C2PSA module strengthens the response of important regions in the feature map through spatial attention mechanism, and inputs deep features after attention weighting. The C2PSA module includes two PSA modules, which are used to enhance the feature representation of small targets and occluded targets; The PSA module includes an Attention module and an FFN module. The Attention module executes the attention mechanism, calculates the spatial attention weights of the feature map, outputs the weighted feature map, performs two convolutions through the FFN module after residual connection, and outputs the final feature map after residual connection.
6. The UAV forest patrol target detection method based on the improved YOLOv11 network as described in claim 1, characterized in that, The neck network includes an upsampling branch and a downsampling branch based on the DS-C3K2 module; In the upsampling branch, the multi-scale feature map is upsampled and then fused with the corresponding scale feature map output by the backbone network. The fused feature map is then input into the DS-C3K2 module for feature enhancement to obtain the fused multi-scale feature map. In the downsampling branch, the fused multi-scale feature map is downsampled and then fused with the feature map of the corresponding scale output by the upsampling branch. The fused feature map is then input into the DS-C3K2 module for feature enhancement to obtain the enhanced multi-scale feature map.
7. A target detection system for unmanned aerial vehicle (UAV) forest patrol based on an improved YOLOv11 network, characterized in that, include: Drones are used to automatically collect images of forest areas along preset routes and transmit them back in real time. An improved YOLOv11 target detection network was used to detect targets in real-time transmitted images, identify and label forest fires and pine wilt disease trees; The improved YOLOv11 target detection network includes a backbone network, a neck network, and a detection head; The backbone network consists of multiple feature extraction layers arranged sequentially. The last layer uses the SPPF module and the C2PSA module, while the remaining layers use the DS-C3K2 module to extract features from real-time transmitted images and obtain multi-scale feature maps. The neck network consists of two branches, upsampling and downsampling, which are used to perform feature fusion at the corresponding scales on multi-scale feature maps and output enhanced feature maps. The detection head uses a three-branch decoupled head, which separates the category prediction, bounding box localization, and confidence calculation in object detection into three independent network branches, which are used to output the category prediction, bounding box localization, and confidence calculation results based on the enhanced feature map.
8. An electronic device, characterized in that, include: Memory, used to store executable instructions; The processor, when executing the executable instructions stored in the memory, implements the UAV forest patrol target detection method based on the improved YOLOv11 network as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The device stores executable instructions that, when executed by a processor, implement the UAV forest patrol target detection method based on an improved YOLOv11 network as described in any one of claims 1-6.
10. A computer program product, characterized in that, The computer program product includes executable instructions stored in a computer-readable storage medium; When the processor of the electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, it implements the UAV forest patrol target detection method based on the improved YOLOv11 network as described in any one of claims 1-6.
Citation Information
Cited By
A method and system for detecting forest vegetation diseases and pests based on unmanned aerial vehicles (UAVs)
CN122313339A