File size: 2,892 Bytes
fe15010
 
1734d07
fe15010
a60a695
1734d07
a60a695
1734d07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a60a695
1734d07
 
 
 
 
 
a60a695
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
license: apache-2.0
pipeline_tag: other
---

# POST: Prior-Observation Adversarial Learning of Spatio-Temporal Associations for Multivariate Time Series Anomaly Detection

This repository contains the official PyTorch implementation and pre-trained checkpoints for the paper [POST: Prior-Observation Adversarial Learning of Spatio-Temporal Associations for Multivariate Time Series Anomaly Detection](https://huggingface.co/papers/2605.18128).

## 💡 Highlights
 - **Novel Framework**: We propose POST, a model that unifies spatial and temporal anomaly modeling under a joint prior–observation adversarial learning framework. 
 - **Anomaly Localization**: The adversarial optimization not only improves time-wise detection but also enables the model to localize anomalies to specific channels.
 - **SMD+ Dataset**: Construction of a dataset featuring precise channel-wise annotations, serving as a generic testbed for anomaly localization in MTS. 
 - **SOTA Performance**: Extensive experiments demonstrate that POST consistently outperforms state-of-the-art (SOTA) baselines in standard anomaly detection tasks.

## 🛠️ Resources
- **Code**: [GitHub Repository](https://github.com/anocodetest1/POST)
- **Paper**: [huggingface.co/papers/2605.18128](https://huggingface.co/papers/2605.18128)

## 🚀 Get Started

### Evaluation
To evaluate the trained models on the benchmarks, run the following scripts. Ensure you have the datasets prepared and the pre-trained weights placed into the `./checkpoints/` folder (named as `<dataset_name>_checkpoint.pth`).

```bash
# SMD
python main.py --anomaly_ratio 0.5 --batch_size 64 --mode test --dataset SMD --data_path dataset/SMD --input_c 38 --output_c 38
# MSL
python main.py --anomaly_ratio 1. --batch_size 64 --mode test --dataset MSL --data_path dataset/MSL --input_c 55 --output_c 55
# SMAP
python main.py --anomaly_ratio 1. --batch_size 64 --mode test --dataset SMAP --data_path dataset/SMAP --input_c 25 --output_c 25
# SWaT
python main.py --anomaly_ratio 1. --win_size 150 --batch_size 64 --mode test --dataset SWaT --data_path dataset/SWaT --input_c 51 --output_c 51
# PSM
python main.py --anomaly_ratio 1. --batch_size 64 --mode test --dataset PSM --data_path dataset/PSM --input_c 25 --output_c 25
# SMD+
python main_channel.py --anomaly_ratio 0.5 --batch_size 64 --mode test --dataset SMD+ --data_path dataset/SMD+ --input_c 38 --output_c 38
```

## Suggested citation

Please consider citing our work:

```bibtex
@misc{zhang2026postpriorobservationadversariallearning,
      title={POST: Prior-Observation Adversarial Learning of Spatio-Temporal Associations for Multivariate Time Series Anomaly Detection}, 
      author={Suofei Zhang and Yaxuan Zheng and Haifeng Hu},
      year={2026},
      eprint={2605.18128},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2605.18128}, 
}
```