NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Unravel Anomalies: an End-to-End Seasonal-Trend Decomposition Approach for Time Series Anomaly Detection

Zhenwei Zhang, Ruiqi Wang, Ran Ding, Yuantao Gu

TL;DR

TADNet is an end-to-end framework that "unravels" complex time series into interpretable components—trend, seasonality, and remainder—to improve anomaly detection. By leveraging a two-phase training strategy (pre-training on synthetic data followed by fine-tuning on real signals), it achieves state-of-the-art performance while providing clear visual explanations of why a sequence is flagged as anomalous.

What Problem Does This Paper Address?

Time-series anomaly detection (TAD) is notoriously difficult because real-world data is a "composite" of overlapping patterns. A single signal might contain a long-term trend, repeating seasonal cycles, and random noise. Anomalies can hide within any of these: a "point" anomaly might be a sudden spike in noise, while a "pattern" anomaly might be a subtle shift in a seasonal cycle or a declining trend that shouldn't be there.

Most existing deep learning models treat the time series as a black box or use rigid, pre-defined decomposition methods (like STL) that aren't optimized for the detection task. This leads to two main issues:

  1. Ambiguity: Subtle deviations are easily obscured by other dominant patterns.
  2. Lack of Interpretability: When a model flags an anomaly, it rarely tells the operator which part of the signal's structure failed.

Methods

The authors introduce TADNet, which treats time-series decomposition similarly to how audio engineers separate individual voices from a noisy recording (source separation).

The Architecture

TADNet uses an Encoder-Separator-Decoder backbone inspired by TasNet (a popular speech separation model):

  • Encoder: Projects the time-series segments into a latent feature space.
  • Separator: This is the "brain" of the model. It generates three distinct masks—one each for the Trend, Seasonal, and Remainder components.
  • Decoders: Three decoders (sharing parameters) apply these masks to the latent representation and map them back to the time domain, effectively "unraveling" the original signal.
Overview of the TADNet architecture, showing the mask-based separation process.

Two-Phase Training

A major hurdle in end-to-end decomposition is the lack of "ground truth" labels for what a trend or seasonal component should look like in real-world data. To solve this, the authors use:

  1. Phase 1 (Pre-training): They generate a massive synthetic dataset where the trend, seasonality, and anomalies are mathematically defined. The model learns the fundamental task of decomposition here.
  2. Phase 2 (Fine-tuning): The model is fine-tuned on real-world "normal" data. It learns to reconstruct these typical patterns so that any deviation (the reconstruction error) can be flagged as an anomaly.

Datasets

The model was evaluated on five widely recognized benchmarks:

  • UCR: A collection of univariate time series from the KDD 2021 Cup.
  • SMD (Server Machine Dataset): Five weeks of data from an internet company.
  • WADI & SWaT: Data from water treatment plant testbeds, featuring high-dimensional sensor and actuator readings.
  • PSM (Pooled Server Metrics): Application server node data from eBay.

Key Insights and Ideas

  • Anomalies have "homes": The authors map specific anomaly types to decomposition components. Seasonal anomalies (like a missed heartbeat in an EKG) appear in the seasonal component, while drifts appear in the trend. This mapping simplifies the detection logic.
  • The "Unraveling" Advantage: By separating the signal, the model can spot a small anomaly that would otherwise be "drowned out" by a large seasonal swing.
  • Interpretability by Design: Because the model explicitly outputs trend and seasonal components, human operators can visually inspect which component is failing. As seen in Figure 3, the reconstruction error aligns perfectly with the anomalous regions in the decomposed views.
Visualization showing how anomalies become clearer when the signal is decomposed.

Key Results

TADNet achieved the highest F1-score on four out of the five datasets tested, outperforming recent transformer-based models like AnomalyTran and DecompTran.

Quantitative comparison of TADNet against baselines.
  • UCR: Achieved a near-perfect F1-score of 98.74%.
  • PSM: Reached 98.66%, significantly higher than classical methods like OCSVM (70.67%).
  • Efficiency: Despite the two-stage training, the total training time is less than an hour, and inference speed is comparable to existing benchmarks.

Limitations and Future Work

While TADNet is highly effective for univariate signals and handles multivariate data by processing variables independently, the authors note that its performance might be limited in complex multivariate scenarios where anomalies depend on the intricate interaction between many different variables simultaneously.

Future work may involve exploring "iterative training" (which showed promise in the WADI dataset) to better capture these inter-variable dependencies without incurring excessive computational overhead.

Summary updated

BibTeX
@inproceedings{zhang2024unravel,
  author = {Zhenwei Zhang and Ruiqi Wang and Ran Ding and Yuantao Gu},
  title = {{Unravel Anomalies: an End-to-End Seasonal-Trend Decomposition Approach for Time Series Anomaly Detection}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10446482},
}
Figure