Computer Science ›› 2026, Vol. 53 ›› Issue (8): 20-28.doi: 10.11896/jsjkx.250700100

• Database & Big Data & Data Science • Previous Articles     Next Articles

Anomaly Detection in Time Series Based on Time-Frequency Contrastive Learning

LIU Yanze1,2, HAN Bo3, YUAN Jidong1,2, SU Dongliang1,2, REN Jia4, CAI Zhiming4, WANG Zhihai 2   

  1. 1 Key Laboratory of Big Data & Artificial Intelligence in Transportation, Ministry of Education, Beijing 100044, China
    2 School of Computer Science and Technology, Beijing Jiaotong University, Beijing 100044, China
    3 Longying Zhida(Beijing) Technology Co., Ltd., Beijing 100026, China
    4 Faculty of Digital Science and Technology, Macau Millennium College, Macau 999078, China
  • Received:2025-07-15 Revised:2025-11-14 Online:2026-08-15 Published:2026-08-17
  • About author:LIU Yanze,born in 2002,postgraduate.His main research interests include artificial intelligence and time series ano-maly detection.
    YUAN Jidong,born in 1989,Ph.D,associate professor.His main research in-terests include data mining and pattern recognition.
  • Supported by:
    Fundamental Research Funds for the Central Universities(2025JBZX059,2025JBMC028).

Abstract: Time series anomaly detection plays a crucial role in various fields such as finance,healthcare,and industrial production.Relevant applications include detecting abnormal response codes in core banking systems within the financial sector,monitoring electroencephalographic(EEG) signals in healthcare,and providing early warnings for industrial sensor signals.In the field of multivariate time series anomaly detection,existing methods have limitations in handling complex patterns and data with sparse labels.This paper proposes a self-supervised time series anomaly detection algorithm based on time-frequency contrastive learning,which innovatively combines time-domain and frequency-domain features to build a cross-modal representation learning framework.Firstly,high-quality time-frequency consistent representations are obtained from randomly augmented samples through time-domain and frequency-domain feature extraction.Secondly,the model is optimized using a time-frequency ranking contrastive loss function and a hierarchical contrastive loss function and,which accurately control the distance between different samples,capture multi-scale information in time series,and effectively address the issue of false negative samples in contrastive learning.Finally,anomalies are identified based on sample masking and sliding window detection.Experimental results on several datasets from different fields show that the algorithm achieves state-of-the-art performance.Ablation experiments and visualization results verify the effectiveness of the proposed algorithm and its modules,providing an efficient,accurate,and robust solution for time series anomaly detection in finance,industry,and other fields.

Key words: ime series, Anomaly detection, Time-frequency contrastive learning, Multi-domain feature extraction

CLC Number: 

  • TP391
[1] HAMILTON J D.Time series analysis[M].Princeton:Princeton university press,2020.
[2] HOCHENBAUM J,VALLIS O S,KEJARIWAL A.Automatic anomaly detection in the cloud via statistical learning[J].arXiv:1704.07706,2017.
[3] YANG M,WANG J.Adaptability of financial time series prediction based on BiLSTM[J].Procedia Computer Science,2022,199:18-25.
[4] WEN Q,YANG L,ZHOU T,et al.Robust time series analysis and applications:An industrial perspective[C]//Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining.2022:4836-4837.
[5] GUO Y,LIAO W,WANG Q,et al.Multidimensional time series anomaly detection:A gru-based gaussian mixture variational autoencoder approach[C]//Asian Conference on Machine Learning.PMLR,2018:97-112.
[6] PALAKURTI N R.Challenges and future directions in anomaly detection[M]//Practical Applications of Data Processing,Algorithms,and Modeling.IGI Global,2024:269-284.
[7] MEJRI N,LOPEZ-FUENTES L,ROY K,et al.Unsupervisedanomaly detection in time-series:An extensive evaluation and analysis of state-of-the-art methods[J].Expert Systems with Applications,2024,256:124922.
[8] TSAI Y H H,WU Y,SALAKHUTDINOV R,et al.Self-supervised learning from a multi-view perspective[J].arXiv:2006.05576,2020.
[9] XU K,QIN M,SUN F,et al.Learning in the frequency domain[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2020:1740-1749.
[10] ZHANG C,ZHOU T,WEN Q,et al.Tfad:A decompositiontime series anomaly detection architecture with time-frequency analysis[C]//Proceedings of the 31st ACM International Conference on Information & Knowledge Management.2022:2497-2507.
[11] ZHANG X,ZHAO Z,TSILIGKARIDIS T,et al.Self-supervised contrastive pre-training for time series via time-frequency consistency[C]//NeurIPS 2022.2022:3988-4003.
[12] CARTER K M,STREILEIN W W.Probabilistic reasoning for streaming anomaly detection[C]//2012 IEEE Statistical Signal Processing Workshop(SSP).IEEE,2012:377-380.
[13] REDDY A,ORDWAY-WEST M,LEE M,et al.Using gaussian mixture models to detect outliers in seasonal univariate network traffic[C]//2017 IEEE Security and Privacy Workshops(SPW).IEEE,2017:229-234.
[14] KOZITSIN V,KATSER I,LAKONTSEV D.Online forecasting and anomaly detection based on the ARIMA model[J].Applied Sciences,2021,11(7):3194.
[15] LI Z,ZHAO Y,LIU R,et al.Robust and rapid clustering of kpis for large-scale anomaly detection[C]//2018 IEEE/ACM 26th International Symposium on Quality of Service(IWQoS).IEEE,2018:1-10.
[16] SADR A V,BASSETT B A,KUNZ M.A flexible frameworkfor anomaly detection via dimensionality reduction[C]//2019 6th International Conference on Soft Computing & Machine Intelligence(ISCMI).IEEE,2019:106-110.
[17] BERAHMAND K,BAHADORI S,ABADEH M N,et al.Sdac-da:Semi-supervised deep attributed clustering using dual autoencoder[J].IEEE Transactions on Knowledge and Data Engineering,2024,36(11):6989-7002.
[18] AUDIBERT J,MICHIARDI P,GUYARD F,et al.Usad:Unsupervised anomaly detection on multivariate time series[C]//Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining.2020:3395-3404.
[19] ZHANG C,SONG D,CHEN Y,et al.A deep neural network for unsupervised anomaly detection and diagnosis in multivariate time series data[C]//Proceedings of the AAAI Conference on Artificial Intelligence.2019:1409-1416.
[20] CHEN S W,LI J,XUAN J X,et al.LSTM-GAN:Unsupervised Anomaly Detection for Time Series Fusion of GAN and Bi-LSTM[J].Journal of Chinese Computer Systems.2024,45(1):123-131.
[21] XU J.Anomaly transformer:Time series anomaly detection with association discrepancy[J].arXiv:2110.02642,2021.
[22] TULI S,CASALE G,JENNINGS N R.Tranad:Deep trans-former networks for anomaly detection in multivariate time series data[J].arXiv:2201.07284,2022.
[23] YUE Z,WANG Y,DUAN J,et al.Ts2vec:Towards universal representation of time series[C]//Proceedings of the AAAI Conference on Artificial Intelligence.2022:8980-8987.
[24] YANG Y,ZHANG C,ZHOU T,et al.Dcdetector:Dual attention contrastive representation learning for time series anomaly detection[C]//Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining.2023:3033-3045.
[25] WANG C,ZHUANG Z,QI Q,et al.Drift doesn’t matter:dynamic decomposition with diffusion reconstruction for unstable multivariate time series anomaly detection[C]//NeurIPS 2023.2024.
[26] JEONG Y,YANG E,RYU J H,et al.Anomalybert:Self-supervised transformer for time series anomaly detection using data degradation scheme[J].arXiv:2305.04468,2023.
[27] DENG A,HOOI B.Graph neural network-based anomaly detection in multivariate time series[C]//Proceedings of the AAAI Conference on Artificial Intelligence.2021:4027-4035.
[28] ZONG B,SONG Q,MIN M R,et al.Deep autoencoding gaussian mixture model for unsupervised anomaly detection[C]//International Conference on Learning Representations.2018.
[29] SHENTU Q,LI B,ZHAO K,et al.Towards ageneral time series anomaly detector with adaptive bottlenecks and dual adversarial decoders[J].arXiv:2405.15273,2024.
[1] WANG Yuqi, ZHANG Yangsen, GUO Yalong, KANG Jing, WANG Yalun. Time Series Language Model for Continuous Glucose Monitoring Interpretation [J]. Computer Science, 2026, 53(8): 29-39.
[2] CHEN Yifan, DING Cong, CAO Min. Image Anomaly Detection Based on Masked Convolutional Kernel [J]. Computer Science, 2026, 53(7): 45-53.
[3] XU Jian, CHEN Shijie, FENG Jiancong, YANG Geng. CBT-AD:CNN-BiLSTM-Transformer Hybrid Model for Time Series Anomaly Detection [J]. Computer Science, 2026, 53(7): 230-241.
[4] XIAO Yanxue, DENG Li, REN Zhengwei, WU Mengxin. iDSRformer:Node Load Prediction Model for High-performance Computing Cluster [J]. Computer Science, 2026, 53(7): 251-261.
[5] JI Wendi, WANG Yongquan. Autoregressive Sequence Reconstruction for Unsupervised Anomaly Detection in Medical Insurance [J]. Computer Science, 2026, 53(7): 298-307.
[6] WANG Jia, GAN Yongqiang. Multivariate Mimic Voting Method Based on Anomaly Perception [J]. Computer Science, 2026, 53(7): 414-421.
[7] ZHANG Juling, ZHAO Yibing, WANG Sheng, XI Ning, SHE Wenkui. Robust Time Series Anomaly Detection Model Based on Multi-view Cross Filtering [J]. Computer Science, 2026, 53(6A): 250600105-10.
[8] LIU Pneg, SHEN Jiying, LIU Dongsheng, CHEN Guibo, SONG Yuanwei. Time Series Prediction Method Based on Multi-level Wavelet Decomposition Bidirectional Mamba [J]. Computer Science, 2026, 53(6A): 250600172-8.
[9] ZHANG Xulin, WANG Lei, NIU Mengjin, LIANG Junda. ALHC:Floating-point Time Series Adaptive Lossless Compression Tool Based on HybridPrediction Architecture [J]. Computer Science, 2026, 53(6A): 250700136-8.
[10] HUANG Siyang, YAO Ye, ZHU Yian, HAI Duo, XIONG Zhihai. Anomaly Detection and Localization Technology for Gravity Wave Spectral Images Based onPre-trained Networks [J]. Computer Science, 2026, 53(5): 193-206.
[11] CHEN Peng, HAO Junfeng, XIA Yunni, LI Xi. Novel Multi-task Federated Learning Based Approach for Detecting and Diagnosing Anomalies inCloud Microservices [J]. Computer Science, 2026, 53(5): 388-403.
[12] XU Jingtao, YANG Yan, JIANG Yongquan. Time-Frequency Attention Based Model for Time Series Anomaly Detection [J]. Computer Science, 2026, 53(2): 161-169.
[13] GENG Haijun, LI Dongxin. D-LINet:Time Series Forecasting Framework Integrating Dual-linear Layersand Dual Normalization [J]. Computer Science, 2026, 53(2): 170-179.
[14] PAN Jian, WANG Xuhao. Time Series Forecasting Model Integrating Multi-scale Features and Attention Mechanism [J]. Computer Science, 2026, 53(2): 180-186.
[15] LIU Fujie, FANG Xianwen. Anomaly Detection and Repair Methods for Dynamic Adjustment of Business Process [J]. Computer Science, 2026, 53(2): 207-215.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!