AI-enabled root-cause diagnosis of water quality anomalies in continuous monitoring networks using a retrieval-augmented generation (RAG) approach
Abstract
Real-time sensor networks are widely used to monitor the quality of surface waters; however, translating detected anomalies into clear operational actions remains challenging. Deep learning (DL) models can detect deviations effectively, but they rarely provide interpretable or regulation-relevant explanations, and existing explainable artificial intelligence (XAI) tools offer limited practical value for water utilities. This study introduces a framework, Water Quality- Retrieval Augmented Generation (WQ-RAG), that integrates DL-based anomaly detection with RAG to enable automated, regulation-grounded root-cause diagnosis of water quality events. The framework was evaluated using high-frequency monitoring data from 2021 to 2024 at four geographically and hydrogeochemically diverse river monitoring stations operated by the U.S. Geological Survey (USGS). Among four anomaly detection models, a Long Short-Term Memory (LSTM) autoencoder achieved the highest F1-scores at three stations (0.799-0.841), while the Patch Time Series Transformer (PatchTST) showed the strongest discrimination, measured by the area under the receiver operating characteristic (ROC) curve (AUC-ROC: 0.860-0.906). Adaptive, station-specific thresholding improved detection performance by up to 61% at low-variance source water. Using a curated knowledge base of 25 regulatory and technical documents, RAG-grounded explanations generated by a large language model (LLM) (Llama-3-8B) achieved a mean quality score of…
Read the paper
Related studies
- Animal models of schizophrenia
- Retrieval Augmented Visual Question Answering with Outside Knowledge
- Fine-grained Late-interaction Multi-modal Retrieval for Retrieval Augmented Visual Question Answering
- Understand What LLM Needs: Dual Preference Alignment for Retrieval-Augmented Generation
- Retrieval-Augmented Embodied Agents
- Retrieving, Rethinking and Revising: The Chain-of-Verification Can Improve Retrieval Augmented Generation
Go deeper in Evidence Hub
Evidence Hub adds a study data sheet (design, sample size, evidence level, key numbers), an AI summary and a chat grounded in the paper's text.