An Explainable AI Model for Anomaly Detection in Water Quality Data
摘要
Detecting anomalies in water quality data is critical for ensuring safe and reliable water supplies. This study introduces an explainable, iterative, multitemporal machine learning algorithm based on decision trees to detect and characterize temporal anomalies. The model partitions time series into sliding windows at three temporal scales, capturing multivariate relationships across distinct chronological levels. Iterative training enables the classification of new data subsets, progressively refining the learned expert criteria and expanding the anomaly set. To improve interpretability, we developed the Visual Decision Paths Representation (VDPR) algorithm, which provides visual insights into variable importance, learned thresholds, and sample-level classification reasoning. Across all monitoring stations, the model achieved an average F1 score of 99% and an error rate below 1%. By comparing individual samples with the broader dataset, VDPR delivers deeper interpretability than state-of-the-art methods that focus fundamentally on variable importance while preserving strong predictive performance across varied environmental conditions and stations.
Graphical abstract