TY - JOUR
T1 - Time series anomaly detection based on time–frequency domain with masking strategy and contrastive learning
AU - Wang, Zhengkai
AU - Liu, Hui
AU - Kuang, Longjing
AU - Zhang, Xueliang
AU - Chen, Xiude
AU - Du, Junzhao
N1 - Publisher Copyright:
© 2025 Elsevier Ltd.
PY - 2025/12/26
Y1 - 2025/12/26
N2 - 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.
AB - 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.
KW - Adversarial training
KW - Anomaly detection
KW - Contrastive learning
KW - Time series
UR - https://www.scopus.com/pages/publications/105020571229
U2 - 10.1016/j.engappai.2025.112775
DO - 10.1016/j.engappai.2025.112775
M3 - Article
AN - SCOPUS:105020571229
SN - 0952-1976
VL - 162
JO - Engineering Applications of Artificial Intelligence
JF - Engineering Applications of Artificial Intelligence
M1 - 112775
ER -