Multivariate functional data analysis and machine learning methods for anomaly detection in water quality sensor data
Xurxo Rigueira, David Nicholas Olivieri, María Araújo, Ángeles Saavedra, María Pazo · Environmental Modelling & Software · 2025
Reliable anomaly detection is crucial for water resources management, but the complexity of environmental sensor data presents challenges, especially with limited labeled data in water quality analysis. Functional data has experienced significant growth in anomaly detection, but most applications focus on unlabeled datasets. This study assesses the performance of multivariate functional data analysis and compares it with current machine learning models for detecting water quality anomalies on 18 years of expert-annotated data from four monitoring stations along Spain’s Ebro River. We propose and validate a multivariate functional model incorporating a new amplitude metric and a nonparametric outlier detector (Multivariate Magnitude, Shape, and Amplitude–MMSA). Additionally, a Random Forest-based machine learning architecture was developed for the same purpose, employing sliding windows and data balancing techniques. The Random Forest model demonstrated the highest performance, achieving an average F1 score of 93%, while MMSA exhibited robustness in scenarios with limited anomalous data or labels. • Developed a multivariate functional model utilizing directional outlyingness. • Presented machine learning classifiers with sliding windows & data balancing methods. • Functional model validated using Monte Carlo studies with state-of-the-art models. • Anomaly detection performance of all models evaluated on labeled water quality data.