Water Quality Identification: Integrating IoT Sensors and Deep Learning for Near-Real-Time Water Quality Assessment
Source abstract
Abstract
The increasing demand for sustainable, affordable smart city infrastructure has heightened the need for low-cost near-real-time water quality monitoring systems. In this study, we propose Water-QI, a low-cost Internet of Things (IoT)-based environmental monitoring platform that combines budget-friendly sensors with deep learning for water quality index (WQI) assessment and forecasting. The sensing platform measures five key physicochemical parameters, namely temperature, total dissolved solids (TDS), pH, turbidity, and electrical conductivity, enabling continuous multi-parameter monitoring in urban water environments. To model temporal variations in water quality under both cloud-based and edge-oriented deployment scenarios, we evaluate multiple gated recurrent unit (GRU) architectures with different widths and depths. Experiments are conducted at two temporal resolutions, hourly and minute-level, in order to examine the trade-off between predictive accuracy and edge computational latencies. In the hourly scenario, the single-layer GRU with 64 units achieved the best overall balance, reaching a validation RMSE of 0.0281 and a test R2 of 0.9820, while deeper stacked GRU models degraded performance substantially. In the minute-resolution scenario, shallow wider GRU models produced the best results, with the single-layer GRU with 512 units attaining the lowest validation RMSE (0.025548) and the 256-unit variant achieving nearly identical accuracy with much lower inference cost. The results show that increasing the GRU model length can yield improvements at high temporal granularity, whereas increasing the GRU layer depth consistently harms convergence and generalization. Overall, the findings indicate that shallow GRU architectures provide the most practical solution for accurate, low-cost, and scalable water quality forecasting. In particular, the 64-unit GRU is the most suitable choice for hourly periodic interval operation, while the 256-unit GRU offers the best edge computational speed and accuracy trade-off for minute-level near-real-time inference on resource-constrained devices.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Water Quality Monitoring Technologies · Hydrological Forecasting Using AI · Water Quality Monitoring and Analysis
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Laboratory Team of Distributed Microcomputer Systems, Department of Mathematics, University of Ioannina, 45110 Ioannina, Greece
Department of Information and Electronic Engineering, International Hellenic University, 57001 Thessaloniki, Greece
Department of Accounting and Finance, Democritus University of Thrace, Ag. Loukas, 65404 Kavala, Greece
References (62)
Show source-provided references
1. IoT-Based Automatic Water Quality Monitoring System with Optimized Neural Network
2. Kyritsakas, G. (2021). Exploring Machine Learning Applications for Improving Drinking Water Quality. [Ph.D. Dissertation, The University of Sheffield]. Available online: https://etheses.whiterose.ac.uk/id/eprint/30179/.
3. Water Quality Prediction on a Sigfox-compliant IoT Device: The Road Ahead of WaterS10.1016/j.adhoc.2021.102749 ↗
4. Groundwater Quality Forecasting Using Machine Learning Algorithms for Irrigation Purposes10.1016/j.agwat.2020.106625 ↗
5. Machine Learning-Based Surrogate Modeling for Urban Water Networks: Review and Future Research Directions10.1029/2021WR031808 ↗
6. Lowe, M., Qin, R., and Mao, X. (2022). A Review on Machine Learning, Artificial Intelligence, and Smart Technology in Water Treatment and Monitoring. Water, 14.10.3390/w14091384 ↗
7. A Review of the Application of Machine Learning in Water Quality Evaluation10.1016/j.eehl.2022.06.001 ↗
8. Water Quality Prediction Using Machine Learning10.58864/mrijet.2023.10.1.8 ↗
9. Water Quality Prediction: A Data-Driven Approach Exploiting Advanced Machine Learning Algorithms with Data Augmentation10.2166/wcc.2023.403 ↗
10. Water Quality Prediction and Classification Using Machine Learning10.55248/gengpi.6.0525.1832 ↗
11. Garcia, J., Heo, J., and Kim, C. (2024). Machine Learning Algorithms for Water Quality Management Using Total Dissolved Solids (TDS) Data Analysis. Water, 16.10.3390/w16182639 ↗
12. Water Quality Analysis and Prediction Using Machine Learning
13. Comparative analysis of machine learning models for detecting water quality anomalies in treatment plants10.1038/s41598-025-15517-4 ↗
14. A Predictive Model of Recreational Water Quality Based on Adaptive Synthetic Sampling Algorithms and Machine Learning10.1016/j.watres.2020.115788 ↗
15. Hmoud Al-Adhaileh, M., and Waselallah Alsaade, F. (2021). Modelling and Prediction of Water Quality by Using Artificial Intelligence. Sustainability, 13.10.3390/su13084259 ↗
16. Water Quality Prediction Using Machine Learning Algorithms
17. Multiple Statistical Model Ensemble Predictions of Residual Chlorine in Drinking Water: Applications of Various Deep Learning and Machine Learning Algorithms10.1155/2022/7104752 ↗
18. Sharaan, M., Elshemy, M.M., Fujii, M., Ibrahim, M.G., and Nada, A.M. (2024). Water Quality Prediction and Classification for Drinking Water from Seawater Desalination Plants Using Machine Learning Algorithms. SSRN, 4999808.10.2139/ssrn.4999808 ↗
19. Using Multiple Machine Learning Algorithms to Optimize the Water Quality Index Model and Their Applicability10.1016/j.ecolind.2025.113299 ↗
20. Assessing the Feasibility of Using Machine Learning Algorithms to Determine Reservoir Water Quality Based on a Reduced Set of Predictors10.1016/j.ecolind.2025.113556 ↗
21. Machine Learning Methods for Better Water Quality Prediction10.1016/j.jhydrol.2019.124084 ↗
22. Water quality prediction using machine learning models based on grid search method10.1007/s11042-023-16737-4 ↗
23. Hybrid Decision Tree-Based Machine Learning Models for Short-Term Water Quality Prediction10.1016/j.chemosphere.2020.126169 ↗
24. Predicting water quality index using stacked ensemble regression and SHAP based explainable artificial intelligence10.1038/s41598-025-09463-4 ↗
25. Advanced Machine Learning Models for Robust Prediction of Water Quality Index and Classification10.2166/hydro.2025.290 ↗
26. Lokman, A., Ismail, W.Z.W., and Aziz, N.A.A. (2025). A Review of Water Quality Forecasting and Classification Using Machine Learning Models and Statistical Analysis. Water, 17.10.3390/w17152243 ↗
27. Chen, J., Wei, X., Liu, Y., Zhao, C., Liu, Z., and Bao, Z. (2024). Deep Learning for Water Quality Prediction—A Case Study of the Huangyang Reservoir. Appl. Sci., 14.10.3390/app14198755 ↗
28. Yan, X., Zhang, T., Du, W., Meng, Q., Xu, X., and Zhao, X. (2024). A Comprehensive Review of Machine Learning for Water Quality Prediction over the Past Five Years. J. Mar. Sci. Eng., 12.10.3390/jmse12010159 ↗
29. Artificial Ecosystem Optimization with Deep Learning Enabled Water Quality Prediction and Classification Model10.1016/j.chemosphere.2022.136615 ↗
30. Rizal, N.N.M., Hayder, G., and Yusof, K.A. (2022). Water Quality Predictive Analytics Using an Artificial Neural Network with a Graphical User Interface. Water, 14.10.3390/w14081221 ↗
31. Wang, X., Li, Y., Qiao, Q., Tavares, A., and Liang, Y. (2023). Water Quality Prediction Based on Machine Learning and Comprehensive Weighting Methods. Entropy, 25.10.3390/e25081186 ↗
32. Analysis and Prediction of Water Quality Using Deep Learning and Auto Deep Learning Techniques10.1016/j.scitotenv.2022.153311 ↗
33. Chen, H., Yang, J., Fu, X., Zheng, Q., Song, X., Fu, Z., Wang, J., Liang, Y., Yin, H., and Liu, Z. (2022). Water Quality Prediction Based on LSTM and Attention Mechanism: A Case Study of the Burnett River, Australia. Sustainability, 14.10.3390/su142013231 ↗
34. LSTM and GRU based Accurate Water Quality Prediction for Smart Aquaculture10.1088/1742-6596/2466/1/012027 ↗
35. Cai, H., Zhang, C., Xu, J., Wang, F., Xiao, L., Huang, S., and Zhang, Y. (2023). Water Quality Prediction Based on the KF-LSTM Encoder-Decoder Network: A Case Study with Missing Data Collection. Water, 15.10.3390/w15142542 ↗
36. Aquaculture 4.0: Hybrid Neural Network Multivariate Water Quality Parameters Forecasting Model10.1038/s41598-023-41602-7 ↗
37. Water Quality Index Prediction and Classification Using Hyperparameter Tuned Deep Learning Approach
38. Water Quality Prediction Based on Hybrid Deep Learning Algorithm
39. Im, Y., Song, G., Lee, J., and Cho, M. (2022). Deep Learning Methods for Predicting Tap-Water Quality Time Series in South Korea. Water, 14.10.3390/w14223766 ↗
40. Kontogiannis, S., Gkamas, T., and Pikridas, C. (2023). Deep Learning Stranded Neural Network Model for the Detection of Sensory Triggered Events. Algorithms, 16.10.3390/a16040202 ↗
41. Short-term runoff prediction with GRU and LSTM networks without requiring time step optimization during sample generation10.1016/j.jhydrol.2020.125188 ↗
42. Leakage detection in water distribution networks via 1D CNN deep autoencoder for multivariate SCADA data10.1016/j.engappai.2023.106062 ↗
43. Water Quality Prediction Using LSTM-RNN: A Review10.46754/jssm.2022.07.015 ↗
44. ThingsBoard (2021, November 10). ThingsBoard Open-source IoT Platform. Available online: https://thingsboard.io/.
45. Apache Foundation (2021, August 01). Cassandra, Open Source NoSQL Database. Available online: https://cassandra.apache.org/.
46. Kontogiannis, S., Koundouras, S., and Pikridas, C. (2024). Proposed Fuzzy-Stranded-Neural Network Model That Utilizes IoT Plant-Level Sensory Monitoring and Distributed Services for the Early Detection of Downy Mildew in Viticulture. Computers, 13.10.3390/computers13030063 ↗
47. ThingsBoard (2025, September 20). ThingsBoard Mobile Application. Available online: https://github.com/thingsboard/flutter_thingsboard_app.
48. A Water Quality Index—Crashing the Psycological Barrier
49. An Index Number System for Rating Water Quality
50. A review of water quality index models and their use for assessing surface water quality10.1016/j.ecolind.2020.107218 ↗
51. Patel, D.D., Mehta, D.J., Azamathulla, H.M., Shaikh, M.M., Jha, S., and Rathnayake, U. (2023). Application of the Weighted Arithmetic Water Quality Index in Assessing Groundwater Quality: A Case Study of the South Gujarat Region. Water, 15.10.3390/w15193512 ↗
52. Use of Index Analysis to Evaluate the Water Quality of a Stream Receiving Industrial Effluents
53. A Review of Genesis and Evolution of Water Quality Index (WQI) and Some Future Directions10.1007/s12403-011-0040-0 ↗
54. Sarvajayakesavalu, S. (2018). Evaluation of Water Quality Indices: Use, Evolution and Future Perspectives. Advances in Environmental Monitoring and Assessment, IntechOpen. Chapter 2.
55. World Health Organization (2025, November 15). Guidelines for Drinking-Water Quality: Fourth Edition Incorporating the First and Second Addenda, Available online: https://www.who.int/publications/i/item/9789240045064.
56. United States Environmental Protection Agency (2025, December 10). Drinking Water Regulations and Contaminants, Available online: https://www.epa.gov/ground-water-and-drinking-water/national-primary-drinking-water-regulations.
57. Psaropa, M.X., Kontogiannis, S., Lolis, C.J., Hatzianastassiou, N., and Pikridas, C. (2025). A Proposed Deep Learning Framework for Air Quality Forecasts, Combining Localized Particle Concentration Measurements and Meteorological Data. Appl. Sci., 15.10.20944/preprints202506.0687.v1 ↗
58. A Deep Learning Algorithm for Multi-Source Data Fusion to Predict Water Quality of Urban Sewer Networks10.1016/j.jclepro.2021.128533 ↗
59. Machine Learning-Based Evolution of Water Quality Prediction Model: An Integrated Robust Framework for Comparative Application on Periodic Return and Jitter Data10.1016/j.envpol.2025.125834 ↗
60. Ahmed, U., Mumtaz, R., Anwar, H., Shah, A.A., Irfan, R., and García-Nieto, J. (2019). Efficient Water Quality Prediction Using Supervised Machine Learning. Water, 11.10.3390/w11112210 ↗
61. EYATH, S.A. (2026, January 12). Water Measurements in the Area of Thessaloniki, Greece. Public Page Linking to Area-Level Water Quality Measurements and Historical Data. Available online: https://quality.eyath.gr/.
62. Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., and Isard, M. (2016, January 2–4). TensorFlow: A system for large-scale machine learning. Proceedings of the 12th USENIX Conference on Operating Systems Design and Implementation, OSDI’16, Savannah, GA, USA. Available online: https://dl.acm.org/doi/10.5555/3026877.3026899.