计算机科学 ›› 2026, Vol. 53 ›› Issue (11A): 260400143-823.doi: 10.11896/jsjkx.260400143

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

基于自适应掩码和有界异常损失的自监督TCN-Transformer时序数据异常检测框架

黄浩然1, 李宝伟1, 王少鹏1, 李舒越2, 许一成2, 张建君2, 陈伯林2   

  1. 1 许继电气股份有限公司 河南 许昌 461000
    2 西北工业大学计算机学院 西安 710072
  • 出版日期:2026-11-16 发布日期:2026-11-16
  • 通讯作者: 陈伯林(blchen@nwpu.edu.cn)
  • 作者简介:(huanghaoran@xj.cee-group.cn)
  • 基金资助:
    横向合作项目(D5204250559);中央高校基本科研业务费专项资金(D5000250279)

Self-supervised TCN-Transformer Framework with Adaptive Masking and Bounded Anomaly Loss for Time Series Anomaly Detection

HUANG Haoran1, LI Baowei1, WANG Shaopeng1, LI Shuyue2, XU Yicheng2, ZHANG Jianjun2, CHEN Bolin2   

  1. 1 XJ Electric Corporation,Xuchang,Henan 461000,China
    2 School of Computer Science,Northwestern Polytechnical University,Xi’an 710072,China
  • Published:2026-11-16 Online:2026-11-16
  • About author:HUANG Haoran,born in 1975,master,senior engineer.His main research interests include power system automation,real-time data processing.
    CHEN Bolin,born in 1984,Ph.D,asso-ciate professor,Ph.D supervisor,is a senior member of CCF(No.49257S).His main research interests include data mining,machine learning,and bioinformatics.
  • Supported by:
    This work was supported by the Horizontal Cooperation Project(D5204250559) and Fundamental Research Funds for the Central Universities(D5000250279).

摘要: 时间序列异常检测技术能够及时识别并诊断时序数据中的异常模式,在工业生产、民生服务等众多领域具有不可替代的应用价值。然而,现有方法在实际使用中仍存在以下两方面的瓶颈问题:1)多变量时间序列的各变量往往具备差异化周期特性,异常检测需要以多尺度时间依赖的精准建模为前提,但当前主流的 Global/Local 架构中,Global 分支在捕捉长期依赖时易受噪声干扰,导致注意力过度偏向局部区域,难以完整刻画全局时序规律;2)现实场景中异常样本通常稀缺且标注成本高昂,使得很多方法选择利用异常数据增强来规避此问题,但这些方法在异常数据增强后,仍难以让模型精准学习正常与异常样本的判别边界。为破解上述难题,文中提出一种融合自适应掩码与有界异常损失的自监督 TCN-Transformer 时序数据异常检测框架。针对全局注意力与长期时间依赖易受噪声干扰的问题,在 Global 分支中嵌入自适应掩码机制,通过对变量不同维度的差异化分析,在保留关键周期信息的同时,有效抑制噪声对长期依赖建模的干扰;针对样本判别边界学习困难的痛点,在异常插入与样本重建的基础上,设计有界异常损失函数,强化正常与异常样本的区分性学习。实验结果表明,所提方法在多个公开数据集上均展现出优异的检测性能,整体表现显著优于主流基线模型。

关键词: 时间序列, 异常检测, 自监督, 重建, Transformer

Abstract: Time series anomaly detection technology is capable of promptly identifying and diagnosing anomalous patterns within time series data,and it possesses irreplaceable application value across a multitude of domains,including industrial production and public services.Nevertheless,current methodologies encounter two primary bottlenecks in practical applications.Firstly,variables within multivariate time series frequently demonstrate distinct periodic characteristics,necessitating precise modeling that accounts for multi scale temporal dependencies for effective anomaly detection.However,within the prevailing Global/Local architecture,the Global branch is susceptible to noise interference when capturing long term dependencies,resulting in an excessive focus on local regions and hindering the comprehensive characterization of global temporal patterns.Secondly,anomalous samples are typically scarce and incur high labeling costs in real world settings,leading many approaches to employ anomalous data augmentation as a workaround.Nonetheless,even after implementing anomalous data augmentation,these methods still find it challenging to enable the model to precisely delineate the discriminative boundary between normal and anomalous samples.To overcome these challenges,this paper introduces a self supervisedTCN-Transformer anomaly detection framework that integrates adaptive masking and bounded anomaly loss.To mitigate the issue of global attention and long-term temporal dependencies being vulnerable to noise interference,an adaptive masking mechanism is incorporated into the Global branch.Through a differentiated analysis of various variable dimensions,this mechanism effectively suppresses noise interference in long-term dependency modeling while preserving crucial periodic information.To address the challenge of learning the discriminative boundary between samples,a bounded anomaly loss function is devised based on anomalous insertion and sample reconstruction,thereby enhancing the discriminative learning between normal and anomalous samples.Experimental results indicate that the proposed method demonstrates superior detection performance across multiple public datasets,significantly outperforming mainstream baseline models.

Key words: Time series, Anomaly detection, Self-supervised, Reconstruction, Transformer

中图分类号: 

  • TP181
[1] WU X,QIU X,LI Z,et al.CATCH:Channel Aware multivariate Time Series Anomaly Detection via Frequency Patching[C]//13th International Conference on Learning Representations(ICLR).2025:56894-56922.
[2] LI M X,LIU K,CHEN H Y,et al.TSINR:Capturing Temporal Continuity via Implicit Neural Representations for Time Series Anomaly Detection [C]//Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining(KDD).ACM,2025:671-682.
[3] SHENTU Q,LI B,ZHAO K,et al.Towards A General Time Series Anomaly Detectorwith Adaptive Bottlenecks and Dual Adversarial Decoders[C]//13th International Conference on Learning Representations(ICLR).2025:18810-18833.
[4] YU L,LU Q,XUE Y.DTAAD:Dual TCN-attention networks for anomaly detection in multivariate time series data[J].Knowledge Based Systems,2024,295:111849.
[5] ZERVEAS G,JAYARAMAN S,PATEL D,et al.A transfor-mer-based framework for multivariate time series representation learning[C]//Proceedings of the 27th ACMSIGKDD Conference on Knowledge Discovery & Data Mining.2021:2114-2124.
[6] HUNDMAN K,CONSTANTINOU V,LAPORTE C,et al.Detecting spacecraft anomalies using lstms and nonparametric dynamic thresholding[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mi-ning.2018:387-395.
[7] 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.
[8] 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.
[9] LI D,CHEN D,JIN B,et al.MAD-GAN:Multivariate anomaly detection for time series data with generative adversarial networks[C]//International Conference on Artificial Neural Networks.Cham:Springer International Publishing,2019:703-716.
[10] ZHAO H,WANG Y,DUAN J,et al.Multivariate time-seriesanomaly detection via graph attention network[C]//2020 IEEE International Conference on Data Mining(ICDM).IEEE,2020:841-850.
[11] 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.
[12] ZHANG Y,CHEN Y,WANG J,et al.Unsupervised deep anomaly detection for multi-sensor time-series signals[J].IEEE Transactions on Knowledge and Data Engineering,2021,35(2):2118-2132.
[13] DENG A,HOOI B.Graph neural networkbased anomaly detection in multivariate time series[C]//Proceedings of the AAAI Conference on Artificial Intelligence.2021:4027-4035.
[14] VASWANI A,SHAZEER N,PARMAR N,et al.Attention isall you need[J].Advances in Neural Information Processing Systems,2017,30.
[15] 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.
[16] XU J,WU H,WANG J,et al.Anomaly transformer:Time series anomaly detection with association discrepancy[C]//10th International Conference on Learning Representations(ICLR),2022:1-20.
[17] 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.
[18] DARBAN Z Z,YANG Y,WEBB G I,et al.DACAD:Domain adaptation contrastive learning for anomaly detection in multivariate time series[J].IEEE Transactions on Knowledge and Data Engineering,2025.
[19] SIFFER A,FOUQUE P A,TERMIER A,et al.Anomaly detection in streams with extreme value theory[C]//Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining.2017:1067-1075.
[20] LAI K H,ZHA D,XU J,et al.Revisiting time series outlier detection:Definitions and benchmarks[C]//Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track(round 1).2021.
[21] HU S,ZHAO K,QIU X,et al.Multirc:Joint learning for time series anomaly prediction and detection with multi-scale reconstructive contrast[J].arXiv:2410.15997,2024.
[22] MALHOTRA P,VIG L,SHROFF G,et al.Long short term memory networks for anomaly detection in time series [C]//Proceedings of European Symposium on Artificial Neural Networks(ESANN).2015,89(9):94.
[23] GONG D,LIU L,LE V,et al.Memorizing normality to detectanomaly:Memoryaugmented deep autoencoder for unsupervised anomaly detection[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision.2019:1705-1714.
[24] PARK H,NOH J,HAM B.Learning memoryguided normality for anomaly detection[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2020:14372-14381.
[25] LAVIN A,AHMAD S.Evaluating real-time anomaly detection algorithms-the Numenta anomaly benchmark[C]//2015 IEEE 14th International Conference on Machine Learning and Applications(ICMLA).IEEE,2015:38-44.
[26] MOODY G B,MARK R G.The impact of the MIT-BIH arrhythmia database[J].IEEE Engineering in Medicine and Biology Magazine,2001,20(3):45-50.
[27] GOH J,ADEPU S,JUNEJO K N,et al.A dataset to support research in the design of secure water treatment systems[C]//International Conference on Critical Information Infrastructures Security.Cham:Springer International Publishing,2016:88-99.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!