Results of the statistical analysis of the data.
Abstract
Electrical conductivity (EC) is an important indicator for monitoring water quality in riverine systems. EC is inherently associated with the concentration of dissolved ionic compounds present in aqueous environments, including various salts and minerals. EC estimations are crucial for environmental monitoring and the overall health assessment of aquatic ecosystems. The present study investigated the application of discrete wavelet transform (DWT) in conjunction with artificial neural networks (ANNs) and multiple linear regression (MLR) models to predict daily river water EC. For this purpose, daily river discharge (Q) and EC time series from a hydrology station on the Medina River in San Antonio, Texas, USA, were used. DWT was used to decompose the daily data into several subseries. Then, to estimate one-day-ahead EC values, these subseries were introduced to the ANN and MLR models. To assess the prediction accuracy of the improved wavelet-neural network (WANN) and wavelet-regression (WR) models, EC estimation was also carried out using MLR and ANN models with the original data. Both the WANN and WR techniques outperformed single MLR and ANN methods. A comparison of the results indicated that the WR model had superior performance than the WANN, MLR, and ANN models for daily EC prediction. The R2 values for the WR, WANN, MLR, and ANN models were 0.92, 0.87, 0.74, and 0.74, respectively. For the WR model, the root-mean-square error (RMSE) was 45.55, 46.08, and 25.19% less than those presented by the MLR, ANN, and WANN models, respectively. By the application of the WR method, an accurate daily EC estimator formula was obtained as well. The WR model also satisfactorily simulated the hysteresis in EC, demonstrating the effectiveness of wavelet analysis in extracting essential information embedded in original data.
Keywords
- water quality
- electrical conductivity
- multiple linear regression
- artificial neural networks
- wavelet
- hysteresis
- Medina River
1. Introduction
Water quality deterioration impairs ecological function, puts human health at risk, and impedes socioeconomic development [1]. Monitoring water quality is crucial to maintaining the health of aquatic ecosystems [2], identifying pathogens, harmful chemicals, and other contaminants that pose risks to human health [3], and for resource management. Various water quality variables, including turbidity, pH, dissolved oxygen (DO), biological oxygen demand (BOD), total dissolved solids (TDS), and electrical conductivity (EC), are often used to monitor river water quality worldwide. These water quality indicators delineate a multifaceted phenomenon influenced by numerous hydrodynamic, hydrologic, and climate extremes (floods and droughts) [4] that function across an extensive spectrum of spatiotemporal domains [5].
Electrical conductivity, also called specific conductance or specific conductivity [6], is a key indicator of water quality, particularly in freshwater systems. Since it is predominantly influenced by total dissolved solids (TDS) and is intrinsically linked to the presence of dissolved ionic solutes in aqueous environments, it serves as a potential indicator of contaminants within surface water [7]. TDS and salinity levels of water can be estimated from its EC measurements. EC exhibits a positive correlation with both TDS and salinity, suggesting that elevated EC readings typically signify increased levels of TDS and salinity [8]. EC, which is reported in micromhos per centimeter (μmhos/cm) or microsiemens per centimeter (μS/cm) [9, 10], is a key parameter for evaluating water quality in many riverine systems and for assessing its appropriateness for diverse uses. Fluctuations in EC may indicate the presence of pollutants or contaminants within the water.
Monitoring of electrical conductivity is instrumental in recognizing prospective challenges, executing suitable water management strategies, and guaranteeing adherence to legislative criteria aimed at safeguarding both human health and ecological integrity [8]. However, a huge amount of water quality data, including EC, is obtained through continuous monitoring of rivers that needs to be analyzed to obtain valuable information such as trends and fast changes in the water quality parameter [11]. EC prediction is an important part of EC data analysis that should be performed before making any decision for water resources management. Through the prediction process, future EC levels can be estimated from historical data. The process is also beneficial for EC data gap filling and assessing the performance of the monitoring devices.
In the past two decades, various machine learning approaches such as artificial neural networks (ANNs), random forest (RF), and decision tree (DT) have been widely applied to analyze water quality time series. These models have been extensively used for predicting various water quality parameters, including EC, in rivers throughout the world. Ghorbani et al. [12] used multiple linear regression (MLR) and ANNs to predict EC in the Asi River in Antakya, Turkey. They concluded that EC estimations by the ANN models were more accurate than those obtained by the MLR model. Abozari et al. [13] employed an ANN model optimized with an imperialist competitive algorithm (ICA), particle swarm optimization (PSO), and genetic algorithm (GA) to predict EC in Gamasiab River, Iran. To predict the EC of the Babol-Rood River in northern Iran, Melesse et al. [14] applied different machine learning algorithms. Based on the correlation coefficient, they developed different input combinations from several water quality parameters and river discharge (Q) as inputs for the models and concluded that the developed machine learning models can predict EC with high accuracy.
A study for EC estimations in the Upper Indus River basin, Pakistan, was carried out by Shah et al. [15] using gene expression programming (GEP) and ANN models, and the GEP model outperformed the ANN model. In another study for predicting EC in this river, Alqahtani et al. [16] use GEP, ANN, and random forest (RF) models. The RF model was superior to both the ANN and GEP models. Kumar et al. [8] attempted to predict EC in the Upper Ganga basin using various machine learning techniques. The results of their research indicated that the RF method outperformed the co-adaptive neuro-fuzzy inference system (CANFIS), DT, and ANN models. Karbasi et al. [17] developed a convolutional neural network (CNN) model coupled with long short-term memory (LSTM) to estimate EC at two rivers in Australia. They concluded that their proposed model has a high capability to predict EC over the next 10 days.
Over the past decade, there has been a growing interest in developing hybrid algorithms to boost the prediction accuracy of machine learning approaches [18]. Most of the advancements have been made based on data preprocessing methods, including wavelet analysis. Recent studies confirm the capacity of wavelet transformation (WT) as a common tool for analyzing periodicities, trends, and fast changes within a time series [19, 20, 21, 22]. Steel and Lange [23] utilized wavelet analysis to measure the water temperature variability across various temporal scales simultaneously. Ravansalar and Rajaee [24] used WT in conjunction with ANNs to estimate monthly EC levels of the Asi River in Turkey. Khani and Rajaee [25] developed two combination methods utilizing discrete wavelet transform (DWT) to estimate both the short- and long-interval DO levels at the Clackamas River, OR, USA. They concluded that DWT-based hybrid models increase the prediction accuracy of the water quality variables.
In this research, to predict daily electrical conductivity, two new hybrid models are developed based on the wavelet analysis, one the wavelet and artificial neural network (WANN) model, and the second the wavelet and multiple linear regression (WR) model. The objective of integrating wavelet analysis with the ANN and MLR models is to enhance the precision of EC predictions. The present study shows a new application of the WANN and WR conjunction models, which use decomposed subseries to predict river water EC and simulate its hysteresis. As a first study in this field, the capability of these models to predict daily EC was examined using various performance criteria. A straightforward explicit mathematical formula for the estimation of daily river water electrical conductivity was proposed using the WR model. Results obtained from this formula confirmed its applicability for predicting daily river water EC. The accuracy of the WR and WANN models in predicting daily EC and simulating its hysteresis were compared with those obtained from the single ANN and MLR models.
The remainder of this chapter is structured as follows: Section 2 outlines the study area and data; Section 3 covers MLR, ANN, and wavelet analysis; Section 4 involves model evaluation; and Section 5 discusses the application of the single MLR and ANN models, along with the hybrid WR and WANN models. The results from these models are discussed in Section 6, followed by a conclusion in Section 7.
2. Study area and EC data
2.1 Study area
To conduct this study, daily discharge (Q) and electrical conductivity (EC) data from station USGS Gage 08180700 (latitude 29° 20′ 5.00″, longitude 98° 41′ 22.00″) on the Medina River at San Antonio, Texas, in the USA were used. Data available from the U.S. Geological Survey, National Geospatial Program. The daily data used in this research covered 3 years (1096 days) from 2008 to 2010. The recorded data spans calendar years, with the starting month being January 2008 and the ending month being December 2010. The Medina River and the location of the selected monitoring station are presented in Figure 1.

Figure 1.
Medina River and the location of the USGS monitoring station (the map was created using ArcGIS software, version 10.8.1: https://support.esri.com/zh-cn/products/desktop/arcgis-desktop/arcmap/10-8-1), USA shape file, and the base map of San Antonio is from https://www.usgs.gov, and the map of Texas Rivers is from https://www.twdb.texas.gov/mapping/gisdata.asp.
The Medina River, which passes through the west of San Antonio, is a main supply to recharge the Edwards Aquifer. This aquifer serves as the primary source of drinking water for San Antonio and its neighboring regions, providing for approximately 2.3 million residents, based on the information available on the Edwards Aquifer Authority webpage. The primary water quality concern in South-Central Texas is the risk of contamination of the Edwards Aquifer [26]. Therefore, protecting the Medina River from pollutants is a major issue. The Medina River water quality, especially in this region, is affected by agricultural activities.
From the 1096 daily EC and river discharge data, the first 880 data points (80%) were considered for training the models, and the other 216 data points (20%) were used to evaluate the performances of the models. The EC and river discharge time series for the investigation period are shown in Figure 2. Since the variation between the highest and lowest observed discharge values of this river during the study period was significant, the Q time series is presented in a semi-logarithmic scale.

Figure 2.
Daily EC and Q time series for the monitoring station (Q time series are presented on a semi-logarithmic scale, and its values, when divided by 35.315, are expressed in cubic meters per second (m3/s)).
2.2 Statistical analysis
The results of the statistical analysis of daily river discharge (Q) and electrical conductivity (EC) data are summarized in Table 1. For the train subset, test subset, and the entire data set, the minimum, maximum, mean, standard deviation (Sd), skewness coefficient (Csx), and the lags 1 day to 4 days autocorrelation coefficients (R1, R2, R3, and R4) were calculated. Similar to all empirical methods, ANN and MLR techniques are more effective when they operate within the data range used for training rather than extrapolating beyond it [27]. In other words, when splitting the entire data into the train and test data, the maximum and minimum measurements should happen in the train subset. In such a situation, a higher accuracy in the prediction values of the model may be expected [28].
| All data | Train subset | Test subset | ||||
|---|---|---|---|---|---|---|
| Q (ft3/sec) | EC (μS/cm) | Q (ft3/sec) | EC (μS/cm) | Q (ft3/sec) | EC (μS/cm) | |
| Mean | 86.28 | 597.89 | 82.37 | 598.49 | 102.21 | 594.45 |
| Min | 28.10 | 251 | 28.10 | 251 | 41.30 | 299 |
| Max | 3563.90 | 694 | 3563.9 | 694 | 1943.70 | 654 |
| Sd | 144.84 | 45.94 | 144.93 | 44.77 | 143.39 | 50.37 |
| Csx | 15.49 | −2.22 | 16.68 | −1.86 | 10.93 | −3.215 |
| R1 | 0.538 | 0.872 | 0.555 | 0.875 | 0.456 | 0.861 |
| R2 | 0.317 | 0.725 | 0.353 | 0.718 | 0.157 | 0.743 |
| R3 | 0.265 | 0.616 | 0.303 | 0.618 | 0.097 | 0.610 |
| R4 | 0.241 | 0.538 | 0.276 | 0.546 | 0.080 | 0.510 |
Table 1.
From Table 1, it is evident that the maximum and minimum EC and Q are included in the training subset. Also, it can be seen that both the training and testing subsets exhibit fairly comparable statistical characteristics. EC autocorrelation coefficients, especially R1 and R2, were considerable, but Q autocorrelation coefficients, especially R2, R3, and R4, were very low for both the train and test subsets. For both the subsets, the skewness of the EC and Q data was low, which is appropriate for EC estimation.
In the modeling procedure, to assure high prediction accuracy by the models, it is essential to use an appropriate set of input data. In other words, choosing an appropriate input combination is a very important step in predicting river water quality. There are many different procedures for input selection for the predictive models. In this research, the correlation coefficients (R) were considered to produce different input combinations for the models. For this purpose, using Eq. (1), the correlation coefficients between the measured ECt and Qt-i (i = 0, 1, 2, 3, and 4) time series are computed to extract the dependency of EC on river discharge. The calculated correlation coefficients are summarized in Table 2.
| Time series | All data | Train subset | Test subset |
|---|---|---|---|
| Qt | −0.407 | −0.328 | −0.693 |
| Qt-1 | −0.380 | −0.307 | −0.645 |
| Qt-2 | −0.312 | −0.233 | −0.601 |
| Qt-3 | −0.234 | −0.169 | −0.467 |
| Qt-4 | −0.179 | −0.128 | −0.361 |
Table 2.
The calculated correlation coefficient between EC and Q.
where
Greater absolute values of correlation coefficients, close to 1, signify a stronger relationship between the parameters. The minus sign behind the correlation values presented in Table 2 indicates that river water electrical conductivity negatively depends on river water discharge. It means that an increase in river water discharge leads to a decrease in river water EC values. Also, higher EC values are expected in dry periods when river discharge is low. As it is shown in Table 2, the correlations between ECt and Qt, Qt−1, and Qt−2 are relatively high. Therefore, in this study, to estimate EC values, Qt, Qt−1, and Qt−2 time series were also considered as the input variables to the predictive models.
Data normalization is an essential step that should be carried out before introducing data to the models. This is due to the use of preprocessed non-dimensional data and ensuring that all variables receive equal consideration during the model calibration and testing process. Various techniques for normalizing water quality data are summarized in [18]. In our research, we used the following simple linear mapping equation to normalize the data between 0 and 1.
where
3. Models description
3.1 Artificial neural networks (ANNs)
Artificial Neural Networks are computational algorithms that replicate the neural organization of the human brain, specifically designed for pattern recognition, and perform various tasks, such as classification and regression [29, 30]. Because of their high capability of learning and modeling complex patterns within the data, these models have been extensively applied as predictive models in various fields. A basic architecture of ANNs is the three-layer feed-forward neural network, which includes an input layer, a single hidden layer, and an output layer, where the flow of information is unidirectional without feedback loops [31]. Each of the layers contains some computation nodes, also called neurons, and each neuron in the network sums its weighted inputs and utilizes a nonlinear activation function [32]. When there is no feedback from the outputs of the neurons to the inputs in the network, it is called a feed-forward neural network [33]. The backpropagation algorithm is fundamental for training ANNs, allowing the model to minimize error through a two-phase process: the forward pass, where inputs generate outputs, and the backward pass, where gradients of error are computed and used to update weights [34]. This iterative tweaking of weights enables the neural network to learn from its mistakes and improve performance on predictive tasks [35]. The feed-forward backpropagation (FFBP) is among the widely used neural networks applied for water quality predictions worldwide [18, 36].
In this study, the Levenberg-Marquardt (LM) [37] optimization algorithm, which surpasses simple gradient descent and various conjugate gradient methods across a broad range of problems [38], was used to train the FFBP networks. This optimization method is an iterative approach designed to find the lowest value of a function represented as the sum of squares of nonlinear functions [39].
A mathematical expression of a neural network with three layers, comprising I, J, and one node in its input, hidden, and output layers, respectively, is presented in Eq. (3) [40, 41].
where Y is the network’s output,
3.2 Multiple linear regression (MLR)
Multiple Linear Regression (MLR) is a conventional procedure for modeling the linear connection between a dependent parameter and one or more independent parameters [43]. Its simplicity makes it relatively easy to implement. However, it does have limitations in forecasting, particularly when dealing with complex dynamics and a large volume of noisy data [44]. The common form of MLR is given in Eq. (4).
In this equation, a0 is the intercept, ai is the regression coefficient of the descriptor Xi, and Y is the model estimation.
3.3 Wavelet analysis
Wavelet analysis has developed into an effective method for interpreting data across multiple fields, such as signal processing, image analysis, and financial forecasting. In contrast to conventional Fourier analysis, which decomposes signals into sine and cosine components, wavelet analysis allows for the representation of data at various scales and resolutions. This flexibility makes wavelets especially useful for examining transient and non-stationary signals, facilitating the retrieval of localized information that traditional methods may miss [45]. Wavelet analyses are performed using wavelet functions, also called mother wavelets. The mathematical presentation of the wavelet function is provided in Eq. (5).
where s and
The mother wavelet ψ(t) acts as the foundation from which all other wavelet functions are derived via scaling and translation [46]. This scaling process enables the analysis of signals across various frequency ranges, allowing wavelets to effectively capture localized characteristics in time-frequency representations.
The Discrete Wavelet Transform (DWT) is a mathematical technique implemented to analyze and break down discrete signals into approximations and detail coefficients at multiple levels. The approximation coefficients reflect low-frequency information, while the details capture high-frequency variations. Applying DWT, both the time and frequency information of the signal can be extracted. More information on the DWT is provided by Shensa [47].
The wavelet transformation of the signal
The wavelet transform involves breaking down
where,
The first step in conducting wavelet analysis involves selecting a suitable wavelet function. Different wavelet families, including Haar, Simlet, and Daubechies, have been used for time series decomposition or noise removal from the data. The Daubechies wavelet family is widely utilized due to its compact support and orthogonality properties [46]. Another critical aspect of the process involves identifying the optimal degree of decomposition. The decomposition level indicates how many times the signal should be divided into its approximation and detail components.
During wavelet analysis, the original signal decomposes into one approximation (A) and one or more details (Ds) coefficients using low and high-pass filters [49]. The approximation component represents the trend in the time series, and the details comprise its high frequencies. In the present study, the A and Ds subseries of the original EC and Q time series are obtained by applying DWT. The Daubechies-2 (db2) wavelet function was utilized to break down the time series at three levels.
4. Model evaluation metrics
The root-mean-square error (RMSE), the mean absolute error (MAE), and the Nash-Sutcliffe coefficient of efficiency (NS) performance measures (Eqs. 8–10) were used to assess the accuracies of the models for EC estimation. In these equations, n denotes the number of observations in the dataset. The models achieve optimal predictions when NS, MAE, and RMSE are close to 1, 0, and 0, respectively. Detailed information on NS evaluation metrics is available in [50].
5. Model implementations
5.1 ANN and MLR models
Based on the statistical analysis presented in Table 1 and the correlations between river electrical conductivity and discharge time series shown in Table 2, the six different combinations, which consist of various values of EC and Q, are considered as input data for the ANN and MLR models to predict one-day-ahead EC (ECt + 1). The generated input combinations for the prediction of ECt + 1 are shown in Table 3:
| Input combination | EC time series | Q time series | |||
|---|---|---|---|---|---|
| C1 | ECt | ||||
| C2 | ECt | ECt-1 | |||
| C3 | ECt | ECt-1 | ECt-2 | ||
| C4 | ECt | Qt | |||
| C5 | ECt | ECt-1 | Qt | ||
| C6 | ECt | ECt-1 | Qt | Qt-1 | |
Table 3.
The time series combinations of the inputs for the ANN and MLR models.
In this research, an FFBP neural network with three layers, comprising one input layer, one hidden layer, and one output layer in its structure, was implemented. The Levenberg-Marquardt method was used for training the ANN models. In ANN models, choosing the right activation function for the nodes is crucial.
Typically, activation functions in neural networks possess three key properties: they are bounded, continuous, and non-constant. Among these, the Sigmoid function is the most commonly used [25]. In the current study, the Sigmoid and Purlin functions were employed as activation functions for the hidden and output layers, respectively, to enhance the effectiveness of the neural network. The optimal number of neurons in the hidden layer was established through iteration. The developed ANN models were trained using the train dataset and then assessed using the test data.
In addition to the ANN model, MLR was also used to create the relation between the input variables and EC for all the six input combinations shown in Table 3. By applying the MLR model to each input combination, six different regression equations were created. These equations were obtained based on the training data set. Subsequently, the model’s predictive capabilities were assessed using the same datasets that were used to test the ANN models.
5.2 Wavelet-ANN combination model
This study presents a new application of the WANN combination model for the prediction of river electrical conductivity. The goal of integrating the discrete wavelet transform with artificial neural networks is to enhance the accuracy of the predicted EC values. The WANN combination model uses decomposed subseries as inputs to the ANN model. To perform this research, the Daubechies-2 (db2) wavelet function was used, and the EC and Q time series were decomposed at three levels utilizing discrete wavelet transform. During the decomposition process, the original time series is initially divided into an approximation (A1) and a details (D1) subseries. This process can be extended, allowing the approximation subseries to be further decomposed into lower-resolution components. In the WANN model, the approximation and details components of the EC and Q time series served as input data for the ANN models. The structure of the WANN hybrid model for prediction of 1-day-ahead EC values is presented in Figure 3.

Figure 3.
WR and WANN modeling diagram for EC prediction.
5.3 Wavelet-regression combination model
In this research, the wavelet-regression (WR) combination model is implemented to predict river electrical conductivity. This model is created by integrating two approaches: discrete wavelet transformation and multiple linear regression. It is anticipated that utilizing the approximation and details components of the time series will enhance the predictability of the regression model. The same DWT-obtained components of EC and Q time series, previously used in the development of the WANN model, were considered inputs for the WR model to predict one-day-ahead EC values. Figure 3 represents the structure of the proposed wavelet-regression model.
6. Results and discussion
The prediction of one-day-ahead EC is performed using MLR and ANN models. The performances of these models for the six input combinations are summarized in Tables 4 and 5, respectively. As can be seen from these tables, the higher accuracies of the MLR and ANN models obtained from the C4 (ECt and Qt) input combination, which includes observed values of current day EC and Q. For C4, the ANN and MLR models predicted the electrical conductivity with NS = 0.737 and 0.742, RMSE = 25.78 and 25.53, and MAE = 7.08 and 7.25, respectively. Results also indicate that for the input combination C1, which uses only the current day EC time series (ECt), the accuracy of the ANN and MLR models is higher than all other input combinations except the C4. As indicated earlier, the optimum number of neurons in the hidden layer was identified based on a trial-and-error approach. In Table 5, for all the six input combinations, the optimum number of neurons in the hidden layer of the ANN models is presented as well. For the most accurate ANN model, the ANN architecture is represented as ANN (2, 4, 1), indicating that this model has two neurons in its input layer, 4 neurons in its hidden layer, and one neuron in its output layer.
| Model | MLR | |||||
|---|---|---|---|---|---|---|
| Input combination | 1 | 2 | 3 | 4 | 5 | 6 |
| NS | 0.740 | 0.729 | 0.704 | 0.742 | 0.728 | 0.728 |
| RMSE | 25.60 | 26.16 | 27.34 | 25.53 | 26.18 | 26.18 |
| MAE | 7.32 | 7.78 | 7.84 | 7.25 | 7.76 | 7.76 |
Table 4.
Evaluation of the MLR models in EC prediction.
| Model | ANN | |||||
|---|---|---|---|---|---|---|
| Input combination | 1 | 2 | 3 | 4 | 5 | 6 |
| neurons | 5 | 5 | 7 | 4 | 3 | 8 |
| NS | 0.733 | 0.697 | 0.703 | 0.737 | 0.705 | 0.715 |
| RMSE | 25.96 | 27.64 | 27.40 | 25.78 | 27.29 | 26.81 |
| MAE | 6.81 | 6.84 | 6.72 | 7.08 | 8.96 | 7.01 |
Table 5.
Evaluation of the ANN models in EC prediction.
A comparison between different ANN and MLR models based on the RMSE values is presented in Figure 4. From this figure, it can be seen clearly that, for each input combination, the MLR model outperforms the corresponding ANN model to a slight degree. The most accurate MLR equation, obtained for the input combination C4, is presented in Eq. (11). In this equation, the minus sign behind the Qt, as discussed before, indicates that river discharge has a reverse impact on daily EC values. The best accurate ANN and MLR models performed with NS = 0.737 and 0.742, RMSE = 25.78 and 25.53, and MAE = 7.08 and 7.25, respectively.

Figure 4.
Comparison of RMSE values obtained from the ANN and MLR models for the six input combinations.
The hybrid WANN and WR models were employed to enhance EC prediction accuracy. The calculated performance measures for the WR and WANN models are summarized in Table 6. As mentioned earlier, both the MLR and ANN demonstrated their highest level of accuracy for the input combination C4. It means that for Medina River, in the hydrological station selected for this study, using observed values of current day Q and EC would result in the best prediction for one-day-ahead electrical conductivity. Therefore, the prediction of EC with the WANN and WR models was conducted by applying the DWT subseries of the ECt and Qt. The decomposed subseries of EC at three levels is presented in Figure 5. Similar subseries of the Q data were also obtained and used for the development of the hybrid models.
| Model | WANN | WR | ||||||
|---|---|---|---|---|---|---|---|---|
| neurons | 5 | 9 | 10 | 11 | 12 | 15 | 19 | — |
| NS | 0.642 | 0.682 | 0.858 | 0.863 | 0.713 | 0.808 | 0.743 | 0.923 |
| RMSE | 30.03 | 28.31 | 18.89 | 18.58 | 26.91 | 22.00 | 25.45 | 13.90 |
| MAE | 15.54 | 8.68 | 7.04 | 6.45 | 8.68 | 9.87 | 9.08 | 5.97 |
Table 6.
Performances of the WR and WANN models for predicting ECt+1.

Figure 5.
Decomposed subseries of the EC data at three levels.
The performance of the WANN model for various numbers of neurons in the hidden layer of its ANN structure is shown in Table 6. This table indicates that the WANN with 11 neurons in the hidden layer of its ANN structure provides the most accurate EC predictions. The NS, RMSE, and MAE evaluation metrics for the best WANN model were 0.863, 18.58, and 6.45, respectively. The results of the WR model are presented in Table 6 as well. For this model, the NS, RMSE, and MAE statistics were 0.923, 13.90, and 5.97, respectively.
The application of the WR model results in a straightforward equation that predicts ECt+1 with considerable accuracy (see Eq. (12)). This equation is a simple multiple linear regression that estimates the river electrical conductivity time series from the DWT-obtained subseries of the original time series of river discharge and electrical conductivity.
Comparison between the prediction accuracy of the hybrid WANN and WR model and the single ANN and MLR models revealed that the decomposition of input time series significantly improved the EC predictions. From Tables 4–6 it is clear that both the WANN and WR models outperformed the ANN and MLR models. The accuracy of the WR model was superior compared to the three other models. The results of the most accurate MLR, ANN, WANN, and WR models in terms of RMSE are presented in Figure 6. The comparison of results reveals that the root-mean-square errors for the WR model were 45.55, 46.08, and 25.19% less than the MLR, ANN, and WANN models, respectively.

Figure 6.
Comparison between the RMSE of the best-performing ANN, MLR, WANN, and WR models.
The scatter plots of the predicted EC by the models versus the corresponding observed EC during the test period are presented in Figure 7. It can be seen that both the ANN and MLR overestimated the minimum EC values. While the WANN model presented underestimations of the minimum EC, predictions of the WR model were close to the 1–1 line of the scatter plots. The EC predictions by the WR model were also more accurate than the three other models during high EC periods. Figure 7 also provides the linear trendline and their corresponding equations and coefficient of determination (R2) values for the predictive models. The higher R2 value of the WR and WANN models is another indicator confirming their superiority to the single ANN and MLR models.

Figure 7.
Scatter plots of the predicted EC by the models versus measured EC.
The residuals of the EC predictions by the models are shown in Figure 8. From this figure, the underestimations of the low EC levels by the WANN model and the overestimations of the other models, especially the ANN and MLR models, are observable. In the low EC period, the residuals of the WR model were lower than those for the three other models.

Figure 8.
EC prediction residuals by the models at different time intervals for the test period.
From the results of both hybrid models applied in this research, it was evident that wavelet analysis played a crucial role in analyzing the EC and Q time series, allowing for the extraction of significant features within the data. This study demonstrated that the WR model is an effective method for predicting river electrical conductivity, thanks to its superior accuracy. Additionally, the use of WR models is straightforward compared to WANN and ANN models, providing fast and more precise predictions for water quality.
The observed time series of EC and Q shows an inverse dependency of the river water electrical conductivity to the river discharge amount. In other terms, the river displays hysteresis in its EC levels. This hysteresis phenomenon can also be seen in other hydrological processes, such as river suspended sediment concentrations [51] and river dissolved oxygen concentrations [25]. The hysteresis phenomenon as a nonlinear signature of the process is usually exhibited at different time and space scales [52]. In the following, using the WANN and WR models, an attempt was made to detect the hysteresis in EC.
The high river discharge of July 11th, 2010 (Figure 9(A)) and September 8th, 2010 (Figure 9(B)) were selected for the hysteresis analysis of EC. For the two events, the hydrographs and observed EC series are presented in the left side of Figure 9. In the right side of this figure, the actual EC-Q loops and the corresponding simulated loops by the WR, WANN, MLR, and ANN models are shown. These EC-Q graphs were used to examine the capability of the models in simulating EC hysteresis loops. For the period A from July 7th, 2010 to July 21st, 2010, in which Q has relatively low and smooth variations, all the models were able to mimic the EC-Q loops.

Figure 9.
(A) and (B) Time series of the river discharge, observed EC, and corresponding simulated EC-Q hysteresis loops during the two periods.
For the period B from September 7th, 2010 to September 12th, 2010, river discharge rapidly increased from 61 ft3/sec to 1943 ft3/sec, resulting in a decrease in EC from 642 μS/cm to 299 μS/cm. Following these extreme values within this period, Q decreases to 193 ft3/sec, and EC reaches its local maximum value of 483 μS/cm. For this period, as shown in Figure 9(B), the ANN and MLR models failed to detect hysteresis within the EC time series. However, the WR and WANN models satisfactorily followed the clockwise (positive) hysteresis loop during the high discharge levels. It can be seen that the EC-Q loop simulated by the WR model is in good agreement with the actual EC-Q graph. In general, the wavelet-based models simulated hysteresis in EC better than the ANN and MLR models, confirming the capability of the DWT for studying EC-Q relationships in the river system.
7. Conclusions
The present study attempted to examine the performance of the discrete wavelet transform (DWT) in conjunction with ANN and MLR models for predicting river water electrical conductivity. For this purpose, two wavelet-ANN and wavelet-regression combination models were developed. The procedure involved decomposing EC and discharge data using the Daubechies-2 wavelet function across three levels, generating one approximation and three detail components. These decomposed subseries were then employed as inputs for the ANN and MLR models.
One-day-ahead EC levels were also predicted using a three-layer feed-forward neural network and simple MLR model. The results indicated that the MLR models slightly outperformed the ANN models. Although the WANN model, by employing the artificial neural network technique in its structure, provided better performance than the ANN and MLR models, its accuracy was lower than the WR model. The WR model demonstrated superior accuracy in predicting EC levels and was closely aligned with the measured values across various ranges. The optimal input combination for predicting one-day-ahead EC was identified as the current day’s EC and river discharge values.
In this study, EC hysteresis simulations were carried out to detect the EC-Q relationship and simulate EC variations during the river’s high- and low-flow conditions. The WR model excelled in simulating EC hysteresis, reflecting dynamic variations during high- and low-flow periods. In contrast, the WANN, ANN, and MLR models were unable to replicate this phenomenon.
The application of wavelet analysis resulted in a reasonable improvement in the prediction accuracy of EC and simulation of its hysteresis. This is because of its unique ability to concurrently analyze all temporal scales. The applied WR model offers a straightforward mathematical structure, significantly less complex than the WANN and ANN models. This simplicity allows the WR model to effectively model daily EC. In contrast, the WANN and ANN models are classified as black-box models, meaning that the relationships between the input and output data are unknown. The EC of any river may depend on many known and unknown hydrologic, land use, and physical parameters. In this study, the models were developed using a long period of daily EC and river discharge data. Therefore, the simple formula obtained from the WR model can be used as a practical tool to accurately predict daily EC levels in the Medina River.
Previous studies primarily focused on predicting monthly EC values using monthly data as inputs. These models incorporated various water quality, meteorological, and hydrological parameters, applying an array of machine learning techniques to estimate monthly EC levels. In contrast, the current chapter presents a novel approach by utilizing daily EC and river discharge data to estimate one-day-ahead EC levels. This shift from monthly to daily estimation is significant, as it allows for enhanced responsiveness to dynamic river conditions. We compared the performance of the proposed WR model against those from prior studies using RMSE metrics. The RMSE by the model was lower than numerous established models, including MLR, MNLR, ANN, GA, PSO, RF, DT, and CANFIS. This comparison underscores the superior accuracy of the proposed WR model for daily EC estimation in river water, highlighting its potential for more effective and timely water quality management.
References
- 1.
du Plessis A. Persistent degradation: Global water quality challenges and required actions. One Earth. 2022; 5 (2):129-131 - 2.
Carpenter SR, Caraco NF, Correll DL, Howarth RW, Sharpley AN, Smith VH. Nonpoint pollution of surface waters with phosphorus and nitrogen. Ecological Applications. 1998; 8 (3):559-568 - 3.
World Health Organization. Guidelines for Drinking-Water Quality. Geneva: World Health Organization; 2021 - 4.
Fabian PS, Kwon HH, Vithanage M, Lee JH. Modeling, challenges, and strategies for understanding impacts of climate extremes (droughts and floods) on water quality in Asia: A review. Environmental Research. 2023; 225 :115617 - 5.
Najah A, El-Shafie AH, Karim OA, Jaafar O, El-Shafie AH. An application of different artificial intelligences techniques for water quality prediction. International Journal of Physical Sciences. 2011; 6 (22):5298-5308 - 6.
Weiner ER. Applications of Environmental Aquatic Chemistry: A Practical Guide. Boca Raton: CRC Press; 2008 - 7.
Ahmadianfar I, Jamei M, Chu X. A novel hybrid wavelet-locally weighted linear regression (W-LWLR) model for electrical conductivity (EC) prediction in surface water. Journal of Contaminant Hydrology. 2020; 232 :103641 - 8.
Kumar D, Singh VK, Abed SA, Tripathi VK, Gupta S, Al-Ansari N, et al. Multi-ahead electrical conductivity forecasting of surface water based on machine learning algorithms. Applied Water Science. 2023; 13 (10):192 - 9.
Spellman FR. The Science of Water: Concepts and Applications. Boca Raton: CRC Press; 2020 - 10.
Heydari M, Olyaie E, Mohebzadeh H, Kisi Ö. Development of a neural network technique for prediction of water quality parameters in the Delaware River, Pennsylvania. Middle-East Journal of Scientific Research. 2013; 10 :1367-1376 - 11.
González PS, Stehr A, Barra RO. Assessment of water quality trends through the application of an aggregated water quality index with historical monitored data in a Mediterranean Andean basin. Ecological Indicators. 2024; 166 :112373 - 12.
Ghorbani MA, Aalami MT, Naghipour L. Use of artificial neural networks for electrical conductivity modeling in Asi River. Applied Water Science. 2017; 7 :1761-1772 - 13.
Abozari N, Hassanvand M, Salimi AH, Heddam S, Mohammadi HO, Noori A. Comparison performance of artificial neural network based method in estimation of electric conductivity in wet and dry periods: Case study of Gamasiab River, Iran. Journal of Applied Research in Water and Wastewater. 2019; 6 (2):88-94 - 14.
Melesse AM, Khosravi K, Tiefenbacher JP, Heddam S, Kim S, Mosavi A, et al. River water salinity prediction using hybrid machine learning models. Water. 2020; 12 (10):2951 - 15.
Shah MI, Javed MF, Abunama T. Proposed formulation of surface water quality and modelling using gene expression, machine learning, and regression techniques. Environmental Science and Pollution Research. 2021; 28 :13202-13220 - 16.
Alqahtani A, Shah MI, Aldrees A, Javed MF. Comparative assessment of individual and ensemble machine learning models for efficient analysis of river water quality. Sustainability. 2022; 14 (3):1183 - 17.
Karbasi M, Ali M, Bateni SM, Jun C, Jamei M, Farooque AA, et al. Multi-step ahead forecasting of electrical conductivity in rivers by using a hybrid convolutional neural network-long short-term memory (CNN-LSTM) model enhanced by Boruta-XGBoost feature selection algorithm. Scientific Reports. 2024; 14 (1):15051 - 18.
Rajaee T, Khani S, Ravansalar M. Artificial intelligence-based single and hybrid models for prediction of water quality in rivers: A review. Chemometrics and Intelligent Laboratory Systems. 2020; 200 :103978 - 19.
Partal T, Küçük M. Long-term trend analysis using discrete wavelet components of annual precipitations measurements in Marmara region (Turkey). Physics and Chemistry of the Earth, Parts A/B/C. 2006; 31 (18):1189-1200 - 20.
Zhou HC, Peng Y, Liang GH. The research of monthly discharge predictor-corrector model based on wavelet decomposition. Water Resources Management. 2008; 22 :217-227 - 21.
Penalba O, Rivera J, Bettolli ML. Trends and periodicities in the annual amount of dry days over Argentina, looking towards the climatic change. Options Méditerranéennes en ligne. 2010; 95 :27-33 - 22.
Nalley D. Analyzing trends in temperature, precipitation and streamflow data over Southern Ontario and Quebec using the discrete wavelet transform [thesis]. Department of Bioresource Engineering: McGill University: Montreal; 2012 - 23.
Steel EA, Lange IA. Using wavelet analysis to detect changes in water temperature regimes at multiple scales: Effects of multi-purpose dams in the Willamette River basin. River Research and Applications. 2007; 23 (4):351-359 - 24.
Ravansalar M, Rajaee T. Evaluation of wavelet performance via an ANN-based electrical conductivity prediction model. Environmental Monitoring and Assessment. 2015; 187 (6):366 - 25.
Khani S, Rajaee T. Modeling of dissolved oxygen concentration and its hysteresis behavior in rivers using wavelet transform-based hybrid models. CLEAN–Soil, Air, Water. 2017; 45 (2):1-18 - 26.
Opsahl SP, Musgrove M. Occurrence of Pharmaceutical Compounds in the San Antonio Segment of the Edwards (Balcones Fault Zone) Aquifer, South-Central Texas, June 2018–August 2020. Reston, VA: U.S. Geological Survey; 2023 - 27.
Tokar AS, Johnson PA. Rainfall-runoff modeling using artificial neural networks. Journal of Hydrologic Engineering. 1999; 4 (3):232-239 - 28.
Masters T. Practical Neural Network Recipes in C++. San Francisco: Morgan Kaufmann; 1993 - 29.
Gutiérrez-Estrada JC, Vasconcelos R, Costa MJ. Estimating fish community diversity from environmental features in the Tagus estuary (Portugal): Multiple linear regression and artificial neural network approaches. Journal of Applied Ichthyology. 2008; 24 (2):150-162 - 30.
Haykin S. Neural Networks: A Comprehensive Foundation. Upper Saddle River, NJ: Prentice Hall PTR; 1998 - 31.
Hastie T, Tibshirani R, Friedman JH, Friedman JH. The Elements of Statistical Learning: Data Mining, Inference, and Prediction. New York: Springer; 2009 - 32.
Bishop CM, Nasrabadi NM. Pattern Recognition and Machine Learning. New York: springer; 2006 - 33.
Sazlı MH. A brief review of feed-forward neural networks. Communications Faculty of Sciences University of Ankara Series A2-A3 Physical Sciences and Engineering. 2006; 50 (01):11-17 - 34.
Rumelhart DE, Hinton GE, Williams RJ. Learning representations by back-propagating errors. Nature. 1986; 323 (6088):533-536 - 35.
Goodfellow I, Bengio Y, Courville A. Deep Learning. Cambridge, MA: MIT Press; 2016 - 36.
Chen Y, Song L, Liu Y, Yang L, Li D. A review of the artificial neural network models for water quality prediction. Applied Sciences. 2020; 10 (17):5776 - 37.
Hagan MT, Menhaj MB. Training feedforward networks with the Marquardt algorithm. IEEE transactions on Neural Networks. 1994; 5 (6):989-993 - 38.
Ranganathan A. The levenberg-marquardt algorithm. Tutoral on LM Algorithm. 2004; 11 (1):101-110 - 39.
Raghuwanshi NS, Singh R, Reddy LS. Runoff and sediment yield modeling using artificial neural networks: Upper Siwane River, India. Journal of Hydrologic Engineering. 2006; 11 (1):71-79 - 40.
Brion GM, Neelakantan TR, Lingireddy S. A neural-network-based classification scheme for sorting sources and ages of fecal contamination in water. Water Research. 2002; 36 (15):3765-3774 - 41.
Brion GM, Lingireddy S. Artificial neural network modelling: A summary of successful applications relative to microbial water quality. Water Science and Technology. 2003; 47 (3):235-240 - 42.
Lin GF, Wu MC, Chen GR, Tsai FY. An RBF-based model with an information processor for forecasting hourly reservoir inflow during typhoons. Hydrological Processes: An International Journal. 2009; 23 (25):3598-3609 - 43.
Ebrahimi H, Rajaee T. Simulation of groundwater level variations using wavelet combined with neural network, linear regression and support vector machine. Global and Planetary Change. 2017; 148 :181-191 - 44.
Adamowski J, Karapataki C. Comparison of multivariate regression and artificial neural networks for peak urban water-demand forecasting: Evaluation of different ANN learning algorithms. Journal of Hydrologic Engineering. 2010; 15 (10):729-743 - 45.
Mallat S. A Wavelet Tour of Signal Processing. San Diego: Academic Press; 1999 - 46.
Daubechies I. Ten Lectures on Wavelets. Philadelphia: Society for Industrial and Applied Mathematics; 1992 - 47.
Shensa MJ. The discrete wavelet transform: Wedding the a trous and Mallat algorithms. IEEE Transactions on Signal Processing. 1992; 40 (10):2464-2482 - 48.
Kisi O. Wavelet regression model as an alternative to neural networks for river stage forecasting. Water Resources Management. 2011; 25 :579-600 - 49.
Kişi Ö. Wavelet regression model as an alternative to neural networks for monthly streamflow forecasting. Hydrological Processes: An International Journal. 2009; 23 (25):3583-3597 - 50.
Rajaee T, Khani S. Comment on “performance of ANFIS versus MLP-NN dissolved oxygen prediction models in water quality monitoring a. Najah & a. El-Shafie & OA Karim & Amr H. El-Shafie. Environ Sci Pollut res (2014) 21: 1658-1670”. Environmental Science and Pollution Research. 2016; 23 (1):938-940 - 51.
Rajaee T. Wavelet and ANN combination model for prediction of daily suspended sediment load in rivers. Science of the Total Environment. 2011; 409 (15):2917-2928 - 52.
Nourani V, Rahimi AY, Nejad FH. Conjunction of ANN and threshold based wavelet de-noising approach for forecasting suspended sediment load. International Journal of Information Technology. 2013; 3 :9-26