ML4ITS/mtad-gat-pytorch
PyTorch implementation of MTAD-GAT (Multivariate Time-Series Anomaly Detection via Graph Attention Networks) by Zhao et. al (2020, https://arxiv.org/abs/2009.02040).
What it solves
It provides a framework for detecting anomalies in multivariate time-series data, where multiple related variables are tracked over time. The project aims to identify unusual patterns that deviate from normal behavior across these different dimensions.
How it works
The system processes raw data through a multi-stage pipeline:
- Noise Reduction: A 1-D convolution is applied to smooth the temporal data.
- Dependency Capture: Two parallel Graph Attention Networks (GAT) analyze the data. One focuses on dependencies between different features (feature-oriented), and the other focuses on dependencies across different timestamps (time-oriented).
- Sequential Modeling: A GRU (Gated Recurrent Unit) layer captures long-term sequential patterns.
- Prediction and Reconstruction: The model uses a forecasting model to predict the next timestamp and a GRU-based decoder to reconstruct the input sequence.
- Anomaly Scoring: It employs various thresholding methods—such as Peaks-Over-Threshold (POT), a method by Hundman et al., and a brute-force F1-score search—to determine if a data point is an anomaly.
Who it’s for
Data scientists and ML engineers working with time-series monitoring, system health tracking, or any domain requiring the detection of outliers in complex, multi-variable datasets.
Highlights
- Supports both standard GAT and the more expressive GATv2.
- Implements multiple thresholding strategies for flexible anomaly detection.
- Includes preprocessing and evaluation tools for standard datasets like MSL, SMAP, and SMD.
- Provides a visualization notebook to compare predicted anomalies against ground truth.
Related
- Project
- Project
- Project
- Project