Intelligent Water Quality Forecasting and Monitoring System based on Water Quality Index using Machine Learning and IoT Techniques
Main Article Content
Abstract
This research utilizes Internet of Things (IoT) technology and Machine Learning (ML) to develop a prototype for a smart water quality forecasting and monitoring system. The study focuses on analyzing the Reduced Water Quality Index (rWQI) based on water temperature, pH, and Total Dissolved Solids (TDS). To forecast water quality 1 to 6 hours in advance, the performance of four predictive models was evaluated and compared: Extremely Randomized Trees (ET), Random Forest (RF), Simple Linear Regression (LR), and Multiple Linear Regression (MLR). The efficiency of these algorithms was validated using four key evaluation metrics: Coefficient of Determination (R2), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and Symmetric Mean Absolute Percentage Error (sMAPE). The experimental results indicated that the predictive performance of the models varied significantly depending on the forecasting horizon. In the short-term horizon (1–3 hours ahead), the RF model achieved the highest performance, with an R² of 0.566 and an MAE of 5.215 in the first hour. Conversely, for long-term forecasting (4–6 hours ahead), all models exhibited a significant drop in performance (R² < 0), yielding higher prediction errors than the Mean Baseline. This long-term limitation stems from high water quality volatility in real-world environments combined with error accumulation in multi-step ahead forecasting. In conclusion, these findings emphasize that aligning model selection with the specific forecasting horizon is critical for enhancing system efficiency and stability. The developed model demonstrates high accuracy and suitability for short-term early warnings within 3 hours. This knowledge enables operators to plan water quality management with precision and speed, thereby reducing operational costs and the risk of aquatic livestock loss. Furthermore, this system serves as a technological prototype in digital agriculture, elevating conventional water quality monitoring into proactive management through intelligent technology.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
The Journal of Science and Science Education (JSSE) retain the right of all articles published in JSSE. The coresponding author or the authorized person on behalf of the authors must send the complete Copyright Transfer Form to JSSE before any article get published in JSSE.
Copyright Transfer Form
The JSSE request the coresponding author or the authorized person on behalf of the authors upload the manuscript under the together with the Copyright Transfer Form under the supplementary data. The guidline for uploading both manuscript and Copyright Transfer Form is shown below:
1. Upload the manuscript in the sub-menu, Article Component > Article Text.
2. Upload the the Copyright Transfer Form in the sub-menu, Article Component > Other.
Download Copyright Transfer Form
References
Al-Shareeda, M. A., Ali, A. M., Hammoud, M. A., Kazem, Z. H. M. and Hussein, M. A. (2025). Secure IoT-based real-time water level monitoring system using ESP32 for critical infrastructure. Journal of Cyber Security and Risk Auditing, 2025(2), 44-52.
Arthi, P., Mahesh, N., Saipurusoth, H. and Janardhanam, B. (2024). IoT based smart aquaculture monitoring system for fish tank management. Journal of Ubiquitous Computing and Communication Technologies, 6(3), 214–227.
Bakar, A. A., Bakar, Z., Yusoff, Z., Ibrahim, M., Mokhtar, N. and Zaiton, S. (2025). IoT-based real-time water quality monitoring and sensor calibration for enhanced accuracy and reliability. International Journal of Interactive Mobile Technologies, 19(1), 155–170.
Boyd, C. E. (1990). Water quality in ponds for aquaculture. Birmingham: Birmingham Publishing Co.
Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32.
Brown, R. M., McClelland, N. I., Deininger, R. A. and Tozer, R. G. (1970). A water quality index-do we dare?. Water and Sewage Works, 117(10), 339–343.
Dayaday, M. G. and Namoco, C. S. (2021). An innovative real-time water quality monitoring system for aquaculture application. Journal of Engineering and Applied Sciences, 16(24), 2737-2740.
De Oliveira, A. R. M., Borges, A. C., Da Silva, G. J. and Nascimento, M. (2022). Development of a water quality index with a reduced number of parameters. Engenharia Agrícola, 42(3), e20220006.
Department of Fisheries. (2024). Director-general of the department of fisheries reveals ornamental fish and Thai Siamese fighting fish are popular worldwide, generating over 1,000 million baht in exports (in Thai). Retrieved 30 May 2026, from Department of Fisheries: https://www4.fisheries.go.th/local/index.php/main/view_activities/1210/255678
Duangwongsa, J., Ungsethaphand, T., Akaboot, P., Khamjai, S. and Unankard, S. (2022). Real-time water quality monitoring and notification system for aquaculture. Proceedings of IEEE International Conference on Internet of Things and Intelligence System (pp. 1–6). Bali, Indonesia.
Fandiño Pelayo, J. S., Mendoza Castellanos, L. S., Cazes Ortega, R. and Hernández-Rojas, L. G. (2025). AI-driven monitoring for fish welfare in aquaponics: a predictive approach. Sensors, 25(19), 6107.
Forhad, H. M., Uddin, M. R., Chakrovorty, R. S., Ruhul, A. M., Faruk, H. M., Kamruzzaman, S., Sharmin, N., Jamall, A. S. M. M., Haque, M. M. and Morshed, A. K. M. (2024). IoT based real-time water quality monitoring system in water treatment plants (WTPs). Heliyon, 10(23), e40746.
Gaya, M. S., Abba, S. I., Abdu, A. M., Tukur, A. I., Saleh, M. A., Esmaili, P. and Wahab, N. A. (2020). Estimation of water quality index using artificial intelligence approaches and multi-linear regression. IAES International Journal of Artificial Intelligence, 9(1), 126–134.
Geurts, P., Ernst, D. and Wehenkel, L. (2006). Extremely randomized trees. Machine Learning, 63(1), 3–42.
Hridoy, M. A. A. M., Shawkat, A. I., Bordin, C., Acharjee, M. R., Masood, A., Baki, A. O. and Al Mamun, M. A. (2025). Advanced machine learning models for accurate water quality classification and WQI prediction: Implications for aquatic disease risk management. Science of The Total Environment, 1008, 180965.
Jais, N. A. M., Abdullah, A. F., Kassim, M. S. M., Abd Karim, M. M. and Muhadi, N. A. (2024). Improved accuracy in IoT-Based water quality monitoring for aquaculture tanks using low-cost sensors: Asian seabass fish farming. Heliyon, 10(8), e29022.
Mohd Zebaral Hoque, J., Ab. Aziz, N. A., Alelyani, S., Mohana, M. and Hosain, M. (2022). Improving water quality index prediction using regression learning models. International Journal of Environmental Research and Public Health, 19(20), 13702.
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, É. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12(85), 2825–2830.
Palabıyık, S. and Akkan, T. (2024). Evaluation of water quality based on artificial intelligence: performance of multilayer perceptron neural networks and multiple linear regression versus water quality indexes. Environment, Development and Sustainability, 26(6), 7521–7545.
Palconit, M., Concepcion, R. S, Tobias, R. R., Alejandrino, J., Almero, V. J. D, Bandala, A. A, Vicerra, R. R. P., Sybingco, E. and Dadios, E. P. (2021). Development of IoT-based fish tank monitoring system. In Proceedings of the 2021 IEEE 13th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control Environment (HNICEM) (pp. 1–6). Manila, Philippines.
Patel, D., Kiradia, K. and Sharma, P. (2025). IoT-Based Water Quality Monitoring System using ESP32. International Journal for Research in Applied Science and Engineering Technology, 13(4), 4942–4949.
Shams, M. Y., Elshewey, A. M., El-Kenawy, E. S. M., Ibrahim, A., Talaat, F. M. and Tarek, Z. (2023). Water quality prediction using machine learning models based on grid search method. Multimedia Tools and Applications, 83, 35307–35334.
Siswanto, B., Dani, Y., Morika, D. and Mardiyana, B. (2023). A simple dataset of water quality on aquaponic fish ponds based on an internet of things measurement device. Data in Brief, 48, 109218.
Stojanovic, N. and Chaudhary, S. (2023). Real-time water quality monitoring in aquaculture using IoT sensors and cloud-based analytics. Research Journal of Computer Systems and Engineering, 4(2), 174–187.
Straits Research. (2024). Ornamental fish market size, share and trends analysis report by type (tropical freshwater, temperate freshwater, marine), by application, by distribution channel, and segment forecasts 2024–2032. Retrieved 30 May 2026, from Straits Research: https://straitsresearch.com/report/ornamental-fish-market
Zhu, M., Wang, J., Yang, X., Zhang, Y., Zhang, L., Ren, H., Wu, B. and Ye, L. (2022). A review of the application of machine learning in water quality evaluation. Eco-Environment and Health, 1(2), 107–116.