# Neural Contextual Anomaly Detection for Time Series

arXiv: https://arxiv.org/abs/2107.07702 · HTML: https://mlsanity.com/paper/2107.07702/

## Key facts

- Cited by 43 papers in the map (data through 14 Oct 2026).
- Builds on 26 of its 54 references that are in the map.
- First posted on arXiv 16 Jul 2021.

## Builds on (most cited first, 26 of 26)

- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [mixup: Beyond Empirical Risk Minimization](https://mlsanity.com/paper/1710.09412/) (2017)
- [WaveNet: A Generative Model for Raw Audio](https://mlsanity.com/paper/1609.03499/) (2016)
- [An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling](https://mlsanity.com/paper/1803.01271/) (2018)
- [Deep Anomaly Detection with Outlier Exposure](https://mlsanity.com/paper/1812.04606/) (2018)
- [Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery](https://mlsanity.com/paper/1703.05921/) (2017)
- [A Unifying Review of Deep and Shallow Anomaly Detection](https://mlsanity.com/paper/2009.11732/) (2020)
- [Detecting Spacecraft Anomalies Using LSTMs and Nonparametric Dynamic Thresholding](https://mlsanity.com/paper/1802.04431/) (2018)
- [Deep Semi-Supervised Anomaly Detection](https://mlsanity.com/paper/1906.02694/) (2019)
- [Unsupervised Scalable Representation Learning for Multivariate Time Series](https://mlsanity.com/paper/1901.10738/) (2019)
- [Unsupervised Anomaly Detection via Variational Auto-Encoder for Seasonal KPIs in Web Applications](https://mlsanity.com/paper/1802.03903/) (2018)
- [A Multimodal Anomaly Detector for Robot-Assisted Feeding Using an LSTM-based Variational Autoencoder](https://mlsanity.com/paper/1711.00614/) (2017)
- [A Deep Neural Network for Unsupervised Anomaly Detection and Diagnosis in Multivariate Time Series Data](https://mlsanity.com/paper/1811.08055/) (2018)
- [MAD-GAN: Multivariate Anomaly Detection for Time Series Data with Generative Adversarial Networks](https://mlsanity.com/paper/1901.04997/) (2019)
- [Multivariate Time-series Anomaly Detection via Graph Attention Network](https://mlsanity.com/paper/2009.02040/) (2020)
- [Time-Series Anomaly Detection Service at Microsoft](https://mlsanity.com/paper/1906.03821/) (2019)
- [Current Time Series Anomaly Detection Benchmarks are Flawed and are Creating the Illusion of Progress](https://mlsanity.com/paper/2009.13807/) (2020)
- [Explainable Deep One-Class Classification](https://mlsanity.com/paper/2007.01760/) (2020)
- [Evaluating Real-time Anomaly Detection Algorithms - the Numenta Anomaly Benchmark](https://mlsanity.com/paper/1510.03336/) (2015)
- [Precision and Recall for Time Series](https://mlsanity.com/paper/1803.03639/) (2018)
- [Rethinking Assumptions in Deep Anomaly Detection](https://mlsanity.com/paper/2006.00339/) (2020)
- [Time Series Anomaly Detection; Detection of anomalous drops with limited features and sparse examples in noisy highly periodic data](https://mlsanity.com/paper/1708.03665/) (2017)
- [Anomaly Detection at Scale: The Case for Deep Distributional Time Series Models](https://mlsanity.com/paper/2007.15541/) (2020)
- [Spliced Binned-Pareto Distribution for Robust Modeling of Heavy-tailed Time Series](https://mlsanity.com/paper/2106.10952/) (2021)
- [Deep Anomaly Detection by Residual Adaptation](https://mlsanity.com/paper/2010.02310/) (2020)
- [Learning Ensembles of Anomaly Detectors on Synthetic Data](https://mlsanity.com/paper/1905.07892/) (2019)

## Built on by (most cited first, 30 of 43)

- [Chronos: Learning the Language of Time Series](https://mlsanity.com/paper/2403.07815/) (2024)
- [Self-Supervised Learning for Time Series Analysis: Taxonomy, Progress, and Prospects](https://mlsanity.com/paper/2306.10125/) (2023)
- [TFAD: A Decomposition Time Series Anomaly Detection Architecture with Time-Frequency Analysis](https://mlsanity.com/paper/2210.09693/) (2022)
- [Toward Foundation Model for Multivariate Wearable Sensing of Physiological Signals](https://mlsanity.com/paper/2412.09758/) (2024)
- [Large Language Models can Deliver Accurate and Interpretable Time Series Anomaly Detection](https://mlsanity.com/paper/2405.15370/) (2024)
- [Large Language Model Guided Knowledge Distillation for Time Series Anomaly Detection](https://mlsanity.com/paper/2401.15123/) (2024)
- [Unsupervised Model Selection for Time-series Anomaly Detection](https://mlsanity.com/paper/2210.01078/) (2022)
- [Self-Supervised Anomaly Detection in Computer Vision and Beyond: A Survey and Outlook](https://mlsanity.com/paper/2205.05173/) (2022)
- [Revisiting VAE for Unsupervised Time Series Anomaly Detection: A Frequency Perspective](https://mlsanity.com/paper/2402.02820/) (2024)
- [Graph Anomaly Detection in Time Series: A Survey](https://mlsanity.com/paper/2302.00058/) (2023)
- [Deep Generative model with Hierarchical Latent Factors for Time Series Anomaly Detection](https://mlsanity.com/paper/2202.07586/) (2022)
- [Detecting Anomalies within Time Series using Local Neural Transformations](https://mlsanity.com/paper/2202.03944/) (2022)
- [Unraveling the "Anomaly" in Time Series Anomaly Detection: A Self-supervised Tri-domain Solution](https://mlsanity.com/paper/2311.11235/) (2023)
- [PatchAD: A Lightweight Patch-based MLP-Mixer for Time Series Anomaly Detection](https://mlsanity.com/paper/2401.09793/) (2024)
- [RoSAS: Deep Semi-Supervised Anomaly Detection with Contamination-Resilient Continuous Supervision](https://mlsanity.com/paper/2307.13239/) (2023)
- [Diverse Counterfactual Explanations for Anomaly Detection in Time Series](https://mlsanity.com/paper/2203.11103/) (2022)
- [Precursor-of-Anomaly Detection for Irregular Time Series](https://mlsanity.com/paper/2306.15489/) (2023)
- [Robust and Explainable Detector of Time Series Anomaly via Augmenting Multiclass Pseudo-Anomalies](https://mlsanity.com/paper/2505.20765/) (2025)
- [Multivariate Time Series Anomaly Detection: Fancy Algorithms and Flawed Evaluation Methodology](https://mlsanity.com/paper/2308.13068/) (2023)
- [SimAD: A Simple Dissimilarity-based Approach for Time Series Anomaly Detection](https://mlsanity.com/paper/2405.11238/) (2024)
- [Online Time Series Anomaly Detection with State Space Gaussian Processes](https://mlsanity.com/paper/2201.06763/) (2022)
- [Little Help Makes a Big Difference: Leveraging Active Learning to Improve Unsupervised Time Series Anomaly Detection](https://mlsanity.com/paper/2201.10323/) (2022)
- [Graph similarity learning for change-point detection in dynamic networks](https://mlsanity.com/paper/2203.15470/) (2022)
- [TreeDRNet:A Robust Deep Model for Long Term Time Series Forecasting](https://mlsanity.com/paper/2206.12106/) (2022)
- [Open-Set Multivariate Time-Series Anomaly Detection](https://mlsanity.com/paper/2310.12294/) (2023)
- [A Review on Self-Supervised Learning for Time Series Anomaly Detection: Recent Advances and Open Challenges](https://mlsanity.com/paper/2501.15196/) (2025)
- [GenIAS: Generator for Instantiating Anomalies in time Series](https://mlsanity.com/paper/2502.08262/) (2025)
- [RoCA: Robust Contrastive One-class Time Series Anomaly Detection with Contaminated Data](https://mlsanity.com/paper/2503.18385/) (2025)
- [Deep Federated Anomaly Detection for Multivariate Time Series Data](https://mlsanity.com/paper/2205.04041/) (2022)
- [Contaminated Multivariate Time-Series Anomaly Detection with Spatio-Temporal Graph Conditional Diffusion Models](https://mlsanity.com/paper/2308.12563/) (2023)

## Abstract (arXiv)

We introduce Neural Contextual Anomaly Detection (NCAD), a framework for anomaly detection on time series that scales seamlessly from the unsupervised to supervised setting, and is applicable to both univariate and multivariate time series. This is achieved by effectively combining recent developments in representation learning for multivariate time series, with techniques for deep anomaly detection originally developed for computer vision that we tailor to the time series setting. Our window-based approach facilitates learning the boundary between normal and anomalous classes by injecting generic synthetic anomalies into the available data. Moreover, our method can effectively take advantage of all the available information, be it as domain knowledge, or as training labels in the semi-supervised setting. We demonstrate empirically on standard benchmark datasets that our approach obtains a state-of-the-art performance in these settings.
