Lion Algorithm- Optimized Long Short-Term Memory Network for Groundwater Level Forecasting in Udupi District, India

Groundwater is a precious natural resource. Groundwater level (GWL) forecasting is crucial in the field of water resource management. Measurement of GWL from observation-wells is the principle source of information about the aquifer and is critical to its evaluation. Most part of the Udupi district of Karnataka State in India consists of geological formations: lateritic terrain and gneissic complex. Due to the topographical ruggedness and inconsistency in rainfall, the GWL in Udupi region is declining continually and most of the open wells are drying-up during the summer. Hence, the current research aimed at developing a groundwater level forecasting model by using hybrid Long Short-term Memory-Lion Algorithm (LSTM-LA). The historical GWL and rainfall data from an observation well from Udupi district, located in Karnataka state, India, were used to develop the model. The prediction accuracy of the hybrid LSTM-LA model was better than that of the Feedforward Neural network (FFNN) and the isolated LSTM models. The hybrid LSTM-LA based forecasting model is promising for a larger dataset.


Introduction
e ground water (GW) survey reported in the New Indian Express in 2018 reveals that groundwater level (GWL) is very poor in South Indian states. e survey reports that out of 1421 wells surveyed in Karnataka, 985 showed a decline in GWLs.
e survey also reported that GWL is declining continuously in Udupi district [1]. It is crucial to be able to forecast GW resources with an appropriate model using advanced algorithms. GWL forecasting system has more than six decades of history [2]. A large number of research work is found in the literature, which has reached a certain level of maturity. e hydrogeological GWL forecasting models are probabilistic, deterministic, and stochastic for the assessment of GW systems. e traditional GW flow models are partial differential equations, which are embedded with simplifying assumptions about the aquifer properties and boundary conditions [3]. ese natural groundwater systems are complex and have a large number of parameters that are highly variable throughout time and space, such as aquifer parameters like hydraulic conductivity of the formation, groundwater storage, dimension of the aquifer, and other parameters related to the geological structure. To simplify GWL forecasting, researchers have tried to explore various parameters to develop GWL forecasting models [4]. e importance of the hydrological model for environment and water management is growing with urbanization and climate variability. e hydrological models are broadly classified into conceptual, physical, and mathematical models [5]. Mathematical models are further categorized as empirical lumped conceptual and physical-based models. Physical-based models use physically measurable static input variables and require extensive information about the study area. Measuring physical properties is difficult, especially for predictive models, where the input values change over time [6]. Physical models, though accurate in prediction, are not very practical as they are less efficient in predicting irregularly varying patterns of data [7]. To overcome this limitation and with the rapid increase in computation power, recently data-driven models are adopted using quantitative historical data to forecast future trends [8], which have become a standard tool in water resources management sector [9]. Machine learning-based approaches are promising for hydrological time series forecasting. However, many of the techniques rely on optimization of artificial neural network (ANN) weights or architectures. Data driven models are developed with existing data and information on the relationship between input and output parameters. ese models are location specific, with the output values being applicable only to the location where it is developed [10]. Statistical, fuzzy, regression, and ANN are mathematical approaches typically used in these data-driven models. ANN models have received much interest in the recent literature [11]. Researchers have implemented the functionality of ANNs to model surface and groundwater quantity [12]. Backpropagations (BP) are extensively used for ANN training. However, the results of ANN approach are found to be less consistent and unstable [8]. Hence, alternative and advanced data-driven models are required for predicting real-time GWL more accurately.
Different types of ANN architectures and algorithms are developed in the literature using multilayer feedforward, recurrent networks, and radial basis networks [13]. Rani Sethi et al. [14] investigated multilayer feedforward with BP learning algorithm to develop the water table depth forecasting model. Exploring the important parameters that influence the water table fluctuations, they employed monthly rainfall, evapotranspiration, and water table depth as input parameters. ey predicted groundwater table depth for one month ahead in a hard rock aquifer. e models were calibrated with limited input dataset monitored during the study period. e performance of the model can further be improved with sufficient datasets and with different architectures. e traditional ANNs cannot handle sequential data effectively, which is one of the major drawbacks [15]. Predictive models with longer lead-time are required which have been developed using deep learning techniques with multiple hidden layers.
Deep learning techniques with multiple hidden layers between the input and recurrent neural networks (RNNs) are widely used in recent years [16,17]. However, the standard RNN architecture has difficulty in capturing longterm dependencies between variables, due to vanishing and exploding gradient problem, which can be overcome by a variant of RNN called long short term memory (LSTM). LSTM has only recently been used for hydrologic time series prediction [18]. Bowes et al. [19] compared RNN with LSTM for predicting the GW table in the flood-prone coastal city of Norfolk, Virginia. ey explored two machine learning algorithms LSTM and RNN to model and predict GW table response to storm events, using GW table, rainfall, and sea level as input parameters from 2010 to 2018 to train and test the model. As per their study, LSTM networks were found to have more predictive skills than RNN's. Kratzert et al. [20] explored application of LSTM as a regional rainfall-runoff model in catchments of the freely available CAMELS dataset. ey tested their approach and compared the results with the well-known Sacramento Soil Moisture Accounting Model (SAC-SMA) and achieved better model performance, which underlined the potential of LSTM for hydrological modelling applications. e LSTM RNN has an internal state and may learn to forecast different series with good longterm memory, which is one of the most attractive and powerful features compared with traditional feedforward neural network (FFNN).
ere are several drawbacks for using an LSTM network in isolation. Learning LSTM models for large number of memory cells becomes computationally expensive. It also suffers from the lack of ability to explain the final decision that the model acquires [21]. To overcome this limitation, a hybrid approach has been used. Mohd Nawi et al. [22] investigated the data classifier problem by employing weight optimization on RNN using cuckoo search hybrid techniques. e convergence rate and local minima problem are addressed as the cuckoo search algorithm. e performance of this model is compared with ABC using the BPNN algorithm and other hybrid variants.
e results show that the computational efficiency of traditional RNN is highly improved when coupled with the hybrid method. Chung and Shin [23] investigated a novel stock market prediction model using the available financial data. ey adopted the deep learning technique of hybrid approach by integrating LSTM with a genetic algorithm. ey used a systematic method to determine the time window size and topology of the LSTM network using the genetic algorithm (GA). e experimental results demonstrated that the hybrid LSTM network outperforms the benchmark model. Rashid et al. [24] developed a well-structured LSTM for resolving difficulties with traditional RNN networks. ey used four different optimizers based on metaheuristic algorithms, Harmony Search (HS), Gray Wolf Optimizer (GWO), Sine Cosine Algorithm (SCA), and Ant Lion Optimization Algorithm (ALOA). e learning speed and accuracy due to long-term dependencies in LSTM are explored and compared with the RNN architecture. ey suggested that the classification accuracy of LSTM outperforms traditional RNN architecture and the increased complexity in training these networks could be resolved by using alternative, powerful, and nature-inspired algorithms.
ere is a need to have a computationally efficient model that can forecast water levels with minimum parametrization. At the same time, such a model should be able to deal with expected climate variability. To overcome the weakness and to improve the convergence rate (prediction accuracy) of traditional approaches, a more advanced, simple, robust, efficient, and accurate model is required. e lion algorithm (LA) is a nature-inspired algorithm developed by Rajkumar in 2012, which mimics social territorial lions breeding and its defence to other nomadic lions.
is LA can be used in conjunction with LSTM to find the optimal solutions. e current study aims at developing a new hybrid metaheuristic approach using the LA to optimise the weights of LSTM network. e study also aims to analyse the performance of the proposed hybrid LSTM-LA approach on a selected dataset by comparing with the standard feedforward architecture.

2
Applied Computational Intelligence and Soft Computing

Materials and Methods
e study developed and tested a hybrid LSTM-LA model. is section describes the study area and the dataset used, description of FFNN model, and architecture of the proposed model and its implementation.

Study Area and Dataset.
One of the challenges in GWL forecasting is that the flow of groundwater is unique to geological formations. erefore, the GW analysis is site region-specific. No standard benchmark can be used for the forecasting of GWL to build the predominance of the model. It is therefore essential to develop regional GWL forecasting by collecting data from the specific region. e study is based on the secondary data from government agencies collected from an observation-well located in Udupi district of Karnataka state in India (Figure 1). e geology of the Karnataka state is very complex with varied parameter in its formations from laterites, gneisses granites, dolerite dykes, and coastal sedimentary rock types [25]. e observation well considered in this study is located in lateritic terrain [26].

Feedforward Neural Network-Based Groundwater Level Forecasting Approach.
e FFNN structure for forecasting GWL has wide application in the GW studies. e most frequently used algorithm for aquifer models in neural network domain is the gradient descent algorithm. In this work, the weights of the FFNN were optimised using gradient descent approach. e conventional gradient descent-based algorithms operate on a single weight vector. e FFNN structure with two inputs, three hidden and one output node with gradient descent training is shown in Figure 2.
e FFNN configurations learn in a randomised order, and the information only flows in the forward direction in every layer of the network. Since there is no looping, it predicts only continuous target variables. erefore, in order to learn progressively deep learning algorithm, special type of RNN called LSTM approach with self-connected gates in the hidden layer is implemented.

Hybrid Long Short-Term Memory-Lion Algorithm
(LSTM-LA) Approach. LSTMs, introduced by Hochreiter and Schmidhuber [] [21], are special kind of RNNs capable of learning long-term dependencies. LSTMs selectively remember patterns for long durations of time compared with traditional FFNN. LSTMs are capable of removing or adding information to the cell state through carefully regulated gates such as forget gate f, input gate i, input modulation gate g, and output gate (Figure 3). e forget gate helps to process the output of previous state h t−1 and to take decisions by forgetting unnecessary information.
e forget layer with sigmoid function is represented in equation (1). e input gate adds new information with appropriate scaling, sigmoid activation function updates the values, and tanh function creates new candidate values (equations (2) and (3)). e updated new candidate value with proper scaling is also given in equation (4): Finally, the relevant output of sigmoid function is represented in the following equations: e basic LSTM neuron has a separate cell state that keeps track of long-term sequential information. However, learning LSTM models for large number of memory cell becomes computationally expensive. erefore, a hybrid LSTM-LA methodology is adopted in the current study as shown in the flow diagram ( Figure 4).
In the hybrid LSTM-LA model, the mating characteristics of lions are mathematically modelled to optimise the weights of LSTM network. e population of randomly generated set of solutions called lions are initialised. e possible solutions are the weights and biases for LSTM network. e population of 2n lions are assigned to two groups as the candidate population. e best weights and biases are initialised with LA in the first epoch and are passed on to the LSTM network. e second step in the algorithm is the mating process that assures the lion's survival as well as a platform for information exchange among different members. e new cubs are produced after selecting the female and male lions using linear combination of parents using mating operators as given in the following equations:

Applied Computational Intelligence and Soft Computing
Offspring Offspring where NRM � number of residents males in a pride and α � randomly generated number and e mutation operator with a mutation rate of 0.2 is applied randomly on each gene of the offspring. e last stage in LA is the defence operator, which consists of defence against new matured resident males and defence against nomad lions.
is defence operator plays an important role in LA by assisting it to retain powerful male lions as solutions. e nomadic lion is generated in the same way as territorial lion and new survival fight between territorial lion and nomadic lion is performed. e male lion occupies the territory by

Inputs Hidden layers Output
Rainfall data Ground water level data Predicted output Target output Optimize the weights using gradient descent approach Compare the predicted outputs and target output defending and protecting the cubs, and then the new solution is used to attack the male lion. If the nomadic lion is superior to the other solutions in the pride, the male lions are replaced by the nomadic lion. e territorial takeover is the last step, which is the same as selection process in the genetic algorithm. In this step, the optimal solution is found to replace the inferior one and the mating process is repeated until the termination condition of 100 epochs is reached. e LA will update weights with best possible solutions in the next cycle, and the searching process is continued. us, the weights and thresholds of all layers in the LSTM model are initialised randomly, and LA searches the optimal weights. If the termination criterion, i.e., the maximum iteration number is reached, the optimal parameters are obtained or else the optimization steps are repeated until the conditions are satisfied. en, the optimised LSTM model is used to forecast the GWL. e hybrid LSTM-LA, LSTM, and FFNN models are used to forecast the future trend of GWL. e dataset from the period year 2000-2018 was used to train and test the LSTM-LA model for different prediction horizons. e 80% of the data are set as training set and remaining 20% are set as testing set. e monthly forecast of GWL results for year 2018 from the hybrid LSTM-LA model is compared with LSTM and FFNN approaches.

Results and Discussion
e GWL forecast for year 2018 using the hybrid LSTM-LA, LSTM, and FFNN approaches are shown below ( Figure 5). e forecast results were verified against   We considered two performance metrics to assess the forecasting accuracy. Figure 6 shows the performance of all the three soft computing approaches using statistical indices root-mean-squared error (RMSE) and mean absolute error (MAE). e RMSE is the squared error which is more sensitive to large deviation between forecasts and actuals. e MAE on the other hand mean absolute error is a more suitable measure. e MAE and RMSE values are lower for the hybrid LSTM-LA approach as compared with the FFNN and LSTM approaches, indicating that the hybrid LSTM-LA approach outperforms the standalone approaches, LSTM and FFNN. e monthly forecast of GWL for the year 2019 using the hybrid LSTM-LA, LSTM, and FFNN approaches is presented in Figure 7. e graph shows an increasing trend irrespective of season, because of inconsistency in rainfall. e time series plot (Figure 8) shows the future GWL forecast using proposed hybrid LSTM-LA model. e model is trained using the data for a period of 216 months (18 years) starting from January 2000 to December 2017. e model is able to forecast future trend accurately up to a maximum of one year lead-time.
e cross-validation resampling procedure is used to evaluate different machine learning algorithms on a limited data sample. Cross validation is primarily used to estimate the accuracy of machine learning algorithm on unseen data. In 5-fold cross validation, we partition the original training dataset into 5 equal subsets called folds. e accuracy of the machine learning algorithm is estimated by averaging the accuracies derived in all the 5 cases of cross validation. e box and whisker plot (Figure 9) shows the spread of the prediction accuracy scores across each validation fold for each algorithm. e prediction accuracy, indicated by the median, for FFNN, LSTM, and hybrid LSTM-LA approaches is 72%, 88%, and 97.5%, respectively. e hybrid LSTM-LA based model is compared with traditional FFNN network structure-based model. From the above plot in Figure 9, it can be observed that LSTM-LA approach has higher an accuracy compared with the FFNN-based model.

Conclusions
Scarcity of pure drinking water is the global problem. GWL gives useful information for assessing groundwater resource. e current study has developed a new hybrid metaheuristic approach using the lion algorithm to optimise the weights of LSTM network for forecasting GWL. e precedent GWL and rainfall dataset from year 2000-2018 were accessed from government agencies. e observation well was located in a lateritic terrain in Udupi district, Karnataka, India. e results obtained from the propounded LSTM-LA model was compared with the basic FFNN and LSTM models. e FFNN model apprentice is in the randomised order, whereas feedback loops in LSTM enable to learn progressively. ere are several drawbacks exploiting standalone LSTM network. It suffers from an unusual distribution of input variables in the test set compared with the training data. erefore, the lion algorithm is used to optimise the weights of LSTM and developing LSTM-LA model. e lion algorithm looks for optimal point through different strategies by balancing exploration and exploitation. e hybrid LSTM-LA model is preferred over traditional FFNN and LSTM on its own, in terms of prediction accuracy and convergence rate. is research work concludes that GWL forecasting with systematically configured LSTM model surpasses the traditional FFNN model with higher efficiency.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare no conflicts of interest regarding the publication of this paper.