A tea green leafhopper outbreak prediction method based on a self-attention mechanism

The tea green leafhopper infestation prediction method based on self-attention mechanism utilizes multi-source time-series data and biophysical mechanisms to construct an LSTM neural network and a multi-head attention mechanism model, solving the accuracy problem of tea green leafhopper infestation prediction and realizing real-time monitoring and early warning of tea green leafhopper numbers in tea gardens.

CN120763543BActive Publication Date: 2025-11-18SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511247606.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2025-11-18
Estimated Expiration
2045-09-03

AI Technical Summary

Technical Problem

Existing technologies for predicting the infestation of the tea green leafhopper are insufficient to accurately and dynamically quantify the insect population density. Traditional methods are limited by single data sources and environmental factors, leading to inaccurate predictions.

Method used

A self-attention mechanism-based method for predicting the infestation of the tea green leafhopper was adopted. By acquiring multi-source time-series data, time-series samples were generated using the sliding window method. An LSTM neural network and a multi-head self-attention mechanism prediction model were constructed to calculate the insect population change rate and issue risk warnings.

Benefits of technology

It has achieved accurate and dynamic quantification of the risk of tea green leafhopper infestation, improved the accuracy of prediction and the timeliness of risk warning, and is adaptable to different levels of risk alerts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120763543B_ABST
    Figure CN120763543B_ABST
Patent Text Reader

Abstract

The application provides a tea green leafhopper disaster prediction method based on a self-attention mechanism, comprising obtaining a data set, using a sliding window method on the data set to generate time series samples, constructing a tea green leafhopper number prediction model, the tea green leafhopper number prediction model being based on an LSTM neural network and a multi-head self-attention mechanism, inputting the data set into the tea green leafhopper number prediction model for prediction to obtain the current leafhopper population number of the tea green leafhopper, calculating a population change rate according to the current leafhopper population number, and issuing a tea green leafhopper disaster risk prompt according to the population change rate. The application adopts a sliding window method to construct time series data samples to fuse multi-source time series data and biological physical mechanisms. A double-layer LSTM module and a multi-head attention mechanism are adopted to construct a tea green leafhopper number prediction model, so that high rank expression and task self-adaptation are realized without increasing parameters, and the disaster risk of the tea green leafhopper is accurately and dynamically quantified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism. Background Technology

[0002] The tea green leafhopper, a representative pest of the family Cicadidae in the order Hemiptera, is widely distributed and causes serious damage in my country's tea-growing regions. Its stylet, vibrating at high frequency, pierces the epidermal cells of tea leaves or young shoots, entering the mesophyll or phloem to suck sap from the tender shoots. This causes the tea buds and leaves to curl and the leaf margins to scorch, resulting not only in reduced tea yield but also significantly diminishing the aroma and quality of the finished tea. In subtropical tea-growing areas, the tea green leafhopper reproduces an average of 9-12 generations per year, with significant generational overlap. Traditional control methods rely on manual field surveys combined with climatic experience for assessment. The tea green leafhopper's small size and concealed habitat make manual monitoring inefficient and insufficient for large-scale tea garden early warning systems.

[0003] Existing technologies for predicting tea green leafhopper outbreaks mainly fall into two categories: those based on statistical models and those using automated pest prediction equipment. Statistical models typically require stable, low-noise time-series data. However, the monitored climate data is often unstable, with alternating rainy and sunny days within a month, making it difficult to dynamically predict insect population density. While automated pest prediction equipment improves the efficiency of insect population counting, it is limited to a single data source in a fixed area and ignores the nonlinear influence of environmental factors on population development, making it difficult to capture the temporal patterns of insect development and thus unable to provide accurate timing of outbreaks.

[0004] In summary, there is an urgent need for a time-series prediction framework for insect population density that can integrate multi-source time-series data and biophysical mechanisms, so as to accurately and dynamically quantify the risk of tea green leafhopper outbreaks. Summary of the Invention

[0005] To overcome the problems existing in related technologies, the purpose of this invention is to provide a method for predicting the outbreak of tea green leafhopper based on a self-attention mechanism. This method can integrate multi-source time-series data and a biophysical mechanism-based insect population density time-series prediction framework, thereby accurately and dynamically quantifying the outbreak risk of tea green leafhopper.

[0006] A method for predicting the outbreak of tea green leafhopper based on a self-attention mechanism includes:

[0007] Obtain the dataset, and use the sliding window method to generate time series samples from the dataset;

[0008] A tea green leafhopper population prediction model was constructed, which is based on an LSTM neural network and a multi-head self-attention mechanism.

[0009] The dataset is input into the tea green leafhopper population prediction model for prediction, and the current population of tea green leafhoppers per 100 leaves is obtained.

[0010] The pest population change rate is calculated based on the current number of tea leafhoppers, and a risk warning of tea green leafhopper infestation is issued based on the pest population change rate.

[0011] In a preferred embodiment of the present invention, the construction of the tea green leafhopper population prediction model includes:

[0012] Construct a first LSTM neural network, a second LSTM neural network, a multi-head attention module, and a fully connected layer;

[0013] Connect the output of the first LSTM neural network to the input of the second LSTM neural network;

[0014] Connect the output of the second LSTM neural network to the input of the multi-head attention module;

[0015] Connect the output of the multi-head attention module to the input of the fully connected layer.

[0016] In a preferred embodiment of the present invention, the multi-head attention module adopts a multi-head attention mechanism, and the number of attention heads in the multi-head attention module is 4.

[0017] In a preferred embodiment of the present invention, constructing the first LSTM neural network includes:

[0018] Calculate the input gate, forget gate, and output gate using the following formulas:

[0019] ;

[0020] ;

[0021] ;

[0022] ;

[0023] Among them, i t f represents the output of the input gate at the current time step. t This indicates the output of the forget gate at the current time step, o t Indicates the activation value of the output gate at the current time step; x t h represents the input at the current time step. t-1 This indicates the hidden state of the previous time step. Indicates x t and h t-1 Perform vector concatenation. W represents the sigmoid function;i Let b represent the weight matrix of the input gate. i W represents the bias matrix of the input gate. f The weight matrix of the forget gate, b f W represents the bias matrix of the forget gate. o Let b represent the weight matrix of the output gate. o h represents the bias matrix of the output gate. t This represents the output of the gate at the current time step, tanh represents the hyperbolic tangent function, and C... t This indicates the cell state at the current time step.

[0024] In a preferred embodiment of the present invention, the step of issuing a risk warning for tea green leafhopper infestation based on the insect population change rate includes:

[0025] If the insect population change rate is less than the first risk threshold, a low-level risk is indicated.

[0026] If the insect population change rate is greater than or equal to the first risk threshold and less than the second risk threshold, a medium-level risk is indicated.

[0027] If the insect population change rate is greater than or equal to the second risk threshold, a high-level risk is indicated.

[0028] In a preferred embodiment of the present invention, before inputting the dataset into the tea green leafhopper number prediction model for prediction, the method further includes:

[0029] Construct the loss function according to the following formula:

[0030] ;

[0031] Where L represents the loss function, n represents the total number of samples, and y i This represents the true value of the number of leafhoppers in the i-th sample. This represents the predicted population size of leafhoppers for the i-th sample. This represents the dynamic weight of the i-th sample;

[0032] The model to be trained is trained using the loss function. When the number of training iterations is greater than or equal to the training iteration threshold, training is stopped, and the tea green leafhopper number prediction model is obtained.

[0033] In a preferred embodiment of the present invention, the dataset includes tea garden climate data, microenvironment data near the tea ridges, derived characteristic data, and the population count of the tea green leafhopper per 100 leaves.

[0034] In a preferred embodiment of the present invention, the tea garden climate data includes atmospheric temperature, atmospheric humidity, light intensity, and wind speed; the microenvironmental data near the tea ridges includes soil temperature, soil humidity, soil electrical conductivity, and soil pH; and the derived characteristic data includes effective accumulated temperature and precipitation markers.

[0035] In a preferred embodiment of the present invention, after acquiring the dataset, the precipitation marker and the effective accumulated temperature are calculated according to the following formula:

[0036] The formula for calculating the precipitation marker is as follows:

[0037] ;

[0038] Among them, R rain The symbol represents precipitation, rain represents rainfall amount, e represents an exponential function, and k represents a rainfall adjustment parameter.

[0039] The formula for calculating the effective accumulated temperature is as follows:

[0040] ;

[0041] Among them, T acc This represents the effective accumulated temperature, max indicates the maximum value operation, d represents the day number, total represents the total time period, and T represents the total accumulated temperature. d T represents the average daily atmospheric temperature on day d, T0 represents the developmental starting temperature of the tea green leafhopper, and . represents a multiplication operation.

[0042] In a preferred embodiment of the present invention, the formula for calculating the dynamic weight of the i-th sample in the loss function is as follows:

[0043] ;

[0044] in, This represents the dynamic weight adjustment parameter, || represents the absolute value operation, and T standard R represents the standard effective accumulated temperature. standard This indicates the standard precipitation marker.

[0045] The beneficial effects of this invention are as follows:

[0046] This invention provides a method for predicting tea green leafhopper outbreaks based on a self-attention mechanism. The method includes acquiring a dataset, using a sliding window method to generate time-series samples, constructing a tea green leafhopper population prediction model based on an LSTM neural network and a multi-head self-attention mechanism, inputting the dataset into the model for prediction, and obtaining the current leafhopper population count per 100 leaves. The population change rate is calculated based on the current population count, and a risk warning for tea green leafhopper outbreaks is issued based on the population change rate. This invention integrates tea garden climate data, microenvironmental data near tea ridges, derived feature data, and tea green leafhopper population counts per 100 leaves. The sliding window method is a method that gradually moves a fixed or variable-length window on sequence data. This invention uses the sliding window method to construct time-series data samples to integrate multi-source time-series data and biophysical mechanisms. A tea green leafhopper population prediction model was constructed using a two-layer LSTM module and a multi-head attention mechanism. The multi-head attention mechanism takes the output of the LSTM neural network as input and projects the input onto multiple low-dimensional subspaces, i.e., assigns the input to different self-attention heads, each calculating its own attention. Each attention head can learn different types of relationships, thus achieving high-rank representation and task adaptation without increasing parameters. The model predicts the current number of tea green leafhoppers per 100 leaves, calculates the population change rate, and classifies the risk of infestation based on the population change rate. Corresponding risk warnings are issued for different risk levels, thereby accurately and dynamically quantifying the risk of tea green leafhopper infestation. Attached Figure Description

[0047] Figure 1 This is a flowchart of the tea green leafhopper outbreak prediction method based on the self-attention mechanism of the present invention;

[0048] Figure 2 This is a flowchart of the construction of the tea green leafhopper number prediction model of the present invention. Detailed Implementation

[0049] Preferred embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0050] Example 1

[0051] like Figure 1 As shown, this embodiment provides a method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism, including:

[0052] S1: Obtain the dataset and use the sliding window method to generate time series samples from the dataset;

[0053] S2: Construct a tea green leafhopper number prediction model, which is based on an LSTM neural network and a multi-head self-attention mechanism;

[0054] S3: Input the dataset into the tea green leafhopper population prediction model to make a prediction and obtain the current population of tea green leafhoppers per 100 leaves;

[0055] S4: Calculate the insect population change rate based on the current number of leafhoppers in the tea plantations, and issue a risk warning of tea green leafhopper infestation based on the insect population change rate.

[0056] In time series analysis, a dataset specifically refers to a set of observations arranged in chronological order. The dataset in this embodiment includes tea garden climate data, microenvironmental data near the tea ridges, derived characteristic data, and the number of tea green leafhoppers per 100 leaves. The tea garden climate data includes atmospheric temperature, atmospheric humidity, light intensity, and wind speed. The microenvironmental data near the tea ridges includes soil temperature, soil moisture, soil electrical conductivity, and soil pH. The derived characteristic data includes effective accumulated temperature and precipitation markers. The number of tea green leafhoppers per 100 leaves on the tea trees was counted based on a 5-point sampling method.

[0057] The dataset is divided into training and validation sets in a 7:3 ratio based on the corresponding time series. After collecting the dataset, time series samples are generated by applying a sliding window method. The sliding window method is a time series data processing technique used to generate continuous sample segments from time series data. Specifically, it involves defining a fixed-size window and sliding it stepwise across the time series of the dataset, moving one time step at a time, thereby generating a series of overlapping or non-overlapping time series samples.

[0058] like Figure 2 As shown, the construction of the tea green leafhopper population prediction model includes:

[0059] S21: Construct the first LSTM neural network, the second LSTM neural network, the multi-head attention module, and the fully connected layer.

[0060] S22: Connect the output of the first LSTM neural network to the input of the second LSTM neural network.

[0061] S23: Connect the output of the second LSTM neural network to the input of the multi-head attention module.

[0062] S24: Connect the output of the multi-head attention module to the input of the fully connected layer.

[0063] The multi-head attention module adopts a multi-head attention mechanism, and the number of attention heads in the multi-head attention module is 4.

[0064] The tea green leafhopper population prediction model consists of four parts: a two-layer LSTM neural network, a multi-head attention module, and a fully connected layer. LSTM is a recurrent neural network with a special structure specifically designed to address the problems of gradient explosion, gradient vanishing, and difficulty in capturing long-term dependencies between data during long sequence training. This embodiment uses a multi-head attention mechanism with four attention heads, each focusing on different temporal features, and then merging the results to simultaneously focus on information from different positions and semantic subspaces within the sequence. The fully connected layer connects each neuron in the input layer to all neurons in the output layer, enabling the transformation of global features.

[0065] A validation set consisting of 10 dimensions, including tea garden climate data, microenvironmental data near tea ridges, and derived feature data, is input into the tea green leafhopper population prediction model for prediction. The validation set is processed sequentially through a first LSTM neural network, a second LSTM neural network, a multi-head attention module, and a fully connected layer, outputting the predicted value of the tea green leafhopper population per 100 leaves, i.e., the current population count per 100 leaves. Based on the current population count per 100 leaves, the population change rate is further calculated, and finally, a disaster risk classification is performed based on the population change rate.

[0066] This invention uses a sliding window method to convert non-time-domain datasets into time-domain datasets, i.e., time-series samples. Then, it employs two nested LSTM neural networks to selectively combine time-series features and uses a multi-head attention mechanism to combine different types of features, thereby organizing the features of various types of data in time series and improving the accuracy of predicting the current population of centipedes.

[0067] This embodiment provides a tea green leafhopper infestation prediction method based on a self-attention mechanism, which includes acquiring a dataset, using a sliding window method to generate time-series samples, constructing a tea green leafhopper population prediction model based on an LSTM neural network and a multi-head self-attention mechanism, inputting the dataset into the tea green leafhopper population prediction model for prediction, and obtaining the current population count per 100 leaves. The population change rate is calculated based on the current population count per 100 leaves, and a tea green leafhopper infestation risk warning is issued based on the population change rate. This invention integrates tea garden climate data, microenvironmental data near tea ridges, derived feature data, and tea green leafhopper population counts per 100 leaves. The sliding window method is a method that gradually moves a fixed or variable-length window on sequence data. This invention uses the sliding window method to construct time-series data samples to integrate multi-source time-series data and biophysical mechanisms. A tea green leafhopper population prediction model was constructed using a two-layer LSTM module and a multi-head attention mechanism. The multi-head attention mechanism takes the output of the LSTM neural network as input and projects the input onto multiple low-dimensional subspaces, i.e., assigns the input to different self-attention heads, each calculating its own attention. Each attention head can learn different types of relationships, thus achieving high-rank representation and task adaptation without increasing parameters. The model predicts the current number of tea green leafhoppers per 100 leaves, calculates the population change rate, and classifies the risk of infestation based on the population change rate. Corresponding risk warnings are issued for different risk levels, thereby accurately and dynamically quantifying the risk of tea green leafhopper infestation.

[0068] Example 2

[0069] like Figure 1 As shown, this embodiment provides a method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism. This embodiment describes the differences between it and Embodiment 1. The method includes:

[0070] S1: Obtain the dataset and use the sliding window method to generate time series samples from the dataset.

[0071] S2: Construct a tea green leafhopper number prediction model, which is based on an LSTM neural network and a multi-head self-attention mechanism.

[0072] S3: Input the dataset into the tea green leafhopper population prediction model to make a prediction and obtain the current population of tea green leafhoppers per 100 leaves.

[0073] S4: Calculate the insect population change rate based on the current number of leafhoppers in the tea plantations, and issue a risk warning of tea green leafhopper infestation based on the insect population change rate.

[0074] The construction of the first LSTM neural network includes:

[0075] Calculate the input gate, forget gate, and output gate using the following formulas:

[0076] ;

[0077] ;

[0078] ;

[0079] Among them, i t f represents the output of the input gate at the current time step. t This indicates the output of the forget gate at the current time step, o t Indicates the activation value of the output gate at the current time step; x t h represents the input at the current time step. t-1 This indicates the hidden state of the previous time step. Indicates x t and h t-1 Perform vector concatenation. W represents the sigmoid function; i Let b represent the weight matrix of the input gate. i W represents the bias matrix of the input gate. f The weight matrix of the forget gate, b f W represents the bias matrix of the forget gate. o Let b represent the weight matrix of the output gate. o This represents the bias matrix of the output gate.

[0080] LSTM (Long Short Term Memory) is a gated recurrent architecture specifically designed to solve the long-range dependency problem of traditional RNNs. LSTM uses a gate mechanism to control the retention, forgetting, and output of information, thereby effectively alleviating the problems of gradient vanishing and gradient exploding.

[0081] The input gate determines how much of the input at the current time step of the LSTM neural network is stored in the cell state c. t The forget gate determines the cell state c of the previous time step. t-1 How many cell states c are retained up to the current time step? t The output gate is used to control the state c of the control unit. t How much input is given to the current output value h of the LSTM neural network? t The first and second LSTM neural networks have the same construction. By controlling the input gate, forget gate, and output gate, the two LSTM neural networks can effectively capture long-term dependencies between data when processing time-series samples.

[0082] The forget gate outputs either 0 or 1 via the sigmoid function. A 1 output indicates that the cell state information from the previous time step is completely retained; a 0 output indicates that the cell state information from the previous time step is completely discarded. Cell state C t Used for long-term retention of critical information, h t As the output of the current time step, it is passed to the next time step. LSTM neural networks employ a gating mechanism, using learnable parameters to dynamically adjust the information flow, thereby avoiding gradient explosion and gradient vanishing. This invention uses a nested approach of two LSTM neural networks, where the output of the first LSTM neural network is the input of the second LSTM neural network, which can improve the detection accuracy of temporal features, thereby improving decision accuracy.

[0083] The issuance of a risk warning for tea green leafhopper infestation based on the insect population change rate includes:

[0084] S42: If the insect population change rate is less than the first risk threshold, a low-level risk is indicated;

[0085] S43: If the insect population change rate is greater than or equal to the first risk threshold and less than the second risk threshold, then a medium-level risk is indicated;

[0086] S44: If the insect population change rate is greater than or equal to the second risk threshold, a high-level risk is indicated.

[0087] Before step S42, there is also step S41: calculating the insect population change rate based on the current number of insects in the 100-leaf worms.

[0088] In this embodiment, the first risk threshold is 5% and the second risk threshold is 15%. That is, change ≤ 5% indicates that the growth rate of tea green leafhopper is slow, indicating a low level of risk; 5% < change ≤ 15% indicates that the generation rate of tea green leafhopper is moderate, indicating a medium level of risk; 15% < change indicates that the growth rate of tea green leafhopper is too fast, indicating a high level of risk. change represents the change rate of insect population.

[0089] This embodiment employs a nested approach with two LSTM neural networks, where the output of the first LSTM neural network serves as the input to the second. This approach improves the detection accuracy of temporal features while avoiding gradient explosion and vanishing gradients, thereby enhancing decision-making accuracy. A tea green leafhopper population prediction model is used to predict the leafhopper population change rate, which reflects the leafhopper's reproductive speed. If the leafhopper's reproductive speed is too fast, a high-level risk warning is issued; if the reproductive speed is moderate, a medium-level risk warning is issued; and if the reproductive speed is slow, a low-level risk warning is issued. This method enables real-time monitoring of the tea green leafhopper population in tea gardens, allowing for timely early warnings of leafhopper infestations.

[0090] Example 3

[0091] like Figure 1 As shown, this embodiment provides a method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism. This embodiment describes the differences between it and Embodiment 1. The method includes:

[0092] S1: Obtain the dataset and use the sliding window method to generate time series samples from the dataset.

[0093] S2: Construct a tea green leafhopper number prediction model, which is based on an LSTM neural network and a multi-head self-attention mechanism.

[0094] S3: Input the dataset into the tea green leafhopper population prediction model to make a prediction and obtain the current population of tea green leafhoppers per 100 leaves.

[0095] S4: Calculate the insect population change rate based on the current number of leafhoppers in the tea plantations, and issue a risk warning of tea green leafhopper infestation based on the insect population change rate.

[0096] Before inputting the dataset into the tea green leafhopper number prediction model for prediction, the method further includes:

[0097] Construct the loss function according to the following formula:

[0098] ;

[0099] Where L represents the loss function, n represents the total number of samples, and y i This represents the true value of the number of leafhoppers in the i-th sample. This represents the predicted population size of leafhoppers for the i-th sample. This represents the dynamic weight of the i-th sample;

[0100] Based on the training set, the loss function is used to train the model to be trained. When the number of training iterations is greater than or equal to the training iteration threshold, training is stopped, and the tea green leafhopper number prediction model is obtained.

[0101] A weighted MSE loss function is employed, which measures the average of the squared differences between the model's predicted and actual values. The MSE loss function offers advantages such as differentiability, sensitivity to outliers, and ease of searching for the global minimum. Directly calculating the difference between the predicted and actual leafhopper populations reflects the accuracy of the tea green leafhopper population prediction model.

[0102] The dataset includes tea garden climate data, microenvironmental data near tea ridges, derived feature data, and the population count of tea green leafhoppers per 100 leaves.

[0103] The climate data of the tea garden includes atmospheric temperature, atmospheric humidity, light intensity, and wind speed; the microenvironment data near the tea ridges includes soil temperature, soil moisture, soil electrical conductivity, and soil pH; the derived characteristic data includes effective accumulated temperature and precipitation markers.

[0104] The tea green leafhopper survives at temperatures between 19-31℃, with an optimal breeding temperature of 25-28℃. When the atmospheric temperature is below 10℃ or above 35℃, the tea green leafhopper population declines rapidly. The tea green leafhopper thrives in humidity levels of 70-90%, with an optimal breeding humidity of 80%-85%. Within this humidity range, the development period from egg to adult is significantly shortened, and egg production is increased. When the atmospheric humidity is below 45% or above 95%, the tea green leafhopper population declines.

[0105] Effective accumulated temperature is used to quantify the total amount of heat required for an insect or plant to complete a certain developmental stage. Only when the ambient temperature is higher than the developmental threshold temperature is it considered an effective temperature. This embodiment uses the daily average atmospheric temperature to calculate the effective accumulated temperature. For example, the developmental threshold temperature for the tea green leafhopper is 10℃. When the daily average temperature is higher than the developmental threshold temperature, the difference is accumulated to obtain the effective accumulated temperature T. acc。

[0106] Precipitation labeling refers to introducing precipitation factors as indicator variables into tea green leafhopper population prediction models to quantify the impact of rainfall on insect population fluctuations and prevent window periods. Generally, existing techniques use multiple discrete numerical values ​​to describe precipitation labels; for example, when rainfall is 0, the precipitation label R... rainThe precipitation marker is 0 when the rainfall is between 1-9 mm and 2 when the rainfall is between 10-24 mm. This embodiment uses an exponential function to describe the precipitation marker, meaning the precipitation marker is a continuous value. The unit of rainfall in this embodiment is mm. When the rainfall is less than or equal to 30 mm, the precipitation marker is 0; when the rainfall is greater than 30 mm, the precipitation marker is greater than 0. The larger the rainfall adjustment parameter k, the larger the value of the precipitation marker.

[0107] The formula for calculating the dynamic weight of the i-th sample in the loss function is as follows:

[0108] ;

[0109] in, This represents the dynamic weight adjustment parameter, || represents the absolute value operation, and T standard R represents the standard effective accumulated temperature. standard This indicates the standard precipitation marker.

[0110] The loss function of the tea green leafhopper population prediction model consists of the error values ​​of n samples, each with a dynamic weight. The dynamic weight is related to the effective accumulated temperature and precipitation marker. The larger the difference between the effective accumulated temperature and the standard effective accumulated temperature, the more heat the tea green leafhopper receives from egg to adult stage, leading to a rapid increase in its population. Therefore, the dynamic weight of the corresponding sample is increased, as the probability of a large-scale tea green leafhopper infestation is higher at this time. In this embodiment, the standard precipitation marker is 25 mm, corresponding to moderate rainfall. A large difference between the precipitation marker and the standard precipitation marker indicates that the rainfall type in the tea garden may be heavy rain or light rain. Heavy rain has a rainfall amount greater than 50 mm, while light rain has a rainfall amount less than 10 mm. Under heavy rain conditions, the current leafhopper population per 100 leaves decreases by 20%-40%; under light rain conditions, water shortage leads to a 30%-50% decrease in the current leafhopper population per 100 leaves. The larger the difference between the precipitation marker and the standard precipitation marker, the smaller the dynamic weight, as the probability of a large-scale tea green leafhopper infestation is lower at this time.

[0111] This embodiment combines effective accumulated temperature and precipitation markers to construct a loss function. The loss function is positively correlated with effective accumulated temperature and negatively correlated with precipitation markers. The loss function is used to train the model. Training is stopped when the number of training iterations exceeds or equals a threshold, resulting in a tea green leafhopper population prediction model. This trained tea green leafhopper population prediction model can accurately predict the current population size per 100 leaves, thereby accurately calculating the population change rate and issuing timely early warnings.

[0112] Example 4

[0113] This application also provides a computer device, which may be a server. The computer device includes a processor, memory, a network interface, and a database connected via a system bus. The processor in this computer design provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communication with external terminals via a network connection.

[0114] This embodiment also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the tea green leafhopper infestation prediction method based on a self-attention mechanism described in any one of Embodiments 1-3. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0115] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0116] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism, characterized in that, include: Obtain the dataset, and use the sliding window method to generate time series samples from the dataset; A tea green leafhopper population prediction model was constructed, which is based on an LSTM neural network and a multi-head self-attention mechanism. The dataset is input into the tea green leafhopper population prediction model for prediction, and the current population of tea green leafhoppers per 100 leaves is obtained. Calculate the insect population change rate based on the current number of insects per 100 leaves, and issue a risk warning of tea green leafhopper infestation based on the insect population change rate. Before inputting the dataset into the tea green leafhopper number prediction model for prediction, the method further includes: Construct the loss function according to the following formula: ; Where L represents the loss function, n represents the total number of samples, and y i This represents the true value of the number of leafhoppers in the i-th sample. This represents the predicted population size of leafhoppers for the i-th sample. This represents the dynamic weight of the i-th sample; The model to be trained is trained using the loss function. When the number of training iterations is greater than or equal to the threshold number of training iterations, training is stopped, and the tea green leafhopper number prediction model is obtained. The dataset includes tea garden climate data, microenvironment data near tea ridges, derived feature data, and the population count of tea green leafhoppers per 100 leaves; The climate data of the tea garden includes atmospheric temperature, atmospheric humidity, light intensity, and wind speed; the microenvironment data near the tea ridges includes soil temperature, soil moisture, soil electrical conductivity, and soil pH; the derived characteristic data includes effective accumulated temperature T. acc and precipitation marker R rain ; The formula for calculating the dynamic weight of the i-th sample in the loss function is as follows: ; in, This represents the dynamic weight adjustment parameter, || represents the absolute value operation, and T standard R represents the standard effective accumulated temperature. standard This indicates the standard precipitation marker.

2. The method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism according to claim 1, characterized in that, The construction of the tea green leafhopper population prediction model includes: Construct a first LSTM neural network, a second LSTM neural network, a multi-head attention module, and a fully connected layer; Connect the output of the first LSTM neural network to the input of the second LSTM neural network; Connect the output of the second LSTM neural network to the input of the multi-head attention module; Connect the output of the multi-head attention module to the input of the fully connected layer.

3. The method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism according to claim 2, characterized in that, The multi-head attention module adopts a multi-head attention mechanism, and the number of attention heads in the multi-head attention module is 4.

4. The method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism according to claim 2, characterized in that, The construction of the first LSTM neural network includes: Calculate the input gate, forget gate, and output gate using the following formulas: ; ; ; ; Among them, i t f represents the output of the input gate at the current time step. t This indicates the output of the forget gate at the current time step, o t Indicates the activation value of the output gate at the current time step; x t h represents the input at the current time step. t-1 This indicates the hidden state of the previous time step. Indicates x t and h t-1 Perform vector concatenation. W represents the sigmoid function; i Let b represent the weight matrix of the input gate. i W represents the bias matrix of the input gate. f The weight matrix of the forget gate, b f W represents the bias matrix of the forget gate. o Let b represent the weight matrix of the output gate. o h represents the bias matrix of the output gate. t This represents the output of the gate at the current time step, tanh represents the hyperbolic tangent function, and C... t This indicates the cell state at the current time step.

5. The method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism according to claim 1, characterized in that, The issuance of a risk warning for tea green leafhopper infestation based on the insect population change rate includes: If the insect population change rate is less than the first risk threshold, a low-level risk is indicated. If the insect population change rate is greater than or equal to the first risk threshold and less than the second risk threshold, a medium-level risk is indicated. If the insect population change rate is greater than or equal to the second risk threshold, a high-level risk is indicated.

6. The method for predicting the outbreak of tea green leafhoppers based on a self-attention mechanism according to claim 1, characterized in that, After obtaining the dataset, the precipitation marker and the effective accumulated temperature are calculated according to the following formula: The formula for calculating the precipitation marker is as follows: ; Among them, R rain The symbol represents precipitation, rain represents rainfall amount, e represents an exponential function, and k represents a rainfall adjustment parameter. The formula for calculating the effective accumulated temperature is as follows: ; Among them, T acc This represents the effective accumulated temperature, max indicates the maximum value operation, d represents the day number, total represents the total time period, and T represents the total accumulated temperature. d T represents the average daily atmospheric temperature on day d, T0 represents the developmental starting temperature of the tea green leafhopper, and . represents a multiplication operation.

Citation Information

Patent Citations

  • Tea lesser leafhopper pest dynamic prediction method based on weather and pest situation monitoring data

    CN115018125A

  • Pest control method, system and equipment based on artificial intelligence and storage medium

    CN120450611A