Time series anomaly detection improves with context-anchored pairing

Supervision Recovery for Time Series Anomaly Detection via Context-Anchored Pairing

Artificial Intelligence

Summary

Detecting unusual events in time-based data is hard because anomalies depend a lot on the situation, and labeled examples of these anomalies are rare. The authors propose a new method called CAPS that creates pairs of normal and abnormal sequences within the same context to learn what makes something an anomaly. Their approach builds a meaningful representation of anomalies and uses it to train better detectors without needing real anomaly labels. Tests on multiple datasets show that their method performs better than other existing approaches.

What this means in practice

  • For industrial operations teams: Improve early detection of failures or unusual events in machine sensor data by training anomaly detectors without requiring labeled faults.
  • For financial risk analysts: Enhance spotting context-dependent irregular patterns in market or transaction time series, helping flag potential fraud or unusual trading behavior.

Authors

Yifei Gao, Tian Lan, Yimeng Lu, Xuming An, Meng Wang, Wenjun He, Yijie Li, Chen Zhang

Abstract

Time series anomaly detection (TSAD) remains challenging not only because anomaly labels are scarce, but also because temporal anomalies are highly context-dependent. Existing methods often rely on unsupervised objectives or surrogate abnormal patterns, providing limited supervision for context-dependent normal--anomalous distinctions. We propose Context-Anchored Pair Supervision (CAPS), a supervision-recovery framework for TSAD. CAPS views ideal anomaly supervision as a matched comparison between normal and anomalous outcomes under the same temporal context, and seeks to recover such supervision without target-domain anomaly labels. Using simulated normal--anomalous pairs, CAPS learns structure and anomaly-semantic representations through reconstruction, background consistency, and within-pair counterfactual recombination. The resulting anomaly representations form a continuous semantic space with coarse modes and induce a sampleable multimodal prior. CAPS conditionally realizes sampled semantics as residual-form effects on target reference trajectories. The resulting context-anchored normal--anomalous counterparts provide temporal supervision for discriminative detector learning. Experiments on nine datasets show that CAPS achieves the strongest aggregate performance across all four evaluation metrics among the compared methods, while complementary ablations and transfer analyses support the roles of context anchoring, semantic disentanglement, and conditional realization.