Comparison of artificial neural network methods and support vector machine in predicting water quality parameters of Dinachal river, IRAN

Document Type : Research Paper

Authors

1 Irrigation and Reclamation Engineering Department, Faculty of Agriculture, University of Tehran, Karaj, Iran.

2 Professor, Department of Renewable Energies and Sustainable Resources Engineering, University of Tehran, Tehran, Iran.

Abstract

Predicting water quality parameters plays a crucial role for monitoring of ecosystems of rivers and their sustainability. Alongside this, conventional prediction models are not able to capture the non-linearity and non-stationary inherence of water quality datasets. In recent years, the rapid development of machine learning methods has transformed the water quality prediction fields. In this study, water quality parameters for the Dinachal River in Guilan province have been assessed and predicted. Two models based on Artificial Neural Networks (ANN) and Support Vector Regression (SVR) were utilized to predict nine water quality parameters as TDS, EC, pH, Cl, SO4, HCO3, Ca, Mg, and Na with monthly timesteps between 2006 and 2018. Then, the model’s performance was evaluated using RMSE, MSE, and MAPE indices. According to the results, the SVR model was superior in predicting TDS and Mg parameters with an RMSE Index of 2.03 and 0.062, respectively. Simultaneously, ANN had a slightly better accuracy in the prediction of remaining parameters. However, prediction results for both models in the case study were satisfactory. In addition, the SVR model predicted TDS with a MAPE of 0.007, which was the best compared to other parameters. At the same time, the ANN model had better performance in predicting EC with a MAPE of 0.001. Prediction results for Cl had also the lowest accuracy among water quality parameters with an RMSE of 0.055 and 0.052 for SVR and ANN, respectively. Methods utilized in this study can be effective in predicting water quality parameters of Dinachal river.

Keywords

Main Subjects


Comparison of artificial neural network methods and support vector machine in predicting water quality parameters of Dinachal river, IRAN

EXTENDED ABSTRACT

 

Introduction

Rivers play a crucial role as vital sources of drinking water and agricultural irrigation, supporting both human health and the environment. However, the presence of various pollutants from agricultural, industrial, and urban sources can turn these invaluable resources into vulnerable points of contamination. Therefore, accurately predicting water quality is essential for effectively monitoring river ecosystems and ensuring their reliability. Unfortunately, traditional forecasting models often struggle to capture the complex and dynamic nature of water quality changes, characterized by non-linear and non-stationary patterns. Nonetheless, recent advancements in artificial neural networks have revolutionized the field of water quality prediction, sparking new discussions and possibilities in this area.

Materials and Methods

This study focuses on the evaluation and prediction of qualitative parameters in the Dinachal River, a vital river in the Gilan province. Two models, namely artificial neural network and regression support vector machine, were utilized for predicting nine qualitative parameters including total dissolved solids, electrical conductivity, acidity, Cl, SO4, HCO3, Ca, Mg, and Na. The predictions were made on a monthly basis from the years 2006 to 2, and the performance of the models was assessed using RMSE, MSE, and MAPE statistics.

The artificial neural network was employed to estimate the quality parameters of the Dinachal River. Inspired by biological brain simulation studies, the ANN is a network of interconnected elements capable of identifying similar patterns and predicting time series data. Neural networks have demonstrated their flexibility and applicability in various water resources problems, often outperforming traditional models. For this study, MATLAB 2019a software was employed to develop the neural network. The model was trained using 70% of the data randomly selected, while 15% and 15% were used for validation and testing purposes, respectively.

In the technical literature, support vector machine algorithms are abbreviated as SVC for data classification and SVR for regression applications. Support vectors refer to points with non-zero Lagrange coefficients, and the loss function in SVR is used to evaluate the regression function. The primary objective of SVR is to find the function f(x) that deviates the most from the target data, as obtained from the training data. When the deviation is zero, the best regression is achieved, while larger values indicate lower regression accuracy.

Results

The prediction models SVR and ANN were developed using the SK-Learn Python library and MATLAB software, respectively. These models were utilized to predict nine qualitative parameters (TDS, EC, pH, HCO3, Cl, SO4, Ca, Mg, and Na) based on monthly data from the Dinachal River - Dinachal Station. The performance of each model for each parameter was then compared using evaluation indices such as RMSE, MSE, and MAPE.

To predict each parameter, eight other parameters were used as inputs for the models, with the desired parameter being treated as the objective function. For instance, when predicting the TDS parameter, inputs such as EC, pH, HCO3, Cl, SO4, calcium, magnesium, and sodium ions were considered during model training. In both the ANN and SVR models, 70% of the data was allocated for training the models, while the remaining 30% was randomly selected for validation and testing purposes.

Conclusion:

Based on the results obtained, the SVR model demonstrated superior performance in predicting total dissolved solids (with an RMSE of 2.03) and magnesium concentration (with an RMSE of 0.062) compared to the artificial neural network model. Conversely, the artificial neural network model exhibited relatively better success in predicting the remaining parameters. Nevertheless, both models were deemed suitable for predicting the quality parameters of the Dinachal River.

Furthermore, the SVR model achieved the best performance in predicting total dissolved solids and electrical conductivity with a MAPE coefficient of 0.007, while the artificial neural network model achieved a MAPE coefficient of 0.001 for the same parameters. It is worth mentioning that both models showed weaker performance in predicting the chlorine parameter, despite having RMSE values of 0.055 and 0.052 for SVR and ANN models, respectively.

The methods employed in this study have proven effective in predicting the water quality of the Dinachal River overall. However, it is recommended that future studies investigate the reasons behind the lower accuracy of the artificial neural network and support vector machine models in predicting the chlorine parameter, and propose appropriate solutions. Additionally, exploring the performance of more advanced models based on deep learning for predicting quality parameters could be a valuable avenue for further research.

Abbasi, A., Khalili, K., Bahmanesh, J & Shirzad, A. (2020). Application of Support Vector Machine and Bayesian Network for Agricultural Drought Prediction. Journal of Watershed Engineering and Management, 107-124 and (1)12. (In Persian)
Abobakr Yahya, A. S. Ahmed, A. N. Binti Othman, F. Ibrahim, R. K. Afan, H. A. El-Shafie, A. & Elshafie, A. (2019). Water Quality Prediction Model-Based Support Vector Machine Model for ungauged River Catchment under Dual Scenarios. Water, 11(6), 1231.‏
Ahmadi, F., Radmanesh, F & Mirabbasi Najaf Abadi, R. (2015). Comparison between Genetic Programming and Support Vector Machine Methods for Daily River Flow Forecasting (Case Study: Barandoozchay River). Journal of Water and Soil, 1162-1171 and 28 (6). (In Persian)
Amini, A., Nouri, HA & Aslani Sangdeh, B. (2015). Evaluation of Rice Production Sustainability Using Multi-Criteria Decision-Making Methods: The Case of Razvanshahr County. Agricultural Education and Extension Sciences of Iran, 126-101(1)11. (In Persian)
Banejad, H. and E. Olyaie (2011). "Application of an Artificial Neural Network Model to Rivers Water Quality Indexes Prediction–A Case Study." Journal of American Science Journal of American Science, 77: 60-65.
Chia, S. L. Chia, M. Y. Koo, C. H. & Huang, Y. F. (2022). Integration of Advanced Optimization Algorithms into Least-Square Support Vector Machine (LSSVM) for Water Quality Index Prediction. Water Supply, 22(2), 1951-1963.
Cortes, C. and V. Vapnik (1995). "Support-vector networks." Machine Learning 20(3): 273-297.
Gorashi, F. & Abdullah, A. (2012). Prediction of Water Quality Index Using Back Propagation Network Algorithm Case Study: Gombak River. Journal of Engineering Science and Technology, 7(4), 447-461.‏
Hosseinpanahi, B., Nikmehr, S & Ebrahimi, K. (2021). Comparison of the Support Vector Machine Models and Radial Function Neural Network in Predicting SiminehRood River Water Quality Iran. Water and Irrigation Management, 409-419 and (3)11. (In Persian)
Huang, M. Tian, D. Liu, H. Zhang, C. Yi, X. Cai, J., & Ying, G. (2018). A Hybrid Fuzzy Wavelet Neural Network Model with Self-Adapted Fuzzy c-means Clustering and Genetic Algorithm for Water Quality Prediction in Rivers. Complexity, 2018, 1-11.‏
Iraji, M., Movahedi Naeini, SA., Komaki, CB., Ebrahimi, S & Yaghmaei, B. (2023). Evaluation of the Effective Parameters for Predicting the Potassium Grade of Saline Water by Using Support Vector Machine and Random Forest Algorithms (Case Study: Playa of Khoor and Biabank Area City, Isfahan Province). Iran water and soil research. (In Persian)
Jamali, B & Ebrahimi, K. (2011). Time Series Forecasting of Sefidrood River Water Quality Using Linear Stochastic Models. Journal of Agricultural Engineering Research, 31-44 and (3)12. (In Persian)
Li, Q., Yang, Y., Yang, L., & Wang, Y. (2023). Comparative Analysis of Water Quality Prediction Performance Based on LSTM in the Haihe River Basin, China. Environmental Science and Pollution Research, 30(3), 7498-7509.‏
Mahapatra, S. S., Nanda, S. K., & Panigrahy, B. K. (2011). A Cascaded Fuzzy Inference System for Indian River Water Quality Prediction. Advances in Engineering Software, 42(10), 787-796.‏
Mohammadi Ghaleni, M., Ebrahimi, K & Omid, MH. (2015). Estimation of Rearation Rate Coefficient on Dinachal River Numerical Methods in Water Quality Management. Water and Irrigation Management, 79-69(1)5. (In Persian)
Najwa Mohd Rizal, N., Hayder, G., Mnzool, M., Elnaim, B. M., Mohammed, A. O. Y., & Khayyat, M. M. (2022). Comparison between Regression Models, Support Vector Machine (SVM), and Artificial Neural Network (ANN) in River Water Quality Prediction. Processes, 10(8), 1652.‏
Pedregosa, F., et al. (2012). "Scikit-learn: Machine Learning in Python." Journal of Machine Learning Research 12.
Rohmah, M. F., et al. (2021). "Comparison Four Kernels of SVR to Predict Consumer Price Index." Journal of Physics: Conference Series 1737(1): 012018.
Roshangar, K & Davoudi, S. (2022). Comparing the Performance of Deep Learning and Machine Learning Methods in Predicting Dissolved Oxygen Content. Iran soil and water research, 1885-1900(8)53. (In Persian)
Sakaa, B., Elbeltagi, A., Boudibi, S., Chaffaï, H., Islam, A. R. M. T., Kulimushi, L. C., & Wong, Y. J. (2022). Water Quality Index Modeling Using Random Forest and Improved SMO Algorithm for Support Vector Machine in Saf-Saf River Basin. Environmental Science and Pollution Research, 29(32), 48491-48508.‏‏
Sattari, M., Abbasgoli Naebzad, M & Mirabbasi Najafabadi. (2014). Surface Water Quality Prediction Using Decision Tree Method. Iranian Journal of Irrigation and Water Engineering, 88-86(3)4. (In Persian)
Shahinejad, B., Izadi, Z & Javadi, B (2021). Evaluation of Qual2Kw Model in Qualitative Simulation of Khorramabad River. Hydrogeomorphology. Volume 8, Number 26. (In Persian)
Sillberg, C.V., Kullavanijaya, P., & Chavalparit, O. (2021). Water Quality Classification by Integration of Attribute-Realization and Support Vector Machine for the Chao Phraya River. Journal of Ecological Engineering, 22 (9), 70-86
Veisi, M & Mohammadi Rouzbahani, M. (2021). Survey on Shavoor River Using Water Quality Indexes (Hamzeh village to Shavoor dam). Environmental Science and Technology Quarterly, 23-81(5)-93. (In Persian)
Yan, J., Liu, J., Yu, Y., & Xu, H. (2021). Water Quality Prediction in the Luan River based on 1-drcnn and bigru Hybrid Neural Network Model. Water,13 (9), 1273.‏