Paper · 2020-04-01 · cs.LG, stat.ML
Anomaly Detection in Univariate Time-series: A Survey on the State-of-the-Art
Benchmarks 20 univariate time-series anomaly detectors (statistical, classical ML, neural) by test-set AUC on four Yahoo sets and the NYC taxi series, plus runtime. Author-reported: AR and MA lead on the Yahoo sets; deep models win only on NYC taxi, whose anomalies are contextual. No official code found.
Anomaly detectionTime series forecastingAutoencoderanomaly-detectiontime-seriesbenchmarksurvey
AI-compiled by claude-haiku-5-5 on 2026-11-08, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Anomaly detection on a time series means flagging moments where a signal stops behaving the way it usually does. Many methods exist, from old statistical forecasting models to classic machine-learning clustering and to neural networks. This paper asks which family works best. It picks 20 methods from the three families and runs them all on the same labelled series.
The main result, as the authors report it: simple statistical models score best on most of the test data and run fastest. Neural networks do better only on the one dataset whose anomalies look normal in isolation and become anomalous only in context. The neural models are also slow to run in some cases. Read the numbers as one team's benchmark, not a general verdict.
TL;DR
- 20 univariate detectors, grouped as statistical, classical ML and neural, are each scored by AUC on five labelled datasets §5.1 tab. 6.
- On the four Yahoo sets the statistical AR and MA models score highest, and neural models score lowest §6.1.
- On the NYC taxi set the neural models do better, but K-Means has the highest AUC in tab. 6 and the text does not discuss it §6.1.
- Runtime varies widely: AR and MA are the fastest, and LSTM and GRU are the slowest §6.2 tab. 7.
- Author-reported, one run per setting, no official code found.
Problem
Many detectors need a model of normal behaviour, and a forecast-residual detector is only as good as its forecaster §2.5. The authors note that no earlier study compared statistical, classical ML and deep methods on univariate series under one protocol §4.1. They also argue that anomalies in time series are often contextual or collective, not single outliers §2.5 §6.4.
Method
This is an evaluation study, not a new detector. Its method is the protocol below, applied to 20 existing detectors §5.1 §5.2.
Anomaly definition. An anomaly is a point or a run of points that departs strongly from the bulk of the data, and anomalies form a very small share of the series §2.1 §2.5. The paper studies point, collective and contextual anomalies §2.2.
Forecast-residual scoring. For forecast-based detectors, a model predicts each value from the w values before it. The error between prediction and observation is the anomaly score, and a point is flagged when the score exceeds a threshold δ §2.5 §3.3. The threshold is chosen on training data, but the paper does not give one rule for every method §3.3.
Statistical detectors §3.1.
- AR(p): a linear autoregression on p past values. Coefficients come from least squares. The residual is the score. The series must be stationary §3.1.
- MA(q): the current value is a linear combination of q past errors. There is no closed-form fit, so an iterative estimator is used §3.1.
- ARMA(p,q): combines AR and MA. Choosing p and q is the main difficulty §3.1.
- ARIMA: ARMA applied to a d-times differenced series, to remove trend §3.1.
- SES: exponentially weighted average, with smoothing α in [0,1] §3.1.
- Double and triple exponential smoothing: adds trend (β) and seasonal (γ) terms §3.1.
- PCI: a weighted average of neighbouring points, with a bound set from a Student t-factor, the residual standard deviation s and window k. A point outside the bound is an anomaly §3.1.
Classical ML detectors §3.2.
- K-Means on sliding subsequences (STSC): the score is the distance to the nearest centroid. A subsequence is an anomaly if the distance exceeds δ. The authors cite prior work that subsequence clustering may be uninformative §3.2.
- DBSCAN on values: points are core, border or anomaly. A point that is neither core nor border is an anomaly. The output is a label, not a score §3.2.
- LOF on windows: the test window is scored against the training windows, and the window is an anomaly when its LOF exceeds δ §3.2.
- Isolation Forest on windows: anomalies have short average path lengths. The score is 2 to the power of minus the mean path length over c(w) §3.2.
- One-class SVM: each window is mapped to a 2-D point [x_t, x_{t-1}] (for t>1) and an RBF one-class SVM is fitted on training data §3.2.
- XGBoost as a one-step forecaster. The threshold is a λ-percentile of the training errors. The paper does not state λ §3.2 tab. 4.
Neural detectors §3.3. All use a sliding window of past values as input, except as noted, and are scored by forecast residual.
- MLP: fully connected, one step ahead, residual threshold §3.3 fig. 8.
- CNN: 1-D convolution and max-pooling blocks, then a dense layer §3.3 fig. 9.
- CNN with batch normalization §3.3.
- CNN with a residual block: output is ψ(φ(x)+x), with φ a convolution block §3.3 fig. 10.
- WaveNet-style network with dilated convolutions, dilation doubling per layer §3.3 fig. 11 fig. 12.
- LSTM: a stateful two-layer network. Residual vectors over a prediction window are fitted to a multivariate Gaussian by maximum likelihood, and a point is flagged from its likelihood against δ §3.3 fig. 13 fig. 14. The text describes the LSTM input as one timestamp per step §3.3.
- GRU: the LSTM model with GRU cells §3.3 fig. 15.
- Autoencoder: encoder and decoder trained to reconstruct normal windows; the reconstruction error is the score §3.3 fig. 16.
Preprocessing §4.3 §5.1.
- Each dataset is standardized, (x − μ)/σ. The paper does not say whether μ and σ are per series or per dataset §4.3.1.
- Min-max normalization is avoided because it is sensitive to outliers §4.3.1.
- Detrending and deseasonalizing are discussed, but the paper reports no results with them §4.3.2 §6.
Protocol §5.1 §5.2.
- Each series is split 30% train, 70% test. Test series with no anomaly are dropped §5.1.
- Deep models use 10% of training data as validation §5.1. Table 2 instead says 0.1 of the test set tab. 2.
- Forecasting models are tuned on the naive-model metric NMM, the MSE of the model divided by the MSE of a predict-previous-value baseline. The authors aim to keep NMM below 1 §5.2.
- Score: AUC over the test points §4.4. Runtime is total training plus prediction time per dataset §4.4.
# Evaluation of one detector on one series [§5.1] [§4.4]
# Input: series (N,), labels (N,) in {0, 1}
# Output: AUC on the test split, or None
def evaluate(series, labels, detector):
# 1. Standardize the series [§4.3.1] (scope not stated)
series = (series - mean(series)) / std(series)
# 2. Split 30% train, 70% test [§5.1]
train, test = split(series, train_ratio=0.3)
train_labels, test_labels = split(labels, train_ratio=0.3)
# 3. Skip series with no anomaly in the test part [§5.1]
if not any(test_labels):
return None
# 4. Fit on train only; deep models use 10% of train as validation [§5.1]
model = fit(detector, train)
# 5. Score every test point [§2.5] [§3.1]-[§3.3]
scores = score(model, test)
# 6. AUC over the test points [§4.4]
return roc_auc(test_labels, scores)# Forecast-residual scoring [§2.5] [§3.3]
# Input: series (N,), window w, threshold delta
# Output: flag per point
def flag_anomalies(series, model, w, delta):
# 1. Build (window, next value) pairs from the series [§2.5]
inputs, targets = sliding_windows(series, w) # (N-w, w), (N-w,)
# 2. Predict the next value from each window [§3.3]
predictions = model(inputs) # (N-w,)
# 3. Residual as printed in the paper, not absolute [§3.3]
residuals = predictions - targets
# 4. Flag points whose residual exceeds the threshold [§3.3]
return residuals > deltaHyperparameters
Hardware: two Intel Xeon CPUs at 2.30 GHz, about 12.4 GB RAM, one Tesla K80 GPU with 12 GB. Every computation ran in a single process and thread tab. 1. The paper does not say whether the deep models trained on the GPU when timed.
Software: statsmodels for statistical models, scikit-learn for classical ML, TensorFlow and Keras for deep models §5.2.
Sliding window and splits tab. 2:
| Setting | Value | Notes |
|---|---|---|
| window w | 30 | listed for the Yahoo sets only; NYCT window not stated |
| train / test | 0.3 / 0.7 | all datasets |
| validation | 0.1 of test set | text says 10% of training data §5.1 |
Statistical models tab. 3:
| Model | Hyperparameter | Value |
|---|---|---|
| AR | max lag | 12·(|X_train|/100)^(1/4) |
| AR | fitting | conditional maximum likelihood by OLS |
| MA | max lag | same formula as AR |
| MA | error residual lag | w |
| MA | fitting | conditional maximum likelihood by OLS |
| ARIMA | max lag | same formula as AR |
| ARIMA | p, d, q | 1; d = 1 if trend else 0; 2 |
| ARIMA | fitting, max iter, tol | max conditional sum of squares; 500; 1e-8 |
| SES | α | grid search by MLE (grid not stated) |
| ES (double/triple) | α, β, γ | grid search by MLE (grid not stated) |
| PCI | k | 30 |
| PCI | α | 98.5 (text recommends 0.85 to 0.99 and k 3 to 15 §3.1) |
Classical ML tab. 4:
| Model | Hyperparameter | Value |
|---|---|---|
| K-Means | k | 4 |
| DBSCAN | ε, μ | 0.4, 5 |
| DBSCAN | distance | Euclidean |
| LOF | k | 10 |
| LOF | distance | Minkowski (order not stated) |
| Isolation Forest | trees | 10 |
| Isolation Forest | contamination | "find automatically" (method not stated) |
| One-class SVM | kernel | RBF |
| One-class SVM | outlier bound | 0.7 (mapping to ν not stated) |
| XGBoost | max depth, learning rate | 3, 0.1 |
| XGBoost | estimators, loss | 1000, MSE |
Deep models tab. 5:
| Model | Architecture | Filters / units | Training |
|---|---|---|---|
| MLP | 2 hidden layers, ReLU | 100, 50 | Adam, MSE, batch 32, 50 epochs |
| CNN | 3 conv + max-pool blocks, ReLU, dense 50 | filters 8, 16, 32; kernel 2 | Adam, MSE, batch 32, 50 epochs |
| CNN+BN | 2 conv + BatchNorm blocks, ReLU, dense 50 | filters 256, 256; kernel 3 | Adam, MSE, batch 32, 50 epochs |
| CNN+residual | 1 conv block + 1 residual block, dense 50 | filters 256, 256, 256; kernel 3 | Adam, MSE, batch 32, 50 epochs |
| WaveNet | 3 conv + max-pool blocks, dilation 1, 2, 4, dense 50 | filters 8, 16, 32 | Adam, MSE, batch 32, 50 epochs |
| LSTM | 2 stateful LSTM layers | 4, 4 | Adam, MSE, batch 32, 50 epochs |
| GRU | table says "2 stateful LSTM layers" | 4, 4 | Adam, MSE, batch 32, 50 epochs |
| Autoencoder | encoder 32, 16; decoder 16, 32; linear output | ReLU hidden | Adam, MSE, batch 32, 50 epochs |
Cited as tab. 5. Prediction horizon and LSTM reset rules are not stated.
Results
Author-reported. Setup: 20 detectors, five datasets, 30/70 split, AUC on the test points §5.1 §4.4. Datasets §4.2:
- UD1: 67 real Yahoo traffic series, about 1400 hourly steps, 1.9% anomalous.
- UD2: 100 synthetic Yahoo series, about 1421 steps, 0.3% anomalous, point anomalies inserted at random.
- UD3: 100 synthetic Yahoo series with seasonality, about 1680 steps, 0.3% anomalous.
- UD4: 100 synthetic Yahoo series with changepoints, about 1680 steps, 0.5% anomalous.
- NYCT: one NYC taxi-demand series, 10320 half-hour steps, five collective anomalies (marathon, Thanksgiving, Christmas, New Year, a snowstorm).
AUC per dataset tab. 6. The table in the paper is split in two; here it is combined. Values are copied as printed.
| Method | Family | UD1 | UD2 | UD3 | UD4 | NYCT |
|---|---|---|---|---|---|---|
| AR | statistical | 0.911394 | 0.994769 | 0.994116 | 0.975152 | 0.6369 |
| MA | statistical | 0.868123 | 0.994150 | 0.994245 | 0.986400 | 0.3938 |
| SES | statistical | 0.824894 | 0.932215 | 0.990782 | 0.969333 | 0.3452 |
| ES | statistical | 0.830289 | 0.957964 | 0.989360 | 0.971991 | 0.3423 |
| ARIMA | statistical | 0.8730 | 0.9891 | 0.990 | 0.9709 | 0.3583 |
| PCI | statistical | 0.522397 | 0.762529 | 0.674337 | 0.688257 | 0.5377 |
| K-Means | classical ML | 0.877623 | 0.923446 | 0.728037 | 0.663028 | 0.9137 |
| DBSCAN | classical ML | 0.806574 | 0.995251 | 0.696868 | 0.725566 | 0.5407 |
| LOF | classical ML | 0.814574 | 0.995116 | 0.951007 | 0.952523 | 0.5294 |
| iForest | classical ML | 0.803997 | 0.993984 | 0.952241 | 0.955123 | 0.4922 |
| OC-SVM | classical ML | 0.850292 | 0.995276 | 0.957272 | 0.939444 | 0.5859 |
| XGBoost | classical ML | 0.896743 | 0.968308 | 0.80231 | 0.85375 | 0.4602 |
| MLP | neural | 0.780471 | 0.71911 | 0.569883 | 0.558124 | 0.7962 |
| CNN | neural | 0.809449 | 0.74924 | 0.582761 | 0.581019 | 0.8181 |
| CNN+BN | neural | 0.785505 | 0.74815 | 0.581911 | 0.604943 | 0.76 |
| CNN+residual | neural | 0.819109 | 0.721279 | 0.575338 | 0.568564 | 0.7468 |
| WaveNet | neural | 0.8239 | 0.761423 | 0.579589 | 0.592414 | 0.8229 |
| LSTM | neural | 0.8121 | 0.7348 | 0.5781 | 0.5891 | 0.8404 |
| GRU | neural | 0.8025 | 0.7183 | 0.5711 | 0.5811 | 0.7978 |
| Autoencoder | neural | 0.782197 | 0.742767 | 0.602905 | 0.597238 | 0.6967 |
Author claims §6.1 §6.4 fig. 17 fig. 18:
- Statistical models have the best average AUC over UD1 to UD4, and the authors say four of the five best are statistical. The average plot fig. 17 is a figure, so its values are not reproduced here.
- Neural models score lowest on the Yahoo sets. The NYCT result is the reverse §6.1.
- The authors attribute the statistical models' NYCT failure to contextual anomalies, where the anomalous values look like normal ones §6.1.
Runtime, total on UD1-UD4 (367 series) and per series tab. 7:
| Method | UD1-4 total (s) | Per series (s) |
|---|---|---|
| AR | 51 | 0.139 |
| MA | 17 | 0.046 |
| SES | 2910 | 7.93 |
| ES | 13268 | 36.15 |
| ARIMA | 72422 | 197.3351 |
| PCI | 374 | 1.02 |
| K-Means | 190 | 0.52 |
| DBSCAN | 319 | 0.87 |
| LOF | 319 | 0.87 |
| iForest | 38451 | 104.77 |
| OC-SVM | 210 | 0.57 |
| XGBoost | 14 | 0.38 |
| MLP | 7396 | 20.15 |
| CNN | 10824 | 29.49 |
| CNN+BN | 12938 | 35.38 |
| CNN+residual | 37038 | 100.92 |
| WaveNet | 17252 | 47.0 |
| LSTM | 54083 | 147.36 |
| GRU | 49756 | 135.57 |
| Autoencoder | 9413 | 25.65 |
Training and inference on NYCT, in seconds tab. 8:
| Method | Training | Inference |
|---|---|---|
| AR | 0.1004 | 0.1004 |
| MA | 0.1404 | 0.6423 |
| SES | 125.26 | 5.06 |
| ES | 989.49 | 9.5115 |
| ARIMA | 1482.87 | 1481.56 |
| PCI | 2.85 | 0.0093 |
| K-Means | 0.25845 | 1.99455 |
| DBSCAN | 0.0879 | 8.3774 |
| LOF | 0.0917 | 5.5646 |
| iForest | 5.5646 | 787.29 |
| OC-SVM | 0.02 | 2.98 |
| XGBoost | 0.1187 | 0.0205 |
| MLP | 4.439 | 0.561 |
| CNN | 48.322 | 0.6783 |
| CNN+BN | 39.2339 | 0.7661 |
| CNN+residual | 111.36 | 1.6401 |
| WaveNet | 23.263 | 0.737 |
| LSTM | 1067 | 1086 |
| GRU | 813.021 | 385.979 |
| Autoencoder | 17.459 | 0.5406 |
Author claims §6.2: AR and MA are fastest. Some deep models infer fast, but LSTM and GRU infer slowly, more than most classical methods §6.2.
Paper vs code
No official code. The paper gives no code link and no project page. Searches of GitHub for the author names and for title words returned no repository tied to the authors.
Pitfalls
- Threshold rule is unstated for most methods. The paper says the threshold comes from training data §3.3 but gives no rule for MLP, CNN, WaveNet, LSTM or GRU. AUC does not need a threshold, but any deployed use does.
- Scores are unclear for binary-output methods. DBSCAN outputs a label §3.2 and the paper does not say how it obtained a continuous score for AUC. The same question applies to K-Means in its binary form.
- Sign and direction of the residual rule. Forecast detectors flag when
prediction - target > δ§3.3. The autoencoder and the other residual rules use a norme = ‖x − x̂‖§3.3. Using the signed rule would miss the opposite-direction errors. - LSTM likelihood rule reads inverted. The paper says a point is an anomaly
when
P(e) > δ§3.3. An anomaly should have low likelihood. Read the rule as a low-likelihood test, and treat the printed form as a likely typo. - PCI formula. The weighted-average denominator is written as an unweighted sum of the X values §3.1. Normalize by the sum of weights unless the paper says otherwise, and note that the one-sided and two-sided windows differ in the factor k versus 2k §3.1.
- PCI parameters are outside the recommended range. The paper recommends k between 3 and 15 and α between 0.85 and 0.99 §3.1, but Table 3 uses k = 30 and α = 98.5 tab. 3.
- Validation split conflicts. Text says 10% of training data §5.1; Table 2 says 0.1 of the test set tab. 2.
- NYCT window length. Table 2 lists w = 30 for the Yahoo sets only tab. 2. The window for NYCT is not stated.
- Standardization scope. Per series or per dataset is not stated §4.3.1. The dataset-level choice changes the scale for every series.
- Duplicate timing values. The DBSCAN and LOF rows in tab. 7 are identical, and tab. 8 gives AR's training and inference times as the same value. The paper does not explain these. Treat them as possible copy errors.
- Series count mismatch. The runtime section counts 367 series §6.2, and the conclusion says 368 §7.
- K-Means on NYCT. tab. 6 marks K-Means as highest on NYCT (0.9137), and the text does not discuss it §6.1.
- Figure captions. The NYCT figure caption repeats the UD1-UD4 average caption fig. 18. The seasonal-data caption describes a stock price, while the text describes a home-sales index fig. 4 §2.4.
- Typos in the hyperparameter table. The GRU row says "2 stateful LSTM layers" tab. 5. The text says GRU equals the LSTM model except for cell type §3.3.
- Isolation Forest notation. The paper writes c(w) and c(p) for the same normalizer §3.2.
- OC-SVM. The "upper bound of outliers 0.7" is not mapped to ν tab. 4. Window-to-2-D mapping is described for t > 1 only §3.2.
- Stateful LSTM and GRU. The paper does not state when state is reset.
- Deep timing on GPU. The paper does not say whether training and inference times used the GPU tab. 1.
- Author-reported single runs. Table values are single numbers without variance or seeds, and the test series are short (roughly 1400 to 1680 steps).
- The "best" average claim depends on Figure 17, which this card does not reproduce.
Lineage
- Uses the NYC taxi series from the Numenta Anomaly Benchmark §4.2. The wiki card for that benchmark is NAB.
- Related work the paper cites: forecasting comparisons such as the M3 competition, a 22-algorithm IoT comparison, and FuseAD, DeepAnT and TwitterAD §4.1.
- Superseded by: not stated.
Source and license
Adapted from “Anomaly Detection in Univariate Time-series: A Survey on the State-of-the-Art” by Mohammad Braei, Sebastian Wagner (arXiv:2004.00433), used under CC BY-SA 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. This page is licensed under CC BY-SA 4.0.