Tea lesser leafhopper disaster prediction method based on self-attention mechanism
By constructing a tea green leafhopper infestation prediction method based on the self-attention mechanism, and utilizing multi-source time series data and LSTM neural network, the accuracy problem of tea green leafhopper infestation prediction was solved, and dynamic quantification and timely warning of tea green leafhopper infestation risk were achieved.
Patent Information
- Application Number
- CN202511247606.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-09-03
AI Technical Summary
Existing tea green leafhopper infestation prediction technologies are difficult to accurately and dynamically quantify insect population density. Traditional methods are limited by a single data source and environmental factors, resulting in inaccurate predictions.
A tea green leafhopper infestation prediction method based on the self-attention mechanism is adopted. By acquiring multi-source time series data, a tea green leafhopper number prediction model based on an LSTM neural network and a multi-head self-attention mechanism is constructed. The sliding window method is used to generate time series samples, predict the current number of leafhoppers, calculate the insect population change rate, and issue risk warnings.
It has achieved accurate dynamic quantification of the risk of tea green leafhopper infestation, improved prediction accuracy and the timeliness of risk warnings, and adapted to risk warnings at different levels.
Smart Images

Figure CN120763543A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a tea green leafhopper disaster prediction method based on a self-attention mechanism. BACKGROUND
[0002] As a representative pest of the family of Cicadellidae in Hemiptera, tea green leafhopper is widely distributed and seriously harmful in tea areas in China. The mouth needle of tea green leafhopper pierces the epidermal cells of tea tree leaves or tender shoots with high-frequency vibration, enters the mesophyll tissue or phloem, and sucks the sap of tea tree shoots, causing the bud and leaf of tea tree to curl and the leaf margin to be scorched, which not only causes the reduction of tea yield, but also significantly reduces the aroma and quality of tea. Tea green leafhopper reproduces 9-12 generations per year in subtropical tea areas, and the phenomenon of generation overlap is significant, and the traditional prevention and control relies on artificial field investigation combined with climatic experience. The body of tea green leafhopper is small and its habitat is hidden, which leads to low efficiency of artificial monitoring, and it is difficult to meet the early warning needs of large-scale tea gardens.
[0003] The existing tea green leafhopper disaster prediction technology mainly includes statistical models and automatic pest prediction devices. The statistical model usually needs stable and low-noise time series data, but the monitored climate data usually has the characteristics of instability, such as the alternation of rainy and sunny days in a month, which makes it difficult to dynamically predict the insect population density. Although the automatic pest prediction device improves the efficiency of insect population counting, it is limited by the single data source of the fixed area, and ignores the nonlinear influence of environmental factors on population development, which makes it difficult to capture the time sequence rule of insect state development, and thus cannot provide accurate insect outbreak time points.
[0004] In summary, there is an urgent need for an insect population density time series prediction framework that can integrate multi-source time series data and biophysical mechanisms, so as to accurately and dynamically quantify the disaster risk of tea green leafhopper. SUMMARY
[0005] To overcome the problems in the related art, the purpose of the present application is to provide a tea green leafhopper disaster prediction method based on a self-attention mechanism, which can integrate an insect population density time series prediction framework of multi-source time series data and biophysical mechanisms, so as to accurately and dynamically quantify the disaster risk of tea green leafhopper.
[0006] 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 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 hundred-leaf insect population number of tea green leafhopper; According to the current number of cassida, a rate of change of the number of cassida is calculated, and a risk prompt of the cassida is sent according to the rate of change of the number of cassida.
[0007] In the preferred technical scheme of the present application, the method for constructing the prediction model of the number of cassida includes: The first LSTM neural network, the second LSTM neural network, the multi-head attention module and the full connection layer are constructed. The output end of the first LSTM neural network is connected to the input end of the second LSTM neural network. The output end of the second LSTM neural network is connected to the input end of the multi-head attention module. The output end of the multi-head attention module is connected to the input end of the full connection layer.
[0008] In the preferred technical scheme of the present application, the multi-head attention mechanism is used in the multi-head attention module, and the number of attention heads of the multi-head attention module is 4.
[0009] In the preferred technical scheme of the present application, the first LSTM neural network is constructed, and includes: The input gate, the forget gate and the output gate are calculated according to the following formula: ; ; ; ; wherein, i t represents the output of the input gate at the current time step, f t represents the output of the forget gate at the current time step, o t represents the activation value of the output gate at the current time step, x t represents the input at the current time step, h t-1 represents the hidden state at the previous time step, represents that x t and h t-1 are spliced into vectors, represents a sigmoid function, W i represents a weight matrix of the input gate, b i represents a bias matrix of the input gate, W f represents a weight matrix of the forget gate, b f represents a bias matrix of the forget gate, W o represents a weight matrix of the output gate, b o represents a bias matrix of the output gate, h t represents the output of the output gate at the current time step, tanh represents a hyperbolic tangent function, and C ta cell state of a current time step.
[0010] In the preferred technical solution of the present application, the tea green leafhopper disaster risk prompt issued according to the change rate of the insect population comprises: If the change rate of the insect population is less than a first risk threshold, a low-level risk is prompted. If the change rate of the insect population is greater than or equal to the first risk threshold and less than a second risk threshold, a middle-level risk is prompted. If the change rate of the insect population is greater than or equal to the second risk threshold, a high-level risk is prompted.
[0011] In the preferred technical solution of the present application, before the data set is input into the tea green leafhopper number prediction model for prediction, the method further comprises: A loss function is constructed according to the following formula: ; Wherein, L represents the loss function, n represents the total number of samples, y i represents the true value of the per-leaf insect population of the i th sample, represents the predicted value of the per-leaf insect population of the i th sample, represents the dynamic weight of the i th sample. The loss function is used to train the to-be-trained model, and when the number of training times is greater than or equal to a training times threshold, the training is stopped, and a tea green leafhopper number prediction model is obtained.
[0012] In the preferred technical solution of the present application, the data set comprises tea garden climate data, tea ridge nearby microenvironment data, derived feature data and tea green leafhopper per-leaf insect population.
[0013] In the preferred technical solution of the present application, the tea garden climate data comprises atmospheric temperature, atmospheric humidity, light intensity and wind speed; the tea ridge nearby microenvironment data comprises soil temperature, soil humidity, soil conductivity and soil pH value; and the derived feature data comprises effective accumulated temperature and precipitation marker.
[0014] In the preferred technical solution of the present application, after the data set is obtained, the precipitation marker and the effective accumulated temperature are calculated according to the following formula: The calculation formula of the precipitation marker is as follows: ; Wherein, R rain represents the precipitation marker, rain represents the rainfall, e represents the exponential function, and k represents the rainfall adjustment parameter. The calculation formula of the effective accumulated temperature is as follows: ; Wherein, Tacc represents effective accumulated temperature, max represents maximum value operation, d represents day number, total represents total time period, T d represents daily average atmospheric temperature of the dth day, T0 represents development starting temperature of tea green leafhopper,. represents multiplication operation.
[0015] In the preferred technical solution of the present application, the calculation formula of the dynamic weight of the i th sample of the loss function is as follows: ; wherein, represents dynamic weight adjustment parameter, || represents absolute value operation, T standard represents standard effective accumulated temperature, R standard represents standard precipitation marker.
[0016] The beneficial effects of the present application are: The tea green leafhopper disaster prediction method based on the self-attention mechanism provided by the present application comprises: acquiring a data set, using a sliding window method on the data set to generate time sequence samples. A tea green leafhopper number prediction model is constructed, and the tea green leafhopper number prediction model is based on an LSTM neural network and a multi-head self-attention mechanism. The data set is input into the tea green leafhopper number prediction model for prediction to obtain the current leafhopper population of the tea green leafhopper. The leafhopper population change rate is calculated according to the current leafhopper population, and a tea green leafhopper disaster risk prompt is issued according to the leafhopper population change rate. The present application integrates tea garden climate data, tea ridge nearby microenvironment data, derived feature data and tea green leafhopper leafhopper population, and the sliding window method is a method of moving a fixed or variable length window on sequence data. The present application adopts the sliding window method to construct time sequence data samples to fuse multi-source time sequence data and biophysical mechanisms. A double-layer LSTM module and a multi-head attention mechanism are used to construct a tea green leafhopper number prediction model. The multi-head attention mechanism takes the output of the LSTM neural network as input, projects the input to multiple low-dimensional subspaces, i.e., allocates the input to different self-attention heads, respectively calculates attention, and each attention head can learn different types of relationships, thereby realizing high-rank expression and task adaptation without increasing parameters. The tea green leafhopper number prediction model is used to predict the current leafhopper population of the tea green leafhopper, calculate the leafhopper population change rate, and classify the disaster risk according to the leafhopper population change rate. Corresponding risk prompts are issued for different levels of risk, so as to accurately dynamically quantify the disaster risk of the tea green leafhopper. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a flowchart of the tea green leafhopper disaster prediction method based on the self-attention mechanism of the present application; Figure 2 is a flowchart of constructing a tea green leafhopper number prediction model of the present application. DETAILED DESCRIPTION
[0018] Preferred embodiments of the present application will be described in more detail with reference to the drawings. Although the preferred embodiments of the present application are shown in the drawings, it is to be understood that the present application can be carried out in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
[0019] Example 1 As Figure 1 shown, the present embodiment provides a tea green leafhopper outbreak prediction method based on a self-attention mechanism, comprising: S1: obtaining a data set, using a sliding window method on the data set to generate time series samples; S2: 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; S3: inputting the data set into the tea green leafhopper number prediction model for prediction to obtain the current hundred leaf insect population of the tea green leafhopper; S4: calculating the insect population change rate according to the current hundred leaf insect population, and issuing a tea green leafhopper outbreak risk prompt according to the insect population change rate.
[0020] In time series analysis, a data set specifically refers to a collection of observation values arranged in chronological order. The data set of the present embodiment includes tea garden climate data, tea ridge near microenvironment data, derived feature data, and tea green leafhopper hundred leaf insect population, wherein the tea garden climate data includes atmospheric temperature, atmospheric humidity, light intensity, and wind speed, the tea ridge near microenvironment data includes soil temperature, soil humidity, soil electrical conductivity, and soil pH value, the derived feature data includes effective accumulated temperature and precipitation marker, and the tea green leafhopper insect population per hundred leaves on the tea tree is counted based on a 5-point sampling method.
[0021] According to the corresponding time series, the data set is divided into a training set and a validation set in a ratio of 7:3. After collecting the data set, a sliding window method is used on the data set to generate time series samples. The sliding window method is a time series data processing technique used to generate continuous sample segments from time series data. Specifically, by defining a fixed size window, the window is moved step by step on the time series of the data set, moving one time step each time, thereby generating a series of overlapping or non-overlapping time series samples.
[0022] As Figure 2 shown, the tea green leafhopper number prediction model comprises: S21: constructing a first LSTM neural network, a second LSTM neural network, a multi-head attention module, and a fully connected layer.
[0023] S22: connecting an output end of the first LSTM neural network to an input end of the second LSTM neural network.
[0024] S23: connecting an output end of the second LSTM neural network to an input end of the multi-head attention module.
[0025] S24: connecting an output end of the multi-head attention module to an input end of the full connection layer.
[0026] The multi-head attention module adopts a multi-head attention mechanism, and the number of attention heads of the multi-head attention module is 4.
[0027] The tea green leafhopper number prediction model comprises two layers of LSTM neural networks, a multi-head attention module and a full connection layer, the LSTM is a special structure of recurrent neural network, which is specially used to solve the problems of gradient explosion, gradient disappearance and difficulty in capturing long-term dependencies between data in long sequence training process. The multi-head attention mechanism of the embodiment is designed with 4 attention heads, each attention head focuses on different time sequence features, and the results are combined to simultaneously focus on information in different positions and different semantic subspaces in the sequence. The full connection layer connects each neuron of the input layer to all neurons of the output layer, and can transform global features.
[0028] The verification set composed of 10-dimensional features such as tea garden climate data, microenvironment data near the tea ridge and derived feature data is input into the tea green leafhopper number prediction model for prediction, and after the verification set is processed by the first LSTM neural network, the second LSTM neural network, the multi-head attention module and the full connection layer in turn, the prediction value of the tea green leafhopper per leaf insect population is output, that is, the current tea green leafhopper per leaf insect population. According to the current per leaf insect population, the change rate of the insect population is further calculated, and finally the disaster risk classification is carried out according to the change rate of the insect population.
[0029] The application converts the non-time domain data set into a time domain data set, i.e. a time sequence sample, by using a sliding window method, selectively combines time sequence features by using two nested LSTM neural networks, combines different types of features by using a multi-head attention mechanism, thereby arranging the features of various types of data in time sequence, and improving the accuracy of predicting the current per leaf insect population.
[0030] The tea green leafhopper disaster prediction method based on the self-attention mechanism provided in the embodiment includes obtaining a data set, using a sliding window method on the data set to generate time sequence samples. A tea green leafhopper number prediction model is constructed, and the tea green leafhopper number prediction model is based on an LSTM neural network and a multi-head self-attention mechanism. The data set is input into the tea green leafhopper number prediction model for prediction to obtain the current hundred insect population number of the tea green leafhopper. The insect population change rate is calculated according to the current hundred insect population number, and a tea green leafhopper disaster risk prompt is issued according to the insect population change rate. The present application integrates tea garden climate data, tea ridge nearby microenvironment data, derived feature data and tea green leafhopper hundred insect population number, and the sliding window method is a method of moving a fixed or variable length window on sequence data. The present application uses the sliding window method to construct time sequence data samples to fuse multi-source time sequence data and biophysical mechanisms. A double-layer LSTM module and a multi-head attention mechanism are used to construct a tea green leafhopper number prediction model. The multi-head attention mechanism takes the output of the LSTM neural network as input, projects the input to multiple low-dimensional subspaces, that is, allocates the input to different self-attention heads, respectively calculates the attention, and each attention head can learn different types of relationships, thereby realizing high-rank expression and task adaptation without increasing parameters. The tea green leafhopper number prediction model is used to predict the current hundred insect population number of the tea green leafhopper, the insect population change rate is calculated, the disaster risk is classified according to the insect population change rate, and corresponding risk prompts are issued for different levels of risk, so that the disaster risk of the tea green leafhopper can be accurately quantified dynamically.
[0031] Embodiment 2 As shown in Figure 1 The embodiment provides a tea green leafhopper disaster prediction method based on a self-attention mechanism. The embodiment describes the differences from embodiment 1 on the basis of embodiment 1. The method comprises: S1: obtaining a data set, using a sliding window method on the data set to generate time sequence samples.
[0032] S2: constructing a tea green leafhopper number prediction model, and the tea green leafhopper number prediction model is based on an LSTM neural network and a multi-head self-attention mechanism.
[0033] S3: inputting the data set into the tea green leafhopper number prediction model for prediction to obtain the current hundred insect population number of the tea green leafhopper.
[0034] S4: calculating the insect population change rate according to the current hundred insect population number, and issuing a tea green leafhopper disaster risk prompt according to the insect population change rate.
[0035] The first LSTM neural network is constructed, comprising: The input gate, the forgetting gate and the output gate are calculated according to the following formula: ; ; ; wherein, i t represents the output of the current time step input gate, f t represents the output of the current time step forget gate, o t represents the activation value of the current time step output gate; x t represents the input of the current time step, h t-1 represents the hidden state of the previous time step, represents the vector splicing of x t and h t-1 , represents the sigmoid function; W i represents the weight matrix of the input gate, b i represents the bias matrix of the input gate, W f represents the weight matrix of the forget gate, b f represents the bias matrix of the forget gate, W o represents the weight matrix of the output gate, b o represents the bias matrix of the output gate.
[0036] LSTM (Long Short Term Memory, Long Short Term Memory Network) is a gated recurrent architecture specially designed to solve the long-range dependence problem of traditional RNN. LSTM controls the preservation, forgetting and output of information through the gate mechanism, thereby effectively alleviating the problems of gradient disappearance and gradient explosion.
[0037] The input gate determines how much of the current time step input of the LSTM neural network is saved to the cell state c t , the forget gate determines how much of the cell state c t-1 of the previous time step is preserved to the cell state c t of the current time step, and the output gate is used to control how much of the cell state c t is input to the current output value h t of the LSTM neural network. The first LSTM neural network and the second LSTM neural network are constructed in the same way. By controlling the input gate, the forget gate and the output gate, the two LSTM neural networks can effectively capture the long-term dependence between data in the process of processing time series samples.
[0038] The forget gate outputs 0 or 1 through the sigmoid function. When the output of the forget gate is 1, it means that the information of the cell state of the previous time step is completely preserved; when the output of the forget gate is 0, it means that the information of the cell state of the previous time step is completely discarded. The cell state C t is used to long-term preservation of key information, h tAs the output of the current time step, and passed to the next time step. The LSTM neural network adopts a gating mechanism to dynamically adjust the information flow through learnable parameters, thereby avoiding gradient explosion and gradient disappearance. The present application adopts a nested manner of two LSTM neural networks, that is, the output of the first LSTM neural network is the input of the second LSTM neural network, which can improve the detection accuracy of the time sequence feature, thereby improving the decision accuracy.
[0039] The tea green leafhopper disaster risk prompt is issued according to the change rate of the insect population, and includes: S42: If the change rate of the insect population is less than a first risk threshold, a low-level risk is prompted; S43: If the change rate of the insect population is greater than or equal to the first risk threshold and less than a second risk threshold, a middle-level risk is prompted; S44: If the change rate of the insect population is greater than or equal to the second risk threshold, a high-level risk is prompted.
[0040] Before step S42, it further includes step S41: calculating the change rate of the insect population according to the current insect population.
[0041] 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 the tea green leafhopper is slow, and a low-level risk is prompted; 5%<change≤15% indicates that the growth rate of the tea green leafhopper is moderate, and a middle-level risk is prompted; 15%<change indicates that the growth rate of the tea green leafhopper is too fast, and a high-level risk is prompted, and change represents the change rate of the insect population.
[0042] In this embodiment, a nested manner of two LSTM neural networks is adopted, that is, the output of the first LSTM neural network is the input of the second LSTM neural network, which can improve the detection accuracy of the time sequence feature under the premise of avoiding gradient explosion and gradient disappearance, thereby improving the decision accuracy. The change rate of the insect population is predicted by using the tea green leafhopper number prediction model, and the change rate of the insect population can reflect the reproduction rate of the tea green leafhopper. If the reproduction rate of the tea green leafhopper is too fast, a high-level risk prompt is issued; if the reproduction rate of the tea green leafhopper is moderate, a middle-level risk prompt is issued; and if the reproduction rate of the tea green leafhopper is slow, a low-level risk prompt is issued. Through the above-mentioned manner, real-time monitoring of the number of tea green leafhoppers in the tea garden can be realized, and early warning information of the tea green leafhopper disaster can be timely issued.
[0043] Embodiment 3 As Figure 1 shown, the present embodiment provides a tea green leafhopper disaster prediction method based on a self-attention mechanism. The present embodiment describes the differences from embodiment 1 based on embodiment 1, and the method includes: S1: obtaining a data set, using a sliding window method on the data set to generate time series samples.
[0044] S2: constructing a number of tea green leafhoppers prediction model based on LSTM neural network and multi-head self-attention mechanism.
[0045] S3: inputting the data set into the number of tea green leafhoppers prediction model for prediction to obtain the current number of tea green leafhoppers per leaf.
[0046] S4: calculating the rate of change of insect population according to the current number of tea green leafhoppers per leaf, and issuing a risk warning of tea green leafhopper disaster according to the rate of change of insect population.
[0047] Before the data set is input into the number of tea green leafhoppers prediction model for prediction, it further comprises: The loss function is constructed according to the following formula: ; Wherein, L represents the loss function, n represents the total number of samples, y i represents the true value of the number of tea green leafhoppers per leaf of the i-th sample, represents the predicted value of the number of tea green leafhoppers per leaf of the i-th sample, represents the dynamic weight of the i-th sample. Based on the training set, the loss function is used to train the to-be-trained model, and when the training times are greater than or equal to the training times threshold, the training is stopped, and the number of tea green leafhoppers prediction model is obtained.
[0048] The weighted MSE loss function is used, the MSE loss function measures the square of the difference between the predicted value and the true value of the model, and then takes the average, the MSE loss function has the advantages of differentiability, sensitivity to abnormal values, and easy to search for global minimum value. Directly calculate the difference between the predicted value of the number of tea green leafhoppers per leaf and the true value of the number of tea green leafhoppers per leaf, which can reflect the accuracy of the number of tea green leafhoppers prediction model in predicting the number of tea green leafhoppers per leaf.
[0049] The data set comprises tea garden climate data, tea ridge nearby microenvironment data, derived feature data and tea green leafhopper per leaf insect population.
[0050] The tea garden climate data comprises atmospheric temperature, atmospheric humidity, light intensity and wind speed; the tea ridge nearby microenvironment data comprises soil temperature, soil humidity, soil electrical conductivity and soil pH value; the derived feature data comprises effective accumulated temperature and precipitation marker.
[0051] The tea green leafhopper thrives in a temperature range of 19-31°C, with an optimum breeding temperature of 25-28°C. When the atmospheric temperature drops below 10°C or exceeds 35°C, the tea green leafhopper's population rapidly declines. The tea green leafhopper thrives in a humidity range of 70-90%, with an optimum 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's population declines.
[0052] Effective accumulated temperature is used to quantify the total amount of heat required for insects or plants to complete a certain development stage. It is considered effective temperature only when the ambient temperature is higher than the development starting temperature. This embodiment uses the daily average atmospheric temperature to calculate the effective accumulated temperature. For example, the development starting temperature of the tea green leafhopper is 10°C. When the daily average temperature is higher than the development starting temperature, the difference is accumulated to obtain the effective accumulated temperature T acc。
[0053] The precipitation marker refers to the introduction of precipitation factors as indicator variables in the tea green leafhopper population prediction model to quantify the impact of rainfall on insect population fluctuations and prevention windows. Generally, the existing technology uses multiple discrete values to describe the precipitation marker. For example, when the rainfall is 0, the precipitation marker R rain The precipitation flag is 0; when the rainfall is between 1-9 mm, the precipitation flag is 1; when the rainfall is between 10-24 mm, the precipitation flag is 2. This embodiment uses an exponential function to describe the precipitation flag, that is, the precipitation flag 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 flag is 0; when the rainfall is greater than 30 mm, the precipitation flag is greater than 0. The larger the rainfall adjustment parameter k, the larger the value of the precipitation flag.
[0054] The calculation formula of the dynamic weight of the i-th sample of the loss function is as follows: ; in, represents the dynamic weight adjustment parameter, || represents the absolute value operation, T standard Indicates the standard effective accumulated temperature, R standard Indicates standard precipitation mark.
[0055] The loss function of the tea green leafhopper number prediction model is composed of error values of n samples, and each sample error value corresponds to a dynamic weight. The dynamic weight is related to the effective accumulated temperature and the precipitation mark. The greater the difference between the effective accumulated temperature and the standard effective accumulated temperature, the more heat the tea green leafhopper obtains from the egg stage to the adult stage, and the number of tea green leafhoppers will enter a rapid growth stage. At this time, the dynamic weight of the corresponding sample is increased because the possibility of a large-scale tea green leafhopper disaster is higher. The standard precipitation mark of this embodiment is 25 mm, which corresponds to moderate rainfall. When the difference between the precipitation mark and the standard precipitation mark is large, it indicates that the rainfall type of the tea garden may be heavy rain or light rain. The rainfall of heavy rain is greater than 50 mm, and the rainfall of light rain is less than 10 mm. In the case of heavy rain, the current number of tea green leafhoppers decreases by 20%-40%; in the case of light rain, water shortage will cause the current number of tea green leafhoppers to decrease by 30%-50%. The greater the difference between the precipitation mark and the standard precipitation mark, the smaller the dynamic weight, because the possibility of a large-scale tea green leafhopper disaster is lower.
[0056] In this embodiment, the loss function is constructed in combination with the effective accumulated temperature and the precipitation mark. The loss function is positively correlated with the effective accumulated temperature, and the loss function is negatively correlated with the precipitation mark. The loss function is used to train the to-be-trained model. When the training times are greater than or equal to the training times threshold, the training is stopped, and the tea green leafhopper number prediction model is obtained. The tea green leafhopper number prediction model trained in the foregoing manner can accurately predict the current number of tea green leafhoppers, thereby accurately calculating the change rate of the number of tea green leafhoppers and timely issuing a warning prompt.
[0057] Embodiment 4 In the embodiments of the present application, a computer device is also provided, which can be a server. The computer device includes a processor, a memory, a network interface and a database connected by a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection.
[0058] The embodiments also provide a computer readable storage medium having a computer program stored thereon. The computer program is executed by a processor to implement the tea green leafhopper disaster prediction method based on the self-attention mechanism according to any one of the embodiments 1-3. It can be understood that the computer readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0059] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a", "comprising", or "comprises" does not, without further restriction, exclude the existence of additional elements of the process, method, article, or apparatus that comprises the element.
[0060] The above only describes the preferred embodiments of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for predicting tea green leafhopper infestation based on a self-attention mechanism, characterized in that: include: Acquire a data set, and use a sliding window method on the data set to generate time series samples; Constructing a tea leafhopper population prediction model 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 to perform prediction to obtain the current population of the tea green leafhopper; The insect population change rate is calculated based on the current insect population number, and a tea green leafhopper infestation risk warning is issued based on the insect population change rate.
2. The method for predicting tea green leafhopper infestation based on the self-attention mechanism according to claim 1, characterized in that: The method of constructing a tea green leafhopper number prediction model comprises: Build the first LSTM neural network, the second LSTM neural network, the multi-head attention module and the fully connected layer; Connecting the output of the first LSTM neural network to the input of the second LSTM neural network; Connecting 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 tea green leafhopper infestation based on the 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 of the multi-head attention module is 4.
4. The method for predicting tea green leafhopper infestation based on the self-attention mechanism according to claim 2, characterized in that: The first LSTM neural network is constructed, comprising: The input gate, forget gate, and output gate are calculated according to the following formula: ; ; ; ; Among them, i t represents the output of the input gate at the current time step, f t Represents the output of the forget gate at the current time step, o t Represents the activation value of the output gate at the current time step; x t represents the input of the current time step, h t-1 represents the hidden state of the previous time step, Indicates that x t and h t-1 Perform vector stitching, represents the sigmoid function; W i represents the weight matrix of the input gate, b i represents the bias matrix of the input gate, W f represents the weight matrix of the forget gate, b f Represents the bias matrix of the forget gate, W o represents the weight matrix of the output gate, b o represents the bias matrix of the output gate; h t represents the output of the output gate at the current time step, tanh represents the hyperbolic tangent function, C t Represents the cell state at the current time step.
5. The method for predicting tea green leafhopper infestation based on the self-attention mechanism according to claim 1, characterized in that: The issuing of a tea green leafhopper infestation risk warning 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 tea green leafhopper infestation based on the self-attention mechanism according to claim 1, characterized in that: Before inputting the data set into the tea green leafhopper number prediction model for prediction, the method further comprises: The loss function is constructed according to the following formula: ; Where L represents the loss function, n represents the total number of samples, and y i represents the true value of the number of beetles in the i-th sample, represents the predicted value of the number of leafhoppers in the i-th sample, represents the dynamic weight of the i-th sample; The loss function is used to train the model to be trained. When the number of training times is greater than or equal to the training number threshold, the training is stopped to obtain a tea green leafhopper number prediction model.
7. The method for predicting tea green leafhopper infestation based on the self-attention mechanism according to claim 6, characterized in that: The data set includes tea garden climate data, microenvironment data near tea ridges, derived characteristic data and the population count of tea green leafhoppers.
8. The method for predicting tea green leafhopper infestation based on the self-attention mechanism according to claim 7, characterized in that: The tea garden climate data includes atmospheric temperature, atmospheric humidity, light intensity and wind speed; the microenvironment data near the tea ridges includes soil temperature, soil moisture, soil conductivity and soil pH value; the derived characteristic data includes effective accumulated temperature and precipitation mark.
9. The method for predicting tea green leafhopper infestation based on the self-attention mechanism according to claim 8, characterized in that: After obtaining the data set, the precipitation mark and the effective accumulated temperature are calculated according to the following formula: The calculation formula of the precipitation mark is as follows: ; Among them, R rain represents precipitation mark, rain represents rainfall, e represents exponential function, and k represents rainfall adjustment parameter; The calculation formula of the effective accumulated temperature is as follows: ; Among them, T acc Indicates effective accumulated temperature, max indicates the maximum value operation, d indicates the day number, total indicates the total time period, T d represents the daily average atmospheric temperature on the dth day, T0 represents the starting temperature of the development of the tea green leafhopper, and . represents a multiplication operation.
10. The method for predicting tea green leafhopper infestation based on the self-attention mechanism according to claim 9, characterized in that: The calculation formula of the dynamic weight of the i-th sample of the loss function is as follows: ; in, represents the dynamic weight adjustment parameter, || represents the absolute value operation, T standard Indicates the standard effective accumulated temperature, R standard Indicates standard precipitation mark.
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
