Abstract
As an important hydrological parameter, dissolved oxygen (DO) concentration is a well-accepted indicator of water quality. This study deals with introducing and evaluating four novel integrative methods for the prediction of DO. To this end, teaching–learning-based optimization (TLBO), sine cosine algorithm, water cycle algorithm (WCA), and electromagnetic field optimization (EFO) are appointed to train a commonly-used predictive system, namely multi-layer perceptron neural network (MLPNN). The records of a USGS station called Klamath River (Klamath County, Oregon) are used. First, the networks are fed by the data between October 01, 2014, and September 30, 2018. Later, their competency is assessed using the data belonging to the subsequent year (i.e., from October 01, 2018 to September 30, 2019). The reliability of all four models, as well as the superiority of the WCA-MLPNN, was revealed by mean absolute errors (MAEs of 0.9800, 1.1113, 0.9624, and 0.9783) in the training phase. The calculated Pearson correlation coefficients (RPs of 0.8785, 0.8587, 0.8762, and 0.8815) plus root mean square errors (RMSEs of 1.2980, 1.4493, 1.3096, and 1.2903) showed that the EFO-MLPNN and TLBO-MLPNN perform slightly better than WCA-MLPNN in the testing phase. Besides, analyzing the complexity and the optimization time pointed out the EFO-MLPNN as the most efficient tool for predicting the DO. In the end, a comparison with relevant previous literature indicated that the suggested models of this study provide accuracy improvement in machine learning-based DO modeling.
Introduction
Background
As is known, water quality is a primary indicator of ecosystem health in aquatic communities. For instance, in aquaculture, the quality and growth of aquatic products are highly affected by the quality of water1. The concentration of dissolved oxygen (DO) is a well-known measure of water quality, reflecting the balance between the production and consumption of oxygen. Therefore, is an important criterion for water quality management 2,3. The variations in DO concentration are functions of several factors, however, major sources of DO are photosynthetic activities, aeration (at structures), and re-aeration (from the atmosphere)4.
Measuring the DO is a difficult task due to the effect of various factors like salinity, temperature, oxygen source, etc.5,6. Considering this dynamic nature, as well as the challenges in providing DO measurement equipment, developing DO predictive models is of great desire for monitoring water quality. Hence, non-linear methods have received increasing attention for exploring the relationship between the DO and environmental key factors. Water discharge (Q), water temperature (WT), pH, and specific conductance (SC) are among the most important parameters and different combinations of them have been considered in earlier research depending on data availability and environmental conditions.
A very popular provider of these hydrological time series is the US Geological Survey (USGS)7. It is a research organization that provides high-quality and publicly available water data for different areas in the US. In general, the provided data are categorized as either (i) approved for publication or (ii) subject to revision. As the names imply, the first group of data has been reliably processed by the relevant staff, while the second group has not received this approval yet. In this work, the approved data of Klamath River Station (station number 11509370) is used. Many studies in the literature on water quality prediction have used USGS data8,9, especially for DO prediction of the Klamath River10,11.
Literature review
With recent advances in computational and measurement domains, the world of science has witnessed various developments aiming at facilitating complex problems regarding natural phenomena12,13,14,15. For instance, remote sensing facilities are among the most applicable tools for monitoring nature e.g., water bodies16,17,18,19. Hydrology is one of these fields that has been highly befitted by these developments20,21,22,23. In this sense, the involved subject may extend from precipitation analysis24,25 to water quality assessment26. Statistical and machine learning methods are two evident examples of suggested models for water quality analysis27,28.
In a general sense, prediction/monitoring studies cover a wide range of scientific efforts for various environmental parameters29,30,31. The advent of machine learning has shed new light on this domain as it provides fast, reliable, and inexpensive solutions to complex prediction problems. Recent sophisticated methods like artificial neural network (ANN) and adaptive neuro-fuzzy inference system (ANFIS) have been highly regarded by engineers for DO prediction in different parts of the world32,33. Ay and Kisi34 investigated the ability of two popular notions of ANNs, namely radial based function (RBF) and multi-layer perceptron neural network (MLPNN) for analyzing the DO concentration. They compared these models with multilinear regression (MLR). It was found that the RBF performs better than the two other models. Liu et al.35 successfully employed an attention-based recurrent neural network (RNN) for long-term and short-term prediction of the DO. More research about the effectiveness of the ANNs can be found in36,37,38. Ji et al.39 proved the applicability of support vector machine (SVM) for predicting the DO concentration in hypoxic river systems. With reference to a larger than 86% correlation obtained for the testing phase, they used the SVM as a promising approach for this purpose. Huan et al.40 demonstrated the high efficiency of the SVM based on the least-squares theory (LSSVM). Shi et al.41 successfully applied a clustering-based softplus extreme learning machine (CSELM) for simulating the DO content in aquaculture. It was also shown that this model is more accurate than standard ELM. Kisi et al.42 proposed an intelligent model called Bayesian model averaging (BMA), for the DO estimation. They validated the performance of this model by five well-known models including ELM, classification and regression tree (CART), ANN, MLR, and ANFIS. Based on the obtained RMSEs (1.321 for the BMA vs. 1.439, 1.809, 1.504, 1.742, and 1.447 for the ELM, CART, ANN, MLR, and ANFIS, respectively), the superiority of the BMA was clearly derived. Najah et al.43 compared the ANFIS with ANN for the DO modeling and found that the results of the ANFIS were more accurate. Olyaie et al.44 conducted a comparison among four data-driven models including RBF, linear genetic programming (LGP), MLPNN, and SVM used for the same objective. Referring to the respective coefficient of determinations (R2s of 0.8140, 0.9662, 0.9169, and 0.9748), the SVM surpassed other tested models. The feasibility of a so-called deep learning technique “gated recurrent unit” for the DO analysis in a fishery pond was shown by Li et al.45. This model also outperformed the RNN and long short-term memory. The applicability of other machine learning models such as evolving fuzzy neural network (EFuNN)11, radial basis function neural network (RBFNN) and general regression neural network (GRNN)46, long-short term memory (LSTM)47, support vector regression (SVR)48, dynamic evolving neural-fuzzy inference system (DENFIS)49 has been shown and compared in earlier studies. Further comparative studies can be found in earlier literature50,51,52.
Optimization of regular predictive models has been studied by many scholars in recent years53,54,55. Raheli et al.56 built an optimized version of the MLP neural network using firefly algorithm for forecasting the DO and biochemical oxygen demand. The performance of the hybrid model was found to be more reliable than the standard MLP. Furthermore, uncertainty analysis revealed an acceptable degree of uncertainty for the ANN. Yaseen et al.57 coupled an LSSVM with bat algorithm for approximating the DO. A comparison with conventional machine learning models like multivariate adaptive regression spline (MARS) and M5 tree pointed out a considerably higher accuracy (i.e., 42% and 20% RMSE reduction) for the proposed hybrid. Three optimization techniques of particle swarm optimization (PSO), biogeography‐based optimization, and butterfly optimization algorithm were used by Fadaee et al.58 for optimizing the ANFIS applied to the seasonal analysis of the DO. The accuracy of the AFNIS experienced nearly 14, 16, 6, and 13% improvement in the spring, summer, fall, and winter, respectively. Liu et al.59 could enhance the accuracy of a least-squares SVR with an improved PSO. A similar application of the PSO was examined by Chen et al.60. Bayram et al.61 recommended the use of teaching–learning based optimization (TLBO) applied to quadratic regression for stream DO analysis. In a comparative effort by Azma et al.62, seven hybrids of MLP with biogeography-based optimization (BBO), sunflower optimization (SFO), atom search optimization (ASO), crow search algorithm (CSA), league championship algorithm (LCA), shuffled frog leaping algorithm (SFLA), and slime mould algorithm (SMA) were tested for DO prediction in the Rock Creek Station (USGS number 01648010) around Washington, USA. Their results showed the higher accuracy of the BBO-based model. Also, an importance assessment of the inputs reflected the largest and lowest importance for the TW and Q, respectively.
Motivation and contribution
Concerning the promising results obtained by hybrid algorithms, utilizing metaheuristic-empowered models is becoming a research hotspot in a wide range of engineering domains. In order to address the latest developments in this regard, this work employs the TLBO along with sine cosine algorithm (SCA), water cycle algorithm (WCA), and electromagnetic field optimization (EFO) as the training strategies of the MLPNN to predict daily DO using five-year records. The main contribution of these four metaheuristic algorithms to the problem of DO prediction lies in tuning the MLPNN computational variables that are responsible for establishing the relationship between the DO and its influential parameters. Hence, due to the optimization procedure of these algorithms, it can be said that the TLBO, SCA, WCA, and EFO will optimize the non-linear dependency of the DO on water conditions to achieve a reliable prediction for different conditions.
The case study is Klamath River (Oregon and northern California, US) whose initial part suffers from seasonal low water quality. This study also pursues comparing the efficiency of the used algorithms toward achieving a fast, inexpensive, and reliable DO evaluative model. The used models are optimized in terms of hyperparameters, and in the end, practical monolithic formulas are extracted to be used as DO-predictive equations; eliminating the need for running computer-aided programs and GUIs. Hence, the outcomes of this study may provide significant contributions to the early prediction of DO concentration within the Klamath River.
USGS data and study area
Figure 1 shows the location of the study area in Klamath County, Oregon. Flowing through southern Oregon to the Pacific Ocean, the Klamath River has an approximate length of 410 km. It originates from the Link River Dam that is responsible for regulating lake level, controlling downstream flow, and diverting water for hydropower or irrigation purposes. The origin of the Klamath River is a shallow wide reach around Klamath Falls Town (with a rough altitude of 1250 m). The Keno Dam is located around 32 km downstream and controls the river flow. The dominant climate in this area is semi-arid with dry summers and the precipitations mostly occur in the winter (and fall)49,63. This initial part of the river is characterized by seasonal low water quality preventing it from hosting aquatics64. This issue calls for proper water quality assessment in this area65.

Location of the Klamath River station (images obtained from Google Earth).
The time-series data consisting of WT, pH, SC, and DO records in Klamath River Station operated by USGS (station number 11509370) are downloaded from the USGS water data website (https://waterdata.usgs.gov/nwis). Out of the available data for a five-year period (i.e., 2014–2019), those between October 01, 2014, and September 30, 2018, are considered as training samples for deriving the relationship between the DO and WT, pH, and SC. The trained models are then tested using the data between October 01, 2018, and September 30, 2019, called testing data. Figure 2 depicts the variations in the WT, pH, SC, and DO. Moreover, the training and testing datasets are statistically described in Table 1.

Variations in the DO and independent factors.
Methodology
Figure 3 shows the methodological flowchart of the study. After data provision from the Klamath River station, training and testing datasets are created. The models are developed by combining the MLPNN model with four metaheuristic algorithms of TLBO, SCA, WCA, and EFO. These models are trained using the training dataset and they predict the DO for the testing period. In the end, their accuracy is evaluated using error and correlation criteria to rank their performance.

Methodology of this study.
In the following, the description of the models is presented.
The MLPNN
The MLPNN66,67 is a broadly used type of ANNs68 that is structured on several units lying in three (or more) layers, namely the input layer, hidden layer(s), and output layer. Figure 4 shows the architecture of the MLPNN used in this work. The neurons in an MLPNN are completely connected together. The weights of the network play the role of synapses in a biological neural network.

The MLP designed for predicting the DO.
In each neuron, the input is multiplied by a specific weight factor, and then, added to a bias. The neurons in the hidden layer and output layer can have a linear or non-linear activation function that releases the outcome of the neurons in the last step.
The training mechanism of an MLPNN is described as iteratively adjusting the weights and biases toward a more accurate prediction (e.g., a lower error) for the new network. A common algorithm that is responsible for this process is Levenberg–Marquardt69. In this work, this algorithm is replaced with TLBO, SCA, WCA, and EFO.
Metaheuristic algorithms
The TLBO is a metaheuristic algorithm designed by Rao et al.70. It has been widely used for solving various problems71. In this algorithm, a class (with the students and their teacher) is simulated so that the teacher influences the learners to reach the most proper harmony. Improving the knowledge of the students takes place in two separate steps conducted by the teacher and students themselves (i.e., teacher phase and learner phase, respectively). In this regard, the potential (i.e., the fitness) of each individual is assessed by exams. In the teacher phase, after calculating the fitness values, the most potent individual is considered a teacher. In the next phase, the learners help together to improve each other’s knowledge. Previous studies have detailed mathematical regulations of the TLBO72,73.
As a recently developed algorithm, the SCA mimics mathematical rules (i.e., sine/cosine functions). This algorithm was proposed by Mirjalili74. After generating a random swarm, the algorithm conducts the optimization over two phases, namely exploration and exploitation. In the first phase, a suitable searching area is found by abruptly mixing the random solution with several others having a large rate of randomness. In the second phase, the random solutions experience changes gradually. Several random values are used in the SCA. Some are considered as the variables of the sine/cosine functions. A random number also plays the role of a criterion for determining the updating equation (i.e., utilizing either sine or cosine function). The SCA has been mathematically described in studies like75,76.
Eskandar et al.77 developed the WCA by taking the main inspiration from the water cycle running in nature. Assuming that the algorithm commences by raining, the raindrops may finally take the form of a stream, river, and sea-based on their fitness value. In this designation, the sea is the most capable solution provided by the algorithm so far. The rivers also represent an improved version of the streams. These individuals iteratively replace each other to find the most powerful sea. More clearly, once a stream is more promising than a river, they exchange their position. The sea is likewise replaced with a more promising river. In the WCA, the mentioned process is repeated by repeating the rain process. It creates new raindrops and hereby prevents premature optimums. The WCA is detailed in earlier literature78,79.
As an electromagnetics-based search scheme, Abedinpourshotorban et al.80 proposed the EFO in 2016. Similar to the initial classification executed in the WCA, each agent of the EFO algorithm, known as an electromagnetic particle (EMP), is first grouped in one of the positive, negative, and neutral fields. It is done with respect to the fitness of the proposed EMP. In each iteration, a new EMP is generated and if it brings a larger fitness, it replaces the worst existing EMP. Producing the new EMP begins with taking a member from each field. In the next step, the neutral EMP donates its position (and pole) to the new particle. Based on the fact that EMs with different poles attract each other (and vice versa), the new particle is then affected by positive and negative EMPs. Studies like81,82 contain the mathematical details of the explained process.
Accuracy criteria
For assessing the capability of these models, mean absolute error (MAE) and root mean square error (RMSE) indices are employed to report the prediction error. Equations 1 and 2 describe the error calculation using the MAE and RMSE. Besides, Pearson correlation coefficient (RP) is used to measure the correlation of the results. Equation 3 formulates the RP index. Another criterion called Nash–Sutcliffe efficiency (NSE) coefficient is also expressed by Eq. 4.
where ({DO}_{{i}_{predicted}}) and ({DO}_{{i}_{expected}}) stand for the modeled and measured DOs, respectively (with respective means of ({overline{DO} }_{predicted}) and ({overline{DO} }_{expected})). Moreover, Q signifies the number of processed samples which equals 1430 and 352 for the training and testing data, respectively.
Results and discussion
Once again, this paper offers four novel models for DO prediction. The models are composed of an MLP neural network as the core and the TLBO, SCA, WCA, and EFO as the training algorithms. All models are developed and implemented in the MATLAB 2017 environment.
Optimization and training
Proper training of the MLP is dependent on the strategy employed by the algorithm appointed for this task (as described in previous sections for the TLBO, SCA, WCA, and EFO). In this section, this characteristic is discussed in the format of the hybridization results of the MLP.
An MLPNN is considered the basis of the hybrid models. As per Section “The MLPNN”, this model has three layers. The input layer receives the data and has 3 neurons, one for each of WT, pH, and SC. The output layer has one neuron for releasing the final prediction (i.e., DO). However, the hidden layer can have various numbers of neurons. In this study, a trial-and-error effort was carried out to determine the most proper number. Ten models were tested with 1, 2, …, and 10 neurons in the hidden layer and it was observed that 6 gives the best performance. Hence, the final model is structured as 3 × 6 × 1. With the same logic, the activation function of the output and hidden neurons is respectively selected Pureline (x = y) and Tansig (described in Section “Formula presentation”) 83.
Next, the training dataset was exposed to the selected MLPNN network. The relationship between the DO and water conditions is established by means of weights and biases within the MLPNN (Fig. 4). In this study, the role of tuning theses weighst and biases is assigned to the named metaheuristic algorithms. For this purpose, the MLPNN configuration is first transformed in the form of mathematical equations with adjustable weights and biases (The equations will be shown in Section “Formula presentation”). Training the MLPNN using metaheuristic algorithms is an iterative effort. Hereupon, the RMSE between the modeled and measured DOs is introduced as the objective function of the TLBO, SCA, WCA, and EFO. This function is used to monitor the optimization benhavior of the algorithms. Since RMSE is an error indicator, the algorithms aim to minimize it over time to improve the quality of the weights and biases. Designating the appropriate number of iterations is another important step. By analyzing the convergence behavior of the algorithms, as well as referring to previous similar studies, 1000 iterations were determined for the TLBO, SCA, and WCA, while the EFO was implemented with 30,000 iterations. The final solution is used to constrcuct the optimized MLPNN. Figure 5 illustrates the optimization flowchart.

Optimization flowchart of the models.
Furthermore, each algorithm was implemented with nine swarm sizes (NSWs) to achieve the best model configuration. These tested NSWs were 10, 25, 50, 75, 100, 200, 300, 400, and 500 for the TLBO, SCA, WCA, while 25, 30, 50, 75, 100, 200, 300, 400, and 500 for the EFO84. Collecting the obtained objective functions (i.e., the RMSEs) led to creating a convergence curve for each tested NSWs. Figure 6 depicts the convergence curves of the TLBO-MLPNN, SCA-MLPNN, WCA-MLPNN, and EFO-MLPNN.

Optimization curves of the (a) TLBO-MLPNN, (b) SCA-MLPNN, (c) WCA-MLPNN, and (d) EFO-MLPNN.
As is seen, each algorithm has a different method for training the MLPNN. According to the above charts, the TLBO-MLPNN, SCA-MLPNN, WCA-MLPNN, and EFO-MLPNN with respective NSWs of 500, 400, 400, and 50, attained the lowest RMSEs. It means that for each model, the MLPNNs trained by these configurations acquired more promising weights and biases compared to eight other NSWs. Table 2 collects the final parameters of each model.
Training and testing results
The RMSE of the recognized elite models (i.e., the TLBO-MLPNN, SCA-MLPNN, WCA-MLPNN, and EFO-MLPNN with the NSWs of 500, 400, 400, and 50) was 1.3231, 1.4269, 1.3043, and 1.3210, respectively. These values plus the MAEs of 0.9800, 1.1113, 0.9624, and 0.9783, and the NSEs of 0.7730, 0.7359, 0.7794, and 0.7737 indicate that the MLP has been suitably trained by the proposed algorithms. In order to graphically assess the quality of the results, Fig. 7a,c,e, and g are generated to show the agreement between the modeled and measured DOs. The calculated RPs (i.e., 0.8792, 0.8637, 0.8828, and 0.8796) demonstrate a large degree of agreement for all used models. Moreover, the outcome of ({DO}_{{i}_{expected }}- {DO}_{{i}_{predicted}}) is referred to as “error” for every sample, and the frequency of these values is illustrated in Fig. 7b,d,f, and h. These charts show larger frequencies for the error values close to 0; meaning that accurately predicted DOs outnumber those with considerable errors.

The scatterplot and histogram of the errors plotted for the training data of (a and b) TLBO-MLPNN, (c and d) SCA-MLPNN, (e and f) WCA-MLPNN, and (g and h) EFO-MLPNN.
Evaluating the testing accuracies revealed the high competency of all used models in predicting the DO for new values of WT, pH, and SC. In other words, the models could successfully generalize the DO pattern captured by exploring the data belonging to 2014–2018 to the data of the fifth year. For example, Fig. 8 shows the modeled and measured DOs for two different periods including (a) October 01, 2018 to December 01, 2018 and (b) January 01, 2019 to March 01, 2019. It can be seen that, for the first period, the upward DO patterns have been well-followed by all four models. Also, the models have shown high sensitivity to the fluctuations in the DO pattern for the second period.

The real and predicted DO patterns for (a) October 01, 2018 to December 01, 2018 and (b) January 01, 2019 to March 01, 2019.
Figure 9a,c,e, and g show the errors obtained for the testing data. The RMSE and MAE of the TLBO-MLPNN, SCA-MLPNN, WCA-MLPNN, and EFO-MLPNN were 1.2980 and 0.9728, 1.4493 and 1.2078, 1.3096 and 0.9915, and 1.2903 and 1.0002, respectively. These values, along with the NSEs of 0.7668, 0.7092, 0.7626, and 0.7695, imply that the models have predicted unseen DOs with a tolerable level of error. Moreover, Fig. 9b,d,f, and h present the corresponding scatterplots illustrating the correlation between the modeled and measured DOs in the testing phase. Based on the Rp values of 0.8785, 0.8587, 0.8762, and 0.8815, a very satisfying correlation can be seen for all used models.

The error line and scatterplot plotted for the testing data of (a and b) TLBO-MLPNN, (c and d) SCA-MLPNN, (e and f) WCA-MLPNN, and (g and h) EFO-MLPNN.
Efficiency comparison and discussion
To compare the efficiency of the employed models, the most accurate model is first determined by comparing the obtained accuracy indicators, then, a comparison between the optimization time is carried out. Table 3 collects all calculated accuracy criteria in this study.
In terms of all all accuracy criteria (i.e., RMSE, MAE, RP, and NSE), the WCA-MLPNN emerged as the most reliable model in the training phase. In other words, the WCA presented the highest quality training of the MLP followed by the EFO, TLBO, and SCA. However, the results of the testing data need more discussion. In this phase, while the EFO-MLPNN achieved the smallest RMSE (1.2903), the largest RP (0.8815), and the largest NSE (0.7695) at the same time, the smallest MAE (0.9728) was obtained for the TLBO-MLPNN. About the SCA-based ensemble, it was shown that this model yields the poorest predictions in both phases.
Additionally, Figs. 10 and 11 are also produced to compare the accuracy of the models in the form of boxplot and Taylor Diagram, respectively. The results of these two figures are consistent with the above comparison. They indicate the high accordance between the models’ outputs and target DOs, and also, they reflect the higher accuracy of the WCA-MLPNN, EFO-MLPNN, and TLBO-MLPNN, compared to the SCA-MLPNN.

Boxplots of the models for comparison.

Taylor diagram of the models for comparison.
In comparison with some previous literature, it can be said that our models have attained a higher accuracy of DO prediction. For instance, in the study by Yang et al.85, three metaheuristic algorithms, namely multi-verse optimizer (MVO), shuffled complex evolution (SCE), and black hole algorithm (BHA) were combined with an MLPNN and the models were applied to the same case study (Klamath River Station). The best training performance was achieved by the MLP-MVO (with respective RMSE, MAE, and RP of 1.3148, 0.9687, and 0.8808), while the best testing performance was achieved by the MLP-SCE (with respective RMSE, MAE, and RP of 1.3085, 1.0122, and 0.8775). As per Table 3, it can be inferred that the WCA-MLPNN suggested in this study provides better training results. Also, as far as the testing results are concerned, both WCA-MLPNN and TLBO-MLPNN outperformed all models tested by Yang et al.85. In another study by Kisi et al.42, an ensemble model called BMA was suggested for the same case study, and it achieved training and testing RMSEs of 1.334 and 1.321, respectively (See Table 5 of the cited paper). These error values are higher than the RMSEs of the TLBO-MLPNN, WCA-MLPNN, and EFO-MLPNN in this study. Consequently, these model outperform benchmark conventional models that were tested by Kisi et al.42 (i.e., ELM, CART, ANN, MLR, and ANFIS). With the same logic, the superiority of the suggested hybrid models over some conventional models employed in the previous studies49,65 for different stations on the Klamath River can be inferred. Altogether, these comparisons indicate that this study has achieved considerable improvements in the field of DO prediction.
Table 4 denotes the times elapsed for optimizing the MLP by each algorithm. According to this table, the EFO-MLPNN, despite requiring a greater number of iterations (i.e., 30,000 for the EFO vs. 1000 for the TLBO, SCA, and WCA), accomplishes the optimization in a considerably shorter time. In this relation, the times for the TLBO, SCA, and WCA range in [181.3, 12,649.6] s, [88.7, 6095.2] s, and [83.2, 4804.0] s, while those of the EFO were bounded between 277.2 and 296.0 s. Another difference between the EFO and other proposed algorithms is related to two initial NSWs. Since NSW of 10 was not a viable value for implementing the EFO, two values of 25 and 30 are alternatively considered.
Based on the above discussion, the TLBO, WCA, and EFO showed higher capability compared to the SCA. Examining the time of the selected configurations of the TLBO-MLPNN, SCA-MLPNN, WCA-MLPNN, and EFO-MLPNN (i.e., 12,649.6, 5295.7, 4733.0, and 292.6 s for the NSWs of 500, 400, 400, and 50, respectively) shows that the WCA needs around 37% of the TLBO’s time to train the MLP. The EFO, however, provides the fastest training.
Apart from comparisons, the successful prediction carried out by all four hybrid models represents the compatibility of the MLPNN model with metaheuristic science for creating predictive ensembles. The used optimizer algorithms could nicely optimize the relationship between the DO and water conditions (i.e., WT, pH, and SC) in the Klamath River Station. The basic model was a 3 × 6 × 1 MLPNN containing 24 weights and 7 biases (Fig. 4). Therefore, each algorithm provided a solution composed of 31 variables in each iteration. Considering the number of tested NSWs and iterations for each algorithm (i.e., 30,000 iterations of the EFO and 1000 iterations of the WCA, SCA, and TLBO all with nine NSWs), it can be said that the outstanding solution (belonging to the EFO algorithm) has been excerpted among a large number of candidates (= 1 × 30,000 × 9 + 3 × 1000 × 9).
However, concerning the limitations of this work in terms of data and methodology, potential ideas can be raised for future studies. First, it is suggested to update the applied models with the most recent hydrological data, as well as the records of other water quality stations, in order to enhance the generalizability of the models. Moreover, further metaheuristic algorithms can be tested in combination with different basic models such as ANFIS and SVM to conduct comparative studies.
Formula presentation
The higher efficiency of the WCA and EFO (in terms of both time and accuracy) was derived in the previous section. Hereupon, the MLPNNs constructed by the optimal responses of these two algorithms are mathematically presented in this section to give two formulas for predicting the DO. Referring to Fig. 4, the calculations of the output neuron in the WCA-MLPNN and EFO-MLPNN is expressed by Eqs. 5 and 6, respectively.
In the above relationships, ({O}_{HNi}) and ({{O}_{HNi}}^{prime}) represent the outcome of the ith hidden neuron in the WCA-MLPNN and EFO-MLPNN, respectively. Given Tansig (x) = (frac{2}{1+ {e}^{-2x}}) – 1 as the activation function of the hidden neurons, ({O}_{HNi}) and ({{O}_{HNi}}^{prime}) are calculated by the below equations. As is seen, these two parameters are calculated from the inputs of the study, i.e., (WT, pH, and SC).
More clearly, the integration of Eqs. (5 and 7) results in the WCA-MLPNN formula, while the integration of Eqs. (6 and 8) results in the EFO-MLPNN formula. Given the excellent accuracy of these two models and their superiority over some previous models in the literature, either of these two formulas can be used for practical estimations of the DO, especially for solving the water quality issue within the Klamath River.
Conclusions
Four stochastic search strategies, namely teaching–learning-based optimization, sine cosine algorithm, water cycle algorithm, and electromagnetic field optimization were used to train an artificial neural network for predicting the dissolved oxygen of the Klamath River, Oregon, US. After designating the appropriate parameters for each algorithm, accuracy indices showed that all four methods can properly train the MLP to grasp a reliable understanding of the DO behavior. Due to the same reason, the models could reliably predict the DO for new environmental conditions. The hybrid models were compared in terms of accuracy, complexity, and computation time to detect the most efficient predictor. During the training process, it was deduced that although the EFO algorithm required 30 times more iterations, it accomplished this process far faster than three other algorithms. It also presented the most accurate results (in terms of the RMSE, RP, and NSE) in the testing phase. Another advantage of this model was hiring a smaller number of search agents to find the optimal response. After that, the WCA-MLPNN emerged as the second-efficient model. Therefore, two DO predictive, based on the weights and biases tuned by the WCA and EFO were proposed in the last part of this research. Moreover, it was shown that the outstanding models of this study outperform several hybrid and conventional models from previous studies, indicating an improvement in practical DO predictions. It would also help in better solving the problem of poor water quality in the studied area.
Data availability
All data analysed during this study was (can be) freely downloaded from the USGS water data website (https://waterdata.usgs.gov/nwis). Also, the code of the used algorithms is available upon reasonable request from the author.
References
-
Xiao, R. et al. A review on the research status and development trend of equipment in water treatment processes of recirculating aquaculture systems. Rev. Aquac. 11, 863–895 (2019).
Google Scholar
-
Singh, K. P., Basant, A., Malik, A. & Jain, G. Artificial neural network modeling of the river water quality—a case study. Ecol. Model. 220, 888–895 (2009).
Google Scholar
-
Ranković, V., Radulović, J., Radojević, I., Ostojić, A. & Čomić, L. Neural network modeling of dissolved oxygen in the Gruža reservoir, Serbia. Ecol. Model. 221, 1239–1244 (2010).
Google Scholar
-
Cox, B. A review of dissolved oxygen modelling techniques for lowland rivers. Sci. Total Environ. 314, 303–334 (2003).
Google Scholar
-
Kalff, J. Limnology: Inland water ecosystems (2002).
-
Incorporated, Y. The Dissolved Oxygen Handbook (2009).
-
USGS U. S. Geological Survey.
-
Roushangar, K., Davoudi, S. & Shahnazi, S. The potential of novel hybrid SBO-based long short-term memory network for prediction of dissolved oxygen concentration in successive points of the Savannah River, USA. Environ. Sci. Pollut. Res. 30, 46960–46978 (2023).
Google Scholar
-
Heddam, S. Hybrid kernel extreme learning machine-based empirical wavelet transform for water quality prediction using only river flow as predictor. In Climate Change Impacts on Natural Resources, Ecosystems and Agricultural Systems 413–429 (Springer, 2023).
-
Kisi, O., Alizamir, M. & DocheshmehGorgij, A. Dissolved oxygen prediction using a new ensemble method. Environ. Sci. Pollut. Res. 27, 9589–9603 (2020).
Google Scholar
-
Heddam, S. Fuzzy neural network (EFuNN) for modelling dissolved oxygen concentration (DO). In Intelligence Systems in Environmental Management: Theory and Applications 231–253 (Springer, 2016).
-
Zhang, L., Qin, D., Feng, J., Tang, T. & Cheng, H. Rapid quantitative detection of luteolin using an electrochemical sensor based on electrospinning of carbon nanofibers doped with single-walled carbon nanoangles. Anal. Methods 15, 3073–3083 (2023).
Google Scholar
-
Tang, T. et al. Sensitive and selective electrochemical determination of uric acid in urine based on ultrasmall iron oxide nanoparticles decorated urchin-like nitrogen-doped carbon. Colloids Surf. B 216, 112538 (2022).
Google Scholar
-
Xu, Z. et al. Characteristics of source rocks and genetic origins of natural gas in deep formations, Gudian Depression, Songliao Basin, NE China. ACS Earth Space Chem. 6, 1750–1771 (2022).
Google Scholar
-
Li, W. et al. Influence of nitrogen addition on the functional diversity and biomass of fine roots in warm-temperate and subtropical forests. For. Ecol. Manag. 545, 121309 (2023).
Google Scholar
-
Zhao, M. et al. Mapping urban dynamics (1992–2018) in Southeast Asia using consistent nighttime light data from DMSP and VIIRS. Remote Sens. Environ. 248, 111980 (2020).
Google Scholar
-
Liu, Z., Xu, J., Liu, M., Yin, Z., Liu, X., Yin, L. & Zheng, W. Remote sensing and geostatistics in urban water-resource monitoring: A review. Mar. Freshw. Res. (2023).
-
Li, W. et al. Fine root biomass and morphology in a temperate forest are influenced more by canopy water addition than by canopy nitrogen addition. Front. Ecol. Evol. 11, 1132248 (2023).
Google Scholar
-
Zhu, G. et al. Stable water isotope monitoring network of different water bodies in Shiyang River basin, a typical arid river in China. Earth Syst. Sci. Data 14, 3773–3789 (2022).
Google Scholar
-
Qiu, D. et al. Water use strategy of nitraria tangutorum shrubs in ecological water delivery area of the lower inland river: Based on stable isotope data. J. Hydrol. 624, 129918 (2023).
Google Scholar
-
Zhou, J. et al. Quantifying the major drivers for the expanding lakes in the interior Tibetan Plateau. Sci. Bull. 67, 474–478 (2022).
Google Scholar
-
Liu, W., Zhao, C., Zhou, Y. & Xu, X. Modeling of vapor-liquid equilibrium for electrolyte solutions based on COSMO-RS interaction. J. Chem. 2022, 1–13 (2022).
Google Scholar
-
Gao, C., Hao, M., Chen, J. & Gu, C. Simulation and design of joint distribution of rainfall and tide level in Wuchengxiyu Region, China. Urban Clim. 40, 101005 (2021).
Google Scholar
-
Yin, L. et al. Spatial and wavelet analysis of precipitation and river discharge during operation of the Three Gorges Dam, China. Ecol. Indic. 154, 110837 (2023).
Google Scholar
-
Zhu, X., Xu, Z., Liu, Z., Liu, M., Yin, Z., Yin, L. & Zheng, W. Impact of dam construction on precipitation: A regional perspective. Mar. Freshw. Res. (2022).
-
Li, Y. et al. Urbanization and agriculture intensification jointly enlarge the spatial inequality of river water quality. Sci. Total Environ. 878, 162559 (2023).
Google Scholar
-
Unigwe, C. O. & Egbueri, J. C. Drinking water quality assessment based on statistical analysis and three water quality indices (MWQI, IWQI and EWQI): A case study. Environ. Dev. Sustain. 25, 686–707 (2023).
Google Scholar
-
Nasir, N. et al. Water quality classification using machine learning algorithms. J. Water Process Eng. 48, 102920 (2022).
Google Scholar
-
Yin, L. et al. U-Net-STN: A novel end-to-end lake boundary prediction model. Land 12, 1602 (2023).
Google Scholar
-
Sun, S. et al. Application of a novel coagulant in reservoir water treatment in Qingdao. Desalination Water Treat 284, 49–60 (2023).
Google Scholar
-
Wu, X., Feng, X., Wang, Z., Chen, Y. & Deng, Z. Multi-source precipitation products assessment on drought monitoring across global major river basins. Atmos. Res. 295, 106982 (2023).
Google Scholar
-
Huang, J., Huang, Y., Hassan, S. G., Xu, L. & Liu, S. Dissolved oxygen content interval prediction based on auto regression recurrent neural network. J. Ambient Intell. Humaniz. Comput. 14, 7255–7264 (2023).
Google Scholar
-
Chukwuemeka, E., Ismaila Mohammed, S., Alfa Umar, A., Apeh Abraham, I. & Ayobami, B. A. Performance evaluation of adaptive neuro-fuzzy inference system for modelling dissolved oxygen of Kubanni Reservoir: A case study in Zaria, Nigeria. Environ. Health Eng. Manag. J. 9, 347–353 (2022).
Google Scholar
-
Ay, M. & Kisi, O. Modeling of dissolved oxygen concentration using different neural network techniques in Foundation Creek, El Paso County, Colorado. J. Environ. Eng. 138, 654–662 (2012).
Google Scholar
-
Liu, Y., Zhang, Q., Song, L. & Chen, Y. Attention-based recurrent neural networks for accurate short-term and long-term dissolved oxygen prediction. Comput. Electron. Agric. 165, 104964 (2019).
Google Scholar
-
Xiao, Z. et al. The dissolved oxygen prediction method based on neural network. Complexity 2017, 1–6 (2017).
Google Scholar
-
Antanasijević, D., Pocajt, V., Perić-Grujić, A. & Ristić, M. Multilevel split of high-dimensional water quality data using artificial neural networks for the prediction of dissolved oxygen in the Danube River. Neural Comput. Appl. 1–10 (2019).
-
García del Toro, E. M., Mateo, L. F., García-Salgado, S., Más-López, M. I. & Quijano, M. Á. Use of artificial neural networks as a predictive tool of dissolved oxygen present in surface water discharged in the coastal lagoon of the Mar menor (murcia, Spain). Int. J. Environ. Res. Public Health 19, 4531 (2022).
Google Scholar
-
Ji, X., Shang, X., Dahlgren, R. A. & Zhang, M. Prediction of dissolved oxygen concentration in hypoxic river systems using support vector machine: A case study of Wen-Rui Tang River, China. Environ. Sci. Pollut. Res. 24, 16062–16076 (2017).
Google Scholar
-
Huan, J., Cao, W. & Qin, Y. Prediction of dissolved oxygen in aquaculture based on EEMD and LSSVM optimized by the Bayesian evidence framework. Comput. Electron. Agric. 150, 257–265 (2018).
Google Scholar
-
Shi, P., Li, G., Yuan, Y., Huang, G. & Kuang, L. Prediction of dissolved oxygen content in aquaculture using Clustering-based Softplus Extreme Learning Machine. Comput. Electron. Agric. 157, 329–338 (2019).
Google Scholar
-
Kisi, O., Alizamir, M. & Gorgij, A. D. Dissolved oxygen prediction using a new ensemble method. Environ. Sci. Pollut. Res. 1–15 (2020).
-
Najah, A., El-Shafie, A., Karim, O. A. & El-Shafie, A. H. Performance of ANFIS versus MLP-NN dissolved oxygen prediction models in water quality monitoring. Environ. Sci. Pollut. Res. 21, 1658–1670 (2014).
Google Scholar
-
Olyaie, E., Abyaneh, H. Z. & Mehr, A. D. A comparative analysis among computational intelligence techniques for dissolved oxygen prediction in Delaware River. Geosci. Front. 8, 517–527 (2017).
Google Scholar
-
Li, W., Wu, H., Zhu, N., Jiang, Y., Tan, J. & Guo, Y. Prediction of dissolved oxygen in a fishery pond based on gated recurrent unit (GRU). Inf. Process. Agric. (2020).
-
Csábrági, A., Molnár, S., Tanos, P. & Kovács, J. Application of artificial neural networks to the forecasting of dissolved oxygen content in the Hungarian section of the river Danube. Ecol. Eng. 100, 63–72 (2017).
Google Scholar
-
Heddam, S., Kim, S., Mehr, A. D., Zounemat-Kermani, M., Malik, A., Elbeltagi, A. & Kisi, O. Predicting dissolved oxygen concentration in river using new advanced machines learning: Long-short term memory (lstm) deep learning. In Computers in Earth and Environmental Sciences 1–20 (Elsevier, 2022).
-
Nong, X. et al. Prediction modelling framework comparative analysis of dissolved oxygen concentration variations using support vector regression coupled with multiple feature engineering and optimization methods: A case study in China. Ecol. Indic. 146, 109845 (2023).
Google Scholar
-
Heddam, S. Modelling hourly dissolved oxygen concentration (DO) using dynamic evolving neural-fuzzy inference system (DENFIS)-based approach: case study of Klamath River at Miller Island Boat Ramp, OR, USA. Environ. Sci. Pollut. Res. 21, 9212–9227 (2014).
Google Scholar
-
Keshtegar, B. & Heddam, S. Modeling daily dissolved oxygen concentration using modified response surface method and artificial neural network: A comparative study. Neural Comput. Appl. 30, 2995–3006 (2018).
Google Scholar
-
Nemati, S., Fazelifard, M. H., Terzi, Ö. & Ghorbani, M. A. Estimation of dissolved oxygen using data-driven techniques in the Tai Po River, Hong Kong. Environ. Earth Sci. 74, 4065–4073 (2015).
Google Scholar
-
Jasmin, S. A., Ramesh, P. & Tanveer, M. An intelligent framework for prediction and forecasting of dissolved oxygen level and biofloc amount in a shrimp culture system using machine learning techniques. Expert Syst. Appl. 199, 117160 (2022).
Google Scholar
-
Alizamir, M. et al. Investigating landfill leachate and groundwater quality prediction using a robust integrated artificial intelligence model: Grey wolf metaheuristic optimization algorithm and extreme learning machine. Water 15, 2453 (2023).
Google Scholar
-
Ahmadi, F., Mehdizadeh, S. & Mohammadi, B. Development of bio-inspired-and wavelet-based hybrid models for reconnaissance drought index modeling. Water Resour. Manag. 35, 4127–4147 (2021).
Google Scholar
-
Ahmadi, F. et al. Application of an artificial intelligence technique enhanced with intelligent water drops for monthly reference evapotranspiration estimation. Agric. Water Manag. 244, 106622 (2021).
Google Scholar
-
Raheli, B., Aalami, M. T., El-Shafie, A., Ghorbani, M. A. & Deo, R. C. Uncertainty assessment of the multilayer perceptron (MLP) neural network model with implementation of the novel hybrid MLP-FFA method for prediction of biochemical oxygen demand and dissolved oxygen: A case study of Langat River. Environ. Earth Sci. 76, 503 (2017).
Google Scholar
-
Yaseen, Z. M. et al. The integration of nature-inspired algorithms with least square support vector regression models: Application to modeling river dissolved oxygen concentration. Water 10, 1124 (2018).
Google Scholar
-
Fadaee, M., Mahdavi-Meymand, A. & Zounemat-Kermani, M. Seasonal short-term prediction of dissolved oxygen in rivers via nature-inspired algorithms. CLEAN—Soil, Air, Water 48, 1900300 (2020).
Google Scholar
-
Liu, S. et al. Prediction of dissolved oxygen content in river crab culture based on least squares support vector regression optimized by improved particle swarm optimization. Comput. Electron. Agric. 95, 82–91 (2013).
Google Scholar
-
Chen, Y., Xu, J., Yu, H., Zhen, Z. & Li, D. Three-dimensional short-term prediction model of dissolved oxygen content based on pso-bpann algorithm coupled with kriging interpolation. Math. Probl. Eng. 2016, 1–10 (2016).
-
Bayram, A., Uzlu, E., Kankal, M. & Dede, T. Modeling stream dissolved oxygen concentration using teaching–learning based optimization algorithm. Environ. Earth Sci. 73, 6565–6576 (2015).
Google Scholar
-
Azma, A. et al. Hybrid machine learning models for prediction of daily dissolved oxygen. J. Water Process Eng. 54, 103957 (2023).
Google Scholar
-
Sullivan, A. B., Rounds, S. A., Deas, M. L., Asbill, J. R., Wellman, R. E., Stewart, M. A., Johnston, M. W. & Sogutlugil, I. Modeling hydrodynamics, water temperature, and water quality in the Klamath River upstream of Keno Dam, Oregon, 2006-09 (U. S. Geological Survey, 2011).
-
Mrazik, S. Oregon water quality index summary water years 1997–2006: Oregon Department of Environmental Quality. DEQ07-LAB-007-TR (2007).
-
Heddam, S. Generalized regression neural network-based approach for modelling hourly dissolved oxygen concentration in the Upper Klamath River, Oregon, USA. Environ. Technol. 35, 1650–1657 (2014).
Google Scholar
-
Pinkus, A. Approximation theory of the MLP model in neural networks. Acta Numer. 8, 143–195 (1999).
Google Scholar
-
Hornik, K., Stinchcombe, M. & White, H. Multilayer feedforward networks are universal approximators. Neural Netw. 2, 359–366 (1989).
Google Scholar
-
Anderson, D. & McNeill, G. Artificial neural networks technology. Kaman Sci. Corp. 258, 1–83 (1992).
-
Moré, J. J. The Levenberg–Marquardt algorithm: Implementation and theory. In Numerical analysis 105–116 (Springer, 1978).
-
Rao, R. V., Savsani, V. J. & Vakharia, D. Teaching–learning-based optimization: A novel method for constrained mechanical design optimization problems. Comput.-Aided Des. 43, 303–315 (2011).
Google Scholar
-
Zhou, G., Moayedi, H. & Foong, L. K. Teaching–learning-based metaheuristic scheme for modifying neural computing in appraising energy performance of building. Eng. Comput. 1–12 (2020).
-
Seda, Ö. -D., Temür, R. & Alhan, C. Teaching-learning based optimization of nonlinear isolation systems under far fault earthquakes. Teknik Dergi 33, 11487–11505 (2022).
Google Scholar
-
Ponnam, V. K. B. & Swarnasri, K. Multi-objective optimal allocation of electric vehicle charging stations in radial distribution system using teaching learning based optimization. Int. J. Renew. Energy Res. (IJRER) 10, 366–377 (2020).
-
Mirjalili, S. SCA: a sine cosine algorithm for solving optimization problems. Knowl. Syst. 96, 120–133 (2016).
Google Scholar
-
Wang, J., Yang, W., Du, P. & Niu, T. A novel hybrid forecasting system of wind speed based on a newly developed multi-objective sine cosine algorithm. Energy Convers. Manag. 163, 134–150 (2018).
Google Scholar
-
AbdElaziz, M., Oliva, D. & Xiong, S. An improved opposition-based sine cosine algorithm for global optimization. Expert Syst. Appl. 90, 484–500 (2017).
Google Scholar
-
Eskandar, H., Sadollah, A., Bahreininejad, A. & Hamdi, M. Water cycle algorithm–A novel metaheuristic optimization method for solving constrained engineering optimization problems. Comput. Struct. 110, 151–166 (2012).
Google Scholar
-
Luo, Q., Wen, C., Qiao, S. & Zhou, Y. Dual-System Water Cycle Algorithm For Constrained Engineering Optimization Problems (Springer, 2016).
Google Scholar
-
Ibrahim, S., Alwash, S. & Aldhahab, A. Optimal network reconfiguration and DG integration in power distribution systems using enhanced water cycle algorithm. Int. J. Intell. Eng. Syst. https://doi.org/10.22266/ijies2020229 (2020).
Google Scholar
-
Abedinpourshotorban, H., Shamsuddin, S. M., Beheshti, Z. & Jawawi, D. N. Electromagnetic field optimization: A physics-inspired metaheuristic optimization algorithm. Swarm Evolut. Comput. 26, 8–22 (2016).
Google Scholar
-
Bouchekara, H., Zellagui, M. & Abido, M. A. Optimal coordination of directional overcurrent relays using a modified electromagnetic field optimization algorithm. Appl. Soft Comput. 54, 267–283 (2017).
Google Scholar
-
Talebi, B. & Dehkordi, M. N. Sensitive association rules hiding using electromagnetic field optimization algorithm. Expert Syst. Appl. 114, 155–172 (2018).
Google Scholar
-
Mehrabi, M. et al. Spatial mapping of gully erosion susceptibility using an efficient metaheuristic neural network. Environ. Earth Sci. 82, 1–22 (2023).
Google Scholar
-
Mehrabi, M., Scaioni, M. & Previtali, M. Forecasting air quality in Kiev during 2022 military conflict using sentinel 5P and optimized machine learning. IEEE Trans. Geosci. Remote Sens. (2023).
-
Yang, F., Moayedi, H. & Mosavi, A. Predicting the degree of dissolved oxygen using three types of multi-layer perceptron-based artificial neural networks. Sustainability 13, 9898 (2021).
Google Scholar
Author information
Authors and Affiliations
Contributions
All authors wrote the main manuscript text. All authors reviewed the manuscript.
Corresponding author
Ethics declarations
Competing interests
The author declares no competing interests.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
Reprints and Permissions
About this article
Cite this article
Yang, J. Predicting water quality through daily concentration of dissolved oxygen using improved artificial intelligence.
Sci Rep 13, 20370 (2023). https://doi.org/10.1038/s41598-023-47060-5
-
Received: 14 August 2023
-
Accepted: 08 November 2023
-
Published: 21 November 2023
-
DOI: https://doi.org/10.1038/s41598-023-47060-5
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.