STGAD: Self-temporal generative adversarial framework with transformer attention for unsupervised multivariate time-series anomaly detection and localization

X Xiao Liao W Wei Deng H Hongyue Ma Y Yihan Mu

Abstract

Unsupervised anomaly detection in multivariate time series is important for maintaining the reliability of complex cyber-physical systems. However, existing methods often face practical challenges in adversarial stability, temporal dependency modeling, and anomaly-score calibration across datasets. We present STGAD, a dual-score generative-adversarial framework for anomaly detection and localization in multivariate time series. STGAD employs a WGAN-GP critic with a Transformer encoder to perform self-temporal modeling of within-window dependencies and cross-variable interactions, and uses a stochastic generator trained under adversarial supervision with sample-level proximity regularization to model normal temporal patterns. During inference, multiple generated candidates are sampled for each input window, and the minimum residual is used as a sample-matching anomaly cue. This residual-based score is fused with the critic-based score after normalization, and final anomaly decisions are produced by distribution-adaptive thresholding. Experiments on five benchmark datasets spanning server monitoring, aerospace telemetry, industrial control, and ECG signals (SMD, SMAP, MSL, SWaT, and MIT-BIH) show that STGAD achieves strong and consistent performance against representative baselines. Ablation and robustness analyses further demonstrate the effectiveness of critic-side temporal modeling, stable adversarial learning, and dual-score fusion in the proposed framework.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 21, Issue 5
Published May 21, 2026
Pages e0349223
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (4)

X

Xiao Liao

W

Wei Deng

H

Hongyue Ma

Y

Yihan Mu