计算机科学 ›› 2026, Vol. 53 ›› Issue (2): 161-169.doi: 10.11896/jsjkx.241200106

• 数据库&大数据&数据科学 • 上一篇    下一篇

基于时频域注意力的时间序列异常检测模型

徐敬涛, 杨燕, 江永全   

  1. 西南交通大学计算机与人工智能学院 成都 611756
    可持续城市交通智能化教育部工程研究中心 成都 611756
  • 收稿日期:2024-12-16 修回日期:2025-03-17 发布日期:2026-02-10
  • 通讯作者: 杨燕(yyang@swjtu.edu.cn)
  • 作者简介:(kk_xjt@163.com)
  • 基金资助:
    国家自然科学基金(61976247)

Time-Frequency Attention Based Model for Time Series Anomaly Detection

XU Jingtao, YANG Yan, JIANG Yongquan   

  1. School of Computing and Artificial Intelligence,Southwest Jiaotong University,Chengdu 611756,ChinaEngineering Research Center of Sustainable Urban Intelligent Transportation,Ministry of Education,Chengdu 611756,China
  • Received:2024-12-16 Revised:2025-03-17 Online:2026-02-10
  • About author:XU Jingtao,born in 1999,postgraduate.His main research interest is time series anomaly detection and forecasting.
    YANG Yan,born in 1964,Ph.D,professor,Ph.D supervisor, is a member of CCF(No.06877D).Her main research interests include artificial intelligence,big data analysis and mining.
  • Supported by:
    National Natural Science Foundation of China(61976247).

摘要: 时序数据中复杂的时间依赖关系和有限的异常标签数据,使得时序异常检测成为一项十分具有挑战性的工作。以往大多数工作的聚焦点局限于数据的时域建模上,而忽略并缺失了对时序数据频域信息的提取与利用,造成了一定程度的性能瓶颈。以此为突破点,提出一种基于时域注意力和频域注意力的异常检测模型——TFA-TSAD。该模型首先创新性地对输入数据进行渐进式分解,进而探索数据在不同模式下的异常情况;然后利用精心设计的时频域建模模块,以注意力机制为核心,分别对时序数据的时域信息与频域信息进行高效提取来提高异常检测的性能;此外,在传统误差损失的基础上,采用均方误差加和平均的方式作为损失函数,进一步提高了模型的性能。经过大量的实验验证,该方法在多个数据集上的性能表现卓越,与其他13个基线模型相比,异常检测效果提升显著。

关键词: 时序异常检测, 时域, 频域, 注意力机制, 模式分解

Abstract: Time series anomaly detection is a challenging task due to complex temporal dependencies and limited labeled anomaly data.Previous methods have predominantly focused on modeling in the time domain,overlooking valuable information contained in the frequency domain,resulting in a certain degree of performance bottleneck.Taking this as a breakthrough,this paper proposes a Time-Frequency Attention Based Model for Time Series Anomaly Detection-TFA-TSAD,which firstly innovatively performs progressive decomposition of the input data to explore the anomalies of the data in different modes,and then utilizes the well-designed time-frequency domain modeling module to efficiently extract the time-domain information and frequency-domain information of the origin data respectively,by taking the attention mechanism to improve the performance of anomaly detection.Finally,based on the traditional error loss,a loss function incorporating average MSE is utilized to further improve model performance.Extensive experimental results on multiple datasets demonstrate that the proposed model outperforms 13 other benchmark models with a significant performance.

Key words: Time series anomaly detection, Time domain, Frequency domain, Attention mechanism, Decomposition

中图分类号: 

  • TP391.1
[1]LAI K H,ZHA D,XU J,et al.Revisiting time series outlier detection:Definitions and benchmarks[C]//Thirty-fifth Confe-rence on Neural Information Processing Systems Datasets and Benchmarks Track.2021.
[2]LI C,LAMMIE C,DONG X,et al.Seizure detection and prediction by parallel memristive convolutional neural networks[J].IEEE Transactions on Biomedical Circuits and Systems,2022,16(4):609-625.
[3]GOLMOHAMMADI K,ZAIANE O R.Time series contextual anomaly detection for detecting market manipulation in stock market[C]//2015 IEEE International Conference on Data Science and Advanced Analytics(DSAA).IEEE,2015:1-10.
[4]LIU F T,TING K M,ZHOU Z H.Isolation forest[C]//2008 Eighth IEEE International Conference on Data Mining.IEEE,2008:413-422.
[5]VAPNIK V,CHERVONENKIS A Y.A class of algorithms for pattern recognition learning[J].Avtomatikai Telemekhanika,1964,25(6):937-945.
[6]MACQUEEN J.Some methods for classification and analysis of multivariate observations[C]//Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability.1967:281-297.
[7]OEHMCKE S,ZIELINSKI O,KRAMER O.Event detection in marine time series data[C]//KI 2015:Advances in Artificial Intelligence:38th Annual German Conference on AI.Springer,2015:279-286.
[8]FU S,GAO X,ZHAI F,et al.A time series anomaly detection method based on series-parallel transformers with spatial and temporal association discrepancies[J].Information Sciences,2024,657:119978.
[9]YANG Y,ZHANG C,ZHOU T,et al.Dcdetector:Dual atten-tion contrastive representation learning for time series anomaly detection[C]//Proceedings of the 29th ACM SIGKDD Confe-rence on Knowledge Discovery and Data Mining.2023:3033-3045.
[10]GRÖCHENIG K.Uncertainty principles for time-frequency representations[M]//Advances in Gabor Analysis.2003:11-30.
[11]SHEN L,LI Z,KWOK J.Timeseries anomaly detection using temporal hierarchical one-class network[J].Advances in Neural Information Processing Systems,2020,33:13016-13026.
[12]HUNDMAN K,CONSTANTINOU V,LAPORTE C,et al.De-tecting spacecraft anomalies using lstms and nonparametric dynamic thresholding[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mi-ning.387-395.
[13]REN H,XU B,WANG Y,et al.Time-series anomaly detection service at microsoft[C]//Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining.3009-3017.
[14]AHMAD S,LAVIN A,PURDY S,et al.Unsupervised real-time anomaly detection for streaming data[J].Neurocomputing,2017,262:134-147.
[15]KINGMA D P.Auto-encoding variational bayes[J].arXiv:1312.6114,2013.
[16]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.
[17]WANG Z,FENG J,FU Q,et al.Quality control of online monitoring data of air pollutants using artificial neural networks[J].Air Quality,Atmosphere & Health,2019,12:1189-1196.
[18]ZHANG C,ZHOU T,WEN Q,et al.TFAD:A decomposition time series anomaly detection architecture with time-frequency analysis[C]//Proceedings of the 31st ACM International Conference on Information & Knowledge Management.2022:2497-2507.
[19]VASWANI A.Attention is all you need[C]//Proceedings of the 31st International Conference on Neural Information Processing Systems.2017:6000-6010.
[20]XU J.Anomaly transformer:Time series anomaly detection with association discrepancy[J].arXiv:2110.02642,2021.
[21]NAM Y,YOON S,SHIN Y,et al.Breaking the Time-Frequency Granularity Discrepancy in Time-Series Anomaly Detection[C]//Proceedings of the ACM on Web Conference.2024:4204-4215.
[22]TULI S,CASALE G,JENNINGS N R.Tranad:Deep trans-former networks for anomaly detection in multivariate time series data[J].arXiv:220107284,2022.
[23]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.
[24]YI K,ZHANG Q,FAN W,et al.Frequency-domain MLPs are more effective learners in time series forecasting[J].arXiv:2311.06184,2023.
[25]WU H,HU T,LIU Y,et al.Timesnet:Temporal 2d-variationmodeling for general time series analysis[J].arXiv:2210.02186,2022.
[26]ZHOU T,MA Z,WEN Q,et al.Fedformer:Frequency enhanced decomposed transformer for long-term series forecasting[C]//International Conference on Machine Learning.PMLR,2022:27268-27286.
[27]WOO G,LIU C,SAHOO D,et al.Cost:Contrastive learning of disentangled seasonal-trend representations for time series forecasting[J].arXiv:2202.01575,2022.
[28]LEI T,GONG C,CHEN G,et al.A novel unsupervised framework for time series data anomaly detection via spectrum decomposition[J].Knowledge-Based Systems,2023,280:111002.
[29]WU H,XU J,WANG J,et al.Autoformer:Decomposition transformers with auto-correlation for long-term series forecasting[J].arXiv:2106.13008,2021.
[30]WANG H,PENG J,HUANG F,et al.Micn:Multi-scale local and global context modeling for long-term series forecasting[C]//The Eeleventh International Conference on Learning Representations.2023.
[31]LUO Y,LYU Z,HUANG X.TFDNet:Time-Frequency En-hanced Decomposed Network for Long-term Time Series Forecasting[J].arXiv:230813386,2023.
[32]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]//Proceedings of the 37th International Conference on Neural Information Processing Systems.2024:10785-10774.
[33]SHIN Y,LEE S,TARIQ S,et al.Itad:integrative tensor-based anomaly detection system for reducing false positives of satellite systems[C]//Proceedings of the 29th ACM International Conference on Information & Knowledge Management.2020:2733-27340.
[34]TARIQ S,LEE S,SHIN Y,et al.Detecting anomalies in space using multivariate convolutional LSTM with mixtures of probabilistic PCA[C]//Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining.2019:2123-21233.
[35]LI Z,ZHAO Y,HAN J,et al.Multivariate time series anomaly detection and interpretation using hierarchical inter-metric and temporal embedding[C]//Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining.2021:3220-3230.
[36]SU Y,ZHAO Y,NIU C,et al.Robust anomaly detection for multivariate time series through stochastic recurrent neural network[C]//Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining.2019:2828-2837.
[37]PARK D,HOSHI Y,KEMP C C.A multimodal anomaly detector for robot-assisted feeding using an lstm-based variational autoencoder[J].IEEE Robotics and Automation Letters,2018,3(3):1544-1551.
[38]FANG Y,XIE J,ZHAO Y,et al.Temporal-Frequency Masked Autoencoders for Time Series Anomaly Detection[C]//2024 IEEE 40th International Conference on Data Engineering(ICDE).IEEE,2024:1228-1241.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!