Application of long short-term memory neural network technique for predicting monthly pan evaporation

Evaporation is a key element for water resource management, hydrological modelling, and irrigation system designing. Monthly evaporation (Ep) was projected by deploying three machine learning (ML) models included Extreme Gradient Boosting, ElasticNet Linear Regression, and Long Short-Term Memory; and two empirical techniques namely Stephens-Stewart and Thornthwaite. The aim of this study is to develop a reliable generalised model to predict evaporation throughout Malaysia. In this context, monthly meteorological statistics from two weather stations in Malaysia were utilised for training and testing the models on the basis of climatic aspects such as maximum temperature, mean temperature, minimum temperature, wind speed, relative humidity, and solar radiation for the period of 2000–2019. For every approach, multiple models were formulated by utilising various combinations of input parameters and other model factors. The performance of models was assessed by utilising standard statistical measures. The outcomes indicated that the three machine learning models formulated outclassed empirical models and could considerably enhance the precision of monthly Ep estimate even with the same combinations of inputs. In addition, the performance assessment showed that Long Short-Term Memory Neural Network (LSTM) offered the most precise monthly Ep estimations from all the studied models for both stations. The LSTM-10 model performance measures were (R2 = 0.970, MAE = 0.135, MSE = 0.027, RMSE = 0.166, RAE = 0.173, RSE = 0.029) for Alor Setar and (R2 = 0.986, MAE = 0.058, MSE = 0.005, RMSE = 0.074, RAE = 0.120, RSE = 0.013) for Kota Bharu.

www.nature.com/scientificreports/ In recent times, the American researcher Chen and Guestrin 43 presented a new powerful learning model called XGBoost, which is extensively used by data experts and has obtained state-of-the-art outcomes in several areas because of its general scalability. For instance, Lei et al. 44 used 6 machine learning approaches to create the prediction models, and the XGBoost model achieved the most precise qualitative predictions. Nonetheless, amongst various techniques known for a long time, one deep learning method of ANN, known as LSTM-NN (Long Short-Term Memory Neural Networks), has drawn attention for time series prediction 45 . The estimations by this class are affected by the system's previous behaviour, and it can be employed for both classification and regression purposes. In comparison to other deep models, like the deep Boltzman machine, convolutional neural networks (CNN), and graph-structured recurrent neural network, the LSTM-NN deep learning models perform significantly better. Through a specifically designed architecture, LSTM-NNs have shown better modelling capabilities in different time series applications. In more recent years, Zhang et al. 46 related the performance of various neural network models for simulating and forecasting the water levels of an integrated sewer structure in Norway, on the basis of online data from water-level sensors and rain gauges. They proved that LSTM is better adapted for multi-step-ahead estimations than traditional models without explicit cell memory. Zhang et al. 46 employed an LSTM model for estimating water tables in agricultural regions. In addition, the authors compared the resultant model from the LSTM-based method with that of a conventional neural network and discovered that the former performs better than the latter.

Objectives
This study's contribution is to examine the capability and establish the efficiency of the LSTM (Long Short-Term Memory) neural networks in forecasting monthly evaporation (Ep) using information from two climatological stations located in Malaysia: Kota Bharu and Alor Setar. The performance of LSTM was compared with the Extreme Gradient Boosting (Xgboost) as the most reliable ML model and with the ElasticNet Linear Regression (LR). Moreover, the recently developed ML models were compared with two empirical techniques, namely Stephens & Stewart and Thornthwaite. After predicting Ep, the efficiencies of the proposed models were examined and evaluated using various selected performance parameters to assess their effectiveness in the field of evaporation forecasting. Furthermore, the application of the proposed methodology to various regions throughout Malaysia using different data sets will also be investigated in the future work.

Methodology
Study area and data collection. Malaysia is a tropical country with a high rate of rainfall. However, as a result of development, there is an increase in water demand. Furthermore, global climate change lengthens the dry season and increases the rate of evaporation from impounding reservoirs. This research aims to develop a reliable generalised model to predict evaporation throughout Malaysia. The relevance of the models for evaporation prediction was investigated in Kota Bharu and Alor Setar meteorological stations as part of this research. The climate data from two stations, Alor Setar (longitude 100° 24′ E, latitude 6° 12′ N, elevation 3.4 m) as well as Kota Bharu (longitude 102° 18′ E, latitude 6° 10′ N, elevation 4.4 m), managed by the MMD (Malaysian Meteorological Department), are used in this study. Figure 1 displays the location of these stations on the map of Malaysia. Figure 1 has been generated by using Google Map software to identify the location of the study area.
Weather parameters measured include minimum, maximum and mean air temperature (T min , T max , T a ), wind speed (S w ), relative humidity (RH), open pan evaporation (E p ) and solar radiation (R s ). The data set comprised 19 years of daily reports from 2000 to 2019. Statistical parameters regarding the climatic data are shown in Table 1 and Fig. 2.
As far as the climate is concerned, in Alor Setar region, the summers are hot and short; the winters are warm, long, and wet; and it is gloomy and oppressive year-round. During the year, the temperature usually varies from 23 to 34 °C and is seldom less than 22 °C or more than 36 °C. The hot weather lasts for 1.9 months, beginning in February and ending in April, with a mean daily high temperature more than 33 °C. The winter lasts for 6 months, beginning in June and ending in December, with a mean daily high temperature less than 31 °C. The average part of the sky cloaked by clouds experiences noteworthy seasonal variation during the year. In Alor Setar, the sunnier part of the year lasts for 3.6 months beginning in December and ending around March. The clearest day is the mid of January when the sky remains clear, mostly sunny, or partially cloudy for 35% of the time, and mostly cloudy or gloomy for 65% time.
The summer season in Kota Bharu is hot, while the winter season is warm but relatively short; the area witnesses cloudy sky throughout the year. Annual temperatures range between 23 and 32 °C; temperatures are rarely above 34 °C or below 21 °C. The average hot summer duration is 3.2 months, covering April, May, June, and July. On the other hand, November, December, January, and February are relatively cool, with an average duration of 2.6 months; the average high temperature remains less than 29 °C. There is a noteworthy difference in cloud cover over seasons. Kota Bharu skies are clearer for 3.9 months beginning in December and ending in April. The sky is clearest in February, which has the clearest day of the year. Additionally, there is a 36% incidence of clear, partially clear, or partly cloudy sky, while higher cloudiness is present for the remaining 64% of the month.
Selection of input combinations and data partitioning. Input variability can substantially affect the modelling procedure and prediction accuracy; therefore, different combinations of input data were explored in the present study to ascertain optimal ML model predictability for evaporation. There are specific conscious choices for selecting these combinations. First, for comparison purpose, input parameters to the machine learning models (XGR, ElasticNet LR, and LSTM) were chosen based on the needed meteorological aspects in the two proposed empirical models (Stephens-Stewart and Thornthwaite). Second, availability of consistent long-term weather data has always been one of the major constraints in deciding on input combination. In fact, one or two www.nature.com/scientificreports/ missing meteorological parameters for model inputs can be expected in some case studies, primarily in developing countries. It is advantageous then to investigate the level of prediction accuracy of ML models in the absence of any input parameters. This will also provide a better practical understanding of how each input variable affects the evaporation forecast in that region. Hence, one of the objectives of this study is to explore the predictive capability of ML models under various input combinations of meteorological variables to successfully map the model input-output with a high level of prediction accuracy. Moreover, the present research assesses the effects of input variable E p. In this context, the input data records were chosen based on how the antecedent records were related to the predicted output value. As shown in Fig. 3, the autocorrelation analysis for the historical monthly time series for the pan evaporation rate revealed that the correlation deteriorated significantly once it passed the preceding second lag-time record. This demonstrates that the preceding second evaporation rate record influenced the evaporation rate at any time. Consequently, the maximum lag time of two antecedent records was used as  Table 2 depicted the ten combinations of inputs having varying T min , T max , T a , R s, S w , RH and E p. The 80/20 principle was used to split the quantified meteorological data into training, and testing sets required for ML modelling; 80% of data were employed for model training, while the remaining 20% were used for testing. The training set was used to initiate ML parameter training. Subsequently, the test set was employed to assess the model. Thus, the dataset was divided by taking the first years for training and the last ones for testing. The present study aims to perform a detailed evaluation for testing soft computing capability and using practical frameworks for predicting monthly evaporation levels at the Kota Bharu and Alor Setar regions.
Empirical models used for monthly pan evaporation prediction. Taking into consideration the number of required meteorological inputs and data availability, two empirical techniques, namely Stephens-Stewart and Thornthwaite, have been selected in this study as the most commonly used methods 47 .
Stephens and Stewart. This method also called the "Fractional Evaporation-Equivalent of Solar Energy" by Stephens and Stewart 48 . Stephens and Stewart suggested that using measured radiation Qs, give a better result where data are available and can be correlated with temperature, as shown in Eq. (1): where Ta , Ep , and Qs denotes mean air temperature (F), evaporation (mm), and solar radiation (cal cm −2 day −1 ).
Stephens and Stewart also suggested the desirability of continued studies in other regions to establish such relations under a range of climatic conditions. Thornthwaite. Thornthwaite 49 used practical data to ascertain the correlation between probable evaporation ( Ep ) and mean monthly temperature ( Ta ) and standardised it to a 30-day month, comprising 12 h of sunshine per day. The Thornthwaite technique is used to compute potential evaporation ( Ep ); the following expression is used to compute the Monthly Thornthwaite Heat Index ( i): where Ta denote mean monthly temperature (°C).
The Annual heat index (I) is the aggregate of Monthly Heat Indices (i): A potential Evaporation Ep estimation is obtained for each month by applying the following equation: where a is: www.nature.com/scientificreports/ Ep for a given month is, therefore, given by the expression: N and d denote theoretical monthly sunshine hours, and days in the month, respectively.
Machine learning (ML) models used for monthly pan evaporation prediction. The present study used three ML frameworks for estimating evaporation. These models are Extreme Gradient Boosting (XGB) 43 , ElasticNet Linear Regression (ElasticNet LR) 50 , and Long Short-Term Memory (LSTM) 45 . The training and testing for the machine learning models were carried out by using the TensorFlow framework on an NVIDIA GeForce GTX 1080 Ti GPU.   [50][51][52] . This method applies the elastic net penalty on the least-squares calculation. The method comprises two widely-used penalty expressions (L1 and L2); these are included with the loss function while the system is trained 50,51 . The method allows addressing the challenges  β′ denote the ideal weights required for minimising the loss function, which comprises the squared difference of the real and predicted values, including the two regularisation items. Penalty expressions for L1 and L2 are λ1 ‖β‖ 1 , and λ2 ‖β‖ 2 ; here, λ coefficients must be tuned.
Extreme gradient boosting (XGB). XGB is a scalable end-to-end tree-based learning framework with more than ten times the speed of present offerings meant for a single machine. XGB scaling comprises numerous examples for memory-restricted applications 43,50 . XGB scalability is the consequence of numerous optimisations implemented for addressing the roadblock. This framework employs the gradient descent technique for loss minimisation, while regularisation is used to regulate overfitting.
In our experiment, we try different set of values of hyperparameters to select the optimal one which is given as follows: 1. Least squares regression Loss function to be optimized. 2. Learning rate = 0.5. 3. Number of estimators = 100; gradient boosting is quite robust to over-fitting, and hence a large number typically drives superior performance. 4. The number of features to consider when looking for the best split max_features = ''sqrt' "sqrt", then max_features = sqrt(n_features). 5. Max_depth = 3; the maximum depth limits the number of nodes in the tree.
Long short-term memory (LSTM). LSTM belongs to the Recurrent Neural Network (RNN) category and is employed for long-range sequence models. Figure 4 depicts an LSTM memory cell that store state information and is regulated using gates. This system reduces gradient vanishing. An LSTM structure can record temporal associations.
The present study applies several inputs like humidity, temperature, wind, evaporation, and solar radiation to LSTM. Iterative LSTM parameter tuning was performed for data fitting. Several hyperparameters were evaluated to identify the optimal LSTM architecture that provides ideal assessment metrics.
The ideal LSTM structure for the study comprises these layers:  In general, AI models are chosen based on the availability of data and their ability to solve the targeted problem. There are various benefits and drawbacks for each model that have been observed across all AI models. Table 3 summarises the advantages and disadvantages of each model. However, since each model behaves separately depending on the problem it was designed to solve, these benefits and drawbacks may not be necessarily lined with the model. Performance evaluation. Model predictive performance was assessed using several statistical indicators like mean absolute error (MSE), determination coefficient (R 2 ), relative absolute error (RAE), root mean square error (RMSE), relative squared error (RSE) and mean absolute error (MAE). These indicators are described below: (1) The determination coefficient (R 2 ) is an indicator that specifies the correlation between the real and predicted output; it lies between zero and one (both inclusive). Zero value indicates a random model, while one indicates a perfect fit.
(2) Mean absolute error (MAE) the absolute error existing between the real and predicted output.
(3) Mean square error (MSE) the average squared error existing between the predicted and real output.
(4) Root mean square error (RMSE) the square root of average squared error existing between the predicted and real output.  where n is the number of samples, y is an actual output, y is a is forecast output, y is the average of actual output. To conclude the training and performance evaluation processes, a flow chart has been designed which is shown in Fig. 5. The step-by-step process used in this methodology has been demonstrated in the flow chart.

Results and discussion
Estimation of monthly pan evaporation using two empirical models. As stated earlier, monthly Ep, including the temperature-based and radiation-based models, was predicted by employing two empirical models. The values pertaining to R 2 , MSE, MAE, RSE, RAE and RMSE are listed in Table 4, with regards to the two empirical models employed to predict Ep in Kota Bharu and Alor Setar stations. As suggested by the statistical values listed in Table 4, higher prediction accuracy was observed with the radiation-based model (   Estimation of monthly pan evaporation using three machine learning models. Table 5 shows the statistical results pertaining to three machine learning models in order to predict monthly Ep that is placed under 10 input combinations with regards to meteorological variables for Kota Bharu and Alor Setar stations. For each of the machine learning models, the best statistical indicators have been represented in bold. As observed in Table 5, there was a considerable difference in the prediction accuracy of monthly E p based on the input combination as well as model type.   Figs. 8 and 9, respectively. The lower-level pertaining to scatter plot as well as a better fit with regards to the predicted data with that of the observed values in the 1:1 line are the obvious indicators hinting the superiority with regards to the LSTM model over the other two models. As observed in Table 5, the best prediction accuracy was achieved with the models that used the complete meteorological dataset (T min , T max , S w , R s , Ep, RH) for both stations, versus other incomplete data input combinations. This established that the accuracy of the model prediction was enhanced with more input parameters in general, which was in line with the earlier studies 3,31 . Also, four input parameters that only lack of R s or S w were sufficient to get acceptable accuracy for monthly Ep estimation. This showed that for monthly Ep estimation in the studied region, relative humidity can be regarded as being more significant versus solar radiation and wind speed. In cases where the only available data are the average temperature data, it was seen that the machine learning models' prediction accuracy was not sufficient even for the LSTM model ( . This suggested that the machine learning models' prediction accuracy may not get enhanced with the powerful capabilities pertaining to artificial intelligence, when there are limited meteorological inputs. Better prediction accuracy was achieved, when minimum and maximum temperatures data were available, versus only average temperature as input. In addition, the prediction accuracy of monthly Ep was found to enhance with the implementation of RH or R s versus the models that incorporated only minimum and maximum temperatures as inputs. Besides, in all ML models, employing Ep as an input slightly was seen to enhance the prediction accuracy. However, with the input combination of T max , T min , R s , S w and RH, it was seen that the statistical values pertaining to machine learning models were near when compared with complete meteorological inputs (i.e., employing Ep as an input). This clearly indicated that the generally estimated monthly Ep values via machine learning models were in good agreement with the measured monthly Ep values. Also, the LSTM model was seen to outperform all other ML models like XGB and ElasticNet LR. This could be due to the architecture pertaining to LSTM The results showed that the LSTM model's superiority versus other ML models strongly implies that the LSTM model could be employed for predicting monthly pan evaporation with high accuracy. Furthermore, as stated earlier, the application of the proposed methodology to various regions throughout Malaysia using different data sets will also be investigated with the aim of developing a reliable generalised model to predict evaporation.
Comparison of empirical and machine learning models under the same input combinations. Table 6 shows the performances pertaining to the two empirical models that predict monthly Ep,  Table 6 that ML models outperformed empirical models and can significantly improve the accuracy of monthly Ep prediction even with the same inputs parameters relying on its superior capabilities to perform complex tasks.

Conclusion
The present study is aimed at evaluating the machine learning ML technique's ability for predicting monthly Ep pertaining to two regions in Malaysia. To predict monthly evaporation, we developed three different machine learning models included Extreme Gradient Boosting, ElasticNet Linear Regression and Long Short-Term Memory, along with 10 input combinations pertaining to meteorological variables. The prediction models were tested and trained using available monthly Ep data from 2000 to 2019. The models were trained on 80% of the data and tested on 20%. The models' accuracies were compared by accounting for standard statistical measures. The prediction accuracy pertaining to monthly Ep differed considerably relies on both the input combination and the model type. The best prediction accuracy was achieved with the models that were using complete meteorological dataset (T min , T max , R s , RH, S w , Ep) for both stations, versus other incomplete data input combinations. Four input parameters that lacked just S w or R s were found to be sufficient for the estimation of monthly Ep providing acceptable accuracy. This suggests relative humidity to be more significant when compared with solar radiation and wind speed with regards to monthly Ep estimation pertaining to the studied region. The prediction accuracy was found to be better with the available minimum and maximum temperatures data, versus with those with just the average temperature as input. Moreover, it was found that using Ep as an input slightly improve the prediction accuracy in all ML models. Comparisons were also made between developed ML models and two empirical models, one of which is radiation-based model (Stephens and Stewart) and the other is temperature-based model (Thornthwaite). It was found that the three developed ML models outperformed empirical models with the same input combinations. The performance evaluation revealed that the Long Short-Term Memory provided Table 5. Statistical results (testing period) of the three machine learning models for predicting monthly Ep under 10 input combinations of meteorological variables for Alor Setar and Kota Bharu. The results showed that the LSTM model's superiority versus other ML models strongly imply that the LSTM model could be employed for predicting monthly pan evaporation with high accuracy. Furthermore, the application of the proposed methodology to various regions throughout Malaysia using different data sets will also be investigated with the aim of developing a reliable generalised model to predict evaporation.