Agricultural pest occurrence amount early warning and monitoring method based on artificial intelligence network model

By improving the LSTM network model and feature extraction module, the problems of prediction bias and adaptability in pest prediction are solved, and efficient and accurate prediction of pest numbers is achieved, especially during peak pest periods under climate change and extreme weather.

CN120954192APending Publication Date: 2025-11-14临海市特产技术推广总站(临海市柑桔产业技术协同创新中心) +2
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202511040997.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing technologies for pest forecasting suffer from problems such as large prediction bias, difficulty in adapting to the nonlinear relationship between weather and pests, and high computational costs. In particular, their prediction accuracy is insufficient when dealing with pest outbreaks under climate variability and extreme weather conditions.

Method used

An improved LSTM network model is adopted, which combines a variable structure bus module (VSB) and a bidirectional LSTM feature extraction module. By constructing a multi-dimensional feature matrix, peak optimization processing, local attention window mechanism and Huber loss function, a pest quantity prediction model is established to achieve autonomous learning and efficient prediction of meteorological and pest dynamics.

Benefits of technology

It significantly improved the prediction accuracy of peak pest periods, enhanced the model's generalization performance and ability to capture nonlinear relationships, and provided more intuitive and reliable prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120954192A_ABST
    Figure CN120954192A_ABST
Patent Text Reader

Abstract

The invention provides an artificial intelligence network model-based early warning and monitoring method for the occurrence amount of agricultural pests, and particularly relates to a time sequence modeling method by combining a variable structure bus module VSB with a bidirectional long short-term memory network BiLSTM, which is used for predicting the occurrence dynamic state of important pests in a field and an orchard with high precision. Comprising the following steps: selecting three monitoring sites in a main crop producing area; and establishing a time sequence data set of the corresponding relationship between the average daily temperature, the rainfall and the effective accumulated temperature and the number of pests in ten days. According to the method, a hybrid neural network prediction model is constructed, the model comprises five function modules, and the model can accurately early warn annual dynamic changes of main crop main pest populations and judge peak values, and helps farmers establish efficient pest prevention and control measures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent monitoring and prediction technology for agricultural pests and diseases, and in particular to an early warning monitoring method for the occurrence of agricultural pests based on an artificial intelligence network model. Background Technology

[0002] Pest damage is a significant problem in agricultural production. Producers invest substantial manpower and resources annually to control the extent of damage. However, major pests affecting key crops, such as the rice stem borer (rice borer), the citrus fruit fly (fruit fly), and the corn borer (corn borer), still experience localized outbreaks each year, with a trend of escalation. A major reason is the untimely control measures, leading to a surge in pest populations and severely impacting crop yields and economic benefits. There are three main reasons for the untimely pest control: first, habitat changes and crop or pest migration mean that new environments have obscured pest occurrence patterns; second, climate changes cause the emergence of some pests to be delayed or advanced, rendering old control methods ineffective in timely and efficient population control; and third, the main occurrence period of some pests occurs during crop maturity, a stage unsuitable for pesticide application, while new control methods are more complex to implement, increasing the difficulty of control and causing missed optimal control times. Therefore, accurate prediction of pest population changes and timely implementation of measures can significantly improve pest control efficiency. On the other hand, with the development of modern agriculture and smart agriculture, the prediction of agricultural pest population dynamics has also become an important research topic in precision agriculture and ecological protection.

[0003] Currently, pest prediction for different crops still relies on traditional methods (such as ARIMA and linear regression), which assume a linear relationship between pest numbers and environmental factors. However, actual pest outbreaks are driven by nonlinear meteorological cumulative effects (such as accumulated temperature and delayed rainfall), leading to large prediction biases, especially in addressing pest outbreaks (peak prediction) under climate variability and extreme weather conditions. Although pest prediction models built using machine learning methods such as SVM, random forests, and recurrent neural networks (RNNs) have made some progress, they still face challenges such as over-reliance on manual feature engineering for input data, difficulty in adaptively extracting the dynamic nonlinear relationship between meteorology and pests, and the tendency for gradient vanishing during model training, resulting in high computational costs. Therefore, there is an urgent need to introduce intelligent models capable of autonomously learning time dependencies and feature interaction relationships to improve prediction accuracy and practicality. LSTM-based deep learning models, through continuous training and learning of basic parameters, undergo multiple rounds of self-optimization to establish long-term dependencies between feature parameters and the target, obtaining the optimal model. Furthermore, the prediction results are presented in the form of images, making them more intuitive and reliable. LSTM (Long Short-Term Memory) is a special type of recurrent neural network (RNN) that addresses the vanishing gradient problem in long-sequence data processing by introducing three gates (input gate, forget gate, and output gate) and memory units (cell states). This allows it to capture dependencies in long sequences, making it a highly suitable deep learning model for tasks such as time series analysis, natural language processing, and speech recognition. Improved or optimized LSTM models have been widely used in research and applications for identification and prediction in meteorology, industry, and finance. However, the application of LSTM models in agriculture is rarely mentioned. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide an early warning and monitoring method for agricultural pest occurrence based on an artificial intelligence network model, which is applicable to the dynamic prediction of population size of major pests on fruit trees and field crops and to support control decision-making.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model, comprising the following steps:

[0006] Step 1: In the production area of ​​the pest's host crop, select multiple sites, place traps, and record the number of pests trapped each ten-day period. Simultaneously record the average daily temperature and ten-day rainfall in the production area. Based on the starting temperature of the average daily temperature and the accumulated temperature, calculate the average daily temperature and effective accumulated temperature for each ten-day period, thus obtaining three original characteristic variables: average daily temperature for each ten-day period, ten-day rainfall, and effective accumulated temperature. Record 36 sets of data each year, and continuously record data for no less than 8 years.

[0007] Step 2: Establish a time series dataset showing the correlation between ten-day average temperature, ten-day rainfall, effective accumulated temperature, and insect population size;

[0008] Step 3: Construct a prediction model, which includes five functional modules: Module S1, used to generate a multi-dimensional feature matrix of time series data, including lag features, moving statistical features, seasonal features, and meteorological interaction features; Module S2, a peak optimization processing module, which generates a feature matrix tensor dataset and processes the feature tensor using a weighted sampling strategy to optimize the peak value; Module S3, which inputs the optimized feature matrix tensor into a Variable Structure Bus (VSB) module. The VSB module performs multi-scale dynamic sampling of the input features through multiple sub-modules to achieve adaptive abstraction of the features. The VSB module performs non-linear enhancement on the input feature matrix before sequence learning; the S4 module, an improved bidirectional LSTM feature extraction module, inputs the enhanced multi-dimensional feature matrix into the enhanced bidirectional LSTM network to capture the bidirectional dependencies in the time series, obtaining the forward and backward hidden states at each time step; in the bidirectional LSTM network, a local attention window mechanism is used to generate the attention of key time points that affect future pest population changes based on the weighted sum of historical data; the S5 module, a visualization output module, outputs the predicted pest population through a fully connected layer; and the Huber loss function is used to optimize the prediction model.

[0009] In a preferred embodiment, meteorological data synchronized with changes in insect population size is obtained from a meteorological department, including average daily temperature and ten-day rainfall. Based on the starting temperature for pest development, effective accumulated temperature is calculated. :

[0010]

[0011] Where T base The starting temperature for the specific development of pests, i is the temperature exceeding T. base The specific date for the average daily temperature over a ten-day period is usually the number of days in that date; To exceed T base The total number of days with the average daily temperature over a ten-day period, T i To exceed T base The average daily temperature over ten days; CSV format insect infestation and meteorological data were generated;

[0012] Data statistics were conducted on a ten-day basis to establish a time series dataset showing the correspondence between ten-day average daily temperature, ten-day rainfall, effective accumulated temperature, and insect population size. The original time series data recorded was no less than 8 years.

[0013] In a preferred embodiment, the S1 module constructs an input feature matrix from the original time series, including the following steps:

[0014] Construct lag features, including insect population lag features calculated based on historical data, to capture trends and fluctuations in time series;

[0015] ;

[0016] Where k is the lag order, x t This is the time series data at time t; The lag characteristic of the insect population at time t is represented by the number of fruit flies k steps prior in the history. This represents the number of pests at time tk;

[0017] Construct moving statistical features and calculate the moving mean of historical data. In order to capture long-term trends;

[0018] ;

[0019] in This represents the moving average at time t, capturing the recent trend in insect population. This represents the number of pests at time t−i in history; The size of the sliding window indicates the number of historical days to consider; set to 7, 14, or 30.

[0020] ;

[0021] in, It represents the sliding standard deviation at time t, reflecting the volatility of historical data;

[0022] Periodic characteristics are constructed by calculating the sine value of the daily or annual cycle to represent the pattern of seasonal changes;

[0023] Constructing meteorological interaction features, through the ratio of temperature to precipitation Calculated;

[0024] in This represents the meteorological interaction characteristics at time t. Represents the temperature at time t; Let represent the precipitation at time t. To prevent division by zero constant (10 -6 );

[0025] Finally, a multi-dimensional feature matrix column is generated, which provides a vector matrix for subsequent feature extraction.

[0026] In a preferred embodiment, the S2 module performs the following steps:

[0027] The multi-dimensional feature matrix generated by module S1 is standardized, and a time window (6 or 14 days) is set to convert the feature matrix into a PyTorch matrix tensor X. ,in Let T be the set of real numbers, d be the time step, d be the number of features, and B be the batch size. To illustrate the dimension, a time series training dataset D is built using a dynamic weighted sampler. Specifically, the training set weight function is defined based on a 3:1 peak sample weight ratio set according to the 85th percentile, and the peak sample weight is increased by 3 times.

[0028] The peak sampling weight must meet the following requirements:

[0029]

[0030] This represents the weight value of the training sample at time t. This represents the number of pests at time t in history. (D) is the 85th percentile of the training data, representing the peak of the pest population;

[0031] , Let represent the feature matrix tensor of the i-th sample, which contains multiple input features used for prediction; Is with characteristics The corresponding target variable is the number of pests; i represents the index of the i-th sample, which is the i-th training sample in the dataset, usually starting from i = 1 and going up to i = N; N represents the total number of training samples obtained after construction using a time sliding window (time step of T).

[0032] The peak resampling mechanism introduced during training can assign higher sampling weights (weight=3) to samples with pest numbers greater than 85% quantile, thereby enhancing the model's ability to predict peak pest events.

[0033] In a preferred embodiment, the S3 module, the Variable Structure Bus (VSB) module includes input data normalization, activation after linear expansion, Dropout mechanism, dimensionality reduction and another Dropout mechanism, and finally residual connection;

[0034] Normalized input: x norm = LayerNorm(X), where x norm This indicates that the input feature tensor (batch_size, hidden_dim) is normalized. LayerNorm(*) represents normalization.

[0035] Activation after linear expansion (dimensional increase): x expand= GELU(W1x norm + b1), where x expand This indicates that the feature dimension is expanded to 4×hidden_dim, and the GELU activation function is applied, where GELU(*) represents the activation function;

[0036] Dropout mechanism: x drop = Dropout(x expand ), where x drop This indicates that the output of Dropout is applied to prevent overfitting;

[0037] Dimensional reduction and Dropout again: x project = Dropout(W2x drop + b2), where x project This means that after the output of the second linear layer, the feature dimension is restored to its original size, and Dropout is applied again for output.

[0038] Residual connection: X′ = X + x project The input and output are added together to form a residual connection, where X′ represents the processed output feature matrix and X represents the multi-dimensional feature matrix tensor.

[0039] W1 and b1 represent the weight matrix and bias of the dimension-upgrading matrix, respectively;

[0040] W2 and b2 represent the weight matrix and bias of the dimension reduction, respectively;

[0041] The Dropout mechanism (Dropout = 0.2) is used to address the problem of overfitting to small samples in agricultural data.

[0042] X′ = VSB (X), where X is the input feature tensor and X′ is the feature tensor after VSB transformation.

[0043] In a preferred embodiment, the improved bidirectional LSTM feature extraction module uses a bidirectional LSTM network to capture bidirectional dependencies in the time series, obtaining the forward and backward hidden states at each time step.

[0044] For each input time step, compute the forward and backward hidden states:

[0045] ), )

[0046] The splicing is hidden in the following state:

[0047] ht = ,in This represents the hidden state of the forward LSTM at time t. This represents the input features at time t; This represents the forward LSTM hidden state at time t−1; This represents the backward LSTM hidden state at time t; h represents the backward LSTM hidden state at time t+1; t This represents the bidirectional LSTM hidden state at time t, which is a concatenation of the forward and backward hidden states. This represents the hidden state of the forward LSTM. This represents the hidden state of the backward LSTM;

[0048] A local attention window mechanism is added after the bidirectional LSTM network structure, that is, based on the weighted sum of historical data, the attention of key time points that affect future insect population changes are generated.

[0049] Attention scoring function: ,in: This represents the attention score at time t, which measures the degree of influence of that time on the final prediction. Let represent a learned vector used to calculate the score; T represents the transpose; tanh is an activation function to introduce non-linear features, enabling the model to learn complex patterns and aiding in pest occurrence prediction; W represents a weight matrix used to transform the bidirectional LSTM hidden state at time t. b represents a bias term;

[0050] Normalized weights:

[0051]

[0052] in This represents the attention weight at time t. Indicates the score value Indexation is applied, increasing the weight of larger values; This means that the scores at all time steps are summed exponentially to ensure the normalization of the weights;

[0053] The final output vector s is obtained using a weighted average method:

[0054]

[0055] This local attention window mechanism enables the model to automatically focus on the time period in the input sequence that is most relevant to the future peak insect population; through attention weights Select hidden states at key time points .

[0056] In a preferred embodiment, in module S5, the visualization output module obtains the predicted number of pests by mapping a weighted sequence representation through a fully connected layer. The attention-weighted output s is input into the fully connected layer to predict the number of insects. : ; This represents the weight matrix of the output layer. This represents the bias term of the output layer; the output is further optimized using the Huber loss function; the optimization process uses the Huber loss function and is trained using the Adam optimizer;

[0057] Huber Loss is defined as follows:

[0058]

[0059] Indicates the predicted number of pests Compared with the true value The losses between; The threshold for the Huber loss function is set to a fixed constant (e.g., 1.0). When the prediction error exceeds this threshold, the loss will become linear instead of quadratic.

[0060] In a preferred embodiment, prediction performance is evaluated using mean squared error (MSE) and mean absolute error (MAE). The pest numbers predicted by the model are inversely normalized to the original scale, and these error metrics, MAE and MSE, are calculated to evaluate the overall performance. A weighted loss function is used on the training set, where samples with high pest numbers are given higher priority.

[0061] When weighting samples with high insect populations, weights are used.

[0062]

[0063] Calculate the weighted value for each sample. Let represent the weight values ​​of the i samples. This represents the true value of the i-th sample. This represents the predicted value of the i-th sample.

[0064] In a preferred embodiment, the prediction model is implemented using the PyTorch framework, wherein the bidirectional LSTM layer is constructed using nn.LSTM(bidirectional=True) and attention weighting is implemented using torch.bmm.

[0065] In a preferred embodiment, the prediction results are displayed through visualization methods, including a comparison chart of actual and predicted values, and marking the peak locations of insect populations at key time points.

[0066] Compared with the prior art, the present invention has the following beneficial effects:

[0067] 1) It achieves efficient modeling of complex time-series meteorological and pest data;

[0068] 2) Significantly improved the accuracy of predicting peak (outbreak) insect infestation events;

[0069] 3) The use of the VSB module enhances feature adaptation capabilities and improves model generalization performance;

[0070] 4) The introduction of various feature engineering methods effectively characterizes the impact of factors such as time sequence, seasonality, and cumulative changes on the occurrence of pests. Attached Figure Description

[0071] Figure 1 This is a flowchart illustrating a preferred embodiment of the present invention;

[0072] Figure 2 This is a schematic diagram of the prediction model structure according to a preferred embodiment of the present invention;

[0073] Figure 3 This is a schematic diagram comparing the prediction of the number of fruit flies according to a preferred embodiment of the present invention;

[0074] Figure 4 This is a schematic diagram comparing the prediction of arrowhead scale numbers according to a preferred embodiment of the present invention;

[0075] Figure 5 This is a schematic diagram comparing the prediction of rice stem borer populations according to a preferred embodiment of the present invention. Detailed Implementation

[0076] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0077] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. 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 application pertains.

[0078] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; 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.

[0079] refer to Figure 1-5 An early warning and monitoring method for agricultural pest occurrence based on an artificial intelligence network model ( Figure 1 ),include:

[0080] 1. In the main production areas of crops infested by pests, select multiple sites, place trapping and monitoring equipment, and record the number of insects trapped each ten-day period, i.e., record 36 sets of data per year.

[0081] 2. Simultaneously record the daily average temperature and ten-day rainfall in the production area. Based on the daily average temperature and the starting temperature of the effective accumulated temperature, calculate the ten-day average temperature and effective accumulated temperature, thus obtaining three characteristic variables: ten-day average temperature, ten-day rainfall, and effective accumulated temperature.

[0082] 3. Collect data for at least 8 consecutive years to construct a time series dataset including three predictor variables (ten-day average temperature, ten-day rainfall, and effective accumulated temperature) and one characteristic target (insect population size).

[0083] Accumulated temperature characteristics: Calculate the accumulated temperature characteristics using the effective accumulated temperature.

[0084] Where T base T is the starting temperature for the specific development of pests. i To exceed T base The average daily temperature over ten days; forming CSV format insect infestation and meteorological data.

[0085] 4. Construct a hybrid neural network model VSB-BiLSTM for early warning of insect swarm occurrence based on LSTM structure.

[0086] Specifically, the model network consists of 5 modules.

[0087] S1, constructing a multi-dimensional feature matrix module from the original time series.

[0088] To capture trends and fluctuations in time series data and comprehensively enhance the biological significance of meteorological features, a multi-dimensional feature matrix was constructed, incorporating lag characteristics, sliding statistical characteristics, and interaction characteristics.

[0089] The S1 multi-dimensional feature construction module includes the following steps:

[0090] Constructing multi-scale hysteresis features: Where k is the lag order, x t This is the time series data at time t; The lag characteristic at time t is represented by the number of fruit flies k steps prior. As a characteristic; This represents the number of fruit flies at time tk (the predicted target value).

[0091] Moving statistical characteristics: moving mean

[0092] ,

[0093] in This represents the moving average at time t, capturing the recent trend in insect population. This represents the number of pests at time t−i in history. The size of the sliding window indicates the number of historical days to consider; settings are 7, 14, and 30.

[0094] sliding standard deviation

[0095] ,in This represents the sliding standard deviation at time t, reflecting the volatility of historical data. This represents the number of pests at time t−i in history.

[0096] Meteorological interaction characteristics:

[0097] Wen Yubi ( To prevent division by zero constant (10 -6 )),

[0098] in This represents the meteorological interaction characteristics at time t, usually the ratio of temperature to precipitation. Let t represent the temperature at time t. This represents the precipitation at time t, used to characterize the relationship between temperature and rainfall.

[0099] The final result is a multi-dimensional feature matrix that provides a vector matrix for subsequent feature extraction.

[0100] 5. Module S2, the peak optimization processing module, standardizes the multi-dimensional feature vectors obtained from S1 using StandardScaler, sets a time window (6 or 14 days), and converts the feature matrix into a PyTorch matrix tensor X. ,in Let T be the set of real numbers, d be the time step, d be the number of features, and B be the batch size. The dimension description indicates that a time series training dataset D is built using a dynamic weighted sampler, that is, the training set weight function is defined based on a peak sample weight ratio of 3:1 set according to the 85th percentile, and the peak sample weight is increased to 3 times.

[0101] The peak sampling weight must meet the following requirements:

[0102]

[0103] This represents the weight value of the training sample at time t. This represents the number of pests at time t in history. (D) is the 85th percentile of the training data, representing the peak of the pest population.

[0104] , Let represent the feature matrix tensor of the i-th sample, which contains multiple input features used for prediction; Is with characteristics The corresponding target variable is the number of pests; i represents the index of the i-th sample, which represents the i-th training sample in the dataset, usually starting from i = 1 and going up to i = N; N represents the total number of training samples obtained after construction using a time sliding window (time step T).

[0105] 6. Constructing the backbone structure of a deep neural network: This invention proposes a novel temporal modeling structure combining a Variable Structure Bus (VSB) and a Bidirectional Long Short-Term Memory (BiLSTM) network, which forms the backbone network structure of the prediction model. Figure 2 VSB is a feature adapter that enhances the adaptive feature extraction capability and improves the model's response capability at different time steps, i.e., it increases the model's nonlinearity and dynamic selection capability, and is an S3 module.

[0106] Before the data enters the LSTM, the S3 module performs multiple rounds of local information extraction and structural adjustment to improve the ability to model sequence dependencies. As a front-end feature adapter, it enhances the nonlinear expression ability of the entire deep network.

[0107] The VSB module is implemented through multiple sub-modules, which sequentially perform normalization, linear expansion (dimensionality increase) followed by activation, Dropout mechanism, dimensionality reduction and another Dropout mechanism (to avoid overfitting), and residual connection processing on the input feature vector.

[0108] Normalized input: x norm = LayerNorm(X), where x norm This indicates that the input feature tensor (batch_size, hidden_dim) is normalized. LayerNorm(*) represents normalization.

[0109] Activation after linear expansion (dimensional increase): x expand = GELU(W1x norm + b1), where x expandThis indicates that the feature dimension is expanded to 4×hidden_dim, and the GELU activation function is applied, where GELU(*) represents the activation function;

[0110] Dropout mechanism: x drop = Dropout(x expand ), where x drop This indicates that Dropout is applied to the output to prevent overfitting;

[0111] Dimensional reduction and Dropout again: x project = Dropout(W2x drop + b2), where x project This indicates that after passing through the second linear layer, the feature dimensions are restored to their original size, and Dropout is applied again for output.

[0112] Residual connection: X′ = X + x project Adding the input and output to form a residual connection can effectively alleviate the vanishing gradient problem and promote the training of deeper networks. Here, X′ represents the processed output feature matrix tensor, and X represents the input feature matrix tensor;

[0113] W1, b1: Weight matrices and biases in higher dimensions

[0114] W2, b2: Weight matrices and biases for dimensionality reduction

[0115] The Dropout mechanism (Dropout = 0.2) is used to address the problem of overfitting to small samples in agricultural data.

[0116] 7. S4 module, an improved bidirectional LSTM feature extraction module, uses a bidirectional LSTM network to capture bidirectional dependencies in time series, and obtains the forward and backward hidden states at each time step. That is, it not only considers the impact of historical data on the current prediction, but also the potential impact of future data.

[0117] For each input time step x t Calculate the forward and backward hidden states:

[0118] ), )

[0119] The splicing is hidden in the following state:

[0120] h t = ,in This represents the forward LSTM hidden state at time t. The input features at time t (including all features, such as lag features, meteorological features, etc.). The forward hidden state at time t−1. This represents the backward LSTM hidden state at time t. The backward hidden state at time t+1. t The bidirectional LSTM hidden state at time t is a concatenation of the forward and backward hidden states.

[0121] The improved bidirectional LSTM feature extraction module is characterized by adding a local attention window mechanism after the bidirectional LSTM network structure, that is, generating the attention level of the key time point that has the most influence on future insect population changes based on the weighted sum of historical data.

[0122] Attention scoring function: ,in: This represents the attention score at time t, which measures the degree of influence of that time on the final prediction. Let represent a learned vector used to calculate the score. W represents a weight matrix used to transform the hidden state. b represents a bias term.

[0123] Normalized weights:

[0124] ,

[0125] in Let α represent the attention weight at time t. t This reflects the contribution of that moment to the final prediction. Indicates the score value Indexation is performed, increasing the weight of larger values. This means that the scores at all time steps are summed exponentially to ensure the normalization of the weights.

[0126] The final output vector s is obtained using a weighted average method:

[0127]

[0128] This mechanism enables the model to automatically focus on the time periods in the input sequence that are most relevant to future insect population peaks. 's' represents the weighted sequence representation, calculated using attention weights. Select hidden states at key time points .

[0129] The goal of the local attention window mechanism is to enable the model to focus more on important time points (such as critical moments like sudden weather changes) while ignoring noisy data, thereby improving the model's ability to identify associated meteorological features and its attention to critical time points. The improved bidirectional LSTM feature extraction structure can fully take into account the bidirectional dependency between the modeling target value and the historical sequence, making it suitable for scenarios with strong "lag + predictability" such as insect swarm numbers.

[0130] 8. S5, Visualization Output Module

[0131] The attention-weighted output s is input into the fully connected layer to predict the number of insects. :

[0132] This represents the model's prediction result, specifically the predicted number of pests. This represents the weight matrix of the output layer, used to convert the weighted sequence representation s into the final predicted value. The bias term of the output layer.

[0133] 9. Loss Function and Training Mechanism

[0134] Huber Loss is used to optimize the output to improve prediction accuracy, especially in the high insect population peak region, achieving a balance between stability and robustness to outliers. Huber Loss is defined as follows:

[0135]

[0136] This design is particularly suitable for suppressing outliers during the peak outbreak phase of fruit fly outbreaks. Represents the model's predicted values Compared with the true value The losses between them. y: The model's predicted value. y: The actual number of pests (target value). The threshold for the Huber loss function is usually set to a fixed constant (such as 1.0). When the prediction error is greater than this threshold, the loss will become linear instead of quadratic.

[0137] The Adam optimizer and early stopping mechanism are used during the optimization process to improve the model's generalization ability and prevent overfitting.

[0138] An early stopping strategy is adopted, which stops training when the validation set loss does not improve for 30 consecutive cycles to prevent overfitting.

[0139] 10. Load the training dataset using a weighted random sampler and DataLoader, and train the model in the PyTorch framework. The VSB submodule is constructed using self.norm = norm_layer, self.linear 1 = nn.Linear, self.act = nn.GELU, self.linear 2 = nn.Linear, and self.drop = nn.Dropout. The bidirectional LSTM layer is constructed using nn.LSTM (bidirectional=True), and attention weighting is implemented using torch.bmm() to save the optimal model weights.

[0140] 11. Set the number of training rounds to 500, execute the training, and evaluate the overall performance using MAE and MSE.

[0141] 12. Save the model, perform prediction and inverse standardization on the test set, and output the predicted and true values.

[0142] All algorithms in this experiment were run on Windows 10.0 operating system, based on PyTorch 11.0 framework, with an Intel(R) Core i5-13600KF CPU and an NVIDIA GeForce RTX 3070 Ti GPU. Modeling, training, and prediction were completed in a virtual environment of Python 3.8 and CUDA 11.3. Model training was accelerated by GPU, with 500 epochs, an initial learning rate of 0.001, patience = 30, hidden_dim = 128, num_layers = 2, dropout = 0.2, and shuffle = False.

[0143] Example 1: Annual occurrence dynamics prediction of the fruit fly in citrus orchards

[0144] From 2017 to 2024, in the mandarin orange producing area of ​​Town B, City A, three orchards were selected, with two monitoring points set up in each orchard. At each monitoring point, traps containing methyl eugenol were used, and the number of fruit flies trapped was counted approximately every 10 days. The daily average temperature and rainfall for each ten-day period were obtained from the meteorological department of City A, and the starting temperature T for fruit fly development was determined. base The effective accumulated temperature was calculated at 12 ℃, and a raw time-series dataset of ten-day average temperature, ten-day rainfall, effective accumulated temperature, and fruit fly population was established and saved in CSV format. The dataset was then run on the constructed hybrid neural network model VSB-BiLSTM, and training was repeatedly performed by adjusting parameters (time_step, batch_size) until the optimal model was obtained, at which point the prediction results were output.

[0145] The optimal model in this example was obtained after training for 81 epochs, with the following parameters: time_step: 6, batch_size: 64, Training Loss: 0.0821, Val Loss: 0.1158, MSE: 72.26, MAE: 4.60. The prediction results are as follows... Figure 3 .

[0146] Example 2: Annual occurrence dynamics prediction of arrowhead scale in citrus orchards

[0147] From 2013 to 2020, in the mandarin orange producing area of ​​Town B, City A, three orchards were selected. Five trees were randomly selected from each orchard, and one fruiting branch was chosen from each of the five cardinal directions (east, south, west, north, and center) of the tree canopy. Tags were attached to these branches, and the number of adult arrowhead scale insects on the leaves was surveyed every ten days. The tagged fruiting branches were replaced at the beginning of each year. A 20x handheld magnifying glass was used for the survey, and the number of arrowhead scale insects was recorded. The corresponding ten-day average temperature and rainfall were also recorded simultaneously. Meteorological data were obtained from the City A Meteorological Bureau. The developmental threshold temperature (T) for arrowhead scale insects was determined. base The effective accumulated temperature was calculated at 12℃, and a raw time-series dataset of ten-day average temperature, ten-day rainfall, effective accumulated temperature, and the number of arrowhead scale insects was established and saved in CSV format. The dataset was then run in the constructed hybrid neural network VSB-BiLSTM. Training was repeatedly performed by adjusting parameters (time_step, batch_size) until the optimal model was obtained, and the prediction results were output. The optimal model in this example was obtained after 83 epochs of training, with the following parameters: time_step: 14, batch_size: 64, Training Loss: 0.0363, Val Loss: 0.1811, MSE: 15.11, MAE: 2.37. The prediction results are as follows: Figure 4 .

[0148] Example 3: Annual occurrence dynamics prediction of rice stem borer

[0149] From 2015 to 2024, in the rice-producing area of ​​Town C, City A, rice paddies from three different villages were selected. One monitoring point was set up in each paddy field, and each monitoring point was equipped with an insect monitoring lamp, a type of light-attracting insect monitoring device. The lamps attracted the rice stem borer (Chilodonella dilatatum) based on its phototaxis. The number of adult rice stem borers captured was counted every ten days, and the trapped borers were removed. The number of arrowhead scale insects was recorded, along with the corresponding ten-day average temperature and rainfall. Meteorological data were obtained from the City A Meteorological Bureau. The developmental threshold temperature (T) for arrowhead scale insects was determined. baseThe effective accumulated temperature was calculated at 10.5 ℃, and a raw time-series dataset of ten-day average temperature, ten-day rainfall, effective accumulated temperature, and the number of arrowhead scale insects was established and saved in CSV format. The dataset was then run in the constructed hybrid neural network VSB-BiLSTM. Training was repeatedly performed by adjusting parameters (time_step, batch_size) until the optimal model was obtained, and the prediction results were output. The optimal model in this example was obtained after 112 epochs of training, with the following parameters: time_step: 6, batch_size: 32, TrainingLoss: 0.0502, Val Loss: 0.1676, MSE: 33518.57, MAE: 72.10. The prediction results are as follows: Figure 5 .

Claims

1. A method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model, characterized in that, Includes the following steps: Step 1: In the production area of ​​the host crop of the pest, select multiple sites, place traps, record the number of pests trapped every ten days, and simultaneously record the daily average temperature and ten-day rainfall in the production area. Based on the starting temperature of the daily average temperature and the accumulated temperature, calculate the daily average temperature and the effective accumulated temperature of the ten-day period, thus obtaining three original characteristic variables: daily average temperature of the ten-day period, ten-day rainfall, and effective accumulated temperature. Step 2: Establish a time series dataset showing the correlation between ten-day average temperature, ten-day rainfall, effective accumulated temperature, and insect population size; Step 3: Construct a prediction model, which includes five functional modules: Module S1, used to form a multi-dimensional feature matrix of time series data, including lag features, moving statistical features, seasonal features, and meteorological interaction features; Module S2, peak optimization processing module, which forms a feature matrix tensor dataset and processes the feature tensor through a weighted sampling strategy to optimize the peak value; Module S3, inputting the optimized feature tensor into a Variable Structure Bus (VSB) module, which performs multi-scale dynamic sampling of the input features through multiple sub-modules to achieve adaptive abstraction of features. The VSB module performs nonlinear enhancement on the input feature matrix before sequence learning. Module S4, an improved bidirectional LSTM feature extraction module, inputs the enhanced multi-dimensional feature matrix into the enhanced bidirectional LSTM network to capture bidirectional dependencies in the time series, obtaining the forward and backward hidden states at each time step. A local attention window mechanism is used in the bidirectional LSTM network to generate the attention level of key time points that influence future pest population changes based on the weighted sum of historical data. Module S5, a visualization output module, outputs the predicted pest population through a fully connected layer. The prediction model is optimized using the Huber loss function.

2. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, Meteorological data synchronized with changes in insect population size, including daily average temperature and ten-day rainfall, are obtained from meteorological departments. Based on the starting temperature for pest development, the effective accumulated temperature is calculated. : T base T is the starting temperature for the specific development of pests. i To exceed T base The average daily temperature over ten days, i is above T base The specific dates for the average daily temperature over a ten-day period; To exceed T base The total number of days with the average daily temperature over ten days; generating insect infestation and meteorological data in CSV format; Data statistics were conducted on a ten-day basis to establish a time series dataset showing the correspondence between ten-day average daily temperature, ten-day rainfall, effective accumulated temperature, and insect population size. The original time series data recorded was no less than 8 years.

3. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, The S1 module constructs input features from the original time series, including the following steps: Construct lag features, including insect population lag features calculated based on historical data, to capture trends and fluctuations in time series; ; Where k is the lag order, x t This is the time series data at time t; The lag characteristic of the insect population at time t is represented by the number of fruit flies k steps prior in the history. This represents the number of pests at time tk; Construct moving statistical features and calculate the moving mean and moving standard deviation of historical data to capture long-term trends; ; in This represents the moving average at time t, capturing the recent trend in insect population. This represents the number of pests at time t−i in history; The size of the sliding window; ; in, It represents the sliding standard deviation at time t, reflecting the volatility of historical data; Periodic characteristics are constructed by calculating the sine value of the daily or annual cycle to represent the pattern of seasonal changes; Constructing meteorological interaction features, through the ratio of temperature to precipitation Calculated; in This represents the meteorological interaction characteristics at time t. Represents the temperature at time t; Let represent the precipitation at time t. To prevent division by zero constant; Finally, a multi-dimensional feature matrix is ​​generated, providing options for subsequent feature extraction.

4. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, The S2 module performs the following steps: The multi-dimensional feature matrix generated by module S1 is standardized, a time window is set, and the feature matrix is ​​converted into a PyTorch matrix tensor X. ,in Let T be the set of real numbers, d be the time step, d be the number of features, and B be the batch size. To illustrate the dimension, a time series training dataset D is built using a dynamic weighted sampler. Specifically, the training set weight function is defined based on a 3:1 peak sample weight ratio set according to the 85th percentile, and the peak sample weight is increased by 3 times. The peak sampling weight must meet the following requirements: , This represents the weight value of the training sample at time t. This represents the number of pests at time t in history. (D) is the 85th percentile of the training data, representing the peak of the pest population; , Let represent the feature matrix tensor of the i-th sample, which contains multiple input features used for prediction; It is related to the characteristic tensor The corresponding target variable is the number of pests; i represents the index of the i-th sample, which represents the i-th training sample in the dataset, starting from i = 1 and continuing until i = N; N represents the total number of training samples obtained after construction with a time window of time step T.

5. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, In the S3 module, the Variable Structure Bus (VSB) module includes input data normalization, activation after linear expansion, Dropout mechanism, dimensionality reduction and Dropout mechanism again, and finally residual connection; X′ = VSB (X), where X is the input feature matrix tensor and X′ is the feature matrix tensor after VSB transformation.

6. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, An improved bidirectional LSTM feature extraction module uses a bidirectional LSTM network to capture bidirectional dependencies in time series and obtain the forward and backward hidden states at each time step. For each input time step, compute the forward and backward hidden states: ), ) The splicing is hidden in the following state: ht = ,in This represents the hidden state of the forward LSTM at time t. This represents the input features at time t; This represents the forward LSTM hidden state at time t−1; This represents the backward LSTM hidden state at time t; represents the backward LSTM hidden state at time t+1; ht represents the bidirectional LSTM hidden state at time t, which is a concatenation of the forward and backward hidden states; This represents the hidden state of the forward LSTM. This represents the hidden state of the backward LSTM; A local attention window mechanism is added after the bidirectional LSTM network structure, that is, based on the weighted sum of historical data, the attention of key time points that affect future insect population changes are generated. Attention scoring function: ,in: This represents the attention score at time t, which measures the degree of influence of that time on the final prediction. denoted by , we have a learned vector used to calculate the score; tanh represents the activation function, which introduces non-linear features to enable the model to learn complex patterns, aiding in pest occurrence prediction; W represents a weight matrix used to transform the bidirectional LSTM hidden state at time t. b represents a bias term; Normalized weights: ,in This represents the attention weight at time t. Indicates the score value Indexation is applied, increasing the weight of larger values; This means that the scores at all time steps are summed exponentially to ensure the normalization of the weights; The final output vector s is obtained using a weighted average method: This local attention window mechanism enables the model to automatically focus on the time period in the input sequence that is most relevant to the future peak insect population; through attention weights Select hidden states at key time points .

7. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, In the S5 module, the visualization output module obtains the predicted number of pests through a fully connected layer using a weighted sequence representation. The attention-weighted output s is input into the fully connected layer to predict the number of insects. : ; This represents the weight matrix of the output layer. This represents the bias term of the output layer; the output is further optimized using the Huber loss function; the optimization process uses the Huber loss function and is trained using the Adam optimizer; Huber Loss is defined as follows: , Indicates the predicted number of pests Compared with the true value The losses between; The threshold for the Huber loss function is set to a fixed constant. When the prediction error exceeds this threshold, the loss will become linear instead of quadratic.

8. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, Prediction performance was evaluated using MAE and MSE. The training set used a weighted loss function, in which samples with high insect populations were given higher priority. When weighting samples with high insect populations, weights are used. Calculate the weighted value for each sample; Let represent the weight values ​​of the i samples. This represents the true value of the i-th sample. This represents the predicted value of the i-th sample.

9. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, The prediction model is implemented using the PyTorch framework, where the bidirectional LSTM layer is constructed using nn.LSTM(bidirectional=True) and attention weighting is implemented using torch.bmm.

10. The method for early warning and monitoring of agricultural pest occurrence based on an artificial intelligence network model according to claim 1, characterized in that, The prediction results are presented through visualization, including a comparison chart of actual and predicted values, and the peak locations of insect populations are marked at key time points.

Citation Information

Cited By

  • Insect pest prediction method and system based on language large model

    CN121168445A

  • A pest prediction method and system based on a language large model

    CN121168445B

  • Soybean pod borer predicting and forecasting method based on machine learning

    CN121660484A

  • Grapholitha molesta occurrence prediction method based on multi-source meteorological lag features and ensemble learning

    CN122132691A