Crop pest monitoring and intelligent spraying control method based on deep learning

Through the improved YOLOv5 model and fuzzy logic control algorithm, combined with the cooperation between drones and ground robots, high-precision monitoring and intelligent spraying of crop pests are achieved, solving the problems of high labor costs, low detection accuracy and inaccurate spraying in traditional methods, and improving the intelligence level of pest control.

CN120279442AInactive Publication Date: 2025-07-08JIANGSU COLLEGE OF NURSING
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510336809.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-07-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional pest monitoring methods have problems such as high labor costs, low detection accuracy, slow response speed and low spray accuracy. The existing deep learning models have insufficient detection accuracy under different farmland environments and lighting conditions, and intelligent spraying equipment lacks adaptive adjustment capabilities.

Method used

The improved YOLOv5 model is used to combine multispectral cameras and environmental sensors for pest identification to generate pest density heat maps, and the spraying device is adjusted through a fuzzy logic control algorithm and a PID controller, and the drone and ground robot work together to achieve accurate spraying and intelligent decision-making.

Benefits of technology

It improves the accuracy of pest detection and spraying accuracy, reduces pesticide waste and environmental pollution, and improves the intelligence level of pest control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279442A_ABST
    Figure CN120279442A_ABST
Patent Text Reader

Abstract

A crop pest monitoring and intelligent spraying control method based on deep learning is characterized by comprising the following steps that farmland images and environment data are collected in real time through a multispectral camera and an environment sensor, and the environment data comprise the temperature and humidity, the illumination intensity and the wind speed; performing pest detection on the image based on an improved YOLOv5 model, filtering a redundant detection frame by adopting a non-maximum suppression (NMS) algorithm, and dynamically adjusting a detection confidence threshold; generating a pest density thermodynamic diagram according to a detection result, and calculating a spraying priority through a fuzzy logic control algorithm in combination with environmental parameters; the flow and the direction of the spraying device are dynamically adjusted through a PID controller, and PID parameters are adaptively adjusted according to the real-time wind speed and the target coverage rate; data are collected through an unmanned aerial vehicle and an environment sensor, pest recognition is conducted through an improved YOLOv5 model, and precise spraying and intelligent decision making are achieved in combination with a fuzzy control algorithm and a path optimization technology, so that the intelligent level of pest control is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural intelligence technology, and particularly to a method for monitoring crop pests and intelligent spraying control based on deep learning, which combines computer vision, environmental perception and automatic control technologies to achieve accurate pest identification, optimized spraying decision-making and efficient utilization of pesticides. Background Art

[0002] The prevention and control of crop pests is an important link in ensuring agricultural production. Traditional pest monitoring methods mainly rely on manual observation and statistics, and have the following problems:

[0003] High labor cost: The farmland area is vast, and manual inspection is time-consuming and laborious, making it difficult to achieve large-scale pest monitoring. Low detection accuracy: Affected by human factors, the judgment criteria of different personnel are inconsistent, resulting in large monitoring errors. Slow response speed: The outbreak of pests is sudden, and manual monitoring often fails to detect and handle them in time, which may lead to an increase in crop losses. Low spraying accuracy: Currently, most spraying methods adopt a full-coverage spraying mode, resulting in pesticide waste, environmental pollution and enhanced drug resistance.

[0004] In recent years, pest detection technologies based on computer vision and deep learning have gradually developed. Object detection algorithms such as YOLO and Faster R-CNN have been used for automatic pest identification. However, traditional detection models still have some limitations:

[0005] Insufficient model generalization ability: Different farmland environments, lighting conditions and crop varieties will affect the detection accuracy.

[0006] Inaccurate pest density assessment: Existing methods only provide object detection frames, lacking the spatial distribution information of pest density.

[0007] Insufficient intelligent spraying technology: Spraying equipment generally lacks intelligent control and can only spray at a fixed rate, unable to adjust adaptively according to pest density.

[0008] To solve the above problems, the present invention proposes a method for monitoring crop pests and intelligent spraying control based on deep learning. Data is collected through drones and environmental sensors, an improved YOLOv5 model is used for pest identification, and combined with fuzzy control algorithms and path optimization technologies to achieve precise spraying and intelligent decision-making, thereby improving the intelligent level of pest control. Summary of the Invention

[0009] (1) Technical Problems to be Solved

[0010] In view of the deficiencies of the prior art, the present invention provides a method for monitoring crop pests and intelligent spraying control based on deep learning.

[0011] (2) Technical Solutions

[0012] To achieve the above object, the present invention provides the following technical solutions: A method for monitoring crop pests and intelligent spraying control based on deep learning, comprising the following steps:

[0013] Real-time collect farmland images and environmental data through a multispectral camera and an environmental sensor. The image resolution is 1920×1080, and the environmental data includes temperature and humidity, light intensity, and wind speed;

[0014] Based on the improved YOLOv5 model, detect pests in the image, and use the non-maximum suppression (NMS) algorithm to filter redundant detection frames. The NMS threshold is set to 0.5, and the detection confidence threshold is dynamically adjusted;

[0015] Generate a pest density heat map according to the detection results, and calculate the spraying priority through a fuzzy logic control algorithm in combination with environmental parameters;

[0016] Dynamically adjust the flow rate and direction of the spraying device through a PID controller. The PID parameters are adaptively adjusted according to the real-time wind speed and the target coverage rate. The formula is:

[0017]

[0018] Where e(t) is the deviation between the set coverage rate and the actual one, K p , K i , K d Initialized by the particle swarm optimization algorithm.

[0019] Preferably, the multispectral image preprocessing method in step S1 includes:

[0020] Use Gaussian filtering to eliminate noise. The filter kernel function is:

[0021]

[0022] Perform histogram equalization processing on the image to enhance the contrast between pests and the background;

[0023] Correct image distortion through perspective transformation. The transformation matrix is obtained by pre-calibrating a calibration board.

[0024] Preferably, the improved YOLOv5 model in step S2 includes:

[0025] Embed the SENet attention module in the Backbone, and calculate the channel weights as:

[0026] s = σ(W2δ(W1GAP(F)))

[0027] Where F is the feature map, GAP is global average pooling, and W1, W2 are the weights of the fully connected layers;

[0028] The loss function uses CIoU Loss, and the formula is:

[0029]

[0030] where ρ is the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box, c is the diagonal length of the smallest enclosing box, and v is the measure of aspect ratio consistency;

[0031] The classification branch uses Focal Loss to solve the problem of class imbalance, and the formula is:

[0032]

[0033] where α t = 0.25 and γ = 2.

[0034] Preferably, the YOLOv5 model initializes the weights through transfer learning, specifically:

[0035] Pre-train the Backbone part on the ImageNet dataset until convergence;

[0036] Adopt a mixed data augmentation strategy, including random rotation (±30°), HSV color space perturbation (H±30, S±0.5, V±0.5), and MixUp data mixing. The mixing formula is:

[0037] x mix = λx i + (1 - λ)x j ,y mix = λy i + (1 - λ)y j

[0038] where λ ~ Beta(0.4, 0.6).

[0039] Preferably, the method for adjusting the dynamic confidence threshold is:

[0040] Statistically calculate the mean μ and standard deviation σ of the pest density within the past 24 hours, and the sliding window size is 1 hour;

[0041] Set the threshold T = 0.7 - 0.3 × sigmoid((d - μ) / σ) according to the current density d to ensure a reduced missed detection rate in high-density areas.

[0042] Preferably, the fuzzy logic control algorithm specifically includes:

[0043] Define the input variables of pest density (low, medium, high) and wind speed (weak, medium, strong), and the output variable is the spraying intensity (off, low, medium, high);

[0044] Build a fuzzy rule base, such as "IF the density is high AND the wind speed is weak THEN the spraying intensity is high";

[0045] Use the centroid method for defuzzification to output an accurate control quantity.

[0046] Preferably, the spraying path planning is optimized by the A* algorithm:

[0047] Grid the farmland into 10cm×10cm units, and mark obstacles as non-passable areas;

[0048] Define the cost function f(n) = g(n) + h(n), where g(n) is the actual movement cost and h(n) is the Manhattan distance to the target point;

[0049] Dynamically update the path to avoid repeated spraying, and increase the cost of the sprayed area by 50%.

[0050] Preferably, it further includes a multi-device collaboration mechanism:

[0051] The drone and the ground robot are networked through LoRa, and the communication frequency is 868MHz;

[0052] Use the Hungarian algorithm to allocate detection tasks, and the objective function is to minimize the total movement distance:

[0053]

[0054] where c ij is the Euclidean distance from device i to area j.

[0055] Preferably, the system includes a self-calibration module:

[0056] Automatically take an image of the standard test board at 3 am every day and calculate the detection accuracy

[0057]

[0058] When Acc < 90% lasts for 3 days, trigger online fine-tuning of the model, and set the learning rate to 1 / 10 of the initial value;

[0059] Adopt an active learning strategy to screen high-uncertainty samples (entropy H(p) > 1.2) and add them to the training set.

[0060] Preferably, the hardware deployment plan is:

[0061] Use NVIDIA Jetson AGX Xavier as the edge computing node, with a power consumption of less than 30W;

[0062] The spraying mechanism is equipped with piezoelectric nozzles, with a response time < 50 ms and a flow control accuracy of ±2%; the overall system is encapsulated with an IP67 protection level and supports solar power supply and 4G / 5G dual-mode communication. (III) Beneficial technical effects

[0063] High-precision pest detection:

[0064] (1) An improved YOLOv5 model is adopted, and the SENet attention mechanism is embedded in the Backbone to enhance the feature representation ability of pest targets and improve the detection accuracy; the CIoU Loss and Focal Loss are combined to optimize the model training, enhance the small target recognition ability and reduce the impact of class imbalance.

[0065] (2) Adaptive pest density assessment:

[0066] Combining density clustering (DBSCAN) and fuzzy logic reasoning to model the pest distribution; optimizing the detection results through a dynamic threshold adjustment strategy to ensure the detection robustness in different pest density regions.

[0067] (3) Intelligent spraying control:

[0068] The PID control combined with the particle swarm optimization (PSO) algorithm is adopted to adaptively adjust the spraying flow rate to ensure the spraying accuracy, and the A* algorithm is used to optimize the spraying path to reduce repeated spraying and pesticide waste and improve the control efficiency.

[0069] (4) Cooperative operation of unmanned aerial vehicle and ground robot:

[0070] The LoRa communication technology is adopted to realize the cooperative operation of the unmanned aerial vehicle and the ground spraying robot, improve the operation efficiency, and optimize the detection task allocation through the Hungarian algorithm to reduce the resource conflict between devices.

[0071] (5) Online self-calibration mechanism:

[0072] The active learning strategy is adopted to automatically screen high-uncertainty samples for model updating to improve the long-term adaptability of the model, and the detection system is calibrated through a standard test board to ensure the long-term monitoring stability. Description of the drawings

[0073] Figure 1 It is a schematic flow structure diagram of the method for monitoring crop pests and intelligent spraying control based on deep learning of the present invention. Detailed implementation manners

[0074] In order to enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be further introduced in detail below.

[0075] Embodiment

[0076] The crop pest monitoring and intelligent spraying control method based on deep learning provided by the embodiments of the present invention.

[0077] (II) Technical solutions

[0078] To achieve the above object, the present invention provides the following technical solutions: A crop pest monitoring and intelligent spraying control method based on deep learning, comprising the following steps:

[0079] (S1) Real-time collect farmland images and environmental data through a multispectral camera and an environmental sensor. The image resolution is 1920×1080, and the environmental data includes temperature and humidity, light intensity, and wind speed;

[0080] (S2) Perform pest detection on the image based on the improved YOLOv5 model, and use the non-maximum suppression (NMS) algorithm to filter redundant detection boxes. The NMS threshold is set to 0.5, and the detection confidence threshold is dynamically adjusted;

[0081] (S3) Generate a pest density heat map according to the detection results, and calculate the spraying priority through the fuzzy logic control algorithm in combination with environmental parameters;

[0082] (S4) Dynamically adjust the flow rate and direction of the spraying device through a PID controller. The PID parameters are adaptively adjusted according to the real-time wind speed and the target coverage rate. The formula is:

[0083]

[0084] where e(t) is the deviation between the set coverage rate and the actual one, K p , K i , K d Initialized by the particle swarm optimization algorithm.

[0085] Furthermore, the multispectral image preprocessing method in step S1 includes:

[0086] (11) Use Gaussian filtering to eliminate noise, and the filter kernel function is:

[0087]

[0088] (12) Perform histogram equalization processing on the image to enhance the contrast between pests and the background;

[0089] (13) Correct image distortion through perspective transformation, and the transformation matrix is obtained by pre-calibrating a calibration board.

[0090] Another embodiment of the present invention is: The improved YOLOv5 model in step S2 includes:

[0091] (21) Embed the SENet attention module in the Backbone, and the channel weight is calculated as:

[0092] s = σ(W2δ(W1GAP(F)))

[0093] where F is the feature map, GAP is the global average pooling, and W1, W2 are the weights of the fully connected layers;

[0094] (22) The loss function uses CIoU Loss, and the formula is:

[0095]

[0096] where ρ is the Euclidean distance between the center points of the predicted box and the ground truth box, c is the length of the diagonal of the smallest enclosing box, and v is the measure of the aspect ratio consistency;

[0097] (S23) The classification branch uses Focal Loss to solve the problem of class imbalance, and the formula is:

[0098]

[0099] where α t = 0.25, γ = 2.

[0100] The YOLOv5 model initializes the weights through transfer learning, specifically:

[0101] (4.1) Pre-train the Backbone part on the ImageNet dataset until convergence;

[0102] (4.2) Adopt a mixed data augmentation strategy, including random rotation (±30°), HSV color space perturbation (H±30, S±0.5, V±0.5), and MixUp data mixing. The mixing formula is:

[0103] x mix = λx i + (1 - λ)x j , y mix = λy i + (1 - λ)y j

[0104] where λ ~ Beta(0.4, 0.6).

[0105] The method for adjusting the dynamic confidence threshold is:

[0106] (5.1) Statistically calculate the mean μ and standard deviation σ of the pest density within the past 24 hours, with a sliding window size of 1 hour;

[0107] (5.2) Set the threshold T = 0.7 - 0.3 × sigmoid((d - μ) / σ) according to the current density d to ensure a reduced missed detection rate in high-density areas.

[0108] The specific fuzzy logic control algorithm includes:

[0109] (6.1) Define the input variables of pest density (low, medium, high) and wind speed (weak, medium, strong), and the output variable is spraying intensity (off, low, medium, high);

[0110] (6.2) Construct a fuzzy rule base, such as "IF density is high AND wind speed is weak THEN spraying intensity is high";

[0111] (6.3) Use the centroid method for defuzzification to output the precise control quantity.

[0112] The spraying path planning is optimized by the A* algorithm:

[0113] (7.1) Grid the farmland into 10cm×10cm cells, and mark the obstacles as non-passable areas;

[0114] (7.2) Define the cost function f(n) = g(n) + h(n), where g(n) is the actual movement cost and h(n) is the Manhattan distance to the target point;

[0115] (7.3) Dynamically update the path to avoid repeated spraying, and increase the cost of the sprayed area by 50%.

[0116] It also includes a multi-device cooperation mechanism:

[0117] (8.1) The drone and the ground robot are networked through LoRa, and the communication frequency is 868MHz;

[0118] (8.2) Use the Hungarian algorithm to allocate detection tasks, and the objective function is to minimize the total movement distance:

[0119] s.t. ∑x ij = 1

[0120] where c ij is the Euclidean distance from device i to area j.

[0121] The system includes a self-calibration module:

[0122] (9.1) Automatically take images of the standard test board at 3 am every day, and calculate the detection accuracy

[0123]

[0124] (9.2) When Acc < 90% lasts for 3 days, trigger online fine-tuning of the model, and set the learning rate to 1 / 10 of the initial value;

[0125] (9.3) Adopt an active learning strategy to screen high-uncertainty samples (entropy H(p)

[0126] >1.2) Add to the training set.

[0127] The hardware deployment solution is as follows:

[0128] (10.1) Use NVIDIA Jetson AGX Xavier as the edge computing node, with a power consumption of less than 30W;

[0129] (10.2) The spraying mechanism is equipped with piezoelectric nozzles, with a response time of <50ms and a flow control accuracy of ±2%;

[0130] (10.3) The overall system is encapsulated with an IP67 protection level, supporting solar power supply and 4G / 5G dual-mode communication.

[0131] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art can well understand and utilize the present invention. The present invention is only limited by the claims and their full scope and equivalents. The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art can well understand and utilize the present invention. The present invention is only limited by the claims and their full scope and equivalents.

Claims

1. A method for monitoring crop pests and intelligent spraying control based on deep learning, characterized in that , including the following steps: (S1) Real-time collect farmland images and environmental data through a multispectral camera and an environmental sensor. The image resolution is 1920×1080, and the environmental data includes temperature and humidity, light intensity, and wind speed; (S2) Based on the improved YOLOv5 model, perform pest detection on the image. Use the non-maximum suppression (NMS) algorithm to filter redundant detection boxes. The NMS threshold is set to 0.5, and the detection confidence threshold is dynamically adjusted; (S3) Generate a pest density heat map according to the detection results, and calculate the spraying priority through the fuzzy logic control algorithm in combination with environmental parameters; (S4) Dynamically adjust the flow rate and direction of the spraying device through a PID controller. The PID parameters are adaptively adjusted according to the real-time wind speed and the target coverage rate. The formula is: where e(t) is the deviation between the set coverage rate and the actual one, K p , K i , K d is initialized by the particle swarm optimization algorithm.

2. The method for monitoring crop pests and intelligent spraying control based on deep learning according to claim 1, wherein , the multispectral image preprocessing method in step S1 includes: (S21) Use Gaussian filtering to eliminate noise. The filter kernel function is: (S2) Perform histogram equalization processing on the image to enhance the contrast between pests and the background; (S23) Correct image distortion through perspective transformation. The transformation matrix is obtained by pre-calibrating a calibration board.

3. The method for monitoring crop pests and intelligent spraying control based on deep learning according to claim 1, characterized in that , the improved YOLOv5 model in step S2 includes: (S31) Embed the SENet attention module in the Backbone. The channel weights are calculated as: s = σ(W2δ(W1GAP(F))) where F is the feature map, GAP is the global average pooling, and W1, W2 are the weights of the fully connected layers; (S32) The loss function uses CIoU Loss. The formula is: where ρ is the Euclidean distance between the center points of the predicted box and the true box, c is the diagonal length of the smallest bounding box, and v is the aspect ratio consistency metric; (S33) The classification branch uses Focal Loss to solve the problem of class imbalance. The formula is: where α t = 0.25, γ = 2.

4. The method for monitoring crop pests and intelligent spraying control based on deep learning according to claim 3, characterized in that , the weights of the YOLOv5 model are initialized through transfer learning. Specifically: (S41) Pre-train the Backbone part on the ImageNet dataset until convergence; (S42) Adopt a mixed data augmentation strategy, including random rotation (±30°), HSV color space perturbation (H±30, S±0.5, V±0.5), and MixUp data mixing. The mixing formula is: where λ~Beta(0.4, 0.6).

5. The method for monitoring crop pests and intelligent spraying control based on deep learning according to claim 1, wherein , the method for dynamically adjusting the confidence threshold is: (S51) Statistically calculate the mean μ and standard deviation σ of the pest density in the past 24 hours. The sliding window size is 1 hour; (S52) Set the threshold T = 0.7 - 0.3×sigmoid((d - μ) / σ) according to the current density d to ensure a reduced missed detection rate in high-density areas.

6. The method for monitoring crop pests and intelligent spraying control based on deep learning according to claim 1, characterized in that , the fuzzy logic control algorithm specifically includes: (S61) Define the input variables pest density (low, medium, high) and wind speed (weak, medium, strong), and the output variable is spraying intensity (off, low, medium, high); (S62) Build a fuzzy rule base, such as "IF density is high AND wind speed is weak THEN spraying intensity is high"; (S63) Use the centroid method for defuzzification to output an accurate control quantity.

7. The method for monitoring crop pests and intelligent spraying control based on deep learning according to claim 1, characterized in that , the spraying path planning is optimized using the A* algorithm: (S71) Grid the farmland into 10 cm × 10 cm cells, and mark obstacles as impassable areas; (S72) Define the cost function f(n) = g(n) + h(n), where g(n) is the actual movement cost and h(n) is the Manhattan distance to the target point; (S73) Dynamically update the path to avoid repeated spraying, and increase the cost of the sprayed area by 50%.

8. The method for monitoring crop pests and intelligent spraying control based on deep learning according to claim 1, wherein , also includes a multi-device cooperation mechanism: (S81) The drone and the ground robot are networked through LoRa, and the communication frequency is 868 MHz; (S82) Use the Hungarian algorithm to allocate detection tasks, and the objective function is to minimize the total movement distance: where c ij is the Euclidean distance from device i to area j.

9. The method for monitoring crop pests and intelligent spraying control based on deep learning according to claim 1, wherein , this crop pest monitoring and intelligent spraying control method also includes a self-calibration module: (S91) Automatically take images of the standard test board at 3:00 am every day and calculate the detection accuracy (S92) When Acc < 90% lasts for 3 days, trigger online fine-tuning of the model, and set the learning rate to 1 / 10 of the initial value; (S93) Adopt an active learning strategy to screen high-uncertainty samples (entropy H(p) > 1.2) and add them to the training set.

10. The method for monitoring crop pests and intelligent spraying control based on deep learning according to any one of claims 1-9, characterized in that , the hardware deployment plan is: (S101) Use NVIDIA Jetson AGX Xavier as the edge computing node, with a power consumption of less than 30W; (S102) The spraying mechanism is equipped with piezoelectric nozzles, with a response time < 50 ms and a flow control accuracy of ±2%; (S103) The overall system is encapsulated with an IP67 protection level, supporting solar power supply and 4G / 5G dual-mode communication.

Citation Information

Cited By

  • Novel plant protection robot

    CN121286264A