Introduction

The pressure of population growth, industrialisation, upgraded living standards, and urbanisation has led to increased water requirements and consumption (Zhou et al. 2002). Accurate and reliable flood forecasts are vital, predominantly in flood-affected regions. Unlike any other natural disaster, floods affect countless lives, property, infrastructure, and cause limitless destruction. An accurate flood forecast with proper lead time can provide forward-thoughtful attentiveness to an impending flood event early enough to minimise flood damage significantly. It is not possible to have complete protection from flooding; however, countless lives and vast amounts of money can be avoided by timely and precise predictions of the crests, magnitude, and duration of the flood. The control of floods is essential to halting climate change. In order to adjust to a changing environment and climate, flood management innovation is vital. Ineffective flood management has serious repercussions. Each year, flooding causes up to tens of billions of dollars worth of economic damage and hundreds of fatalities worldwide. Because of machine learning (ML) algorithm’s strong authority in unravelling non-linear relationships, they have been broadly employed for solving environmental and hydrological problems (Fan et al. 2019; Xiao et al. 2019; Yaseen et al. 2019; Deo et al. 2016). Data-driven models (DDM) work on the basis of functional connections between input (e.g. independent) and target (e.g. dependent) variables (Liang et al. 2019; Kim et al. 2019). In hydrological studies, DDM, using ML algorithms, has been extensively utilised and has revealed better prediction performances with lesser constraints compared to physical-based models (Mosavi et al. 2018; Zia et al. 2015; Samantaray et al. 2022f). Classic DDM for hydrological investigations comprises artificial neural networks (ANN; McCulloch and Pitts 1943), support vector machines (SVM; Vapnik 1995), random forest (RF; Breiman 2001), and ANFIS (Jang 1993). ANN has been utilised in several hydrological processes, including river engineering, water resources management, and hydrology. In terms of accuracy and application, several ANN-based studies have demonstrated an effective method for flow forecast, precipitation prediction, and water quality prediction (Fan et al. 2019; Huang et al. 2019; Samantaray et al. 2022a; Ghose and Samantaray 2019; Samantaray and Ghose 2019; Samantaray et al. 2022b). Several studies have reported application of ANN-based flood prediction models using different meteorological parameters of the study region (Mandal et al. 2005; Han et al. 2007; Dawson et al. 2006; Do Hoai et al. 2011; Elsafi 2014; Mitra et al. 2016; Tsakiri et al. 2018; Sahoo et al. 2022a, b). Singh (2012) applied wavelet-based ANN model for predicting flood events and compared it with existing statistical models. They found that WANN model predicted better flood values than statistical models. In another study, Dhunny et al. (2020) studied the use of ANN model for flood prediction using 20,000 climatic datasets (minimum temperature, maximum temperature, rainfall, and humidity) that were gathered over the course of 2 years for Mauritius. They found ANN to be a good predictor for the specified study region.

Although the ANN method is widely used, it may not produce extremely accurate results, which leads to instability. The inability of ANNs to accurately forecast changes in hydrological variables led to the development of ANFIS that can operate with non-linear relationships. Data pre-processing techniques are required to boost ANN performance. ANFIS is said to be a good amalgamation of ANN and FL. Even though ANN and ANFIS have a lot in common in their modelling stages, reports recommend that ANFIS usually has superior performance than ANN (Sahoo et al. 2022b; Samantaray et al. 2022c; Akrami et al. 2013; El-Shafie et al. 2011); hence, it appears to be a reasonable indication for focusing on ANFIS. It is known to be one of the most beneficial and has a satisfactory performance in modelling many hydrological and environmental phenomena (Kheradpisheh et al. 2015; Mekanik et al. 2016).

Nayak et al. (2005) explored the potential of ANFIS for forecasting flood flow of Kolar river basin, India. In another study, Ullah and Choudhury (2010) explored the usability of ANFIS in flood discharge forecasting of Barak river basin. Both the studies concluded that ANFIS provided better results compared to the ANN model. Nguyen and Chua (2012) implemented ANFIS for daily water level forecasting of Lower Mekong River using water levels of 1 to 5 days ahead. Ghalkhani et al. (2013) used ANN and ANFIS, for flood routing based on different lag times in Madarsoo river basin, Iran. Applied models generated good results at the study location. Anusree and Varghese (2016) applied multiple nonlinear regression (MNLR), ANN, and ANFIS to predict daily flow with different input combinations at exit of Karuvannur river basin. The outcomes indicated that ANFIS predicted river flow more precisely than MNLR and ANN models. Tabbussum and Dar (2021) applied ANN, ANFIS, and fuzzy logic techniques based on different training algorithms to forecast QFD inflowing Srinagar city at Padshahi Bagh station of Jhelum River. They found that ANFIS model utilising hybrid training algorithm generated best prediction outcomes.

While classic AI techniques are utilised to model different phenomena, they generally suffer from certain shortcomings, such as utilising local search techniques, getting trapped in local optima, high computing, and over-fitting (Kisi et al. 2018; Peyghami and Khanduzi 2013). ANN and ANFIS are two well-known methods utilised for stimulating different hydrological phenomena. Often, they produce satisfactory performance in modelling the events mentioned above; however, they sometimes face problems estimating flood discharge. It may be because the non-linear and non-stationary condition of flow makes its modelling difficult. Hence, it appears to be a good indication to develop modelling quality by diminishing the complications of classical models. But, even though ANFIS has several benefits, its training approaches undergo a few flaws resulting in the incompetence of the models in some circumstances (Kisi et al. 2017). Finding an appropriate structure and its constraints in a neuro-fuzzy (NF) system is essential and also, the system’s success depends on its training algorithm’s accuracy and efficiency.

Several researches have been published on the successful use of genetic algorithm (GA) in combination with ANN and ANFIS models in predicting river flow discharge (Mukerji et al. 2009; Chau et al. 2005; Wu and Chau 2006). In a similar manner, hybrid ANFIS model with different evolutionary algorithms (Firefly Algorithm (FA); ant colony optimisation (ACO); Whale Optimisation algorithm (WOA); Gray Wolf Optimisation (GWO); Salp Swarm algorithm (SSA); Harris Hawks Optimization (HHO); Butterfly Optimization Algorithm (BOA); Black Widow Optimization Algorithm (BWOA)) have been successfully applied for modelling several hydrological variables like precipitation, temperature, solar radiation, evapotranspiration, runoff, drought, water table depth, and humidity (Tao et al. 2018; Yaseen et al. 2018; Dehghani et al. 2019; Seifi et al. 2020; Penghui et al. 2020; Samantaray et al. 2022d, e; Panahi et al. 2021; Emami and Emami 2021; Mirboluki et al. 2022, Fadaee et al. 2022). Azad et al. (2018) utilised ACO, GA, and PSO, to train ANFIS for estimating the river flow of Zayandehrood river basin, Iran. Among all considered models, ANFIS-PSO performed best and classical ANFIS performed worst. Yaseen et al. (2019) investigated the potential of GA, PSO, and differential evolution (DE) in tuning membership function (MF) of ANFIS for improving accuracy of streamflow forecasting in River Pahang, Peninsular Malaysia. Analysis of performance indicated that PSO improved the proficiency of ANFIS more than DE and GA algorithms. Inyang et al. (2020) applied k-means, self-organising maps (SOM), ANFIS-GA, and ANFIS-PSO models for predicting flood severity levels. ANFIS-PSO model with lowest error established to be superior compared to other applied models. Arya Azar et al. (2021) evaluated ANFIS, least-squares support vector machine (LS-SVM), and ANFIS-HHO models for predicting evaporation utilising data related to Doroudzan dam located in central Iran. They reported that ANFIS-HHO model gave superior performance to LS-SVR and ANFIS models. Mohammadi et al. (2021) investigated performance of single Non-Recorded Catchment Areas (NRECA), Hydrologiska Byråns Vattenbalansavdelning (HBV), SVM, ANFIS, GMDH (group method of data handling) models, and hybridised NRECA and HBV with ANFIS, SVM, and GMDH models in streamflow prediction considering precipitation and streamflow data of four stations in Indonesia. The results revealed that hybrid models performed better than single models, with hybrid GMDH model performing best among all. Haznedar and Kilinc (2022) developed a hybrid ANFIS-GA model to predict river flow from data collected from Zamanti and Körkün stations of River Seyhan, Turkey, and compared its results with traditional ANN and LSTM models. Their outcomes showed that projected ANFIS-GA technique was successful in predicting river flow more accurately. Malik et al. (2022) applied three machine learning models namely MLP, SVM, and ANFIS and their optimisation with PSO, SMA, and spotted hyena optimiser (SHO) algorithms to predict soil temperature at different depths for a semi-arid zone of Punjab, India. They found that SMA algorithm best optimised the ML models and can be applied for other regions across India.

The developed technique, called ANFIS-PSOSMA, works by constructing a group of solutions, each of which refers to arrangement from ANFIS model’s parameters. The training set, representing 70% of total samples, is used to evaluate each solution. The solution with the smallest fitness value is the best, which is found by calculating the RMSE. After that, PSO’s operators are utilised for enhancing the existing population. This procedure is trailed by utilising SMA’s operators to improve solutions till they attain the final condition. The preeminent arrangement of ANFIS, i.e. the preeminent solution, is assessed utilising a testing set representing 30% of the entire samples. To the best of the authors’ understanding, this is the first application of PSOSMA to improve prediction capability of ANFIS and implemented in a real dataset (i.e. flood discharge dataset of Brahmani River). Study flow chart with methodology is given in Fig. 1.

Fig. 1
figure 1

Study flow chart with methodology

Study area

River Bramhani is the second longest river in Odisha and a major seasonal river in eastern India. The Brahmani is a significant seasonal river in the eastern Indian state of Odisha (Fig. 2). The Sankh and South Koel rivers meet to form the Brahmani, which flows through the Sundargarh, Deogarh, Angul, Dhenkanal, Cuttack, Jajapur, and Kendrapara districts. The basin is located on the right by Mahanadi basin and on the left by Baitarani basin. It forms a sizable delta with the river Baitarani before draining into the Bay of Bengal at Dhamra. It is situated amid 20°30′10′′ and 23°36′42′′N latitudes and 83°52′55′′ and 87°00′38′′E longitudes. About 80% of the water of river Bramhani is used in irrigation. In the summer, the temperature may get as high as 47° C, while in the winter, it can get as low as 4 °C. In the state of Odisha, the basin is the primary source of water supplies for several towns and businesses as well as for agriculture. Having a total 39,313.50 km2 catchment area, it spreads over Chhattisgarh (3.5% of basin area), Jharkhand (39.2% of basin area), and Odisha (57.3% of basin area) states. Flood is a common aspect in Baitarani basin.

Fig. 2
figure 2

Study area depicting four selected gauge stations

Materials and methods

ANN

ANNs have been increasingly utilised in hydrological modelling, like streamflow modelling, rainfall-runoff modelling, and reservoir modelling (Othman and Naseri 2011). ANNs are parallelly dispersed processing systems having tendency of storing experiential information (Latt and Wittenberg 2014). ANN descend connotation from historical dataset, as opposed to physical aspects of a watershed (Cai et al. 2009). MLP is a broadly utilised ANN comprising of neurons called perceptron (Mukerji et al. 2009). In mathematical terms, MLP can be expressed by Eq. (1):

$$y=f(\sum\nolimits_{z=1}^{n}{m}_{z}{x}_{z}+b)s$$
(1)

where \(y\)—output; \({x}_{z}\)—input vector \((z = 1\dots n\)); \(f\)—transfer function; \({m}_{z}\)—weight vector; \(b\)—bias. Basic architecture of ANN is shown in Fig. 3.

Fig. 3
figure 3

Architecture of ANN

ANFIS

A NF system combines ideas of ANNs and fuzzy logic. Depending on training data, they change the types of membership fuzzy functions and inference fuzzy rules using an artificial neural network’s learning capability (Das et al. 2019; Sarkar et al. 2021). Learning and logical inference benefits are therefore incorporated into a single system. ANFIS is one of the most widely utilised NF systems (Samantaray et al. 2022g). A multilayer neural network called ANFIS produces output variable’s specific value for identified inputs depending on datasets (input–output vector) used during training.

The ability of ANFIS to accurately simulate non-linear links between input and output is a key characteristic. The implementation of an error propagation backward technique, either separately or in conjunction with approach of least squared error, is the foundation of ANFIS training. For describing ANFIS’s structure, the system comprises two inputs (\(x\) and \(y\)), two Sugeno’s type fuzzy if–then rules, and a single output \((y)\):

$$\begin{array}{c}Rule\ 1 :if \left({x}_{1}\ is\ {C}_{1}\right) and \left({x}_{2}\ is\ {D}_{1}\right)then {f}_{1}={p}_{1}{x}_{1}+{q}_{1}{x}_{2}+{r}_{1}\\ Rule\ 1 :if \left({x}_{1}\ is\ {C}_{2}\right) and \left({x}_{2}\ is\ {D}_{2}\right) then {f}_{2}={p}_{2}{x}_{1}+{q}_{2}{x}_{2}+{r}_{2}\end{array}$$

where \({C}_{i}\) and \({D}_{i}\)—fuzzy sets, \(q\), \(p\), \(r\)—subsequent model parameters assessed during training phase. Five layers of the ANFIS structure are seen in Fig. 4.

Fig. 4
figure 4

Architecture of ANFIS

The 1st layer comprises fuzzy MFs having output function for every node as shown in Eqs. (2) and (3):

$${O}_{i}^{1}={\mu }_{{C}_{i}}\left(x\right) , i=1, 2$$
(2)
$${O}_{i}^{1}={\mu }_{{D}_{i-1}}\left(x\right) , i=3, 4$$
(3)

where \(\mu\)—generalised Gaussian MF.

The 2nd layer calculates firing power of a rule utilising multiplication operator using Eq. (4):

$${O}_{i}^{2}={w}_{i}={\mu }_{{C}_{i}}\left(x\right)\bullet {\mu }_{{D}_{i}}\left(x\right), i=1, 2$$
(4)

The 3rd layer normalises firing power of each rule, utilising ratio between firing power of \(i\) th node and addition of firing powers from all nodes (Eq. (5)). Non-adaptive nodes are present in the 3rd layer.

$${O}_{i}^{3}=\overline{{w }_{i}}=\frac{{w}_{i}}{{w}_{1}+{w}_{2}}, i=1, 2$$
(5)

\({w}_{i}-i\mathrm{th}\) output from layer 2

The 4th layer utilises a nodal function for calculating the impact of \(i\) th rule concerning the output of the model (Eq. (6)):

$${O}_{i}^{4}=\overline{{w }_{i}}\left({p}_{i}x+{q}_{i}y+{r}_{i}\right)=\overline{{w }_{i}}{f}_{i}$$
(6)

where \({p}_{i}\), \({q}_{i}\), and \({r}_{i}\)—parameter sets of node and \({w}_{i}\)—normalised firing power of 3rd layer.

The 5th layer consists of a solitary non-adaptive node that computes ANFIS model’s overall output utilising a summation system (Eq. (7)):

$${O}_{i}^{5}=\sum_{i}\overline{{w }_{i}}{f}_{i}=\frac{{\sum }_{i}{w}_{i}{f}_{i}}{{\sum }_{i}{w}_{i}}$$
(7)

PSO

  Kennedy and Eberhart (1995) proposed a population-based meta-heuristic algorithm known as PSO algorithm for solving optimisation problems. The societal behaviour of cluster of “birds” (particles) inspired the two scientists for developing this optimisation technique. The behaviour of birds known as flocking is based on finding certain foodstuff for themselves. At first, population (particle) is initialised by some arbitrarily produced location values. The preeminent position of every particle (\(pbest\)) is uninterruptedly stored locally in conjunction with the knowledge about global best particle (\(gbest\)). The position and velocity of all population are updated utilising Eq. 8 and Eq. 9 respectively.

$${x}_{i,n}^{j+1}={x}_{i,n}^{j}+{v}_{i,n}^{j+1}$$
(8)
$${v}_{i,n}^{j+1}={wv}_{i,n}^{j}+{c}_{1}{r}_{1}{p}_{i,n}^{j}-{x}_{i,n}^{j}+{c}_{2}{r}_{2}{p}_{g,n}^{j}-{x}_{i,n}^{j}$$
(9)

where \({x}_{i,n}^{j}\) and \({v}_{i,n}^{j}\)—position and velocity of \({i}^{th}\) particle respectively, \(w\)—inertial weight of current particle utilised for modifying subsequent group of particles, \({p}_{i,n}^{j}\)—personal preeminent location having fitness cost (value) of \(i\) th particle usually termed \(pbest\), \({p}_{g,n}^{j}\)—global preeminent particle position usually termed \(gbest\), \({c}_{1}\) and \({c}_{2}\)—coefficient of acceleration utilised for handling exploration and exploitation ability respectively, \({r}_{1}\) and \({r}_{2}\)—equally dispersed arbitrary number between [0, 1]. All elements work together with one another to search for a best solution with their optimal fitness function. Basic architecture of PSO is shown in the following algorithm.

Algorithm 1
figure a

PSO algorithm

SMA

Because metaheuristic algorithms perform better than deterministic algorithms and use less processing power and time, they have gained popularity in several practical fields in recent years. In addition, certain deterministic algorithms are affected by local optima because they lack unpredictability in their latter stages. In contrast, random elements in MAs might cause the algorithm to search for all optimal solutions in the search space, successfully avoiding local optimum. Li et al. (2020) developed a technique for creating wireless sensor networks that use two different slime mould tubular networks corresponding to two different regional routing algorithms.

Approach food

For replicating the contraction technique in this approach, following model equations are expressed (Eq. (10)):

$$\overrightarrow{Y(t+1)}=\left\{\begin{array}{c}\overrightarrow{{Y}_{b}(t)}+\overrightarrow{vb}\bullet \left(\overrightarrow{W}\bullet \overrightarrow{{Y}_{A}\left(t\right)}-\overrightarrow{{Y}_{B}\left(t\right)}\right),r<p\\ \overrightarrow{vc}\bullet \overrightarrow{Y\left(t\right)},r\ge p\end{array}\right.$$
(10)

where \(\overrightarrow{vb}\)—constraint utilised in \([-a, a]\), \(\overrightarrow{vc}\)—constraint values that vary from 1 to 0. \(t-{t}_{th}\) iteration,\(\overrightarrow{{Y}_{b}}\)—discrete location of present best,\(\overrightarrow{Y}\)—position of present solution, \(\overrightarrow{{Y}_{A}}\) and \(\overrightarrow{{Y}_{B}}\)—two randomly selected solutions, and \(\overrightarrow{W}\)—weight of current solution. \(p\) value is determined as follows (Eq. (11)):

$$p=tanh\left|S\left(i\right)-bestfitness\right|$$
(11)

where\(i \in 1, 2, 3, . ... , n\), \(S\left(i\right)\)—fitness function of present solution and \(\overrightarrow{vb}\) is found using the following expression Eq. (12):

$$\overrightarrow{vb}=\left[-a,a\right], a=\mathrm{arctanh}(-(\frac{t}{\mathrm{max}\_iter})+1)$$
(12)

The \(\overrightarrow{W}\) is obtained based on subsequent Eq. (13):

$$\overrightarrow{W(Smellindex(i))}=\left\{\begin{array}{c}1+r\bullet \mathrm{log}\left(\frac{bF-S\left(i\right)}{bF-wF}+1\right), condition\\ 1-r\bullet \mathrm{log}\left(\frac{bF-S\left(i\right)}{bF-wF}+1\right),others\end{array}\right.$$
(13)

where \(r\)—arbitrary value between [0, 1], \(bF\)—best-attained fitness values, \(wF\)—worst-attained fitness values, and \(SmellIndex\)—organised fitness values.

Wrap food

When food item is satisfied to extend to a location where the quantity of food is fragile, then the importance of that area diminishes, initiating investigators to move their observation towards other areas of food accessibility which are not as important as the food item. To update the locations, the following mathematical expression is used as depicted:

$$\overrightarrow{{Y}^{*}}=\left\{\begin{array}{c}rand.\left(UB-LB\right)+LB, rand<z\\ \overrightarrow{{Y}_{B}\left(t\right)}+\overrightarrow{vb}\bullet \left(\overrightarrow{W}\bullet \overrightarrow{{Y}_{A}\left(t\right)}-\overrightarrow{{Y}_{B}\left(t\right)}\right),r<p\\ \overrightarrow{vc}\bullet \overrightarrow{Y\left(t\right)},r\ge p\end{array}\right.$$
(14)

where \(UB\) and \(LB\)—upper and lower boundaries, \(rand\) and \(r\)—arbitrary values between \([\mathrm{0,1}]\), and \(z\) is a value of parameter between \([0, 0.1]\).

Grabble food

\(\overrightarrow{vb}\)—zone of arbitrary numbers between \([-a, a]\), \(\overrightarrow{vc}\) lies between \([-1, 1]\). Even though slime mould obtained an enhanced feed source, it still would extend organic material to seek other sites for a superior-class food source instead of investing all of it in a solitary region for discovering a more consistent nutrition source. The mechanism of SMA algorithm is represented in the following algorithm.

Algorithm 2
figure b

Pseudo-code of SMA

Proposed ANFIS-PSOSMA model

The applied algorithm intends at improving the capability of ANFIS model for predicting QFD by finding its optimal constraints. This is obtained by utilising a novel metaheuristic algorithm called SMA. SMA is dependent on utilising PSO for generating initial population (first generation) as it has the biggest impact on conjunction of solutions concerning optimum solution. The developed model namely ANFIS-PSOSMA, as shown in Algorithm 3, starts by constructing the network that comprises five layers like the conventional ANFIS. After that, the input data is divided into two groups; first set (70% of total data) is utilised for training the network and finding optimal constraints and second set (30% of total data) is utilised for assessing superlative network built utilising PSOSMA. The subsequent procedure is to generate a group of arbitrary solutions and assess superiority of each one for determining best solution in accordance to training set.

Subsequently, solutions are updated utilising PSO operators, and updated population is delivered to SMA algorithm, which means until they reach at end conditions, operators of SMA will be utilised for updating solutions. The best solution of the preeminent ANFIS network is reverted from learning phase. After that, the testing set is utilised for evaluating performance of the best ANFIS model. Steps of ANFIS-PSOSMA model is demonstrated in Fig. 5.

Fig. 5
figure 5

Steps of ANFIS-PSOSMA

Algorithm 3
figure c

Pseudo-code of ANFIS-PSOSMA

Evaluating standards

R2 (Sridharam et al. 2021; Chaudhury et al. 2022; Samantaray and Ghose 2022), MAE (Singh et al. 2022; Jamei et al. 2022), and RMSE (Wang et al. 2022; Ehteram et al. 2019) are standard assessment measures for determining the preeminent prediction model (Eq. (15), Eq. (16), and Eq. (17)). Furthermore, the NSE (Patel et al. 2022; Samani et al. 2022) is also utilised to assess the power of the ANFIS-PSOSMA model (Eq. (18)). For the selection of the best model in this research, the criteria is MAE and RMSE are to be minimum and NSE, R2 must be maximum.

$${={R}^{2}(\frac{\sum_{i=1}^{n}({O}_{i}-\overline{O })({P}_{i}-\overline{P })}{\sqrt{\sum_{i=1}^{n}{({O}_{i}-\overline{O })}^{2}\sum_{i=1}^{n}{({P}_{i}-\overline{P })}^{2}}})}^{2}$$
(15)
$$RMSE=\sqrt{\frac{1}{n}\sum\nolimits_{i=1}^{n}{({P}_{i}-{O}_{i})}^{2}}$$
(16)
$$MAE=\frac{1}{n}\sum\nolimits_{i=1}^{n}\Vert {P}_{i}-{O}_{i}\Vert$$
(17)
$${N}_{SE}=1-[\frac{\sum_{i=1}^{n}{({P}_{i}-{O}_{i})}^{2}}{\sum_{i=1}^{n}{({O}_{i}-\overline{O })}^{2}}]$$
(18)

where

P i :

predicted value.

O i :

observed value.

\(\overline{P }\) :

mean predicted value 

\(\overline{O }\) :

mean observed value 

The applied models based on different input combinations of meteorological components (precipitation (Pt), temperature (Tt), humidity (Ht), infiltration (It), evapotranspiration (ETt)) are presented in Table 1. The observed rainfall (Pt), average temperature (Tt), mean humidity (Ht), and mean evapotranspiration loss (Et) data are collected from IMD (Indian Meteorological Department), Pune. Infiltration data is obtained from Soil Water Infiltration Global Database.

Table 1 Model scenarios based on different input combinations

Statistical analysis (minimum, maximum, mean, standard deviation, and kurtosis) of considered hydrological parameters (precipitation, humidity, temperature, evapotranspiration loss, and infiltration), for all datasets (training and testing) of all four stations, is conducted in Tables 2, 3, 4, and 5. The obtained results are presented in Table 6. After monitoring the data quality, datasets were divided into training (70% of complete data) and testing (30% of complete data). The period from January 1990 to December 2010 was utilised to train the models, and from January 2011 to December 2019 to test them.

Table 2 Statistical parameters of applied data Tilga
Table 3 Statistical parameters of applied data Jenapur
Table 4 Statistical parameters of applied data Jaraikela
Table 5 Statistical parameters of applied data Gomlai
Table 6 Performance of ANN

Results

The performance of three models were tested for predicting monthly QFD in both training and testing phases utilising different statistical assessment measures (Tables 6, 7, 8, 9, and 10). Based on the applied evaluation measures, it was witnessed that all applied models had good prediction capability (R2 > 0.7). The results of R2 revealed that applied models are satisfactory; however, ANFIS-PSOSMA model generated the best QFD values, with the highest value of R2 (0.9946), followed by ANFIS-SMA (0.9813), ANFIS-PSO (0.9748), ANFIS (0.9657), and ANN (0.9507) models in the training phase and in the testing phase, R2 values of 0.9731, 0.9517, 0.9436, 0.9314, and 0.9176 in Jenapur station. Considering RMSE values, ANFIS-PSOSMA model had the lowest RMSE (0.0485) proving its best predictive power, followed by ANFIS-SMA (2.2532), ANFIS-PSO (6.8964), ANFIS (13.8749), and ANN (30.9957) models. Moreover, NSE criteria were categorised from highest prediction power to lowest providing similar to R2, as follows: ANFIS-PSOSMA (0.9952) > ANFIS-SMA (0.9818) > ANFIS-PSO (0.9755) > ANFIS (0.9662) > ANN (0.9513).

Table 7 Performance of ANFIS
Table 8 Performance of ANFIS-PSO
Table 9 Performance of ANFIS-SMA
Table 10 Performance of ANFIS-PSOSMA

The statistical indices discussed above have very well evaluated the prediction capability of projected models. In addition to that, scatter plots and time-series plots are very much useful in assessing the efficiency of forecasting data against the observed data.

It is observed from the scatterplots (Fig. 6) that all models achieved reasonable outcomes in terms of low and high QFD values. However, the values of R2 (Fig. 6) showed that ANFIS-PSOSMA performed superiorly compared to other hybrid and conventional models. As shown in Fig. 6d, the outcomes attained from the five models in the Jenapur station are more closely to 45° reference line than those of Jaraikela, Gomlai, and Tilga stations. Also, ANFIS-PSOSMA generated the best R2 value (0.99468), which inferred superior prediction than other models. The scatter plots of Tilga, Jaraikela, and Gomlai stations are shown in Fig. 6a–c.

Fig. 6
figure 6figure 6figure 6figure 6

Scatter plots of actual vs. predicted flood discharge using ANN, ANFIS, ANFIS-PSO, ANFIS-SMA, and ANFIS-PSOSMA models for a Tilga, b Jaraikela, c Gomlai, and d Jenapur stations

Performance of ANN, ANFIS, and ANFIS-SMA are further demonstrated in a more instinctive manner by plotting observed versus predicted QFD in the form of hydrographs, as presented in Fig. 6. Monthly forecasting time series data for all models are illustrated in Fig. 6 using data from 1 January 1990 to 31 December 2010 during training, whereas during the testing period uses data from 1 January 2011 to 31 December 2019. For all the stations considered in this study, ANFIS-PSOSMA model performed best for QFD forecasting, as estimated QFD values were closer to corresponding actual values and followed similar trend in all sketches, as displayed in Fig. 6. The time-series plots of Tilga, Jaraikela, Gomlai, and Jenapur stations are presented in Fig. 6a–d. Different from predictions from Jaraikela, Gomlai, and Tilga stations, predictions from Jenapur station can better forecast higher and lower flows. Among all the four stations considering the five applied models, the prediction accuracy of Jaraikela station is poor with the least R2 value in both the training and testing stages.

Linear scale plot of actual vs. estimated QFD for applied models are demonstrated in Fig. 7. The figures demonstrate that predicted peak QFD are 459.179M3/s, 454.666M3/s, 444.198M3/s, 433.496M3/s, 414.187M3/s for ANFIS-PSOSMA, ANFIS-SMA, ANFIS-PSO, ANFIS, and ANN in contrast to actual peak of 465.274M3/s for Tilga station. The approximated peak discharges are 3736.342M3/s, 3705.635M3/s, 3624.51M3/s, 3541.109M3/s, and 3344.36M3/s for ANFIS-PSOSMA, ANFIS-SMA, ANFIS-PSO, ANFIS, and ANN against actual peak 3790.931M3/s for Jaraikela division. For Gomlai gauging station, actual QFD is 2859.61M3/s aligned with predicted QFD 2822.149M3/s, 2804.991M3/s, 2736.075M3/s, 2667.444M3/s, and 2547.626M3/s for ANFIS-PSOSMA, ANFIS-SMA, ANFIS-PSO, ANFIS, and ANN correspondingly. Similarly, for Jenapur, observed peak discharge is 4432.095M3/s with respect to predicted QFD 4371.819M3/s, 4326.168M3/s, 4242.401M3/s, 4143.566M3/s, and 3871.435M3/s, for ANFIS-PSOSMA, ANFIS-SMA, ANFIS-PSO, ANFIS, and ANN respectively.

Fig. 7
figure 7figure 7figure 7figure 7

Observed and computed stream flow for a Tilga, b Jaraikela, c Gomlai, and d Jenapur stations

The results of boxplot are shown in Fig. 8. The boxplot of ANFIS-PSOSMA model for QFD prediction was nearly close to the actual boxplot compared to other two hybrid models (ANFIS-SMA and ANFIS-PSO), whereas conventional ANFIS, and ANN underestimated QFD. In terms of quartile, minimum and median values of all considered models were capable of predicting QFD values closer to actual values with a substantial degree of precision, even though ANFIS-PSOSMA model performed best among all models.

Fig. 8
figure 8

Boxplot representation for proposed models for a Tilga, b Jaraikela, c Gomlai, and d Jenapur stations

Correspondingly, frequency analysis is done through a histogram plot (Fig. 9) of actual and predicted data set. The x-axis presents QFD values, and the number of events was determined by the bin ranges of the histograms. From the above analysis, it is clearly found that ANFIS-SMA is more suitable than ANFIS and ANN approach. It can be concluded that after incorporating SMA to ANFIS models, there is a noticeable decrease in forecasting uncertainty resulting in the assessment of the prediction model.

Fig. 9
figure 9

Histogram plots showing frequency of actual and predicted data a Tilga, b Jaraikela, c Gomlai, and d Jenapur

Discussion

The applied models realise flood discharge prediction with a forecasting horizon. The performance criteria of hybrid ANFIS-PSOSMA is satisfactory (NSE = 0.9952, RMSE = 0.0485 R2 = 0.9946, MAE = 0.0265). The coefficient of determination (Fig. 6) illustrates that the developed model has adequately acquired the aspects of time series (QFD) of training data series. The predicted and observed QFD by ANFIS-PSOSMA model are nearly similar (Fig. 7). The same situation is observed with the NSE (0.9952). A small deviation is observed in terms of the RMSE (0.0485) between the forecasted flood discharge against the actual discharge. Hence, the proposed hybrid ANFIS-PSOSMA model has appropriately adjusted with variations in the input dataset (meteorological components) during the training period. The evaluation of generalisation capability, i.e. absence of overfitting or underfitting, is conducted with the testing dataset which has not been utilised in the training period. For each occurrence, testing results showed a good generalisation capability of the selected model. This reveals that there was neither overfitting nor underfitting during training. Also, it specifies perfect forecasts of flood peaks. There was a slight deviation between predicted and observed flood peaks, and hence, we can conclude that ANFIS-PSOSMA model has a better forecasting or prediction ability for flood peaks. The major advantage of the developed holistic approach is automatic determination of ANFIS variables and arrangement of key standardisation samples for overcoming limitations of conventional ML in modelling real-world problems when series of sample values is huge. The PSO is utilised for modifying search operators of SMA for avoiding its limitations in determining preeminent solution because of its fragile exploitation capability. As a result, integration of PSO and SMA, i.e. PSOSMA, utilises benefits of both SMA and PSO, and it shows higher performance outcomes compared to original SMA and PSO.

The key drawback of this research is the assessment of five applied ML approaches utilising data from a particular area. The proposed techniques can further be verified by utilising additional data from other climatic conditions. Also, the prospective of hybridisation of PSOSMA technique with stochastic models, mainly models with exogenous input, necessities to be evaluated. In future works, integrating ANFIS-PSOSMA with ensemble modelling techniques (like Bayesian model averaging) or preprocessing methods (e.g. EEMD or EMD) may be considered for improving models' effectiveness.

Conclusion

This research investigates the possibilities of modelling flood extremes utilising the newly developed AI approaches for improving early flood warning systems to mitigate the effect of flood hazards in the future. The present study was conducted for improving the appropriateness of ANFIS model integrated with PSOSMA for estimating flood discharge. Analysis of outcomes revealed that ANFIS in combination with meta-heuristic algorithms has great potential in estimating QFD with high accurateness and can enhance performance of standalone ANFIS by evading from the possibility of being stuck in local optima. It also decreases the dependency on conditions of the specified problem and improves search technique and capability of optimising complex problems. A good agreement was achieved amid observed and predicted values for simulated QFD in Bramhani River.

  • Among all employed AI models, ANFIS-PSOSMA model provided superior accurateness compared to other models namely ANFIS-SMA, ANFIS-PSO, ANFIS, and ANN. Novel ANFIS-PSOSMA model gave best value of R2 = 0.9946 than ANFIS-SMA (0.9813), ANFIS-PSO (0.9748), ANFIS (0.9657), and ANN (0.9507) models.

  • Addition of evapotranspiration as input to models showed substantial enhancement; hence for building an excellent QFD prediction model, rainfall data should be taken into consideration. In terms of accuracy in predicting QFD, it appears that the employed hybrid models performed very well.

  • Therefore, the hybrid ANFIS algorithm without the need for an innovative mathematical model is excellent for mimicking the non-linear restraints of obtained data and could be useful as a QFD estimation tool. To forecast QFD, identical algorithms with related model architectures could be taken and verified worldwide.

  • Provided that usage of better-quality datasets in ANN models will give more consistent results, however, accessibility of these high-quality hydro-climatic data series is one of the major limitations of these types of approaches. For future studies, efforts should be made for applying other appropriate EA and investigating their capability by comparing the models recommended in this work. Also, proposed EA techniques can be applied in other popular AI models that might face certain problems during training phase.