《计算机应用》唯一官方网站 ›› 2026, Vol. 46 ›› Issue (4): 1131-1138.DOI: 10.11772/j.issn.1001-9081.2025040448
收稿日期:2025-04-25
修回日期:2025-06-19
接受日期:2025-06-25
发布日期:2025-06-30
出版日期:2026-04-10
通讯作者:
刘松华
作者简介:索逸凡(1997—),男,山西吕梁人,硕士研究生,CCF会员,主要研究方向:时间序列异常检测、数据挖掘基金资助:
Yifan SUO1, Songhua LIU2(
), Qiuzhi HAO2
Received:2025-04-25
Revised:2025-06-19
Accepted:2025-06-25
Online:2025-06-30
Published:2026-04-10
Contact:
Songhua LIU
About author:SUO Yifan, born in 1997, M. S. candidate. His research interests include time series anomaly detection, data mining.Supported by:摘要:
在多变量时间序列异常检测任务中,不同变量之间的相关关系复杂,传统的异常检测方法难以明确学习这种相关关系,且多数模型仅考虑变量之间的相关性,对时间依赖性的学习存在不足。因此,提出一种基于高阶特征聚合的时间序列异常检测方法(HFA)。首先,通过图结构学习构造变量之间的关系图;其次,在传统图注意力网络(GAT)的基础上进行改进,充分考虑高阶邻居节点的相关性,更准确地建模变量之间复杂的相关关系;最后,通过融合一维卷积和自注意力机制,充分挖掘序列的时间依赖性。在4个公开数据集上的对比实验结果表明,与次优基线模型Anomaly Transformer相比,HFA的F1分数平均提升了1.34%;与当前主流基线方法TopoGDN(Topology Graph Deviation Network)相比,HFA的F1分数平均提升了9.05%。消融实验结果进一步验证了模型中各个模块的有效性。
中图分类号:
索逸凡, 刘松华, 郝秋智. 基于高阶特征聚合的时间序列异常检测方法[J]. 计算机应用, 2026, 46(4): 1131-1138.
Yifan SUO, Songhua LIU, Qiuzhi HAO. Time series anomaly detection method based on high-order feature aggregation[J]. Journal of Computer Applications, 2026, 46(4): 1131-1138.
| 数据集 | 指标数 | 训练集样本数 | 测试集样本数 | 异常率/% |
|---|---|---|---|---|
| SMAP | 25 | 135 183 | 427 617 | 13.13 |
| MSL | 55 | 58 317 | 73 729 | 10.27 |
| SMD | 38 | 708 405 | 708 420 | 4.16 |
| SWaT | 51 | 49 680 | 44 991 | 12.21 |
表1 实验中使用的数据集
Tab. 1 Datasets used in experiments
| 数据集 | 指标数 | 训练集样本数 | 测试集样本数 | 异常率/% |
|---|---|---|---|---|
| SMAP | 25 | 135 183 | 427 617 | 13.13 |
| MSL | 55 | 58 317 | 73 729 | 10.27 |
| SMD | 38 | 708 405 | 708 420 | 4.16 |
| SWaT | 51 | 49 680 | 44 991 | 12.21 |
| 模型 | SMAP | MSL | SMD | SWaT | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Precision | Recall | F1 | Precision | Recall | F1 | Precision | Recall | F1 | Precision | Recall | F1 | |
| PCA | 0.924 2 | 0.120 4 | 0.247 5 | 0.937 6 | 0.186 7 | 0.237 9 | 0.943 0 | 0.086 1 | 0.153 7 | 0.954 0 | 0.138 9 | 0.267 1 |
| DAGMM | 0.584 5 | 0.905 8 | 0.710 5 | 0.541 2 | 0.993 4 | 0.700 7 | 0.535 1 | 0.884 5 | 0.666 8 | 0.936 3 | 0.633 1 | 0.755 4 |
| OmniAnomaly | 0.741 6 | 0.977 6 | 0.843 4 | 0.886 7 | 0.911 7 | 0.898 9 | 0.702 8 | 0.803 9 | 0.749 9 | 0.978 2 | 0.695 7 | 0.813 1 |
| MSCRED | 0.817 5 | 0.921 6 | 0.866 4 | 0.891 2 | 0.986 2 | 0.936 3 | 0.727 6 | 0.997 4 | 0.841 4 | 0.754 5 | 0.936 0 | 0.817 2 |
| GAN-Li | 0.671 0 | 0.870 6 | 0.757 9 | 0.710 2 | 0.870 6 | 0.782 3 | 0.530 2 | 0.755 1 | 0.622 9 | 0.697 1 | 0.782 5 | 0.672 2 |
| LSTM-AE | 0.892 0 | 0.267 1 | 0.578 4 | 0.910 5 | 0.337 1 | 0.592 6 | 0.940 9 | 0.282 7 | 0.552 2 | 0.952 9 | 0.335 6 | 0.638 7 |
| LSTM-VAE | 0.855 1 | 0.636 6 | 0.729 8 | 0.525 7 | 0.954 6 | 0.678 0 | 0.757 6 | 0.900 8 | 0.823 0 | 0.812 2 | 0.845 7 | 0.837 7 |
| Anomaly Transformer | 0.935 7 | 0.994 9 | 0.964 4 | 0.920 9 | 0.951 5 | 0.935 9 | 0.894 0 | 0.954 5 | 0.923 3 | 0.915 5 | 0.967 3 | 0.940 7 |
| MTAD-GAT | 0.890 6 | 0.912 3 | 0.901 3 | 0.875 4 | 0.944 0 | 0.908 4 | 0.882 0 | 0.925 4 | 0.897 4 | 0.881 5 | 0.892 1 | 0.917 5 |
| GDN | 0.627 9 | 0.643 1 | 0.578 2 | 0.737 0 | 0.687 6 | 0.596 5 | 0.548 3 | 0.805 6 | 0.637 2 | 0.605 3 | 0.652 3 | 0.584 0 |
| MTGFlow | 0.926 0 | 0.857 5 | 0.890 4 | 0.945 1 | 0.900 1 | 0.922 1 | 0.921 3 | 0.893 1 | 0.915 2 | 0.950 4 | 0.867 5 | 0.907 0 |
| TCN | 0.915 7 | 0.648 3 | 0.771 6 | 0.900 3 | 0.614 5 | 0.730 2 | 0.477 8 | 0.995 1 | 0.647 2 | 0.146 2 | 0.880 5 | 0.252 1 |
| TopoGDN | 0.912 6 | 0.899 3 | 0.905 4 | 0.823 7 | 0.996 7 | 0.902 3 | 0.975 7 | 0.833 9 | 0.899 2 | 0.879 3 | 0.719 1 | 0.791 1 |
| CARLA | 0.394 4 | 0.804 0 | 0.529 2 | 0.389 1 | 0.795 9 | 0.522 7 | 0.427 6 | 0.636 2 | 0.511 4 | 0.988 6 | 0.567 3 | 0.720 9 |
| HFA | 0.933 9 | 0.952 1 | 0.973 9 | 0.947 1 | 0.961 5 | 0.954 7 | 0.973 0 | 0.962 5 | 0.935 1 | 0.954 7 | 0.973 0 | 0.950 9 |
表2 不同异常检测模型的性能对比
Tab. 2 Performance comparison of different anomaly detection models
| 模型 | SMAP | MSL | SMD | SWaT | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Precision | Recall | F1 | Precision | Recall | F1 | Precision | Recall | F1 | Precision | Recall | F1 | |
| PCA | 0.924 2 | 0.120 4 | 0.247 5 | 0.937 6 | 0.186 7 | 0.237 9 | 0.943 0 | 0.086 1 | 0.153 7 | 0.954 0 | 0.138 9 | 0.267 1 |
| DAGMM | 0.584 5 | 0.905 8 | 0.710 5 | 0.541 2 | 0.993 4 | 0.700 7 | 0.535 1 | 0.884 5 | 0.666 8 | 0.936 3 | 0.633 1 | 0.755 4 |
| OmniAnomaly | 0.741 6 | 0.977 6 | 0.843 4 | 0.886 7 | 0.911 7 | 0.898 9 | 0.702 8 | 0.803 9 | 0.749 9 | 0.978 2 | 0.695 7 | 0.813 1 |
| MSCRED | 0.817 5 | 0.921 6 | 0.866 4 | 0.891 2 | 0.986 2 | 0.936 3 | 0.727 6 | 0.997 4 | 0.841 4 | 0.754 5 | 0.936 0 | 0.817 2 |
| GAN-Li | 0.671 0 | 0.870 6 | 0.757 9 | 0.710 2 | 0.870 6 | 0.782 3 | 0.530 2 | 0.755 1 | 0.622 9 | 0.697 1 | 0.782 5 | 0.672 2 |
| LSTM-AE | 0.892 0 | 0.267 1 | 0.578 4 | 0.910 5 | 0.337 1 | 0.592 6 | 0.940 9 | 0.282 7 | 0.552 2 | 0.952 9 | 0.335 6 | 0.638 7 |
| LSTM-VAE | 0.855 1 | 0.636 6 | 0.729 8 | 0.525 7 | 0.954 6 | 0.678 0 | 0.757 6 | 0.900 8 | 0.823 0 | 0.812 2 | 0.845 7 | 0.837 7 |
| Anomaly Transformer | 0.935 7 | 0.994 9 | 0.964 4 | 0.920 9 | 0.951 5 | 0.935 9 | 0.894 0 | 0.954 5 | 0.923 3 | 0.915 5 | 0.967 3 | 0.940 7 |
| MTAD-GAT | 0.890 6 | 0.912 3 | 0.901 3 | 0.875 4 | 0.944 0 | 0.908 4 | 0.882 0 | 0.925 4 | 0.897 4 | 0.881 5 | 0.892 1 | 0.917 5 |
| GDN | 0.627 9 | 0.643 1 | 0.578 2 | 0.737 0 | 0.687 6 | 0.596 5 | 0.548 3 | 0.805 6 | 0.637 2 | 0.605 3 | 0.652 3 | 0.584 0 |
| MTGFlow | 0.926 0 | 0.857 5 | 0.890 4 | 0.945 1 | 0.900 1 | 0.922 1 | 0.921 3 | 0.893 1 | 0.915 2 | 0.950 4 | 0.867 5 | 0.907 0 |
| TCN | 0.915 7 | 0.648 3 | 0.771 6 | 0.900 3 | 0.614 5 | 0.730 2 | 0.477 8 | 0.995 1 | 0.647 2 | 0.146 2 | 0.880 5 | 0.252 1 |
| TopoGDN | 0.912 6 | 0.899 3 | 0.905 4 | 0.823 7 | 0.996 7 | 0.902 3 | 0.975 7 | 0.833 9 | 0.899 2 | 0.879 3 | 0.719 1 | 0.791 1 |
| CARLA | 0.394 4 | 0.804 0 | 0.529 2 | 0.389 1 | 0.795 9 | 0.522 7 | 0.427 6 | 0.636 2 | 0.511 4 | 0.988 6 | 0.567 3 | 0.720 9 |
| HFA | 0.933 9 | 0.952 1 | 0.973 9 | 0.947 1 | 0.961 5 | 0.954 7 | 0.973 0 | 0.962 5 | 0.935 1 | 0.954 7 | 0.973 0 | 0.950 9 |
| 模型 | 时间复杂度 | 模型 | 时间复杂度 |
|---|---|---|---|
| MTAD-GAT | TopoGDN | ||
| GDN | MTGFlow | ||
| Anomaly Transformer | HFA | ||
| TCN |
表3 时间复杂度的对比
Tab. 3 Comparison of time complexity
| 模型 | 时间复杂度 | 模型 | 时间复杂度 |
|---|---|---|---|
| MTAD-GAT | TopoGDN | ||
| GDN | MTGFlow | ||
| Anomaly Transformer | HFA | ||
| TCN |
| [1] | 蒋辉,闫秋艳,姜竹郡. 面向多元时间序列异常检测的对称正定自编码器方法[J]. 计算机应用, 2024, 44(10): 3294-3299. |
| JIANG H, YAN Q Y, JIANG Z J. Symmetric positive definite autoencoder method for multivariate time series anomaly detection[J]. Journal of Computer Applications, 2024, 44(10): 3294-3299. | |
| [2] | 梁李芳,关东海,张吉,等. 基于时空注意力机制的多元时间序列异常检测[J]. 计算机科学, 2023, 50(11A): No.230300022. |
| LIANG L F, GUAN D H, ZHANG J, et al. Spatial-temporal attention mechanism based anomaly detection for multivariate times series[J]. Computer Science, 2023, 50(11A): No.230300022. | |
| [3] | SCHLICHTKRULL M, KIPF T N, BLOEM P, et al. Modeling relational data with graph convolutional networks[C]// Proceedings of the 2018 European Semantic Web Conference, LNCS 10843. Cham: Springer, 2018: 593-607. |
| [4] | VELIČKOVIĆ P, CUCURULL G, CASANOVA A, et al. Graph attention networks[EB/OL]. [2024-10-30].. |
| [5] | DENG A, HOOI B. Graph neural network-based anomaly detection in multivariate time series[C]// Proceedings of the 35th AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2021: 4027-4035. |
| [6] | VASWANI A, SHAZEER N, PARMAR N, et al. Attention is all you need[C]// Proceedings of the 31st International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2017: 6000-6010. |
| [7] | SHYU M L, CHEN S C, SARINNAPAKORN K, et al. A novel anomaly detection scheme based on principal component classifier[EB/OL]. [2024-10-30].. |
| [8] | HAWKINS S, HE H, WILLIAMS G, et al. Outlier detection using replicator neural networks[C]// Proceedings of the 2002 International Conference on Big Data Analytics and Knowledge Discovery, LNCS 2454. Berlin: Springer, 2002: 170-180. |
| [9] | KINGMA D P, WELLING M. Auto-encoding variational Bayes[EB/OL]. [2024-12-20].. |
| [10] | MALHOTRA P, RAMAKRISHNAN A, ANAND G, et al. LSTM-based encoder-decoder for multi-sensor anomaly detection[EB/OL]. [2024-07-11].. |
| [11] | 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. |
| [12] | 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 and Data Mining. New York: ACM, 2019: 2828-2837. |
| [13] | 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 33rd AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2019: 1409-1416. |
| [14] | 丁小欧,于晟健,王沐贤,等. 基于相关性分析的工业时序数据异常检测[J]. 软件学报, 2020, 31(3):726-747. |
| DING X O, YU S J, WANG M X, et al. Anomaly detection on industrial time series data based on correlation analysis[J]. Journal of Software, 2020, 31(3): 726-747. | |
| [15] | ZHAO H, WANG Y, DUAN J, et al. Multivariate time-series anomaly detection via graph attention network[C]// Proceedings of the 2020 IEEE International Conference on Data Mining. Piscataway: IEEE, 2020: 841-850. |
| [16] | GUO S, LIN Y, WAN H, et al. Learning dynamics and heterogeneity of spatial-temporal graph data for traffic forecasting[J]. IEEE Transactions on Knowledge and Data Engineering, 2022, 34(11): 5415-5428. |
| [17] | ZONG X, GUO J, LIU F, et al. TSTA-GCN: trend spatio-temporal traffic flow prediction using adaptive graph convolution network[J]. Scientific Reports, 2025, 15: No.13449. |
| [18] | 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 and Data Mining. New York: ACM, 2018: 387-395. |
| [19] | MATHUR A P, TIPPENHAUER N O. SWaT: a water treatment testbed for research and training on ICS security[C]// Proceedings of the 2016 International Workshop on Cyber-physical Systems for Smart Water Networks. Piscataway: IEEE, 2016: 31-36. |
| [20] | 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 and Data Mining. New York: ACM, 2019: 3009-3017. |
| [21] | ZONG B, SONG Q, MIN M R, et al. Deep autoencoding gaussian mixture model for unsupervised anomaly detection[EB/OL]. [2024-09-13].. |
| [22] | LI D, CHEN D, GOH J, et al. Anomaly detection with generative adversarial networks for multivariate time series[EB/OL]. [2024-09-13].. |
| [23] | XU J, WU H, WANG J, et al. Anomaly Transformer: time series anomaly detection with association discrepancy[EB/OL]. [2024-10-06].. |
| [24] | ZHOU Q, CHEN J, LIU H, et al. Detecting multivariate time series anomalies with zero known label[C]// Proceedings of the 37th AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2023: 4963-4971. |
| [25] | LIU L, TIAN L, KANG Z, et al. Spacecraft anomaly detection with attention temporal convolution networks[J]. Neural Computing and Applications, 2023, 35(13): 9753-9761. |
| [26] | LIU Z, HUANG X, ZHANG Z, et al. Multivariate time-series anomaly detection based on enhancing graph attention networks with topological analysis[C]// Proceedings of the 33rd ACM International Conference on Information and Knowledge Management. New York: ACM, 2024: 1555-1564. |
| [27] | DARBAN Z Z, WEBB G I, PAN S, et al. CARLA: self-supervised contrastive representation learning for time series anomaly detection[J]. Pattern Recognition, 2025, 157: No.110874. |
| [1] | 胡婕, 李鹏程, 孙军, 张佳傲. 基于多视角信息增强和层次化权重的关键短语抽取模型[J]. 《计算机应用》唯一官方网站, 2026, 46(4): 1050-1057. |
| [2] | 尹春勇, 张不凡. 基于多尺度的多变量时间序列异常检测模型[J]. 《计算机应用》唯一官方网站, 2026, 46(3): 790-797. |
| [3] | 董莉梅, 李雁姿, 李家印, 许力. 基于邻域增强的无监督图异常检测[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 458-466. |
| [4] | 罗虎, 张明书. 基于跨模态注意力机制与对比学习的谣言检测方法[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 361-367. |
| [5] | 喇孝伟, 胡立华, 胡建华, 姚晓玲, 王欣波. 融合位置编码和重叠掩模的低重叠点云配准网络[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 536-545. |
| [6] | 钟琪, 张淑芬, 张镇博, 菅银龙, 景忠瑞. 面向联邦学习的投毒攻击检测与防御机制[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 445-457. |
| [7] | 韩锋, 卜永丰, 梁浩翔, 黄舒雯, 张朝阳, 孙士杰. 基于多层次时空交互依赖的车辆轨迹异常检测[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 604-612. |
| [8] | 杨兴耀, 齐正, 于炯, 张祖莲, 马帅, 沈洪涛. 时间感知和空间增强的双通道图神经网络会话推荐模型[J]. 《计算机应用》唯一官方网站, 2026, 46(1): 104-112. |
| [9] | 何凡, 李理, 苑中旭, 杨秀, 韩东轩. 融合图注意力的概念关联记忆网络知识追踪模型[J]. 《计算机应用》唯一官方网站, 2026, 46(1): 43-51. |
| [10] | 邓伊琳, 余发江. 基于LSTM和可分离自注意力机制的伪随机数生成器[J]. 《计算机应用》唯一官方网站, 2025, 45(9): 2893-2901. |
| [11] | 王翔, 陈志祥, 毛国君. 融合局部和全局相关性的多变量时间序列预测方法[J]. 《计算机应用》唯一官方网站, 2025, 45(9): 2806-2816. |
| [12] | 张硕, 孙国凯, 庄园, 冯小雨, 王敬之. 面向区块链节点分析的eclipse攻击动态检测方法[J]. 《计算机应用》唯一官方网站, 2025, 45(8): 2428-2436. |
| [13] | 俞凯乐, 廖家俊, 毛嘉莉, 黄小鹏. 多约束条件下钢铁物流车货匹配的多目标优化[J]. 《计算机应用》唯一官方网站, 2025, 45(8): 2477-2483. |
| [14] | 闫家鑫, 陈艳平, 杨卫哲, 黄瑞章, 秦永彬. 基于特征组合的异构图注意力网络关系抽取[J]. 《计算机应用》唯一官方网站, 2025, 45(8): 2470-2476. |
| [15] | 梁辰, 王奕森, 魏强, 杜江. 基于Transformer-GCN的源代码漏洞检测方法[J]. 《计算机应用》唯一官方网站, 2025, 45(7): 2296-2303. |
| 阅读次数 | ||||||
|
全文 |
|
|||||
|
摘要 |
|
|||||