Autoencoder-based Anomaly Detection in Streaming Data with Incremental Learning and Concept Drift Adaptation

Jin Li, Kleanthis Malialis, Marios M. Polycarpou

TL;DR

The paper introduces strAEm++DD, a novel unsupervised framework for detecting anomalies in streaming data. By combining an autoencoder’s incremental learning with an active statistical drift detection mechanism (the Mann-Whitney U test), the model successfully adapts to shifting data distributions ("concept drift") even under conditions of extreme class imbalance and total lack of labels.

What Problem Does This Paper Address?

Anomaly detection in the real world is rarely a static problem. Researchers face three primary hurdles when dealing with data streams (like network traffic or sensor feeds):

  1. Label Unavailability: In most live applications, we don't have "ground truth" labels telling us what is an anomaly and what isn't.
  2. Extreme Class Imbalance: Anomalies are, by definition, rare. This makes it easy for models to ignore them or become biased toward the "normal" majority.
  3. Concept Drift: The definition of "normal" changes over time (e.g., seasonal changes in water usage). A model trained on last year's data might flag today's perfectly normal behavior as an anomaly.

Existing methods are often purely "passive" (slowly updating) or "active" (resetting based on triggers). This paper seeks a hybrid approach that handles all three challenges simultaneously.

Methods

The authors propose strAEm++DD (Streaming Autoencoder with Drift Detection). The architecture consists of several moving parts:

  • The Core Model (strAEm++): An Autoencoder (AE) that learns to compress and reconstruct "normal" data. It uses a sliding window to store recent instances and updates its weights incrementally.
  • Dynamic Thresholding: Instead of a fixed anomaly threshold, the model calculates a threshold based on the $b$-th percentile of recent reconstruction losses. If a new data point’s reconstruction error exceeds this dynamic threshold, it’s flagged as an anomaly.
  • Active Drift Detection (The "DD" part): This is the paper's key innovation. The system maintains a "reference" window of losses and a "moving" window. It uses the Mann-Whitney U Test—a non-parametric statistical test—to determine if the distribution of losses in the moving window has significantly shifted away from the reference.
  • Warning vs. Alarm:
    • A Warning flag pauses incremental learning and starts buffering data into a "warning window."
    • An Alarm flag triggers a "hard reset," where a brand-new autoencoder is initialized and trained on the buffered data to quickly adapt to the new "normal."

Datasets

The researchers evaluated the model on both synthetic and real-world datasets, modified to simulate streaming conditions with 1% (severe) and 0.1% (extreme) anomaly rates:

  • Sea & Circle: Synthetic 2D datasets where the "normal" and "anomalous" regions are abruptly swapped to simulate extreme concept drift.
  • MNIST-01: Using handwritten digits '0' and '1', where drift is introduced by shifting the image pixels.
  • MNIST-23: A more complex scenario where the majority/minority classes are swapped between digits 0-3.

Key Insights and Ideas

  • Loss as a Proxy for Drift: The most elegant idea here is using the Autoencoder's reconstruction error as the signal for drift detection. If the model suddenly gets much worse at reconstructing data it usually handles well, the environment has likely changed.
  • The Power of Non-Parametrics: By using the Mann-Whitney U test, the authors avoid making assumptions about the "shape" of the data distribution (e.g., assuming it's Gaussian), making the detector much more robust to different types of data.
  • Less is More in Training: The empirical analysis showed that a small number of training epochs (1–10) per update actually performs better than extensive training. This prevents the model from "overfitting" to the most recent noise or potential anomalies in the stream.
  • Synergy of Active and Passive: Purely incremental models (passive) take too long to recover after a major drift. Purely active models might reset too often. The "Warning" buffer acts as a safety net, ensuring that if a reset is needed, the model has a high-quality "new" dataset ready to go.

Key Results

The authors used the G-mean (geometric mean of recall for both classes) as their primary metric, as standard accuracy is misleading when 99.9% of data is normal.

  • Superior Recovery: In the "Sea" and "Circle" tests, strAEm++DD recovered to a G-mean of ~0.8–0.9 almost immediately after a drift event, while the purely incremental version (strAEm++) took thousands of steps to catch up.
  • Outperforming Baselines: The proposed method significantly outperformed iForest++ (an incremental version of Isolation Forest) and a static Baseline model across all non-stationary scenarios.
  • Robustness to Extremes: The model maintained high performance even when the anomaly rate was dropped to 0.1%, proving it can handle "needle in a haystack" scenarios.

Limitations and Future Work

  • Hyperparameter Sensitivity: The performance is tied to the window size ($W_{train}$) and the percentile ($b$). While the paper provides heuristics, these currently require manual tuning based on the expected frequency of drift.
  • Recovery Gaps: In the MNIST-23 dataset, while the model outperformed others, it didn't fully recover to its pre-drift performance levels, suggesting that very high-dimensional drift is still a significant challenge.
  • Future Directions: The authors suggest exploring different types of Autoencoders (like Variational AEs) or ensemble methods to further improve the stability of the unsupervised learning process.

Summary updated

BibTeX
@inproceedings{li2023autoencoder,
  author = {Jin Li and Kleanthis Malialis and Marios M. Polycarpou},
  title = {{Autoencoder-based Anomaly Detection in Streaming Data with Incremental Learning and Concept Drift Adaptation}},
  booktitle = {IJCNN},
  year = {2023},
  doi = {10.1109/ijcnn54540.2023.10191328},
}
Figure