Abstract
To ensure undisrupted business, large Internet companies need to closely monitor various KPIs (e.g., Page Views, number of online users, and number of orders) of its Web applications, to accurately detect anomalies and trigger timely troubleshooting/mitigation. However, anomaly detection for these seasonal KPIs with various patterns and data quality has been a great challenge, especially without labels. In this paper, we proposed Donut, an unsupervised anomaly detection algorithm based on VAE. Thanks to a few of our key techniques, Donut greatly outperforms a state-of-arts supervised ensemble approach and a baseline VAE approach, and its best F-scores range from 0.75 to 0.9 for the studied KPIs from a top global Internet company. We come up with a novel KDE interpretation of reconstruction for Donut, making it the first VAE-based anomaly detection algorithm with solid theoretical explanation.
Introduction
Large internet companies monitor thousands of Key Performance Indicators (KPIs) to ensure service reliability. These KPIs are typically "seasonal," meaning they follow daily or weekly cycles (e.g., traffic peaks at noon and dips at 3 AM). Detecting anomalies in these streams is notoriously difficult because "normal" behavior shifts slightly over time, manual labeling across thousands of streams is impossible, and real-world data is often "dirty," containing missing values or existing anomalies that can bias models during training.
Methodology: The Donut Framework
Donut builds on the Variational Auto-Encoder (VAE), a generative model that learns to compress input data ($x$) into a low-dimensional latent space ($z$) and then reconstruct it. The core idea is that the model learns the "normal" patterns; when it encounters an anomaly, it fails to reconstruct it accurately, resulting in a high "reconstruction probability" score.
The authors introduce three key innovations to make VAEs work for KPIs:
- Modified ELBO (M-ELBO): Standard VAE training treats all data points equally. M-ELBO allows the model to ignore known missing points or labeled anomalies during training, preventing the model from "learning" what an anomaly looks like.
- Missing Data Injection: To make the model more robust, the authors randomly "inject" missing values into the training data. This forces the model to learn how to reconstruct the entire window even when parts of the input are missing.
- MCMC Imputation: During the detection phase, if a sliding window contains missing data, Donut uses a Markov Chain Monte Carlo (MCMC) technique to "fill in" the gaps with likely normal values before calculating the anomaly score.
Datasets and Evaluation
The researchers evaluated Donut using 18 real-world business KPIs from a top global internet company (Alibaba). The data was sampled at 1-minute intervals over several weeks to capture multiple seasonal cycles. The paper highlights three specific datasets ($\mathcal{A}$, $\mathcal{B}$, and $\mathcal{C}$) representing low, medium, and high levels of noise and variation to demonstrate the model's versatility.
Key Insights and Theoretical Contributions
- The KDE Interpretation: The authors provide a solid theoretical bridge, showing that the VAE's reconstruction probability can be viewed as a weighted Kernel Density Estimation (KDE) in latent space. This explains why the model works: it's essentially checking if a new data point "fits" the cluster of normal points in the compressed latent space.
- The Time Gradient Effect: They discovered that the latent space naturally organizes itself by time of day. This "time gradient" allows the model to generalize across different days without needing an explicit "time" input.
- Training on Anomalies: Contrary to the common intuition that unsupervised models should only be trained on "clean" data, the authors show that training on data containing anomalies (using M-ELBO) is actually more effective for real-world deployment.
Key Results
- Superior Performance: Donut achieved F-scores between 0.75 and 0.9, significantly outperforming both a baseline VAE and Opprentice, a state-of-the-art supervised ensemble algorithm, especially when labels were limited.
- Robustness: The model maintained high accuracy even when 90% of the anomaly labels were removed, proving its effectiveness as an unsupervised tool.
- Efficiency: By using simple fully-connected layers rather than complex recurrent networks, Donut remains fast enough for practical large-scale deployment.
Limitations and Future Work
While Donut is robust, hyperparameter sensitivity (latent dimension $K$ and window size $W$) remains a challenge in purely unsupervised settings. Additionally, while the sliding window captures some context, the authors suggest that incorporating RNN architectures (like LSTMs) into the Donut framework could better handle long-term dependencies and complex correlations across points.
Summary updated