Time series anomaly detection based on time–frequency domain with masking strategy and contrastive learning

  • Zhengkai Wang
  • , Hui Liu
  • , Longjing Kuang
  • , Xueliang Zhang
  • , Xiude Chen
  • , Junzhao Du*
  • *Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

Abstract

Anomalies in time series often indicate underlying issues or system failures. Timely detection is critical to avoid severe consequences like system crashes and traffic accidents. Although some high-performing time series anomaly detection models already exist, several challenges remain: (1) Training Bias: Unsupervised anomaly detection models are typically trained on clean normal data. If the training data contains noise or potential anomalies, it can cause the model parameters to deviate from the ideal state during optimization, hindering accurate anomaly detection. (2) Distribution Shift: Time series exhibit periodicity and trends, and the training and testing data may have different distribution patterns. This may cause the model to incorrectly classify normal data as anomalies during testing. Therefore, we propose an anomaly detection network called TFCLNet, which utilizes a time–frequency domain masking strategy combined with contrastive learning. Since the frequency domain reveals potential periodicity and frequency variations, a dual-branch structure is adopted to simultaneously process time-domain and frequency-domain features. Additionally, we employ targeted masking strategies in both domains to reduce the impact of noise and address training bias, thereby learning the core data patterns of time series. Furthermore, unlike traditional contrastive learning strategies based on raw features, we minimize the distribution differences between the reconstructed time–frequency domain features through a contrastive objective function, mitigating the negative impact of distribution shifts in the original data on detection performance. Finally, adversarial training is incorporated to prevent overfitting. Experimental results on five real-world datasets demonstrate that TFCLNet outperforms all baseline models and achieves state-of-the-art performance.

Original languageEnglish
Article number112775
JournalEngineering Applications of Artificial Intelligence
Volume162
DOIs
Publication statusPublished - 26 Dec 2025
Externally publishedYes

Keywords

  • Adversarial training
  • Anomaly detection
  • Contrastive learning
  • Time series

Fingerprint

Dive into the research topics of 'Time series anomaly detection based on time–frequency domain with masking strategy and contrastive learning'. Together they form a unique fingerprint.

Cite this