Abstract
We develop a distribution-free, unsupervised anomaly detection method called ECAD, which wraps around any regression algorithm and sequentially detects anomalies. Rooted in conformal prediction, ECAD does not require data exchangeability but approximately controls the Type-I error when data are normal. Computationally, it involves no data-splitting and efficiently trains ensemble predictors to increase statistical power. We demonstrate the superior performance of ECAD on detecting anomalous spatio-temporal traffic flow.
Introduction
Anomaly detection in real-world spatio-temporal systems—such as traffic networks, power grids, or server clusters—presents significant challenges. Observations are inherently dependent across space and time, data is often missing due to sensor failures, and the underlying probability distributions are typically unknown. Traditional Conformal Prediction (CP) methods, while powerful for uncertainty quantification, often rely on the assumption of exchangeability (i.i.d. data), which is violated in time-series contexts. Furthermore, many CP approaches require data splitting, which reduces the information available for model training.
The ECAD Framework
The authors introduce ECAD (Ensemble Conformal Anomaly Detection), a distribution-free framework designed to identify anomalies in complex spatio-temporal data. ECAD acts as a "wrapper" around any regression algorithm (e.g., RNN or Ridge Regression) and operates in two phases:
- Training Phase (Ensemble Approach): Instead of a single model, ECAD trains $B$ bootstrap models on available training data. It utilizes a Leave-One-Out (LOO) approach to calculate "conformity scores" (residuals). For each training point, residuals are computed using models that did not see that specific point, allowing the entire dataset to be used for both training and calibration without overfitting.
- Detection Phase (Sequential Testing): As new data arrives, the ensemble predicts the expected value and calculates a new residual. A p-value is derived by comparing this residual to the historical LOO residuals. If the p-value falls below a user-defined threshold $\alpha$, the point is flagged as an anomaly.
To address missing data, the framework incorporates an iterative imputation strategy before applying the detection logic.
Experimental Evaluation
The method was evaluated using a real-world Spatio-Temporal Traffic Flow Dataset consisting of hourly observations from 20 sensors over the year 2020. To simulate realistic conditions, 40% of the training data was randomly removed. Anomalies were synthetically defined based on local spatio-temporal percentiles, a ground truth hidden from the detectors during evaluation.
Results and Analysis
ECAD (using an RNN base model) was compared against 10 competitors, including unsupervised methods like Isolation Forest and supervised classifiers like Random Forest.
As shown in the table above, ECAD RNN consistently achieved the highest $F_1$ scores, ranging from 0.81 to 0.86. Notably, it maintained high recall (typically >0.90), successfully identifying the vast majority of true anomalies where standard methods like Isolation Forest failed due to spatio-temporal dependencies, often dropping below 0.10 recall.
Limitations and Visual Analysis
While ECAD demonstrates robust performance, its efficacy is sensitive to the base anomaly rate. At sensors where anomalies are extremely rare (e.g., Sensor 4 with only 0.66% anomalies), the "normal" model can dominate, leading to a higher relative rate of false positives.
The figure above illustrates this contrast. At Sensor 19, the p-values clearly distinguish anomalies, resulting in an $F_1$ score of 0.86. Conversely, at Sensor 4, the p-values are less discriminative, leading to a significantly lower $F_1$ score of 0.09. Additionally, the computational cost of training bootstrap ensembles, particularly with deep learning models, remains a consideration for massive-scale real-time applications.
Conclusion
ECAD provides a statistically grounded, data-efficient approach to anomaly detection that breaks the exchangeability barrier of traditional conformal prediction. By leveraging ensemble LOO residuals and a model-agnostic wrapper, it offers a powerful tool for monitoring complex, messy spatio-temporal systems. Future work includes exploring graph-based feature engineering and adapting the framework for classification tasks.
Summary updated