A pest and disease monitoring system and method based on AI vision and multi-parameter dynamic optimization
Through an AI-powered vision and multi-parameter dynamic optimization pest monitoring system, the system can identify, count, and optimize parameters in real time, solving the adaptability problem of the pest monitoring instrument in the processes of attracting, killing, and drying insects, and improving the accuracy of monitoring and the economy of the equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU HUINONG INFORMATION TECH CO LTD
- Filing Date
- 2025-09-02
- Publication Date
- 2026-07-17
AI Technical Summary
Existing insect monitoring instruments suffer from problems such as limited insect attraction efficiency, unstable insecticidal effect, imbalance between drying energy consumption and effect, and inaccurate vibration of the insect collection tray during the insect attraction, killing and drying processes. They are unable to adapt to the activity patterns of different pests and changes in environmental humidity.
The system employs an AI-based vision and multi-parameter dynamic optimization pest monitoring system. It collects insect information in real time through a camera module, and combines this with the main control module to identify, count, and optimize parameters. It dynamically adjusts the insect-attracting time, insect-killing parameters, and drying time, and uses a lightweight convolutional neural network model and reinforcement learning algorithm to optimize equipment operation.
It improved the accuracy of insect pest data and the economy of equipment operation, enhanced the adaptability of equipment to complex farmland environments, optimized the insect attraction, killing and drying processes, and reduced energy waste and equipment wear and tear.
Smart Images

Figure CN121000847B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural and forestry pest monitoring and control technology, and in particular to a pest monitoring system and method based on AI vision and multi-parameter dynamic optimization. Background Technology
[0002] Insect pest monitoring instruments are a new type of monitoring tool widely used in agricultural and forestry pest monitoring and control. Strengthening forestry pest and disease control has become a key aspect of safeguarding economic and ecological interests. Forecasting and early warning of forestry pests and diseases is the foundation of pest and disease control.
[0003] The existing insect monitoring lamps, which use fixed time parameters, have the following disadvantages: Limited insect trapping efficiency: Fixed insect trapping times are difficult to adapt to the activity patterns of different pests. For example, some pests are only active under specific temperature or humidity conditions, and fixed times may miss the optimal trapping window, leading to missed detections or insufficient sample representativeness.
[0004] The insecticidal effect is unstable: the fixed insecticidal time cannot be dynamically adjusted according to the number and type of insects. When the number of insects increases dramatically, it may not be possible to completely kill them in a short time; when the number of insects is small, it will result in energy waste. In addition, different sizes of pests require different heating intensities and times, and fixed parameters are prone to insect residue or excessive carbonization.
[0005] Imbalance between drying energy consumption and effectiveness: Fixed drying time ignores the impact of changes in ambient humidity. In high humidity environments, failure to extend drying time can easily lead to mold growth on insects, while continuing to dry according to a fixed cycle in low humidity environments increases ineffective energy consumption.
[0006] Inaccurate vibration of the insect collection tray: The insect collection tray vibrates at fixed intervals, which may cause two problems due to fluctuations in the number of insects: When the number of insects is high, the insects pile up on the insect collection tray and cannot be completely spread out, affecting the accuracy of subsequent insect identification and counting. When the number of insects is low, the vibrating tray vibrates frequently to clean the insects, causing equipment wear and tear and wasting electricity. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a pest and disease monitoring system and method based on AI vision and multi-parameter dynamic optimization, which enhances the adaptability of the equipment to complex farmland environments and improves the accuracy of pest data and the economic efficiency of equipment operation.
[0008] This invention is achieved using the following technical solution: Firstly, a pest and disease monitoring system based on AI vision and multi-parameter dynamic optimization includes a pest and disease trapping device, a camera module, and a main control module. The camera module is installed in the heating chamber and insect collection tray of the pest and disease trapping device to collect insect information in real time. The main control module has built-in multiple algorithms to perform calculations and processing based on the information collected by the camera module, including pest identification and counting, parameter optimization and adjustment, and self-adaptation.
[0009] Specifically, the pest and disease trapping device includes an insect-catching funnel, a rainwater separator, a heating chamber, an insect-catching tray, and multiple drainage pipes.
[0010] On the other hand, the monitoring method of the pest and disease monitoring system based on AI vision and multi-parameter dynamic optimization includes the following steps: Step S1: Start the pest and disease trapping device. The main control module controls the camera module to collect image data from the pest and disease trapping device. Step S2: The main control module uses AI intelligent algorithms to identify and count pests based on image data, analyzes the current pest control efficiency by calculating the number of pests attracted and killed, and evaluates the effect of each parameter in combination with historical data; Step S3: Dynamically adjust the insect-attracting time, optimize the insect-killing parameters, calculate the optimal drying time, and determine the vibration time of the insect-collecting tray; Step S4: Restart the pest and disease trapping device according to the optimized parameters to execute the pest control process, and record the execution results for the next optimization.
[0011] Specifically, step S2 includes the following steps: Step S21: Preprocess the data collected by the camera installed in the heating chamber; Step S22: Construct a lightweight convolutional neural network model and perform quantization and optimization; Step S23: Train and validate the model, and deploy and infer the model using an embedded device; the model training is based on the cross-entropy loss function and the Adam optimizer, and the cross-entropy loss function is expressed as: ; The model deployment and inference are performed by loading and running the quantized model through TensorFlow Lite, and inputting preprocessed camera image data for inference. Step S24: Dynamically adjust model parameters using a multi-objective optimization objective function combined with reinforcement learning. The multi-objective optimization objective function is expressed as: ; in, This represents the set of model or system parameters that need to be optimized. , where represents the model's prediction accuracy; This indicates the energy consumption during model inference or device operation; This indicates the time required for a single inference or task processing. , and These are the weighting coefficients.
[0012] Specifically, step S21, data preprocessing, includes: Z-Score image standardization transforms the data into a standard distribution with a mean of 0 and a standard deviation of 1. The formula is: ; in, is the mean and N is the total amount of data; For standard deviation and , indicating the degree of dispersion of the data; X represents a sample value or feature value in the original data; It represents the absolute distance of the original data from the mean, with a positive value indicating that it is above the mean and a negative value indicating that it is below the mean; Data augmentation, the calculation formula is: ; in, This refers to data augmentation operations, which apply a series of random transformations to normalized data to generate diverse training samples; This represents the enhanced output data, i.e., the new sample after transformation.
[0013] Specifically, the lightweight convolutional neural network model in step S22, with its depthwise separable convolutional representation, is as follows: ; ; in, The input feature map is a three-dimensional tensor with shape [formula missing]. ,in It is the height and width. This is the number of input channels; The depthwise convolution kernel is a four-dimensional tensor with the shape of... ,in This refers to the kernel size; each kernel operates on only one channel of the input feature map; each input channel undergoes convolution operation independently, and the output... Each feature map has a shape of... ; It is the first One input channel, It corresponds to the convolution kernel; The model quantization converts floating-point operations into integer operations, and the quantization formula is as follows: ; in, This represents the floating-point weights or activation values in the original model; This is the zero-point offset; This is the scaling factor; This indicates the rounding operation.
[0014] Specifically, step S3, optimizing the insecticidal parameters, is based on a parameter optimization algorithm. It employs a multi-objective reinforcement learning framework, combining energy consumption, efficiency, and equipment lifespan constraints to dynamically optimize the insect-attracting duration, insecticidal intensity, drying duration, and insect-collecting tray vibration parameters. This includes the following steps: Step A1: State-space modeling, defining the state variables as: ; in, This indicates the number of pests currently identified as being trapped. Indicates ambient temperature and humidity. Indicates the remaining energy consumption of the equipment. Indicates the health status of the equipment; Step A2: Dynamic space design, using discrete action space to fine-tune parameters, establishing an adjustable parameter action set as follows: ; in, Indicates the step size for increasing or decreasing the insect trapping time. Indicates the step size for adjusting insecticidal power. This indicates the increment or decrement of the drying time. This indicates the step size for adjusting the vibration frequency of the insect-collecting tray; Step A3: Design the reward function, balancing accuracy, energy consumption, and equipment lifespan in a multi-objective optimization, expressed as: ; in, , and These are the weighting coefficients. For insecticidal efficiency, It is the reciprocal of energy consumption. It is the reciprocal of equipment loss; Step A4: Based on reinforcement learning algorithms and experience retrieval, predict the optimal action through a Q-network to maximize long-term cumulative reward and output adjustment parameters; wherein, the input layer of the network architecture takes state variables as input. The process involves two fully connected layers activated by ReLU, and finally outputs a Q-value vector at the output layer; an empirical reclamation buffer stores the transition sequence. , , , And set the loss function as: ; in, For the target network parameters, =0.9 is the discount factor.
[0015] Specifically, step S3 further includes designing an adaptive controller using the MIT gradient method, dynamically adjusting the baseline parameters according to the season and weather; iteratively updating the control parameters using the gradient of the output error to bring the performance closer to the optimal level, wherein the parameter update formula is: ; in, For parameters to be optimized, For learning rate, For error, To output the gradient with respect to the parameters, the baseline parameters include the insect trapping time. Insecticidal voltage (V), drying time Vibration frequency of the insect collecting tray ; Using baseline parameters as optimization variables: The objective functions are insecticidal efficiency R, energy consumption E, and equipment wear C. Establishing a gradient method using the MIT gradient method .
[0016] Specifically, the combination of the MIT gradient method includes: Divide the year into seasonal stages and set initial parameters. Based on local climate and pest occurrence patterns, divide the year into seasonal stages or more detailed phenological stages. Preset a set of baseline parameter variation for each seasonal stage. Divide the weather categories, set initial parameters and some thresholds, and set corresponding responses according to the weather categories. Based on temperature and humidity sensors, light intensity sensors, and wind and rain sensors, the system collects real-time data on ambient temperature and humidity, light intensity, rainfall, and wind speed to determine weather conditions. Standardization formula using Z-Score Mapping the various data acquired in environmental perception to a unified scale, whereby... and The mean and standard deviation of the historical data are used; the gradient components are calculated using the finite difference method to reduce computational complexity, as shown in the formula: ; Introducing parameter optimization constraints, the nearest feasible value is returned when the parameter exceeds the limit; introducing moving average filtering: averaging the results of multiple consecutive error calculations to avoid parameter misadjustment caused by random factors.
[0017] The beneficial effects of this invention are as follows: This invention uses a camera integrated on the insecticidal chamber and a camera above the insect collection tray to capture and identify counting data. It uses AI intelligent algorithms to optimize and adjust the insect attraction time, insecticidal time and intensity, drying time and insect collection tray vibration time, thereby enhancing the adaptability of the equipment to complex farmland environments, improving the accuracy of insect data and the economic efficiency of equipment operation. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the device workflow of the pest and disease monitoring system based on AI vision and multi-parameter dynamic optimization in this embodiment of the invention. Figure 2 This is a schematic diagram of the pest and disease trapping device described in an embodiment of the present invention; Among them, 1-Insect-collecting funnel, 2-Rainwater separator, 3-Heating chamber camera, 4-Heating chamber, 5-Insect-collecting tray camera, 6-Drainage pipe one, 7-Drainage pipe two. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0021] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0022] The following is in conjunction with the appendix Figure 1-2 The following describes some embodiments of the present invention in detail. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0023] This invention proposes a pest and disease monitoring system based on AI vision and multi-parameter dynamic optimization. The system includes a pest and disease trapping device, a camera module, and a main control module. The camera module is installed in the heating chamber and insect collection tray of the pest and disease trapping device to collect insect information in real time. The main control module has built-in multiple algorithms to perform calculations and processing based on the information collected by the camera module, including pest identification and counting, parameter optimization and adjustment, and adaptive behavior.
[0024] In this embodiment, the pest and disease trapping device is as follows: Figure 2 As shown, it includes an insect-collecting funnel 1, a rainwater separator 2, a heating chamber 4, an insect-collecting tray, and multiple drainage pipes (6, 7).
[0025] This invention also proposes a monitoring method for a pest and disease monitoring system based on AI vision and multi-parameter dynamic optimization, comprising the following steps: Step S1: Start the pest and disease trapping device. The main control module controls the camera module to collect image data from the pest and disease trapping device. Step S2: The main control module uses AI intelligent algorithms to identify and count pests based on image data, analyzes the current pest control efficiency by calculating the number of pests attracted and killed, and evaluates the effect of each parameter in combination with historical data; Step S3: Dynamically adjust the insect-attracting time, optimize the insect-killing parameters, calculate the optimal drying time, and determine the vibration time of the insect-collecting tray; Step S4: Restart the pest and disease trapping device according to the optimized parameters to execute the pest control process, and record the execution results for the next optimization.
[0026] The following is in conjunction with the appendix Figure 1 The device operation flow provides a detailed explanation of the technical solutions for each part: I. Data Acquisition Phase: The main control module controls the camera in the insecticidal chamber to take pictures inside the chamber, capturing the real-time process of pests falling. After the insecticidal process is complete, the main control module controls the camera on the insect-collecting tray to take pictures of the insect distribution.
[0027] II. AI Analysis Phase: The lightweight CNN model MobileNetV2 is used for pest identification and counting. MobileNetV2 is a lightweight convolutional neural network proposed by the Google team in 2018, mainly used to solve efficient inference problems on mobile and embedded devices. Its inverse residual structure and linear bottleneck layer significantly reduce the number of model parameters and computational complexity while maintaining accuracy.
[0028] To analyze the current insecticidal efficiency (number killed / number attracted), the host controls the insecticidal chamber camera and the insect collection tray camera to take pictures of the insecticidal chamber and the insect collection tray, and uses AI intelligent algorithms to obtain the number of attracted and killed.
[0029] The effectiveness of each parameter is evaluated by combining historical data, such as historical insecticidal efficiency and corresponding insect-attracting duration, insecticidal duration and intensity, drying duration and insect-collecting tray vibration duration.
[0030] III. Parameter Optimization Stage: Dynamically adjust the insect-attracting time (based on environmental conditions and historical data, such as the number of insects attracted per unit time); optimize the insect-killing time and intensity (based on the kill rate); calculate the optimal drying time (based on the amount of pest residue); determine the vibration time of the insect-collecting tray (to ensure complete flatness).
[0031] IV. Execution Phase: Execute the pest control process according to the optimized parameters and record the execution results for future optimization.
[0032] The key algorithms used in this scheme include: 1. Pest Identification and Counting Algorithms: A lightweight CNN model, MobileNetV2, combined with data augmentation and model quantization techniques, is used to achieve real-time pest identification and accurate counting. The specific steps are as follows: (1) Data preprocessing and enhancement: Improve the model’s ability to generalize images of pests under different postures and lighting conditions.
[0033] a. Image normalization: in The mean, σ is the standard deviation, used to standardize input image data. This formula is the core of Z-Score standardization, used to transform data into a standard distribution with a mean of 0 and a standard deviation of 1.
[0034] The specific meanings of each symbol are as follows: 1) It represents a sample value or feature value in the original data. For example, in image processing, it can be a pixel value; in an insect monitoring system, it can be a feature value such as the number of pests, temperature, or humidity.
[0035] 2) (Mean) represents the average value of the current feature (or dataset), and is calculated using the following formula: ; Where N is the total amount of data. For example, in a pest identification task, μ might be the average pixel value of an image of a certain type of pest.
[0036] 3) (Standard deviation) represents the dispersion of data, and is calculated using the following formula: ; The larger the standard deviation, the more dispersed the data; the smaller the standard deviation, the more concentrated the data.
[0037] 4) This represents the standardized result, and its numerical value indicates the absolute distance of the original data from the mean (in standard deviations). For example, =2 indicates that the data point is 2 standard deviations above the mean; sign direction: positive value indicates above the mean, negative value indicates below the mean.
[0038] b. Data augmentation (random rotation, flipping): ; Improve the model's ability to generalize to pests with different postures.
[0039] : indicates data augmentation, which involves applying a series of random transformations to normalized data to generate diverse training samples.
[0040] Common methods include random rotation (within 20°), horizontal / vertical translation (within ±20%), horizontal flipping, and scaling. Their purpose is to increase data diversity and improve the model's robustness to input variations (e.g., the ability to identify pests under different postures and lighting conditions).
[0041] : Represents the enhanced output data, i.e., the new sample after transformation. Features: It retains the core information of the original data (such as the morphology of pests), but introduces artificially generated variations (such as the angle after rotation, the position after translation) to simulate complex situations in real-world scenarios.
[0042] (2) Lightweight CNN model construction (MobileNetV2) Core formula: Depthwise Separable Convolution: Input feature map: The input feature map is a three-dimensional tensor with shape [formula missing]. ,in It is the height and width. This represents the number of input channels. Its function is to indicate the output features of the original image or the previous layer of the network.
[0043] A depthwise convolution kernel is a four-dimensional tensor with the following shape: , where K is the kernel size (e.g., 3×3), and each kernel operates on only one channel of the input feature map.
[0044] Calculation process: Each input channel undergoes a convolution operation independently, and the output... Each feature map has a shape of... .
[0045] formula: in It is the i-th input channel. That is the corresponding convolution kernel.
[0046] effect: Spatial feature extraction: Extract local spatial features (such as edges and textures) only within each channel.
[0047] Reduced parameters: Traditional convolution requires × × × One parameter, while depthwise convolution only requires one. × × One parameter.
[0048] Depthwise separable convolution: Decomposes traditional convolution into depthwise convolution and pointwise convolution, reducing the number of parameters and computation (for example, MobileNetV2 has only 1 / 100 the number of parameters of VGG-16).
[0049] Transfer learning: Utilizing the feature extraction capabilities of ImageNet pre-training, fine-tuning is performed on specific pest data, saving training time.
[0050] (3) Model quantization and optimization Quantization formula (8-bit integer quantization): : Floating-point weights or activation values (such as 32-bit floating-point numbers) in the original model represent unquantized continuous values in the neural network, which usually have a large range and high computational cost.
[0051] Example: If the weight of a certain layer is [1.2, -0.5, 3.7], then Wfloat is these floating-point values.
[0052] (Zero-point Offset): The offset value corresponding to the "zero point" of the quantized fixed-point integer, used to align the zero points of floating-point and fixed-point numbers. This ensures that 0 in a floating-point number can be accurately represented as a quantized integer (such as 0 or 128 in an 8-bit integer). If the floating-point range contains negative values, It will adjust the range of quantized integers to cover negative numbers.
[0053] Example: If quantized to an 8-bit unsigned integer (0-255), and the floating-point range is [−5, 5], then It could be 128, so that the floating-point 0 corresponds to the integer 128.
[0054] (Scale Factor): The scaling factor that maps the dynamic range of a floating-point number to the range of a fixed-point integer; through... Linearly compress a continuous interval of floating-point numbers (such as [−10,10]) to a discrete interval of fixed-point integers (such as [0,255] of an 8-bit integer).
[0055] Example: If the floating-point range is [−10, 10], and the target is an 8-bit signed integer (−128 to 127), then =20 / 255≈0.0784, which means that each unit integer corresponds to a floating-point change of 0.0784.
[0056] Rounding operation: Discretizes continuous floating-point calculation results into integers. This eliminates floating-point errors during the quantization process, ensuring that the final weights are integer values (e.g., 8-bit integers).
[0057] Example: If =12.7, then round(12.7)=13, and the quantization result is 13.
[0058] Quantization function: Converts floating-point operations to integer operations, reducing model size (typically by 75%) and improving inference speed on embedded devices.
[0059] (4) Model training and validation Formula: Cross-entropy loss function: Cross-entropy loss: measures the difference between the prediction and the true label, and guides the direction of model optimization.
[0060] Adam optimizer: An adaptive learning rate optimization algorithm that accelerates convergence.
[0061] (5) Deployment and inference (embedded devices) Load the quantization model, input preprocessing (camera image), resize, normalize, infer, and return the predicted category.
[0062] Embedded deployment: Run lightweight models with TensorFlowLite to meet device memory and real-time requirements (such as processing more than 10 frames per second).
[0063] 2. Dynamic parameter adjustment (combined with reinforcement learning) Multi-objective optimization objective function: : The set of model or system parameters that need to be optimized (such as the structural parameters of a lightweight CNN model, device operating parameters, etc.); Function: By adjusting The goal is to maximize the objective function, thereby achieving an optimal balance between accuracy, energy consumption, and latency.
[0064] Accuracy: Represents the prediction accuracy of a model (such as the accuracy of pest identification), and is a core indicator for measuring model performance. formula: =Number of correctly predicted samples / Total number of samples; Purpose: To ensure that the model can maintain high recognition accuracy even when resources are limited.
[0065] (Weighting coefficient): The priority of control precision in the objective function; Value range: ∈[0,1], usually with , Joint adjustment; Example: If prioritizing identification accuracy is crucial (e.g., pest species differentiation is critical for agricultural decision-making), the accuracy can be increased. (like =0.6).
[0066] (Energy consumption): Represents the energy consumption (units such as joules) during model inference or device operation. formula: =Power × Time; Application: Lightweight models (such as MobileNetV2) reduce energy consumption by reducing computational load, making them suitable for low-power devices in farmland.
[0067] (Reciprocal of energy consumption): This transforms the goal of minimizing energy consumption into maximizing it; the lower the energy consumption, the larger this value. Example: If energy consumption decreases from 10J to 5J, the contribution doubles.
[0068] (Weighting coefficient): The importance of controlling energy consumption optimization; Recommended values: In resource-constrained scenarios (such as solar-powered agricultural equipment), It should be relatively large (e.g.) =0.3).
[0069] (Delay): Indicates the time required for a single inference or task processing (in milliseconds); formula: = Reasoning start time − Reasoning end time; Function: Latency directly affects real-time performance. Lightweight CNN models (such as quantized MobileNetV2) can significantly shorten inference time.
[0070] (Reciprocal of delay): This transforms minimizing delay into maximizing the objective; the lower the delay, the larger this value. Example: If the latency is reduced from 20ms to 10ms, the contribution will double.
[0071] (Weight coefficient): Controls the priority of delay optimization; Recommended value: In scenarios requiring rapid response (such as real-time pest monitoring), It should be relatively large (e.g.) =0.3); 3. Parameter optimization algorithm A multi-objective reinforcement learning framework is employed, combining constraints on energy consumption, efficiency, and equipment lifespan, to dynamically optimize the insect-attracting duration, insect-killing intensity, drying duration, and vibration parameters of the insect-collecting tray. The specific steps are as follows: (1) State-space modeling Define state variables: : Current number of pests trapped (output by AI recognition algorithm); Ambient temperature and humidity; Remaining energy consumption of the equipment (such as battery power); : Equipment health status (e.g., the degree of aging of the heating chamber); Function: To comprehensively reflect the system's operating environment and status, providing a basis for decision-making.
[0072] (2) Dynamic space design Adjustable parameter action set: ; : Increment or decrease in insect-attracting time step (±10 minutes); Insecticidal power adjustment step (±5% of rated power); : Adjust the drying time step (±5 minutes); : The vibration frequency adjustment step of the insect collection tray is ±1Hz. Function: To achieve fine-tuning of parameters through discrete action space and avoid excessive disturbance.
[0073] (3) Reward function design (multi-objective optimization) , , Weighting coefficients (optimized via grid search); Insecticide efficiency (kill rate); Energy consumption reciprocal (encouraging energy conservation); : Reciprocal of equipment wear and tear (extending lifespan); Function: To achieve multi-objective optimization that balances accuracy, energy consumption, and equipment lifespan.
[0074] (4) Implementation of reinforcement learning algorithm (DQN + experience recycling) Network structure: Input layer: State vector ; Hidden layers: Two fully connected layers (ReLU activated); Output layer: Q-value vector (corresponding to the expected reward of each action).
[0075] Experience replay buffer: stores the transfer sequence ( , , , ), used to break data correlation.
[0076] Loss function: ; in For the target network parameters, =0.9 is the discount factor.
[0077] The optimal action is predicted through a Q-network to maximize long-term cumulative rewards; reinforcement learning decisions are mapped to physical device parameters to achieve closed-loop optimization.
[0078] 4. Adaptive control algorithm: An adaptive controller is designed using the MIT gradient method, which dynamically adjusts the baseline parameters based on season and weather. The MIT gradient method is an adaptive control algorithm whose core idea is to iteratively update the control parameters by measuring the gradient of the system output error, thereby bringing the system performance closer to optimal. Parameter update formula: ; in, For parameters to be optimized, For learning rate, The error is (target value - actual value). This is to output the gradient with respect to the parameters. The baseline parameter is the insect-attracting duration. Insecticidal voltage (V), drying time Vibration frequency of the insect collecting tray etc. Using baseline parameters as optimization variables. The objective functions are insecticidal efficiency R, energy consumption E, and equipment wear C. Establishing a gradient method using the MIT gradient method The specific implementation steps are as follows: (1) Establish initial baseline parameters: Divide the year into seasonal stages and set initial parameters: Based on the local climate and the occurrence patterns of pests, divide the year into seasonal stages, or more detailed phenological stages (such as the hatching period, larval stage, and adult stage of pests), and preset a set of baseline parameter variation for each seasonal stage to form a set of parameter adjustment strategies. Classify weather types and set initial parameters and some thresholds: set thresholds based on local climate to stop the operation of insect monitoring lamps, set corresponding responses based on weather types, and establish fuzzy logic rules between weather types and parameters.
[0079] For example, logically: if it rains then If the rainfall is less than the corresponding threshold, then adjust the insect-collecting tray photo interval and insect-killing power according to the rainfall.
[0080] (2) Environmental perception: Based on temperature and humidity sensors, light intensity sensors, and wind and rain sensors, real-time data such as ambient temperature and humidity, light intensity, rainfall, and wind force are collected to determine weather conditions. The cloud is connected to receive seasonal or phenological data.
[0081] (3) Gradient calculation: using the Z-Score normalization formula Mapping the various data acquired in environmental perception to a unified scale, whereby... and The mean and standard deviation of the historical data.
[0082] The gradient components are calculated using the finite difference method. This reduces the amount of computation.
[0083] (4) Parameter iteration: Introducing parameter optimization constraints: insect trapping duration The drying time is 30-60 minutes, the insecticidal voltage V corresponds to a voltage of 1000V-3000V, and the drying time is [not specified]. Vibration frequency of the insect collection tray during 10-30 minutes In the range of 5Hz to 15Hz, if the parameter goes out of bounds, the nearest feasible value will be returned. Introducing a moving average filter: averaging the results of three consecutive error calculations to avoid parameter misadjustment caused by accidental factors (such as a single large pest); when environmental changes are gradual (such as consecutive sunny days), reducing the parameter update frequency to once every 6 hours to reduce power consumption.
[0084] For the foregoing embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to this application.
[0085] The above embodiments describe the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Modifications and variations made by those skilled in the art without departing from the spirit and scope of the invention should be within the protection scope of the appended claims.
Claims
1. A pest and disease monitoring method based on AI vision and multi-parameter dynamic optimization, characterized in that, This pest and disease monitoring system, based on a pest and disease trapping device, a camera module, and a main control module, specifically includes the following steps: Step S1: Start the pest and disease trapping device. The main control module controls the camera module to collect image data from the pest and disease trapping device. Step S2: The main control module uses AI intelligent algorithms to identify and count pests based on image data. It analyzes the current pest control efficiency by calculating the number of pests attracted and killed, and evaluates the effectiveness of each parameter in conjunction with historical data; specifically including: Step S21: Preprocess the data collected by the camera installed in the heating chamber, including: Z-Score image standardization transforms the data into a standard distribution with a mean of 0 and a standard deviation of 1. The formula is: ; in, is the mean and N is the total amount of data; For standard deviation and , indicating the degree of dispersion of the data; X represents a sample value or feature value in the original data; It represents the absolute distance of the original data from the mean, with a positive value indicating that it is above the mean and a negative value indicating that it is below the mean; Data augmentation, the calculation formula is: ; in, This refers to data augmentation operations, which apply a series of random transformations to normalized data to generate diverse training samples; This represents the enhanced output data, i.e., the new sample after transformation; Step S22: Construct a lightweight convolutional neural network model and perform quantization and optimization; Step S23: Train and validate the model, and deploy and infer the model using an embedded device; the model training is based on the cross-entropy loss function and the Adam optimizer, and the cross-entropy loss function is expressed as: ; The model deployment and inference are performed by loading and running the quantized model through TensorFlow Lite, and inputting preprocessed camera image data for inference. Step S24: Dynamically adjust model parameters using a multi-objective optimization objective function combined with reinforcement learning. The multi-objective optimization objective function is expressed as: ; in, The set of equipment operating parameters to be optimized includes, specifically, the duration of insect attraction. Insecticide power Drying time and the vibration frequency of the insect receiving tray It also includes the structural parameters of the lightweight CNN model to be optimized; , where represents the model's prediction accuracy; This represents the reciprocal of energy consumption; Indicates the reciprocal of the delay; , and These are the weighting coefficients; Step S3: Dynamically adjust the insect-attracting time, optimize the insect-killing parameters, calculate the optimal drying time, and determine the vibration time of the insect-collecting tray; Step S4: Restart the pest and disease trapping device according to the optimized parameters to execute the pest control process, and record the execution results for the next optimization.
2. The pest and disease monitoring method based on AI vision and multi-parameter dynamic optimization as described in claim 1, characterized in that, The lightweight convolutional neural network model in step S22, whose depthwise separable convolutional representation is as follows: ; ; in, The input feature map is a three-dimensional tensor with shape [formula missing]. ,in It is the input feature map The corresponding height and width, This is the number of input channels; The depthwise convolution kernel is a four-dimensional tensor with the shape of... ,in This refers to the kernel size; each kernel operates on only one channel of the input feature map; each input channel undergoes convolution operation independently, and the output... Each feature map has a shape of... ,in These represent the height and width of the output feature map, respectively. It is the first One input channel, It corresponds to the convolution kernel; The model quantization converts floating-point operations into integer operations, and the quantization formula is as follows: ; in, This represents the floating-point weights or activation values in the original model; This is the zero-point offset; This is the scaling factor; This indicates the rounding operation.
3. The pest and disease monitoring method based on AI vision and multi-parameter dynamic optimization as described in claim 2, characterized in that, Step S3, optimizing insecticidal parameters, is based on a parameter optimization algorithm. It employs a multi-objective reinforcement learning framework, combining energy consumption, efficiency, and equipment lifespan constraints to dynamically optimize the insect-attracting duration, insecticidal power, drying time, and insect-collecting tray vibration parameters. This includes the following steps: Step A1: State-space modeling, defining the state variables as: ; in, This indicates the number of pests currently identified as being trapped. Indicates ambient temperature and humidity. Indicates the remaining energy consumption of the equipment. Indicates the health status of the equipment; Step A2: Dynamic space design, using discrete action space to fine-tune parameters, establishing an adjustable parameter action set as follows: ; in, Indicates the step size for increasing or decreasing the insect trapping time. Indicates the step size for adjusting insecticidal power. This indicates the increment or decrement of the drying time. This indicates the step size for adjusting the vibration frequency of the insect-collecting tray; Step A3: Design the reward function, balancing accuracy, energy consumption, and equipment lifespan in a multi-objective optimization, expressed as: ; in, , and These are the weighting coefficients. For insecticidal efficiency, It is the reciprocal of energy consumption. It is the reciprocal of equipment loss; Step A4: Based on reinforcement learning algorithms and experience retrieval, predict the optimal action through a Q-network to maximize long-term cumulative reward and output adjustment parameters; wherein, the input layer of the network architecture takes state variables as input. The process involves two fully connected layers activated by ReLU, and finally outputs a Q-value vector at the output layer; an empirical reclamation buffer stores the transition sequence. , , , And set the loss function as: ; in, For the target network parameters, =0.9 is the discount factor. This is the set of operating parameters for the equipment to be optimized.
4. The pest and disease monitoring method based on AI vision and multi-parameter dynamic optimization as described in claim 3, characterized in that, Step S3 further includes designing an adaptive controller using the MIT gradient method, dynamically adjusting the baseline parameters according to the season and weather; iteratively updating the control parameters using the gradient of the output error to bring the performance closer to the optimal level, wherein the parameter update formula is: ; in, For the set of equipment operating parameters to be optimized, For learning rate, For error, To output the gradient with respect to the parameters, the baseline parameters include the insect trapping time. Insecticide power Drying time Vibration frequency of the insect collecting tray ; Using baseline parameters as optimization variables: The objective functions are insecticidal efficiency R, energy consumption E, and equipment wear C. Establishing a gradient method using the MIT gradient method .
5. The pest and disease monitoring method based on AI vision and multi-parameter dynamic optimization as described in claim 4, characterized in that, The specific components of the combined MIT gradient method include: Divide the year into seasonal stages and set initial parameters. Based on local climate and pest occurrence patterns, divide the year into seasonal stages or more detailed phenological stages. Preset a set of baseline parameter variation for each seasonal stage. Divide the weather categories, set initial parameters and some thresholds, and set corresponding responses according to the weather categories. Based on temperature and humidity sensors, light intensity sensors, and wind and rain sensors, the system collects real-time data on ambient temperature and humidity, light intensity, rainfall, and wind speed to determine weather conditions. Standardization formula using Z-Score Mapping the various data acquired in environmental perception to a unified scale, whereby... and The mean and standard deviation of the historical data are used; the gradient components are calculated using the finite difference method to reduce computational complexity, as shown in the formula: ; Introducing parameter optimization constraints, the nearest feasible value is returned when the parameter exceeds the limit; introducing moving average filtering: averaging the results of multiple consecutive error calculations to avoid parameter misadjustment caused by random factors.
6. A pest and disease monitoring system based on AI vision and multi-parameter dynamic optimization, used to implement the pest and disease monitoring method based on AI vision and multi-parameter dynamic optimization as described in any one of claims 1 to 5, characterized in that, It includes a pest and disease trapping device, a camera module, and a main control module. The camera module is installed in the heating chamber and insect collection tray of the pest and disease trapping device to collect insect information in real time. The main control module has built-in multiple algorithms to perform calculations and processing based on the information collected by the camera module, including pest identification and counting, parameter optimization and adjustment, and adaptive processing.
7. The pest and disease monitoring system based on AI vision and multi-parameter dynamic optimization as described in claim 6, characterized in that, The pest and disease trapping device includes an insect-collecting funnel, a rainwater separator, a heating chamber, an insect-collecting tray, and multiple drainage pipes.