Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anomaly Detection Tutorials

Learn time-series anomaly detection from z-scores to state-of-the-art deep models: runnable notebooks, honest evaluation, real-world case studies.

CI License: MIT Python 3.10+

Unsupervised anomaly detection with an autoencoder

Why this repo

Toolboxes for anomaly detection exist. What is missing is a path: a sequence of tutorials that starts from methods you can compute by hand, builds up to the deep models used in production, and is honest about the part most material skips, which is how to evaluate a detector without fooling yourself.

Every notebook in this repo:

  • runs top to bottom on CPU in minutes, seeded and reproducible,
  • pairs every method with its failure modes, not just its wins,
  • measures results with ground-truth labels where they exist, and says so clearly where they do not,
  • uses one consistent, colorblind-safe visual language.

The curriculum

# Notebook Status
01 Foundations: z-scores, moving statistics, STL residuals Open in Colab available
02 Classic ML: Isolation Forest, One-Class SVM, LOF Open in Colab available
03 Autoencoders: reconstruction error as an anomaly signal Open in Colab available
04 USAD: adversarially trained autoencoders (KDD 2020), measured honestly Open in Colab available
05 Matrix Profile: anomaly detection without training Open in Colab available
06 Forecasting-based detection: predict, then be surprised Open in Colab available
07 Probabilistic reconstruction: VAEs, Donut, and what the likelihood buys Open in Colab available
08 TadGAN: turning a GAN into a detector, and what the critic can and cannot see Open in Colab available
09 Graph neural networks: learning which sensors watch each other Open in Colab available
10 Transformers: when reconstruction learns to cheat Open in Colab available
11 Self-supervised representations: detecting without reconstructing Open in Colab available
12 Streaming detection: the Robust Random Cut Forest Open in Colab available
13 Foundation models: zero-shot detection (Chronos/MOMENT, with a runnable stand-in) Open in Colab available
14 Evaluation done right: the point-adjust trap and what to use instead Open in Colab available
15 Case study: detecting silent regressions in LLM telemetry planned

The numbering is the recommended reading order; each notebook still stands on its own.

Quick start

git clone https://github.com/JulienAu/anomaly-detection-tutorials.git
cd anomaly-detection-tutorials
uv venv && uv pip install -e ".[dev]"
uv run jupyter lab

Or open any notebook directly in Colab with the badge in the table above; the first cell installs what it needs.

The adtuto package in src/ holds what the notebooks share (plotting theme, datasets, windowing helpers) so each notebook stays focused on its method.

History

This repo started in 2016 as one of the early autoencoder anomaly detection tutorials and reached 190 stars in its first life. In 2026 it was rebuilt from scratch: same mission, ten years of hindsight, and a much higher bar for evaluation rigor.

License

MIT. If a notebook helps you, a star helps others find it.

About

Learn time-series anomaly detection from z-scores to state-of-the-art deep models: runnable notebooks, honest evaluation, real-world case studies.

Topics

Resources

Stars

192 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages