End-To-End Self-Tuning Self-Supervised Time Series Anomaly Detection

Boje Deforce, Meng-Chieh Lee, Bart Baesens, Estefanía Serral Asensio, Jaemin Yoo, Leman Akoglu · DOI

TL;DR

TSAP (Time Series Anomalies on autoPilot) is the first framework to automatically tune both discrete and continuous data augmentation hyperparameters for self-supervised time series anomaly detection without requiring any labels. By utilizing a differentiable augmentation model and an unsupervised alignment loss based on Wasserstein distance, it effectively "mimics" unknown real-world anomalies to train highly accurate detectors.

What Problem Does This Paper Address?

Time Series Anomaly Detection (TSAD) is critical for everything from monitoring heart rates to industrial sensors. Recently, Self-Supervised Learning (SSL) has become the go-to approach: you take "normal" data, apply augmentations to create "pseudo-anomalies," and then train a model to tell the difference.

The catch? The detector is only as good as its augmentations. If your pseudo-anomalies (e.g., a simple spike) don't look like the real-world anomalies (e.g., a subtle trend shift), the model fails. Currently, choosing the right augmentation type and its parameters (like the duration or severity of a shift) is a manual, "guess-and-check" process that often requires labeled validation data—which defeats the purpose of unsupervised learning. TSAP aims to automate this selection process entirely "on autopilot."

Methods

TSAP introduces a two-pronged architecture to make augmentation searchable and tunable:

  1. Differentiable Augmentation Module: Instead of using hard-coded rules, TSAP implements augmentations via a pre-trained Encoder-Decoder neural network ($f_{aug}$). This allows the system to generate pseudo-anomalies that are differentiable with respect to their hyperparameters (like "level" or "length"), enabling gradient-based optimization.
  2. Self-Tuning Module: This is an online process that alternates between two phases:
  3. Detection Phase: The detector ($f_{det}$) learns to distinguish between normal training data and the current batch of pseudo-anomalies.
  4. Alignment Phase: The system updates the augmentation hyperparameters to minimize an unsupervised validation loss ($L_{val}$). This loss uses the Wasserstein distance to measure how well the distribution of augmented data aligns with the distribution of the unlabeled test data in a learned embedding space.
The TSAP framework: An offline differentiable augmentation module and an online self-tuning engine.

For discrete choices (e.g., deciding if the anomaly is a "Trend" vs. a "Mean Shift"), TSAP performs a grid search across a catalog of anomaly types, selecting the one that achieves the best alignment score.

Datasets

The authors evaluated TSAP on two primary sources:

  • PhysioNet (ECG): Real-world electrocardiogram recordings. To test continuous tuning, the authors manually injected six types of anomalies: Trend, Extremum, Amplitude, Mean shift, Frequency shift, and Platform.
  • CMU Motion Capture (MoCap): A "natural" anomaly dataset where walking signals are considered normal, while jumping and running signals are treated as anomalies. This tested TSAP's ability to identify unknown anomaly types in the wild.
Examples of the six anomaly types used to benchmark the system.

Key Insights and Ideas

  • Alignment is the Proxy for Labels: The core "aha" moment is that you don't need labels if you can measure distribution alignment. If your generated pseudo-anomalies "look like" the unlabeled test data in a high-dimensional embedding space, the detector trained on them will generalize well to the real anomalies.
  • Distributional Metrics over Point-wise: The authors found that simple point-wise validation losses fail because they favor trivial solutions (like making the anomaly invisible). Using the Wasserstein distance captures the "shape" of the data distribution, which is essential for identifying subtle time-series patterns.
  • Differentiability is the Enabler: By making the augmentation process a neural network, the "search" for the best hyperparameters becomes a standard optimization problem rather than an exhaustive search.

Key Results

TSAP consistently outperformed established baselines, including traditional methods (LOF, ARIMA, Isolation Forest) and state-of-the-art deep learning models like NeuTraL-AD and USAD.

  • Quantitative: TSAP achieved the best overall rank across all six tasks in both $F_1$ score and AUROC. For example, on several PhysioNet tasks, it achieved a perfect 1.000 AUROC where other deep learning methods struggled due to noisy data.
  • Qualitative: The framework successfully "discovered" the parameters of hidden anomalies. As shown in the figure below, the estimated "level" and "length" of anomalies converged closely to the true (but hidden) values during the tuning process.
Figure 2: Examples of six different types of time series anomalies; (black) original real-world time series, (red) pseudo anomalies generated by g.

Limitations and Future Work

  • Single Anomaly Assumption: The current version assumes a single primary anomaly type per dataset. Future iterations could be enhanced to handle datasets containing multiple, concurrent anomaly types.
  • Univariate Focus: While effective, the study focused on univariate time series. Extending this differentiable alignment to multivariate data—where anomalies might exist in the relationship between sensors—is a promising next step.
  • Catalog Dependency: The discrete selection relies on a predefined catalog of anomaly types. Expanding this catalog would further increase the model's versatility.

Summary updated

BibTeX
@inproceedings{deforce2024end,
  author = {Boje Deforce and Meng-Chieh Lee and Bart Baesens and Estefanía Serral Asensio and Jaemin Yoo and Leman Akoglu},
  title = {{End-To-End Self-Tuning Self-Supervised Time Series Anomaly Detection}},
  booktitle = {SDM},
  year = {2024},
  url = {https://openreview.net/forum?id=7qvuaX1hfZ},
}
Figure