Introduction

Simulating the oscillation behavior of groundwater level is one of the most important hydrological tasks and is mostly carried out through various conceptual and deterministic models. In numerous investigations, researchers have approximated groundwater level utilizing a water balance model that correlates the modifications in the water level to the main water balance elements (Adamowski and Chan 2011; Jones et al. 2001; Mohanty et al. 2010). Parameters, for instance incoming and outgoing discharges, rainfall, evaporation, humidity, and temperature, are some the parameters studied for the ground water simulation. Implicitly, precipitation causes minor oscillations anywhere where the subsurface losses of rainfall for vertical penetration are significant. Therefore, in sufficiently permeable aquifers, the response of groundwater level to precipitation can be quick; however, rainfall may be considered a great indicator for groundwater level oscillation in such aquifers (Todd and Mays 2005). In previous decades, artificial intelligence (AI) methods, such as artificial neural networks (ANNs) and the adaptive neuro-fuzzy inference system (ANFIS) were applied as strong tools and accurate solutions to many of the extremely difficult challenges faced by water sciences and hydrology, and this usage has increased. The growing AI approaches have the ability to fill the gaps in the measurements and to forecast future values without long observational data (Karimi et al. 2012). ANNs characterize remarkably simplified numerical types of organic neural networks. ANNs are able to evolve the solutions and process data quickly, to identify a structure within the information from examples of learning. ANFIS is a mixture of an adaptive neural network along with the fuzzy inference system. It has been utilized for a variety of purposes, as well as being identified as generating better outcomes as opposed to some other typically smooth computing approaches. The ANN and ANFIS methods are known as suitable applications for simulating complicated nonlinear programs and have been popular in classifying and evaluating groundwater level fluctuations (Coppola et al. 2005; Feng et al. 2008; Kisi and Shiri 2012; Mohanty et al. 2010; Nayak et al. 2006; Ranković et al. 2014). They are generally significant in learning the underlying relationship between the inputs and the output connections based solely on the observed data set. Applications of ANFIS modeling in hydrological based systems have already been investigated with specific application to modeling the water level (Chang and Chang 2006). Recently, numerous experts have analyzed the benefits of ANN and ANFIS models in comparison to ordinary simulation techniques (Daliakopoulos et al. 2005; Hong and White 2009; Mohammadi 2008; Trichakis et al. 2009; Zhang et al. 2011; Al-Mahallawi et al. 2012).

The main objective of this paper is to integrate the ANN and ANFIS methods to develop a hybrid method in estimating the water level fluctuation. The paper also aims to compare the performance of each method in modeling water table.

Description of the techniques

Artificial neural networks (ANNs)

ANNs are determined as computational models and inspired by human brain biological neural network (Dayhoff 1990). ANNs as a machine learning tool are permitted to fit very general nonlinear functions to experimental data sets; the accessibility of suitable data is mandatory for any statistical approach (Dreyfus 2005), which is the actual target of a trained back-propagation network. A neuron is a nonlinear algebraic function which obtains a number of signals from its input links, every one has a weight given to it (Dreyfus et al. 2002). These kinds of weight load match synaptic performance within biological neurons. Weight loads are classified as the basic form of long-term memory within the ANN. Throughout the training procedure, the initial estimation weight values are gradually reformed, resulting in a comparison of the predicted outputs with target outputs. The connections among the inside activation levels of the particular neuron along with the results can be revealed by a transfer function. The sigmoid function is a common transfer function modifying from 0 to 1 for a variety of inputs (Caudill and Butler 1992). The data running paradigm consists of extremely interconnected neurons in which a complicated input structure is mapped with a related output structure (Hagan et al. 1996). The artificial neurons are structured in three layers: an input layer, one or more hidden layers and an output layer. In this study, the water level with five input variables has been computed by the construction of a three layer feed-forward neural network with back-propagation learning (Fig. 1). The transfer function in the hidden layer was set to sigmoid due to the tansig function, which provides better results than other transfer functions in the initial assessment, although the pure linear transfer function has been used in the output layer. The difference between the various kinds of ANN generally arises from a variety of methods to set up the nodes and the several methods to characterize the weights and functions to train the network. The predicted models that were achieved by the ANN are more conductive than linear models. These models are of different types; the two most usable, especially in hydrological sciences, are the feed-forward neural network (FNN) and the cascade forward network (CFN) used in this research. The Levenberg–Marquardt (LM) algorithm, which supplies a solution to modify the nonlinear functions, is determined for this research because it is fast, accurate, and reliable (Adamowski and Karapataki 2010; Khaki et al. 2014). The robustness and quick convergence capability are essential benefits in applying the LM algorithm in this study.

Fig. 1
figure 1

General conceptual neural network for the water level computation in the Langat Basin, Malaysia

Adaptive neuro-fuzzy inference systems (ANFIS)

Jang (1993) introduced a novel architecture and learning product for the fuzzy inference system (FIS), employing a neural network learning algorithm to provide a set of fuzzy If–Then rules with proper membership functions which are obtained from the stipulated input–output pairs (Chang and Chang 2006). The ANFIS is a fuzzy Sugeno model put in the framework of adaptive systems to facilitate learning and adaptation (Jang 1993; Jang et al. 1997). Generally, Sugeno-type systems may be utilized to model any inference system in that the result membership functions are either linear or constant. The FIS under consideration is assumed to have two inputs, x and y, and one output, f, for a first-order Sugeno fuzzy model; a common rule set with two fuzzy If–Then rules may be expressed as

$${\text{Rule 1}}:{\text{ If}}\;x\; {\text{is}}\;A_{1} \; {\text{and }}y{\text{ is}}\,B_{1} ,{\text{ Then}}\;f_{1} = p_{1} x + q_{1} y + r_{1}$$
(1)
$${\text{Rule 2}}:{\text{ If}}\;x\; {\text{is}}\;A_{2} \; {\text{and }}y{\text{ is}}\;B_{2} \;,{\text{ Then}}\;f_{2} = p_{2} x + q_{2} y + r_{2}$$
(2)

where, for inputs \(x\) and \(y\), the membership functions (MFs) are \(A_{1}\), \(A_{2}\) and \(B_{1}\), \(B_{2}\) respectively; and \(p_{1} , q_{1} , r_{1}\) and \(p_{2} , q_{2} , r_{2}\) are the linear parameters of the output function. Figure 2 shows the resulting Sugeno fuzzy reasoning system and equivalent ANFIS architecture. Nodes at the same layer have the same function for this ANFIS structure. \(O_{l,i}\) specifies the output of the ith node in layer l. The five layers comprising the ANFIS structure are described as follows:

Fig. 2
figure 2

Two inputs first-order Sugeno fuzzy model with two rules and architecture of ANFIS

Layer 1: Input nodes. Membership grades based on the appropriate fuzzy set have been produced by each node of the layers they belong to using MFs

$$O_{l,i} = \mu A_{i} (x) \quad {\text{for}}\; i = 1 , 2$$
(3)
$$O_{l,i} = \mu B_{i - 2} (y)\quad {\text{for}}\; i = 3 , 4$$
(4)

where \(x , y\) are the input to the ith node and \(A_{i} , B_{i - 2}\) is a fuzzy label (excellent, good and unsuitable) characterized by the appropriate MFs \(\mu A_{i} , \mu B_{i}\), respectively, which can be triangular, trapezoidal, Gaussian functions or other shapes. The generalized bell function (5) and Gaussian membership function (6) generally explain the MFs for \(A\) and \(B\)

$$\mu A_{i} (x) = \frac{1}{{1 + [x - c_{i} /a_{i} ]^{{2b_{i} }} }}$$
(5)
$$\mu A_{i} (x) = { \exp }[ - (x - c_{i} /a_{i} )^{2} ]$$
(6)

where \((a_{i} , b_{i} ,c_{i} )\) is the parameter set of the MFs in the premise part of the fuzzy If–Then rules, in which case the shapes of the membership function are variable. Genuinely, the qualified candidates for the node functions in this layer can be any continuous and piecewise differentiable functions, such as commonly used triangular-shaped MFs (Jang 1993). Parameters in this layer are referred to as premise parameters.

Layer 2: Rule nodes. In the second layer, every node is a fixed node labeled \(\varPi\), where the incoming signals and output product are multiplied. For example

$$O_{2,i} = W_{i} = \mu A_{i} (x)\mu B_{i} (y),\quad i = 1 , 2$$
(7)

The firing strength of a rule is shown by the output of each node.

Layer 3: Average nodes. Each node in the third layer denotes N which is a stable node. The main aim of this layer is to compute the ratio of each ith rule’s firing strength to the sum of all the rules’ firing strength

$$O_{3,i} = \bar{W}_{i} = \frac{{W_{i} }}{{W_{1} + W_{2} }},\quad i = 1 , 2$$
(8)

The results of this layer are named the normalized firing strengths.

Layer 4: Consequent nodes. In this layer, each node presents an adaptive node, with the following node function

$$O_{4,i} = \bar{W}_{i} f_{i} = \bar{W}_{i} (p_{i} x + q_{i} y + r_{i} )$$
(9)

where \(\bar{W}_{i}\) is the ith node’s output from the previous layer, and \((p_{i} , q_{i} , r_{i} )\) is the parameter set. Parameters of this layer are referred to as consequence or output parameters.

Layer 5: Output nodes. The overall output summing all the incoming signals is computed by the single node. Therefore, the defuzzification process transforms each rule’s fuzzy results into a crisp output in this layer

$${\text{Overall output}} = O_{5,i} = \mathop \sum \limits_{i = 1} \bar{W}_{i} f_{i} = \frac{{\mathop \sum \nolimits_{i} W_{i} f_{i} }}{{\mathop \sum \nolimits_{i} W_{i} }}$$
(10)

Consequently, an adaptive network which is functionally equivalent to a Sugeno first-order FIS has been carried out. The ANFIS theory has been discussed in detail in previous studies (Jang 1993).

Learning algorithm of ANFIS

Utilizing an understanding algorithm, applying input and output information units, resulted in adaptable parameters of the FIS which is the purpose of ANFIS. The duty of the understanding algorithm for this architecture would be to tune every one of the adaptable variables, videlicet \((a_{i} , b_{i} ,c_{i} )\) and \((p_{i} , q_{i} , r_{i} )\), to create the ANFIS result to match the training data. The result of the ANFIS type can be mentioned as Eq. (10) when the assumption variables \(a_{i}\), \(b_{i}\) and \(c_{i}\) of the membership function are axed

$$\begin{gathered} f = \frac{{W_{1} }}{{W_{1} + W_{2} }}\quad f_{1} + \frac{{W_{1} }}{{W_{1} + W_{2} }}\quad f_{2} = \bar{W}_{1} f_{1} + \bar{W}_{2} f_{2} \hfill \\ = \bar{W}_{1} (p_{1} x + q_{1} y + r_{1} ) + \bar{W}_{2} (p_{2} x + q_{2} y + r_{2} ) \hfill \\ \quad = (\bar{W}_{1} x)p_{1} + (\bar{W}_{1} y)q_{1} + (\bar{W}_{1} )r_{1} + (\bar{W}_{2} x)p_{2} + (\bar{W}_{2} y)q_{1} + (\bar{W}_{2} )r_{2} \hfill \\ \end{gathered}$$
(11)

that is a linear mix of the adaptable consequent variables \(p_{1} , q_{1} ,r_{1} , p_{2} , p_{2}\) and \(r_{2}\). Determination of suitable values of these variables can be effortlessly carried out by the least squares technique. These supposition variables within the fuzzy level and the consequent variables within the defuzzification level were tuned during the ANFIS learning process until the preferred result of the FIS is obtained (Shahbudin et al. 2009). In this study, a hybrid learning algorithm was utilized to achieve the best values of the FIS variables of the Sugeno-type. A combination of the least squares and the back-propagation gradient descent approach for training FIS membership function variables to imitate a given training data set is applicable. It has been proven that the hybrid algorithm within the training ANFIS is broadly effective (Jang 1992, 1993).

Modeling performance criteria

Two different criteria are applied to investigate the effectiveness of each network and the precision of the simulation ability of each network. First, the mean square error (MSE) is calculated by

$${\text{MSE}} = \frac{{\mathop \sum \nolimits_{i = 1}^{N} (y_{i} - \bar{y}_{i} )^{2} }}{N}$$
(12)

where \(N\) is the total number of observation data, and \(y\) and \(\bar{y}\) are the observed and computed data, respectively. The MSE reflects the difference between the observed and computed values; the lower the MSE results the more precise the simulation.

The correlation coefficient \((R)\) between the network result and the network target outputs in three training, testing, and validation groups was the second to be employed, calculated as

$$R = \sqrt {1 - \frac{{\mathop \sum \nolimits (y_{i} - \bar{y}_{i} )^{2} }}{{\mathop \sum \nolimits y_{i}^{2} - \frac{{\mathop \sum \nolimits \bar{y}_{i}^{2} }}{N}}}}$$
(13)

where R represents the percentage of the preliminary uncertainty explained by the model. The best fit between the observed and computed values, which is unlikely to happen, would have been MSE = 0 and R = 1.

Study area and data description

Study area

The neural networks and neuro-fuzzy techniques were employed with data taken from Langat Basin, which is located in the southeastern part of Selangor state, Malaysia. The selected well for modeling of groundwater fluctuations in the study area is displayed in the Fig. 3. It has been selected due to following reasons: (a) It is located far from the coastal area, (b) It is not influenced by Mega Steel Factory which pumps a wide range of water, (c) Data collations are more convenient compared to other wells and (d) This well is located in the area with lower slope. The study area is located at the flat lowland in the downstream part of the Langat Basin with the surface elevation of 10 above mean sea level. Figure 3 also shows the location of 15 wells which were drilled as well as groundwater level contours in the study area. The main flow directions in the study area were from north-east towards south-west, and from south to north. Figure 4 shows the hydrogeological map of Langat Basin gained from Department of Mineral and Geosciences of Malaysia (2007). The overall of the lowlands area and slope for this area was determined to be 5,582 km2 and less than 5 %, using geographical information (Mineral and Geosciences Department 2002). Langat River water source is used for water supply besides various uses for example entertainment, fishing, effluent discharge, irrigation as well as sand mining. Different possible uses of this significant water source attract many industrial factories to invest in this area. The residual area consists of wetlands, rain forest and reed swamps. The main geological coverage of the Langat Basin is Quaternary deposits of Beruas, Gula, and Simpang formations, overlying the sedimentary bedrock of the Kenny Hill Formation (Mineral and Geosciences Department 2002) which are generally presented by the geological map of the study area. Based on drilling data, the gravelly sand (Simpang formation) aquifer layer is covered by clayey layers and then, at some locations, by peat layers, which affects the aquifer depending on the location and makes it confined. The average rainfall in the Langat Basin ranges from around 2,200–2,700 mm per annum. The temperature has a mean of 27 °C, with a range varying from 24 to 32 °C and remains constant during the year (MMD 2013). The highest and lowest temperature reached during the noon and night with an average of 24 and 32 °C, respectively. The average monthly relative humidity in the range of 77–85 % varying from place to place of research area and from month to month. The minimum range of average relative humidity is varying from 67 % in February to 79 % in November. The maximum range of mean relative humidity is varying from 82 % in June to 89 % in November. In Peninsular Malaysia, the lowest relative humidity occurs in January and February while the highest relative humidity normally happens in November (MMD 2013).

Fig. 3
figure 3

Location of the wells in the Langat Basin, Malaysia

Fig. 4
figure 4

Hydrogeological and potential aquifer map of Selangor State, Department of Mineral and Geosciences of Malaysia (2007)

Data description

The data evaluated in this research are those that impact the water budget in a water catchment. The standard hydrologic balance formulation in a groundwater system can be given in terms of the difference between the inflow and outflow:

$$X - Y = \Delta S$$
(14)

where \(X\) shows inflow like precipitation, \(Y\) is outflow like surface run-off, evaporation, infiltration, groundwater flow, and \(\varDelta S\) shows water level variations. In the present study, monthly groundwater levels, precipitation, evaporation, humidity, maximum temperature and minimum temperature data for the selected well were identified and trained with ANNs and ANFIS. These data are known as efficient parameters in the fluctuation of groundwater levels (Lallahem et al. 2005). Figure 5 demonstrates the measured time series of groundwater level and precipitation in the research period. In addition, Fig. 5 obviously show that the depth of groundwater is well-related to the rainfall depth during a certain period. Temperature has a main factor within the water budget as it effects evaporation (Te Chow et al. 1988). Consequently, the input layers include rainfall, evaporation, humidity and the minimum and maximum temperature data and the output layers consist of the fluctuation in water level data. Monthly data values employed in this simulation exercise are the mean of the monthly measurements. The applied data comprises the observations for 7 years from 1st January 2007 to 31st July 2013. The data were randomly included in the training (70 % of all data), testing (15 % of all data) and checking (15 % of all data) of the data sets. The statistical properties of the data used are represented in Table 1. Therefore, the numbers of input and output data were arranged at five and one, respectively. The models were implemented using Matlab 2012a.

Fig. 5
figure 5

Monthly precipitation (mm) and depth to groundwater level (m) for observation well from 2007 to 2013 in Langat Basin, Malaysia

Table 1 The statistics of characteristic parameters variable in the study area

Results

ANN and ANFIS models have developed to estimate water level with applying the database of 79 months of test data from 2007 to 2013. For developing the models a three-layer back propagation ANN with five input nodes in the input layer and two hidden layers have been chosen. The numerous network structures were examined to identify the ideal number of hidden layers and the number of nodes. The processing was applied to the FNN and CFN for various epoch numbers. Similar sets of input and output data were applied in the ANFIS modeling, including Gaussian and generalized bell MFs for each input, which were found to be satisfactory for the processing of the model. The number, step-size and shape of the MFs as predefined internal ANFIS elements were effective, making it possible for the ANFIS model to achieve the efficiency objective. The data is normalized in order to make it appropriate for the training process which was carried out by mapping each term to a value between 0 and 1.

Figure 5 shows that the maximum precipitation (480 mm) was recorded in December of 2012 and the minimum in June 2009 (27 mm). Usually the groundwater level rose and feels as a function of rainfall. The best case of where this occurred was September 2010 when the groundwater level was near its highest level (1 m) and after a large rainfall event (470 mm). Thereafter it fell to one of its lowest levels in February 2011 (2.5 m) and after a prolonged period of low rainfall (<300 mm per month).

Selected values of learning parameters to obtain the best performance of network when R is highest and MSE error is the lowest are illustrated in Table 2. The total data set, all training and checking related to the R and the MSE, between the target unit and the output of the ANN and ANFIS for the observation well, are shown in Table 2. The best overall performance was resulted from the achievement of ANFIS trained with the Generalized bell MFs which were presented in Table 2 and by the ANFIS trained with the Gaussian MFs as the second best was demonstrated by their small MSE error and higher correlation. The obtained results from Table 3 interpret that ANFIS with the Gaussian MFs and generalized bell was efficiently comparable with the FNN and CFN in the entire data set. It clearly shows that ANFIS model performance provides improvement over that ANN models performed. The scatter plot shown in Fig. 6 presents the analysis of the capability of the ANN and ANFIS models, comparing the various networks and MFs (referring to the training steps). This demonstrates the groundwater level simulation and also MSE error of each model in the training step in achieving the greatest input admixture in the form of hydrographs. The predicted values of the models and the real value were matched. Figure 7 shows the results of the ANN and ANFIS groundwater level over the period 2007–2013. All indices confirmed the same results and show sensitivity to the fluctuation in groundwater levels. The figure shows that the observed and simulated groundwater levels for the ANN and ANFIS are very well-matched. Predicted values from ANFIS models well-matched the measured values much better than those obtained from the three methods. Hydrographs and scatter plots verified that the ANFIS simulation is closer to the related observed values compared to the FNNs and CFNs. Nevertheless, the values of groundwater level proposed in this research generate a more stringent output. Table 3 and Figs. 6 and 7 confirm the perfect capability of the ANN and ANFIS models for groundwater level simulation at the Langat Basin, Malaysia. In general, for this research ANFIS is more beneficial compared to ANN since ANFIS model trains are considerably faster with supplying better predictions. As a result, the ANN and ANFIS models can be successfully employed to simulate the fluctuations of groundwater level.

Table 2 Learning factors at the maximum R and minimum MSE of data set
Table 3 Comparison of performance of models developed for all, training, testing and checking periods
Fig. 6
figure 6

Scatter plots of the observed and simulated water levels at training period for FNN, CFN and ANFIS (Gaussian and generalized bell MFs)

Fig. 7
figure 7

Graphical representation the results of ANN, CFN and ANFIS (Gaussian and generalized bell MFs) model which is compared between computed and measured data

Conclusions

Adaptive neuro fuzzy and neural networks system are known as extremely useful method of empirical forecasting of hydrological parameters. Identification of the most stable and efficient neural network and neuro fuzzy configuration to predict groundwater level in the Langat Basin, Malaysia was targeted in current research. The performance of this method has been examined using a database of groundwater variation covering a 7-year period. Using appropriate variables in the model is a key to achieve at successful ANN and ANFIS modelling. The correct prediction of water level fluctuations at a well site is the advantage of employing ANN and ANFIS water level prediction models. These ANN and ANFIS models are capable to be used for running the past data to fill up the missing period of the water level depth measurements at a well site. As a result, much more complete data sets for water resource research can be provided by these models.

The most suitable structure for ANN proved to be a 9–10–1 and 9–11–1 feed forward network trained with the LM algorithm as it demonstrated the most precise predictions of the groundwater level. However, the ANFIS models show the best performance in comparing the correlation coefficient R and MSE, followed by the FNN and CFN models, respectively. Furthermore, the simulated depth for groundwater in all the observation data, with MSE of 0.0043–0.0500 m2, was successfully represented by the obtained results. The minimum reported error belonged to the ANFIS model. In comparing the fewer computational complexities in training the network and quicker convergence to a solution, ANFIS shows the better result than FNN and CFN. Besides, the accuracy of the groundwater level simulation with minimum calculations compared to the FNN and CFN is improved by the ANFIS model.

In general, the outcomes of the research are acceptable and show that neural networks and neuro fuzzy system can be a helpful tool for simulation in the case of groundwater hydrology studies. Consequently, the investigation demonstrated in this research supplies us with a reliable tool to understand the various management strategies and how various climatic tools cause groundwater levels to respond. These tools can be applied to determine the optimal policies that can promote sustainable management of accessible water resources when complete data on the hydrological system is not available.