Abstract
Accurate hydrological simulations comply with the water (sixth) Sustainable Development Goals (SDGs). The study investigates the utility of ANN and SVR, as well as the post-simulation bias treatment of these simulations at Swat River basin, Pakistan. For this, climate variables were lag adjusted for the first time, then cross-correlated with the flow to identify the most associative delay time. In sensitivity analysis, seven combinations were selected as input with suitable hyperparameters. For SVR, grid search cross-validation determined the optimal set of hyper-parameters, while for ANN, neurons and hidden layers were optimized by trial and error. We ran model by using optimized hyperparameter configurations and input combinations. In comparison to SVRs (Root mean square error (RMSE) 34.2; mean absolute error (MAE) 3.0; CC 0.91) values, respectively, ANN fits the observations better than SVR with (RMSE 11.9; MAE 1.14; CC 0.99). Linear bias-corrected simulations greatly improved ANN performance (RMSE 3.98; MAE 0.625; CC 0.99), while the improvement was slight in the case of SVR (RMSE 35; MAE 0.58; CC 0.92). On seasonal scale, bias-corrected simulations remedy low- and high-flow seasonal discrepancies. Flow duration analysis results reveal deviation at low- and high-flow conditions by models, which were then reconciled by applying bias corrections.
HIGHLIGHTS
The study represents a couple of AI prognostic models with bias scaling on the Swat Basin case study.
ANN performs best with higher input parameters, while SVR performs robustly with lower input parameters.
Bias scaling of SVR (SVR-BC) improves in depicting peaks.
Bias correction of ANN yields better flow series having minimum errors than other models.
INTRODUCTION
Water is necessary for sustaining the biosphere. Humans engineer its uses for food, energy, and sustenance. However, no matter how much resourceful it is, it could be disastrous in the form of floods, GLOFs, cloudbursts, etc. This shows that the timely prediction regarding water systems is valuable for managing necessary supplies for hydropower generation, water supply, irrigation, etc., and helps avoid water-related damages (early floods warning, dam breaks, etc.). Hence, several studies have been conducted on water prediction/forecasting, specifically addressing river flows (Wang et al. 2009; Hadi & Tombul 2018; Adnan et al. 2019). River hydrology has high relevance with the supply of fresh water. Timely prediction is imperative for fulfilling the demand for communities, industries, etc. (Panagopoulos 2021, 2022; Panagopoulos & Giannika 2022).
Typically, there are two ways of forecasting streamflow: conventional modeling and data-driven modeling for predicting streamflow. Conventional models are based on mathematical equations and conceptual representations of the underlying processes that describe the real physical system of the basin (Hassan et al. 2014). For imitating a real scenario, a conventional model needs to incorporate a variety of climatic and physiographic parameters that could be of high data demand. For instance, almost all the models required precipitation and temperature as their primary model input, while other climate parameters also needed are humidity, evapotranspiration, wind speed, solar radiation, etc. Physiographic parameters generally comprise surface roughness, slope, elevation, etc. Fulfilling these data demands is an onerous task for model parameterization; on the other hand, deficient quantities could limit the performance of streamflow prediction. Additionally, the streamflow process is also influenced by spatiotemporal irregularity in the watershed characteristics such as a change in surface roughness with a change in areal land use, monthly, annually, etc. (Ali & Shahbaz 2020). For the sake of simplicity, these models neglect such spatiotemporal characteristics and consider them temporally stationary which could induce uncertainty in model inferences. Conventional modeling for forecasting stream flow includes hydrological models such as HEC-HMS, SWAT, VIC, HBV, and ARMAX models.
Alternatively, data-driven modeling includes different machine-learning approaches. Among several approaches, artificial neural networking (ANN) and support vector machine (SVM) are popularly being used for hydrological applications (Tongal & Booij 2018; Essam et al. 2022). Previously several studies have compared their performances with conventional models and reported better results. For instance, Hsu et al. (1995) showed that the ANN model provided a better representation of the rainfall-runoff relationships than the ARMAX time series approach or the conceptual Sacramento model. Zealand et al. (1999) explored the capability of ANN and confirmed its superiority over conventional models during training and testing periods. Demirel et al. (2009) compared the ANN model and the popular SWAT model; their study suggested that the ANN model is more effective in predicting peak flow than the SWAT model. Kerh & Lee (2006) applied a backpropagation neural networking model and found that the ANN model performs relatively better than that of the conventional Muskingum method. The ANN model is applied to forecast river flow in comparison to an analytic power model. They found that the neural network model performed better than the analytic power model (Karunanithi et al. 1994). Chiang et al. (2022) after conducting a study on the rural watershed in Taiwan concluded that SVR performed better than the hydrologic modeling system (HEC-HMS). Furthermore, in the last decade, SVM which is one of the soft computational techniques has been successfully used in hydrology and proved a better alternative to overcome some of the basic gaps in the application of ANN models (Adnan et al. 2017). Khan & Coulibaly (2006) used SVM models to predict lake water levels in comparison to a multilayer perceptron (MLP) and multiplicative seasonal autoregressive model (SAR). They found that SVM prediction accuracy is better than the other two models for multi-month ahead streamflow prediction. Çimen & Kisi (2009) compared the potential of SVM and ANN in modeling lake-level fluctuations in Turkey. Adnan et al. (2017) conducted a study in which a monthly stream flow prediction model was created using ANN and SVM. SVM was found to be more accurate in forecasting streamflow than ANN. Guo et al. (2011) predicted monthly river discharges. They explored that the SVM outperformed the ANN models.
In this study, the Swat River was selected, and less research was done on this area. Additionally, it is a crucial resource for leveraging the regional economy (Shah et al. 2016) and building hydropower capacity (Sabir et al. 2014). Large agricultural lands consistently suffer from flooding every year. Despite having a favorable location and gradient, the Swat River basin was not previously explored by government authorities for hydropower development until recently. In this regard, hydrological studies are crucial for informing managers regarding flow quantities and formulating water policies accordingly. The region also lacks climate observatories which is the major constraint in understanding the hydrologic processes of the basin. This could affect the model's capacity to comprehend complex processes, for instance, actual snow melting response as several intricate processes (melting rate at high latitude, etc.,) remain hidden and unknown. Additionally, an orographic gradient in high altitude also differs between low spatial instances, making it onerous to capture localized precipitation response. In this way, process-based modeling in these conditions would be susceptible to uncertainty, defective parameterization and bias.
While the process-based model suffers, in this study, the data-driven model is assumed to be more suitable under the given conditions as it could skip underlying physical processes and could directly relate climate variables to flow in an efficient manner. Nevertheless, one notable limitation of data-driven model is that it has inheriting bias toward the quantity of the dataset as they favor data in the normal distributed range (proximity to mean). Due to this flow the predicting model could generate a weaker response against the value that lies in extreme zones (months consist of frequent outliers or extreme values) hence creating annual recurrent bias in the model simulation. Therefore, for the removal of these persistent errors, each month of the flow series is needed to be treated individually. However, almost all previously conducted studies ignore the post-simulation treatment of flow series biases.
This research intends to use ANN and SVR models for predicting the 10-daily streamflow of the Swat basin at the Khawazakhela bridge. It will exploit the machine learning schemes by setting out comprehensive procedures for deriving optimal inferences. The 10-daily flow series was used as it is a moderate temporal resolution commonly used by industry practitioners in applied hydrology. Necessary climate data of 5 years (2008–2012) acquired from Pakistan Meteorological Department (PMD) and the irrigation department KPK were used in this examination. This paper is organized in the following order. The study area is explained in section 2. The SVR and ANN model architecture, statistical evaluators, and bias correction method are discussed in section 3. The Pre-modeling analyses including time lag adjustment, setting up model, and sensitivity analysis are represented in section 4. Outcomes of the study are explained in section 5. Finally, conclusions are drawn in section 6.
STUDY AREA
The study basin is situated in the northern part of Pakistan from 35.87° N to 34.94° S latitude and 72.165° W to 72.873° E longitude (Figure 1). The watershed has a drainage area of 3,584 km2. The region includes high altitude, rugged terrain, and a snowy basin. The mean elevation above sea level of the Swat basin is recorded as 3,521 meters. The climate of the Swat basin is colder in winter to pleasant in summer. This region receives precipitation from both systems, the southern summer monsoon system and the winterly western Mediterranean system. According to 5-year records of the meteorological stations at Kalam, the Swat basin received mean annual precipitation of 1,176.1 mm. For the same period, the mean temperature of the catchment varied from 4.5 to 17.9 °C. The Flow of the Swat basin is directly affected by glacier melts and monsoonal rain. The recorded average annual flow of the same 5-year period is 80.4 cumec at Khawazakhela gauge station.
MODELS
Support vector regression

Artificial neural network
ANN architecture for modeling climate-streamflow relationship with one hidden layer.
ANN architecture for modeling climate-streamflow relationship with one hidden layer.

Model's performance evaluation








where ‘x’ is the actual value, while ‘y’ is the predicted value, while ‘’ and ‘
’ are the mean of x and y, respectively. Its values range between −1 and 1, with 1 being the ideal value.
Bias correction




METHODOLOGY
Time lag adjustment analysis (left) and time-lagged adjusted series of highly correlated variables (right).
Time lag adjustment analysis (left) and time-lagged adjusted series of highly correlated variables (right).
Time lag adjustment:
(a1,b1) represents actual and simulated flow and (a2,b2) showing scatterplot of actual and simulated values SVR and SVR-BC and ANN and ANN-BC models.
(a1,b1) represents actual and simulated flow and (a2,b2) showing scatterplot of actual and simulated values SVR and SVR-BC and ANN and ANN-BC models.
The results suggest that precipitation variables depicted a weaker correlation with the flow. However, synthesized AP was found relatively better. A higher correlation of temperature indicates that the catchment regime is majorly governed by snow hydrology as temperature regulates the amount of water in the catchment by freezing and melting snowpacks. Nevertheless, the determined suitable lag times are as follows; For AP lag equals 16 days, P lag equals 16 days, Tx lag equals 17 days, and Tn lag equals 17 days.
Setting up model
Before developing a machine-learning model, input data are required to be organized in the machine-learning-compatible format. The procedure includes normalizing or scaling data and defining training and testing proportions. For this, time-lagged adjusted variables from the previous analysis were selected as input variables and are then further processed. Oftentimes, the data consist of discrepant magnitudes that could be erroneously interpreted by the modeling scheme. To compensate for this constraint, the data need to be scaled, this process is called normalization. For this study, the Min–Max normalization approach was adopted. It allows us to scale the data between 0 and 1. For reserving the appropriate size for training, data were split into 80:20 training and testing ratio.
Sensitivity analysis
Sensitivity analysis was performed to recognize the appropriate number of input combinations and model hyperparameter configurations. For this, firstly seven input combinations were developed considering previously selected suitable time-lagged variables. These combinations are kept same for both ANN and SVR models and were tested against respective model configurations of hyperparameter. In the case of SVR, a grid search cross-validation function was applied to appraise the sensitivity of diverse sets of model parameters. Grid search is an exhaustive method in which the training set is split into user-defined series numbers and independently validated against the user-defined range of model parameters. First, the identification of the most sensitive parameters was made individually. Three hyper parameters namely (regularization parameter (C); {default = 1}, Kernel; {linear, poly, rbf, sigmoid}, epsilon; {default = 0.1}) were found highly influential. Furthermore, selected parameters were given an interval range and incorporated into the grid search function with a cross-validation split equal to three. Models were scored using Pearson correlation. This process was repeated corresponding to each input combination (Pedregosa et al. 2011). While for ANN, the trial-and-error technique was used to select the optimum number of neurons and hidden layers for the given input combinations. For simplicity, two hidden layers were selected and the number of neurons in the hidden layers was increased consecutively till the performance reaches the maximum level. The epoch for the model was selected on the bases of the loss function when its gradient becomes nearly equal to 0. The highly correlated input configurations for each input combination were evaluated and ranked accordingly.
The results of the sensitivity analysis are given in Table 1. From all the iterations performed, only the highest-scoring configurations are mentioned in Table 1 corresponding to each input combination. The analysis suggests that the third number input combination and configuration setting performed best in the case of ANN. While the 14th number would well suit SVR modeling.
Final model hyperparameter values with highest Pearson correlation after trial-and-error for each input combination
S no. . | Input combinations . | Configurations . | Scores (CC) . | Ranking . |
---|---|---|---|---|
ANN | ||||
(Input layer; neurons), (hidden layers; neurons), (output layer; neuron) | ||||
1 | P16 | (1), (10,10), (1) | 0.59 | 7 |
2 | P16, AP22 | (2), (10,20), (1) | 0.68 | 6 |
3 | P16, AP22, Tx17, Tn17 | (4), (20,20), (1) | 0.99 | 1 |
4 | AP22, Tx17, Tn17 | (3), (20,15), (1) | 0.95 | 2 |
5 | Tx17, Tn17 | (2), (10,20), (1) | 0.92 | 3 |
6 | AP22, Tx17 | (2), (10,20), (1) | 0.80 | 4 |
7 | AP22, Tn17 | (2), (10,20), (1) | 0.74 | 5 |
SVR | ||||
(Number of splits), (svr_c), (svr_epsilon), (svr_kernel) | ||||
8 | P16 | (3), (150), (0.3), (rbf) | 0.44 | 7 |
9 | P16, AP22 | (3), (30), (0.3), (rbf) | 0.50 | 6 |
10 | P16, AP22, Tx17, Tn17 | (3), (20), (0.1), (poly) | 0.78 | 5 |
11 | AP22, Tx17, Tn17 | (3), (150), (0.3), (rbf) | 0.88 | 2 |
12 | Tx17, Tn17 | (3), (150), (0.3), (rbf) | 0.86 | 3 |
13 | AP22, Tx17 | (3), (120), (0.3), (rbf) | 0.84 | 4 |
14 | AP22, Tn17 | (3), (150), (0.2), (rbf) | 0.90 | 1 |
S no. . | Input combinations . | Configurations . | Scores (CC) . | Ranking . |
---|---|---|---|---|
ANN | ||||
(Input layer; neurons), (hidden layers; neurons), (output layer; neuron) | ||||
1 | P16 | (1), (10,10), (1) | 0.59 | 7 |
2 | P16, AP22 | (2), (10,20), (1) | 0.68 | 6 |
3 | P16, AP22, Tx17, Tn17 | (4), (20,20), (1) | 0.99 | 1 |
4 | AP22, Tx17, Tn17 | (3), (20,15), (1) | 0.95 | 2 |
5 | Tx17, Tn17 | (2), (10,20), (1) | 0.92 | 3 |
6 | AP22, Tx17 | (2), (10,20), (1) | 0.80 | 4 |
7 | AP22, Tn17 | (2), (10,20), (1) | 0.74 | 5 |
SVR | ||||
(Number of splits), (svr_c), (svr_epsilon), (svr_kernel) | ||||
8 | P16 | (3), (150), (0.3), (rbf) | 0.44 | 7 |
9 | P16, AP22 | (3), (30), (0.3), (rbf) | 0.50 | 6 |
10 | P16, AP22, Tx17, Tn17 | (3), (20), (0.1), (poly) | 0.78 | 5 |
11 | AP22, Tx17, Tn17 | (3), (150), (0.3), (rbf) | 0.88 | 2 |
12 | Tx17, Tn17 | (3), (150), (0.3), (rbf) | 0.86 | 3 |
13 | AP22, Tx17 | (3), (120), (0.3), (rbf) | 0.84 | 4 |
14 | AP22, Tn17 | (3), (150), (0.2), (rbf) | 0.90 | 1 |
Best among input combinations is highlighted in bold.
RESULTS
The determined two combinations along with their optimized configuration were selected to train the model. Training and testing datasets were independently tested using MAE, RMSE, and CC statistical measures. Details of statistical parameters are provided in Section 3.3.
Statistical evaluation of raw and bias-corrected ANN and SVR model simulations at training and testing epochs
No. . | Input combination . | Model . | Training . | Testing . | ||||
---|---|---|---|---|---|---|---|---|
MAE . | RMSE . | CC . | MAE . | RMSE . | CC . | |||
1 | Tn17, AP22 | SVR | 4.6 | 32.0 | 0.90 | 1.4 | 36.4 | 0.93 |
2 | P16, AP22, Tx17, Tn17 | ANN | 0.2 | 10.8 | 0.99 | 2.08 | 13.0 | 0.99 |
Bias-corrected schemes | ||||||||
3 | Tn17, AP22 | SVR-BC | 0.0 | 33.3 | 0.92 | −1.16 | 36.7 | 0.91 |
4 | P16, AP22, Tx17, Tn17 | ANN-BC | 0.0 | 4.27 | 0.99 | 1.25 | 3.69 | 0.99 |
No. . | Input combination . | Model . | Training . | Testing . | ||||
---|---|---|---|---|---|---|---|---|
MAE . | RMSE . | CC . | MAE . | RMSE . | CC . | |||
1 | Tn17, AP22 | SVR | 4.6 | 32.0 | 0.90 | 1.4 | 36.4 | 0.93 |
2 | P16, AP22, Tx17, Tn17 | ANN | 0.2 | 10.8 | 0.99 | 2.08 | 13.0 | 0.99 |
Bias-corrected schemes | ||||||||
3 | Tn17, AP22 | SVR-BC | 0.0 | 33.3 | 0.92 | −1.16 | 36.7 | 0.91 |
4 | P16, AP22, Tx17, Tn17 | ANN-BC | 0.0 | 4.27 | 0.99 | 1.25 | 3.69 | 0.99 |
Furthermore, general model simulations inherently contained model biases which could adversely affect the model simulation. To remedy this, we employed a simple linear bias scaling technique the details of which are provided in section 3.4. The findings show that bias scaling considerably improved ANN model simulations both for training and testing sets. In contrast, SVR couldn't exhibit much improvement except slightly treating underestimations. Overall, the ANN simulation has lower variability of 71.15 compared to the SVR, SVR-BC and ANN-BC simulations, which are 86.25, 79.65 and 85.78, respectively.
Seasonal analysis
Flow duration curve (FDC) analysis of (a) SVR, (b) ANN, (c) SVR-BC, (d) ANN-BC.
Flow duration curve analysis
Flow duration curves (FDCs) possess high importance in the water industry especially in defining project time-based utilities (Castellarin et al. 2007). In this regard, overlaying accuracy of flow simulation becomes greater importance. Practically, FDCs inform discrepancies between flow at different percentile. For this analysis, percentiles were divided into low flow; 91–100%, Intermediate flow; 11–90% and high flow conditions; 0–10%. Actual flow dynamics suggest that up to 60% of the time (low and intermediate-low) flow condition remains almost unchanged. For a sample time period, simulations have shown slght exaggerations except bias-corrected models. Nevertheless, corresponding to the rest of the intermediate observation, simulations displayed little variations. At high flow conditions, ANN-based simulation overlay the observation adequately, while SVR exhibited underestimated quantities. However, improvement in high-flow prediction can be noticed after bias correction as shown in Figure 7.
CONCLUSION
In this study, we appraise the utility of popular machine learning algorithms SVR and ANN to predict 10-daily flow simulations at the Swat River, Pakistan using climate dataset, precipitation (P), and minimum and maximum temperature (Tn, Tx). The study follows comprehensive procedures for flow simulation enhancement such as time lag adjustment, sensitivity analysis, and bias correction. AP was calculated using raw precipitation, to give, in all four inputs that were used for flow prediction. Optimum time lag adjustment was carried out to account for the delayed response and for improving the associative relationship between flow and input climate variables. According to the analysis, P16, AP22, Tx17, and Tn17 were identified as highly correlated variables. Furthermore to get the most pragmatic configuration and combinations, seven input combinations were developed and tested for seeking the best hyperparameters for individual modeling schemes. In the case of SVR, a cross-validation grid search method is used, in which the performance of different combinations of hyperparameter is tested corresponding to each user-defined data partition. For ANN, a trial-and-error procedure is used to determine the suitable neuron and hidden layer combinations.
For training and testing, 80 and 20% data were kept reserved for modeling purposes, respectively. The results of ANN were able to produce a highly colinear response to observation in both training and testing epochs than that of SVR. To deal with simulation biases, linear bias scaling was applied to derived model simulations. The method was able to significantly improve model representation and minimized ANN's MAE and RMSE values from 0.2 and 10.8 to 0.0 and 4.27, respectively. While SVR linear bias correction technique yielded an enhancement in its CC value from 0.90 to 0.92 and reduced the MAE from 4.6 to 0.0. Although significant improvements were observed in overall flow visual improvements in peak flow were witnessed in the case of SVR. Seasonal Analysis was carried out to better demonstrate the flow conditions in four seasons (DJF, MAM, JJA, and SON). Model simulations were found deficient under low flow conditions except for bias-corrected simulations that were able to reduce some discrepancy. FDCs were developed to analyze water quantity at a certain exceedance probability of time. Flows were divided into three conditions, namely, low flow (91–100%), Intermediate flow (11–90%), and high flow (0–10%). The analysis reveals slight underestimation by ANN at low to intermediate-low flow conditions; however, this was greatly resolved after applying bias correction. The SVR exhibited underestimation at high flow conditions, but improvements could be seen in high flow prediction after bias correction.
The results show that machine-learning modeling could be a valuable tool in applied hydrology. However, their accuracies are subject to numerous factors such as data quality, quantity, robust combination and configuration of hyper-parameter and the type of scheme itself (SVR, ANN, etc.). This study also emphasized on the use of simple bias-correcting techniques for improving model simulations regardless of the modeling framework.
Although the methodology adopted in this study is appropriate and has been justified by peer-reviewed literature, it is important to acknowledge that there are still limitations that need to be addressed. It should be noted that while ANNs offer ease of use, they require an excessive amount of data to train properly, whereas physical-based models do not have such a limitation. Therefore, in situations where data are limited, physical-based models may be a more suitable choice. Additionally, the non-stationarity of hydro-climatology has become more evident in the wake of climate change, which presents another challenge. ANNs are weak in predicting values that are beyond the scope of their training samples, so it is crucial to train the model on longer records and utilize variables that correspond to extreme flow values. Furthermore, as stated earlier in the conclusion, streamflow reflects the effects of climate variables, which can impact predicted values, thereby affecting the validity of forecast models.’
AUTHOR CONTRIBUTIONS
Z.S., Sibtain.S. (S.S.), S.H., and P.M. conceptualized the whole article; S.S., Z.S., and F.K. rendered support in data curation; S.S. and P.M. rendered support in data curation; S.S. and Z.S. investigated the article; S.S. and Z.S. devised the methodology; Saqlain S., S.M.T., and S. S., brought the resources; S.S., S.H. and Z.S. wrote the original draft.
DATA AVAILABILITY STATEMENT
All relevant data are available from an online repository at https://data.mendeley.com/datasets/d4bvcf5n5k.
CONFLICT OF INTEREST
The authors declare there is no conflict.