An agricultural drought grade prediction method and device, an electronic device, and a storage medium

By using the GRU model, multi-head self-attention mechanism, and GCN graph convolution module, the overfitting problem caused by the excessive number of parameters in the LSTM model was solved, improving the accuracy of agricultural drought level prediction and reducing agricultural losses.

CN115879623BActive Publication Date: 2026-05-01NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF INFORMATION SCI & TECH
Filing Date
2022-12-12
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, LSTM models have too many parameters in predicting agricultural drought levels, which easily leads to overfitting and low prediction accuracy, resulting in agricultural losses.

Method used

By employing a GRU model combined with a multi-head self-attention mechanism and a GCN graph convolution module, the number of parameters is reduced by extracting temporal, variable, and spatial features, and feature information is refined from multiple dimensions. The model focuses on data at important moments and utilizes the correlation of climate features between adjacent grid points to improve prediction accuracy.

Benefits of technology

By reducing overfitting, the accuracy of drought level prediction has been improved, thus reducing agricultural losses caused by drought.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115879623B_ABST
    Figure CN115879623B_ABST
Patent Text Reader

Abstract

The application discloses an agricultural drought grade prediction method and device, electronic equipment and a storage medium, the method comprises the following steps: extracting time series data of a land surface from a CRU data center; extracting features of the time series data on a time scale, and performing feature fusion and global average pooling to obtain a time feature matrix; extracting features of the time series data on a variable scale, and performing global average pooling to obtain a variable feature matrix; extracting features of the time series data in space, and integrating information of adjacent grid points into the grid point information to obtain a spatial feature matrix; and splicing the time feature matrix, the variable feature matrix and the spatial feature matrix together, and outputting a final drought grade classification result through a Softmax layer. The application improves the prediction accuracy of agricultural drought grades and further reduces agricultural losses caused by drought.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method, device, electronic equipment, and storage medium for predicting agricultural drought levels, belonging to the field of computer and agricultural technology. Background Technology

[0002] Drought is one of the most significant, common, and widespread climate disasters affecting agricultural production in my country. Agricultural drought forecasting is not only a crucial basis for policymakers' disaster mitigation decisions but also a non-engineering measure for drought defense. Understanding drought trends in advance, adjusting crop varieties, and developing effective drought resistance and mitigation measures are of great importance in reducing agricultural losses.

[0003] With the advancement of science and technology, deep learning is increasingly being used in time series prediction. In drought prediction research, commonly used prediction models include ARIMA, Artificial Neural Networks (ANN), Recurrent Neural Networks (RNN), and Long Short-Term Memory Model (LSTM)

[15] . MLSTM_FCN is a network proposed in recent years that can effectively classify time series with multiple features.

[0004] Because LSTM has a large number of parameters, it is prone to overfitting, resulting in insufficient accuracy in model predictions. This could lead to agricultural losses due to drought. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, device, electronic device and storage medium for predicting agricultural drought levels, thereby improving the accuracy of agricultural drought level prediction and further reducing agricultural losses caused by drought.

[0006] To achieve the above objectives, the present invention is implemented using the following technical solution:

[0007] In a first aspect, the present invention provides a method for predicting agricultural drought levels, comprising:

[0008] Extracting time-series data of the land surface from the CRU data center;

[0009] Extract the features of time series data on the time scale, and perform feature fusion and global average pooling to obtain the time feature matrix;

[0010] Extract the features of time series data at the variable scale and perform global average pooling to obtain the variable feature matrix;

[0011] Extract spatial features from time series data, incorporate information from adjacent grid points into the information of that grid point, and obtain a spatial feature matrix;

[0012] The time feature matrix, variable feature matrix, and spatial feature matrix are concatenated together and passed through a Softmax layer to output the final drought level classification result.

[0013] Furthermore, the step of extracting features from the time series data on a time scale, and performing feature fusion and global average pooling to obtain a time feature matrix includes:

[0014] Time series data is input into the dimension shuffling layer for dimension replacement;

[0015] The data obtained after dimension replacement is input into the GRU layer to extract temporal information for each variable. Finally, each variable will output a hidden state, which is concatenated into a hidden matrix.

[0016] The obtained hidden matrix is ​​input into a multi-head self-attention mechanism to perform multiple independent attention calculations, extract temporal feature information from multiple dimensions, and then the results are concatenated to obtain a preliminary temporal feature matrix.

[0017] The initial time feature matrix is ​​passed through a global average pooling layer to obtain the final time feature matrix.

[0018] Furthermore, the calculation formula for the global average pooling layer is as follows:

[0019]

[0020] In the formula, y k Let x represent the global average pooling output value of the k-th feature map. kpq Let |R| represent the element located at (p,q) in the k-th feature map region R, and let |R| represent the total number of elements in the k-th feature map.

[0021] Furthermore, the step of extracting features of the time series data at the variable scale and performing global average pooling to obtain the variable feature matrix includes:

[0022] Time series data is input into multiple temporal convolutional modules to extract variable features and obtain a preliminary variable feature matrix;

[0023] The initial variable feature matrix is ​​then subjected to global average pooling to obtain the final variable feature matrix.

[0024] Furthermore, the temporal convolution module includes a one-dimensional convolution module, batch normalization, ReLU activation function, and compressed excitation module.

[0025] Furthermore, time series data is input into multiple temporal convolutional modules to extract variable features, including:

[0026] The time series data is passed through a one-dimensional convolutional layer, and then batch normalization and ReLU activation are performed.

[0027] The data obtained from batch normalization and ReLU activation are input into the compression excitation module, and the following steps are performed:

[0028] Compress the features of each time step of each input time series into a single feature;

[0029] By using a bottleneck structure to capture the correlation between feature channels, the scaling factor of each channel can be learned.

[0030] The output weights are multiplied and applied channel by channel to the previous features, thus completing the recalibration of the original features in the channel dimension.

[0031] Furthermore, the spatial features of the extracted time-series data are obtained by using the GCN graph convolution module to incorporate the information of adjacent grid points into the grid point information, thus obtaining a spatial feature matrix. The calculation formula is as follows:

[0032]

[0033] In the formula, l represents the l-th layer of the neural network, which contains the first graph convolutional layer. Where A represents the adjacency matrix, I represents the identity matrix, and δ(·) represents the activation function; W is the degree matrix of A; (l) y is the weight matrix of the GCN in layer l; G,l It is the output of the l-th layer GCN.

[0034] Secondly, the present invention provides an agricultural drought level prediction device, comprising:

[0035] The data acquisition module is used to extract time-series data of the land surface from the CRU data center;

[0036] The first extraction module is used to extract the features of time series data on the time scale, and perform feature fusion and global average pooling to obtain the time feature matrix;

[0037] The second extraction module is used to extract the features of time series data on the variable scale and perform global average pooling to obtain the variable feature matrix.

[0038] The third extraction module is used to extract the spatial features of time series data, integrate the information of adjacent grid points into the information of that grid point, and obtain a spatial feature matrix.

[0039] The classification module is used to concatenate the temporal feature matrix, variable feature matrix, and spatial feature matrix together, and output the final drought level classification result through the Softmax layer.

[0040] Thirdly, the present invention provides an electronic device, including a processor and a storage medium;

[0041] The storage medium is used to store instructions;

[0042] The processor is configured to operate according to the instructions to perform the steps of the method according to any of the preceding claims.

[0043] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the preceding methods.

[0044] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0045] (1) This invention provides a method, device, electronic device, and storage medium for predicting agricultural drought levels. By employing a GRU model, the number of model parameters is reduced, thereby reducing the overfitting problem caused by an excessive number of parameters. By adding a multi-head self-attention mechanism after the GRU model, feature information can be extracted from multiple dimensions. By inputting the time features of each variable output by the GRU into the multi-head attention mechanism, this mechanism can assign different weights to the time series, thereby enabling the network to focus on data at important moments and reduce the emphasis on data at unimportant moments.

[0046] (2) This invention adds a GCN graph convolution module to obtain the feature vector of the grid point by considering the grid point's own attributes and the attributes of its neighboring nodes. Since the climate characteristics of adjacent grid points are somewhat correlated, the accuracy of the model prediction can be improved. Attached Figure Description

[0047] Figure 1 This is a flowchart of an agricultural drought level prediction method provided in an embodiment of the present invention;

[0048] Figure 2 This is a schematic diagram of the model provided in an embodiment of the present invention; Detailed Implementation

[0049] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0050] Example 1

[0051] This embodiment introduces a method for predicting agricultural drought levels, including:

[0052] Extracting time-series data of the land surface from the CRU data center;

[0053] Extract the features of time series data on the time scale, and perform feature fusion and global average pooling to obtain the time feature matrix;

[0054] Extract the features of time series data at the variable scale and perform global average pooling to obtain the variable feature matrix;

[0055] Extract spatial features from time series data, incorporate information from adjacent grid points into the information of that grid point, and obtain a spatial feature matrix;

[0056] The time feature matrix, variable feature matrix, and spatial feature matrix are concatenated together and passed through a Softmax layer to output the final drought level classification result.

[0057] like Figure 1 , Figure 2 As shown, the agricultural drought level prediction method provided in this embodiment involves the following steps in its application process:

[0058] Step 1): CRUTS provides monthly data on the global land surface covered from 1901 to 2020 at a resolution of 0.5°. Data for Henan Province from 1961 to 2018 is extracted from the CRU data, and the dataset is divided (1961-2015 as the training set and 2016-2018 as the test set).

[0059] Step 2) Extract the features of the time series data on the time scale and input them into the multi-head self-attention for feature fusion.

[0060] Step 201) Input the time series obtained in step 1) into the dimension shuffling layer for dimension replacement. That is, assuming the input variables have Q time steps and M variables, after replacement, they become M time steps and Q variables.

[0061] Step 202): The data obtained in step 2.1) is input into the GRU layer to extract temporal information for each variable. Finally, each variable will output a hidden state, which is concatenated into a hidden matrix.

[0062] Step 203) Input the hidden matrix obtained in step 2.2) into the multi-head self-attention mechanism to perform multiple independent attention calculations, which can extract time feature information from multiple dimensions, making the model pay more attention to information at important moments, and then concatenate the results.

[0063] Step 204): The feature matrix obtained in step 2.3) is passed through a global average pooling layer, and only one value is output for each channel.

[0064] Step 3) Extract the features of time series data on variables by using multiple time convolution blocks.

[0065] Step 301): Input the time series obtained in step 1) into two temporal convolution modules (including one-dimensional convolution, batch normalization, ReLU activation and compression activation modules) to extract the features of the variables.

[0066] Step 302): Input the feature matrix obtained in step 301) into the one-dimensional convolution module and use batch normalization and ReLU activation function to further extract features.

[0067] Step 303): The feature matrix obtained in step 302) is passed through a global average pooling layer, and only one value is output for each channel.

[0068] Step 4) Establish the adjacency relationship of each grid point to obtain the adjacency matrix of the grid point data, and input the time series data and adjacency matrix into GCN. After two linear layers, compress the feature vector to obtain the spatial features of the grid point data.

[0069] Step 5) Concatenate the three feature matrices obtained in Steps 2), 3), and 4) together, and then output the final classification result through the Softmax layer.

[0070] Specifically, the calculation definition of GRU (gated recurrent neural network) in step 202 is as follows:

[0071] z t =σ g (W z x t +U z h t-1 +b z )

[0072] r t =σ g (W r x t +U r h t-1 +b r )

[0073]

[0074]

[0075] In the formula r t and z t These represent the reset door and the update door, respectively. tLet h represent the input vector. t Indicates the output vector. Let h represent the candidate hidden vector. t-1 This represents the output vector from the previous time step. W and U represent the weight matrices, b is the bias term, and σ... g φ represents the sigmoid activation function. h This represents the tanh activation function.

[0076] Specifically, the multi-head self-attention mechanism layer in step 203 is described as follows: Define h attention heads, that is, apply h self-attention modules to the feature matrix S obtained in step 3. S can be divided into h X sequences, each X sequence having a size of N×d, where D = hd, N is the number of features, and D is the dimension of each feature representation; concatenate the results of the h attention heads together, and finally perform a linear transformation W. o The output H is obtained, and the size of H is N×D, as shown in formula (1). For the i-th h sequence, the attention module will learn three weight matrices, namely W i Q W i K W i V From formula (2), we can obtain three vectors: Q, K, and V. For a given vector, The matching K key vectors are calculated using the inner product, with a dimension of d. The output of self-attention can be calculated using formula (3):

[0077] head i =Attention(Q) i ,K i V i (1)

[0078] In the formula, head i This is the i-th self-attention module;

[0079] Q i =XW i Q ,K i =XW i k V i =XW i V (2)

[0080]

[0081] In the formula, Softmax(·) is the softmax function, the superscript T indicates transpose, and d k Let k be the dimensions of the key vectors.

[0082] Specifically, the calculation process of the global average pooling layer in steps 204 and 303 is as follows:

[0083]

[0084] In the formula, y k Let x represent the global average pooling output value of the k-th feature map. kpq Let |R| represent the element located at (p,q) in the k-th feature map region R, and let |R| represent the total number of elements in the k-th feature map.

[0085] Specifically, the temporal convolution module in step 301 includes the following steps:

[0086] The data obtained in step 1 is first passed through a one-dimensional convolutional layer, followed by batch normalization and ReLU activation. The resulting data is then input into the compression activation module, which is implemented as follows:

[0087] (1) Compress the features of each time step of each time series into one feature. This process is generally accomplished by global average pooling. Each feature channel is transformed into a real number, which to some extent has a global receptive field, and the output dimension matches the number of input feature channels.

[0088]

[0089] (2) By using a bottleneck structure to capture the correlation between channels, the scaling factor (or attention weight) of each channel is learned.

[0090] (3) Treat the weights output in the previous step as the importance of each feature channel after feature selection, and then add them to the previous features one channel at a time through multiplication to complete the recalibration of the original features in the channel dimension.

[0091] Specifically, step 4 extracts spatial features of the time series data using GCN, and incorporates information from adjacent grid points into the grid point information. The specific formula is as follows:

[0092]

[0093] In the formula, l represents the l-th layer of the neural network, which contains the first graph convolutional layer. Where A represents the adjacency matrix, I represents the identity matrix, and δ(·) represents the activation function; W is the degree matrix of A; (l) y is the weight matrix of the GCN in layer l; G,l It is the output of the l-th layer GCN;

[0094] Specifically, step 5 involves concatenating the output matrices from steps 2, 3, and 4 to obtain a feature matrix that fuses temporal, variable, and spatial features. Finally, the final classification result is output through a Softmax layer.

[0095] Example 2

[0096] This embodiment provides an agricultural drought level prediction device, including:

[0097] The data acquisition module is used to extract time-series data of the land surface from the CRU data center;

[0098] The first extraction module is used to extract the features of time series data on the time scale, and perform feature fusion and global average pooling to obtain the time feature matrix;

[0099] The second extraction module is used to extract the features of time series data on the variable scale and perform global average pooling to obtain the variable feature matrix.

[0100] The third extraction module is used to extract the spatial features of time series data, integrate the information of adjacent grid points into the information of that grid point, and obtain a spatial feature matrix.

[0101] The classification module is used to concatenate the temporal feature matrix, variable feature matrix, and spatial feature matrix together, and output the final drought level classification result through the Softmax layer.

[0102] Example 3

[0103] This embodiment provides an electronic device, including a processor and a storage medium;

[0104] The storage medium is used to store instructions;

[0105] The processor is configured to operate according to the instructions to perform the steps of the method according to any one of Embodiment 1.

[0106] Example 4

[0107] This embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described in Embodiment 1.

[0108] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for predicting the level of agricultural drought, characterized in that, include: Extracting time-series data of the land surface from the CRU data center; Extract features from time series data at different time scales, perform feature fusion and global average pooling to obtain a time feature matrix, including: Time series data is input into the dimension shuffling layer for dimension replacement; The data obtained after dimension replacement is input into the GRU layer to extract temporal information for each variable. Finally, each variable will output a hidden state, which is concatenated into a hidden matrix. The obtained hidden matrix is ​​input into a multi-head self-attention mechanism for calculation in multiple independent attention mechanisms to extract temporal feature information from multiple dimensions. The results are then concatenated to obtain a preliminary temporal feature matrix. The initial time feature matrix is ​​passed through a global average pooling layer to obtain the final time feature matrix; Extract the features of time series data at the variable scale and perform global average pooling to obtain the variable feature matrix; Extract spatial features from time series data, integrate information from adjacent grid points into the current grid point information, and obtain a spatial feature matrix; The time feature matrix, variable feature matrix, and spatial feature matrix are concatenated together and passed through a Softmax layer to output the final drought level classification result.

2. The method for predicting agricultural drought levels according to claim 1, characterized in that, The calculation formula for the global average pooling layer is as follows: ; In the formula, This represents the global average pooling output value of the k-th feature map. Let |R| represent the element located at (p,q) in the k-th feature map region R, and let |R| represent the total number of elements in the k-th feature map.

3. The method for predicting agricultural drought levels according to claim 1, characterized in that, The process of extracting features from time series data at the variable scale and performing global average pooling to obtain a variable feature matrix includes: Time series data is input into multiple temporal convolutional modules to extract variable features and obtain a preliminary variable feature matrix; The initial variable feature matrix is ​​subjected to global average pooling to obtain the final variable feature matrix.

4. The method for predicting agricultural drought levels according to claim 3, characterized in that, The temporal convolution module includes a one-dimensional convolution module, a batch normalization module, a ReLU activation module, and a compression excitation module.

5. The method for predicting agricultural drought levels according to claim 4, characterized in that, Time series data is input into multiple temporal convolutional modules to extract features of variables, including: The time series data is passed through a one-dimensional convolutional layer, and then batch normalization and ReLU activation are performed. The data obtained from batch normalization and ReLU activation are input into the compression excitation module, and the following steps are performed: Compress the features of each time step of each input time series into a single feature; By using a bottleneck structure to capture the correlation between feature channels, the scaling factor of each channel can be learned. The output weights are multiplied and applied channel by channel to the previous features, thus completing the recalibration of the original features in the channel dimension.

6. The method for predicting agricultural drought levels according to claim 1, characterized in that, The process of extracting spatial features from time-series data involves incorporating information from adjacent grid points into the current grid point information to obtain a spatial feature matrix. The calculation formula is as follows: ; In the formula, l represents the l-th layer of the neural network, which contains the first graph convolutional layer. Where A represents the adjacency matrix, I represents the identity matrix, and δ(·) represents the activation function; It is the degree matrix of A; It is the weight matrix of the GCN in the l-th layer; It is the output of the l-th layer GCN.

7. An agricultural drought level prediction device, used to implement the agricultural drought level prediction method according to any one of claims 1-6, characterized in that, include: The data acquisition module is used to extract time-series data of the land surface from the CRU data center; The first extraction module is used to extract the features of time series data on the time scale, and perform feature fusion and global average pooling to obtain the time feature matrix; The second extraction module is used to extract the features of time series data on the variable scale and perform global average pooling to obtain the variable feature matrix. The third extraction module is used to extract the spatial features of time series data, integrate the information of adjacent grid points into the information of the current grid point, and obtain a spatial feature matrix. The classification module is used to concatenate the temporal feature matrix, variable feature matrix, and spatial feature matrix together, and output the final drought level classification result through the Softmax layer.

8. An electronic device, characterized in that: Including processor and storage media; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the agricultural drought level prediction method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When executed by a processor, the program implements the steps of the agricultural drought level prediction method according to any one of claims 1 to 6.