NTH

Contrast to Detect: Dynamic Graph Contrastive Regularization for Unsupervised Anomaly Detection in Multivariate Time Series

AuthorsYunhua Pei, Zixing Song, Jin Zheng, John Cartlidge

May 29, 2026 3 min read
Watch on YouTube
The one-line take

This paper improves unsupervised anomaly detection in multivariate time series by using dynamic graph contrastive learning to model changing relationships instead of forcing them to stay fixed.

Key results

88.24
SWaT F1

ContrastAD achieves 88.24 F1 on SWaT, the best result among the evaluated baselines.

93.60
SWaT AUC

ContrastAD reaches 93.60 AUC-ROC on SWaT, reported as the top score on that benchmark.

78.87
SMD F1

ContrastAD achieves 78.87 F1 on SMD.

91.17
PSM F1

ContrastAD achieves 91.17 F1 on PSM, with statistically significant improvement over the strongest baseline.

97.79
PSM AUC

ContrastAD reaches 97.79 AUC-ROC on PSM, also reported as statistically significant over the strongest baseline.

73.84
DGCL ablation SWaT F1

Setting the graph contrastive term weight to 0 removes DGCL and drops SWaT F1 from 88.24 to 73.84.

What the paper found

ContrastAD is an unsupervised multivariate time-series anomaly detector that targets two failure modes in prior work: reconstruction models often reproduce anomalies too faithfully, and graph contrastive methods usually assume static relational structure. The novelty is a dynamic graph contrastive regularizer that treats structural drift as a signal. The architecture combines a Multi-Perspective Embedder that jointly encodes temporal, attribute-wise, and structural views, a Frequency-Aware Attention Mixer that applies FFT-based top-K spectral filtering before attention to suppress noise leakage, and a Dynamic Graph Contrastive Learner that builds sparse snapshot graphs from batch-level Dynamic Time Warping distances and contrasts the most divergent pair against a stable anchor. On five benchmarks—SWaT, SMD, MSL, PSM, and SMAP—ContrastAD achieves the best mean F1 on all five and the best AUC on three, with statistically significant gains on SWaT and PSM; for example, it reaches 88.24 F1 and 93.60 AUC on SWaT, 78.87 F1 and 98.66 AUC on SMD, and 91.17 F1 and 97.79 AUC on PSM. Ablations show the graph contrastive term is essential: setting its weight to 0 drops SWaT F1 from 88.24 to 73.84 and SMD F1 from 78.87 to 50.01, while negative contrastive weights consistently outperform positive ones, confirming that soft regularization is better than strict invariance under non-stationary dynamics.

Original abstract

Anomaly detection in multivariate time series (MTS) is hindered by dynamic inter-variable dependencies and feature entanglement under spectral noise, and in practice, is further complicated by the absence of anomaly labels. Existing reconstruction-based detectors tend to recover anomalies as faithfully as normal patterns, while prevailing graph contrastive methods enforce invariance across views and thus assume a stationary relational structure, an assumption that breaks under structural drift in real systems. We propose ContrastAD, an unsupervised framework that turns structural evolution itself into a learning signal rather than suppressing it. A Multi-Perspective Embedder encodes inputs from temporal, attribute, and structural perspectives. A Frequency-Aware Attention Mixer then performs spectral top-K filtering before attention, preventing noise from leaking into query-key similarities. The core component, a Dynamic Graph Contrastive Learner, builds power-law-inspired sparse graph snapshots from batch-level DTW distances and contrasts the most divergent pair against a stable anchor, regularizing the latent space without imposing rigid invariance. Across five real-world benchmarks, ContrastAD attains the highest mean F1 on all five datasets and the highest AUC on three (SWaT 93.60, SMD 98.66, PSM 97.79), with statistically significant F1 and AUC margins over the strongest baseline on SWaT and PSM. On MSL and SMAP, it trails the AUC leader by under 0.7 points while still leading on F1. Ablation and sensitivity studies further confirm that the contrastive objective works best as a soft regularizer, supporting our claim that strict invariance is suboptimal under non-stationary dynamics.

Read the original paper

More in Graph Learning

Browse all 32 papers →
02Graph Learning

GraphWrit3R: End-to-End 3D Scene Graph Writing

Luka Milivojevic, Nikola Popovic, Sayan Deb Sarkar, Sebastian Koch, Iro Armeni, Luc Van Gool, Danda Pani Paudel

GraphWrit3R turns 3D spatial data into open-vocabulary scene graphs using multimodal encoders and an LLM, without requiring ground-truth object annotations at inference.

Read analysis