Official PyTorch implementation of the paper: VAN-AD: Visual Masked Autoencoder with Normalizing Flow For Time Series Anomaly Detection.
If VAN-AD helps your research, please consider giving us a ⭐ star!
VAN-AD, a novel MAE-based framework for TSAD. To alleviate the over-generalization issue of MAE, we design an Adaptive Distribution Mapping Module (ADMM), which maps the reconstruction results before and after MAE into a unified statistical space to amplify discrepancies caused by abnormal patterns. To overcome the limitation of local perception, we further develop a Normalizing Flow Module (NFM), which combines MAE with normalizing flow to estimate the probability density of the current window under the global distribution.
Ensure you have a Python 3.8+ environment ready. Install the necessary dependencies via:
pip install -r requirements.txt
Download MSL/PSM datasets via OneDrive and store them under the /data path, for example: /data/PSM Regarding the remaining datasets, we follow the TAB data processing pipeline. Download the dataset from TAB (https://github.com/decisionintelligence/TAB) and store it under the data folder, for example, data/tab.
- Model Definition: Explore the core logic in here.
- Reproduction: Run the provided scripts to replicate our results. For instance, to test on the PSM dataset:
sh ./scripts/PSM.shExtensive experiments on nine real-world datasets demonstrate that VAN-AD achieves state-of-the-art performance. We show the main results of all the nine real-world datasets:
We acknowledge the following open-source projects for their outstanding contributions to the field:
- TAB: Unified Benchmarking of Time Series Anomaly Detection Methods(https://github.com/decisionintelligence/TAB)
If you have any questions or suggestions, feel free to contact:
-
[PengYu Chen] (penychen@bupt.edu.cn)
-
[Shang Wan] (2025110739@bupt.cn)
-
Or describe it in Issues.


