An AI-Driven Environmental Informatics Framework for Real-Time Water Quality Monitoring and Anomaly Detection
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
The degradation of freshwater resources caused by industrialization, urban expansion, and climate change necessitates intelligent, data-driven monitoring systems that address the limitations of conventional laboratory-based methods. This study proposes an AI-driven environmental informatics framework for real-time water quality monitoring and anomaly detection by integrating Internet of Things (IoT) sensor data with advanced machine learning models. The framework employs a dual-model architecture that combines a Long Short-Term Memory Autoencoder (LSTM-AE) for unsupervised anomaly detection and a Random Forest Regressor for Water Quality Index (WQI) prediction, forming a unified analytics pipeline for continuous environmental assessment. A synthetic multivariate time-series dataset of 10,000 records from five monitoring stations was used, incorporating parameters such as pH, dissolved oxygen, turbidity, temperature, electrical conductivity, and nitrate concentration. The LSTM-AE, trained exclusively on normal patterns using 24-hour sliding windows, achieved a high ROC-AUC score of 0.9763, demonstrating strong capability in identifying abnormal water quality events. Statistical features derived from the same sequences were used to train the Random Forest model, which achieved a Mean Squared Error (MSE) of 2.3573, indicating accurate WQI prediction. Comparative evaluation with an Isolation Forest baseline confirmed the superior performance of the proposed model, though challenges persist in detecting rare contamination events. The framework supports real-time data ingestion, preprocessing, and analysis, enabling early warning systems and reliable assessment. Its scalable design allows integration with monitoring infrastructures and decision-support platforms, supporting proactive water management, regulatory compliance, and sustainable governance.