Crop Water Requirement Prediction Method Based on EEMD-Attention-LSTM Model

Crop water demand prediction is an important part of Precision agriculture. Due to the nonlinear relationship between input variables (weather data, soil moisture, and crop type) and output variables (crop water demand), it is difficult to accurately predict crop water demand. This article proposes a method for predicting crop water demand based on the EEMD Attention LSTM model. The model combines the ensemble empirical mode decomposition (EEMD), attention mechanism (Attention), and Long short-term memory (LSTM) neural networks to capture the changes in different scales of input variables. It selectively focuses on the relevant parts of the input sequence when making predictions. The performance of the EEMD attention LSTM model was evaluated on the historical crop water demand data set and compared with other prediction models such as RNN, LSTM, and EMD-LSTM. It shows that the model is superior to other methods in terms of Mean squared error and mean absolute error. When the relationship between input variables and output variables is nonlinear, the EEMD-attention-LSTM model is a powerful tool for crop water demand prediction.


Introduction
In recent years, with the arrival of the trend of artificial intelligence technology development, China's agricultural development has ushered in a new turning point, which is the acceleration of the transformation from traditional agriculture to modern agriculture [1] .The prediction of crop water demand is an important part of precision agriculture, which is an important basis for agricultural irrigation.The prediction model using machine learning and deep learning algorithms gradually replaces the traditional empirical model.The GA-SVM model proposed by Liu et al. [2] has high precision performance in predicting the water demand of green pepper.Sun et al. [3] constructed a crop water demand prediction model using an Elman neural network optimized based on a genetic algorithm and verified the feasibility of the model.Chu et al. [4] proposed a crop water demand prediction model based on LSTM.To address the issue of low accuracy in existing crop water requirement forecast models, this study focuses on silage maize.It establishes a crop water requirement forecast model based on EEMD-attention-LSTM.The model enhances the dataset using EEMD and dynamically focuses on the important parts of the input sequence through an attention mechanism to accurately predict crop water requirement forecast.

EEMD algorithm
EEMD (Ensemble Imperial Mode Decomposition) is a signal processing technology that can decompose a time series into a set of intrinsic mode functions (IMFs) and a residual component.EEMD has been widely used in signal-processing tasks [5] , including image processing, speech recognition, and financial time series analysis.In the context of crop water demand prediction, EEMD can be used to decompose the time series of crop water demand into a set of IMFs to capture basic patterns and trends in the data.
The EEMD algorithm usually consists of the following steps: 1. New time series are constructed by adding white noise time series to the original signal time series.
2. The sequences containing noise were decomposed by EMD to obtain each IMF component.4. The IMFs obtained each time are integrated and averaged as the final result.
After decomposing the time series using EEMD, the obtained IMFs can be used as input features for deep learning models to predict future crop water demand.By using IMFs instead of raw time series data, the model can better capture basic patterns and trends in the data, thereby achieving more accurate predictions.

Attention mechanism
The attention mechanism is a technique used in deep learning models to selectively focus on certain parts of the input data during prediction.The fundamental idea of the attention mechanism is to compute a set of attention weights, applying them to different features of each IMF.The attention mechanism can adaptively adjust the weights based on the importance of each feature [6] , allowing the model to pay more attention to the features that contribute more to the forecast of crop water requirements.

LSTM neural network
Deep learning technology has a wide range of application prospects in modern agricultural intelligent irrigation, especially in plant disease detection, intelligent irrigation control, and irrigation decision-making.
LSTM is a special type of recurrent neural network (RNN).Compared with traditional RNNS, LSTM solves the problem of gradient disappearance and gradient explosion when RNNS processes long sequences, as well as the limitation of insufficient long-term memory ability by introducing a memory unit and gating mechanism.This allows the LSTM to perform better when processing timing information with long-term dependencies [7] .The core idea of LSTM is to introduce a memory cell that can store and read information in a recurrent neural network.The memory cell contains a cell state, which is used to pass and save information, and three gating units: input gate, forget gate, and output gate, as shown in Figure 1.

EEMD-attention-LSTM model architecture
The architecture diagram of the proposed EEMD-Attention-LSTM model is shown in Figure 2.

Calculation of crop water demand
The calculation of actual water demand for crops requires two key factors: K C and ET 0 .Crop evapotranspiration (ET0) is a key factor in calculating crop water demand and is also an internationally recognized indicator for guiding precise irrigation of crops and achieving smart agriculture.In this paper, the Penman Monteith formula is used to calculate evapotranspiration [9] , which is currently the most accurate method for calculating evapotranspiration.
The most commonly used form at home and abroad is: In the formula, 0 ET is the reference crop evapotranspiration (mm/d); n R is the input net radiation of the canopy [MJ/(m 2 ꞏd)]; T is the daily average temperature at the height of 2 m (℃); 2 u is the wind speed at the height of 2 m (m/s); s e is the saturated water vapor pressure (Kpa); a e is the actual water vapor pressure (Kpa); The slope (Kpa/℃) of the saturation water vapor pressure temperature relationship curve at a certain point is represented by  ;  is the constant of the dry and wet thermometer (Kpa/℃). [9]ased on the collected and organized meteorological data, Formulas ( 7) and ( 8) are applied to obtain the daily actual water demand value of summer corn.The actual data is shown in Table 1 To determine the feature input vector of the LSTM prediction model, SPSSAU software was used to conduct correlation analysis using the grey correlation method.Meteorological factors with a high correlation with crop water demand were selected as the feature input vector of the model.The crop water demand is taken as the parent series, and the highest temperature, lowest temperature, average temperature, average humidity, Sunshine duration and average wind speed are subsequences.The correlation degree of corresponding elements between each characteristic value is calculated according to some of the meteorological data monitored daily from January 2016 to December 2017 in Qihe County, Shandong Province.The correlation coefficients between the calculated meteorological factors and water demand are shown in Table 2.
Table 2 The grey correlation analysis method is used to determine the correlation coefficient between the average temperature, solar radiation, sunshine duration, average wind speed, and crop water demand.The meteorological factors with a larger correlation coefficient are selected as the characteristic input vector of the crop water requirement forecast model, and crop water demand is the output vector.Firstly, the crop water demand is decomposed into multiple IMFs through the EEMD algorithm.Then each group of subsequences is input into the LSTM neural network through the attention mechanism to obtain the final prediction results.

Crop water demand dataset
The dataset includes meteorological data from a certain region from January 1, 2016, to December 31, 2019.Based on the correlation analysis in the previous section, some parameters in the meteorological data were selected as inputs for the prediction model, mainly including et0 (crop evapotranspiration), timeSSD (sunshine intensity), avgTEM (average temperature), maxTEM (maximum temperature), minTEM (minimum temperature), avgWIN (average wind speed), and avgRHU (average relative humidity), Some of the data in the dataset are shown in Table 3 The water demand dataset contains a total of 1461 pieces of data, divided into training and testing sets at a 4:1 ratio, with ET 0 as the predicted result and other parameters as model inputs.

EEMD-attention-LSTM neural network model construction and result analysis
The model loss function uses Mean Square Error (MSE), which is suitable for solving linear regression problems.
After building the prediction model, based on multiple training results, the parameter settings of the crop water requirement forecast model are shown in Table 4.
Table 4. Parameter settings for prediction models.The training set prediction effect diagram, test set prediction effect diagram, and loss function diagram are shown in Figures 3 and 4.  The prediction results of the EEMD-attention-LSTM model and three neural network models (RNN, LSTM, and EMD-LSTM) in predicting crop water demand were compared with four evaluation indicators [10] : mean absolute error (MAE), mean square error (MSE), mean square error (RMSE) and goodness of fit (R 2 ), as shown in Table 5.It can be concluded that the EEMD-attention-LSTM model predicts better results and can more accurately predict crop water demand.
Table 5. Calculation results of correlation degree of crop water demand.

Conclusion
In this paper, a crop water requirement forecast model based on EEMD-attention-LSTM is proposed, and the prediction accuracy is significantly improved compared with other methods.Experimental results show that the model achieves remarkable precision and stability in predicting crop water demand.This enables agricultural production to benefit from more accurate water resource management and irrigation decision support.By accurately predicting crop water demand, farmers can better adjust their irrigation plans, make rational use of water resources, and enhance crop yield and quality.Therefore, the crop water requirement forecast model based on EEMD-attention-LSTM provides essential decision support and guidance for agricultural production.
actual crop water requirement, C K represents the crop coefficient of the research base, and 0 ET represents the evapotranspiration of silage corn of the research base.
3. Steps 1 and 2 are repeated, and white noise signals with different amplitudes are added to the decomposition each time to get the IMF set.
x is the input of the current time t , W and b are model parameters, t f , t i , and t o are the outputs of the forgetting gate, the input gate and the output gate of the current time t , respectively, and () t

Table 1 .
. Daily actual water demand table for silage corn.
. Calculation results of correlation degree of crop water demand.

Table 3 .
: Sample water demand dataset data.