《计算机应用》唯一官方网站 ›› 2026, Vol. 46 ›› Issue (3): 790-797.DOI: 10.11772/j.issn.1001-9081.2025030302
收稿日期:2025-03-25
修回日期:2025-04-25
接受日期:2025-04-27
发布日期:2025-05-08
出版日期:2026-03-10
通讯作者:
尹春勇
作者简介:张不凡(2001—),男,河南郑州人,硕士研究生,主要研究方向:异常检测、数据挖掘。
Received:2025-03-25
Revised:2025-04-25
Accepted:2025-04-27
Online:2025-05-08
Published:2026-03-10
Contact:
Chunyong YIN
About author:ZHANG Bufan, born in 2001, M. S. candidate. His research interests include anomaly detection, data mining.
摘要:
多变量时间序列数据常表现出多尺度特征和复杂的相互依赖性,给异常检测带来了挑战。为了解决这一问题,提出一种基于多尺度的多变量时间序列异常检测模型M3AD(Multi-scale Mamba Multi-layer perceptron Anomaly Detection)。首先,采用多尺度特征提取方法,即通过在不同时间尺度上分割时间序列,捕捉短期和长期模式;其次,利用多层感知机(MLP)和卷积层进行特征学习,提取局部和高级特征表示;再次,引入选择性状态空间模型(SSM) Mamba,通过它高效的处理能力捕捉长序列中的关键信息;最后,通过基于KL (Kullback-Leibler)散度的损失函数和异常分数计算,实现对异常的敏感检测。为了验证模型的有效性,将M3AD与Anomaly Transformer和MEMTO等7种模型在4个公共数据集上对比。实验结果表明,M3AD在精确率、召回率和F1分数等关键指标上相较于对比方法展现出显著优势和领先性能,验证了M3AD在多变量时间序列异常检测任务中的有效性和优越性。
中图分类号:
尹春勇, 张不凡. 基于多尺度的多变量时间序列异常检测模型[J]. 计算机应用, 2026, 46(3): 790-797.
Chunyong YIN, Bufan ZHANG. Multi-scale based multivariate time series anomaly detection model[J]. Journal of Computer Applications, 2026, 46(3): 790-797.
| 数据集 | 样本数 | 异常比/% | 特征数 | |
|---|---|---|---|---|
| 训练集 | 测试集 | |||
| MSL | 46 653 | 73 729 | 10.5 | 55 |
| PSM | 105 984 | 26 497 | 27.8 | 25 |
| SMAP | 108 146 | 27 037 | 12.8 | 25 |
| SWaT | 495 000 | 449 919 | 12.1 | 51 |
表1 数据集的统计信息
Tab. 1 Statistics of datasets
| 数据集 | 样本数 | 异常比/% | 特征数 | |
|---|---|---|---|---|
| 训练集 | 测试集 | |||
| MSL | 46 653 | 73 729 | 10.5 | 55 |
| PSM | 105 984 | 26 497 | 27.8 | 25 |
| SMAP | 108 146 | 27 037 | 12.8 | 25 |
| SWaT | 495 000 | 449 919 | 12.1 | 51 |
| 参数 | 值 | 参数 | 值 |
|---|---|---|---|
| 初始学习率 | 0.000 1 | 编码器层数 | 6 |
| 批处理大小 | 64 | 时间窗口大小 | 105 |
| 异常比率 | 0.01 | 补丁大小 | (3,5,7) |
表2 模型参数设置
Tab. 2 Model parameter setting
| 参数 | 值 | 参数 | 值 |
|---|---|---|---|
| 初始学习率 | 0.000 1 | 编码器层数 | 6 |
| 批处理大小 | 64 | 时间窗口大小 | 105 |
| 异常比率 | 0.01 | 补丁大小 | (3,5,7) |
| 模型 | MSL | SMAP | SWaT | PSM | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
| BeatGAN[ | 89.75 | 85.42 | 87.53 | 92.38 | 55.85 | 69.61 | 64.01 | 87.46 | 73.92 | 90.30 | 93.84 | 92.04 |
| LSTM-VAE[ | 85.49 | 79.94 | 82.62 | 92.20 | 67.75 | 78.10 | 76.00 | 89.50 | 82.20 | 73.62 | 89.92 | 80.96 |
| OmniAnomaly[ | 89.02 | 86.37 | 87.67 | 92.49 | 81.99 | 86.92 | 81.42 | 84.30 | 82.83 | 88.39 | 74.46 | 80.83 |
| AnomalyTrans[ | 92.09 | 95.15 | 93.59 | 99.40 | 96.69 | 91.55 | 96.73 | 94.07 | 96.91 | 97.89 | ||
| InterFusion[ | 81.28 | 92.70 | 86.62 | 89.77 | 88.52 | 89.14 | 80.59 | 85.58 | 83.01 | 83.61 | 83.45 | 83.52 |
| MEMTO[ | 92.07 | 93.76 | 96.61 | 99.23 | 98.34 | |||||||
| DiffAD[ | 92.23 | 95.34 | 93.75 | 96.39 | 97.02 | 94.08 | 96.78 | 95.41 | 96.87 | 98.79 | 97.82 | |
| M3AD | 97.73 | 94.83 | 93.92 | 99.70 | 96.72 | 94.33 | 99.87 | 97.02 | 97.56 | 98.85 | ||
表3 不同模型在4个数据集上的性能对比 (%)
Tab. 3 Performance comparison of different models on four datasets
| 模型 | MSL | SMAP | SWaT | PSM | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
| BeatGAN[ | 89.75 | 85.42 | 87.53 | 92.38 | 55.85 | 69.61 | 64.01 | 87.46 | 73.92 | 90.30 | 93.84 | 92.04 |
| LSTM-VAE[ | 85.49 | 79.94 | 82.62 | 92.20 | 67.75 | 78.10 | 76.00 | 89.50 | 82.20 | 73.62 | 89.92 | 80.96 |
| OmniAnomaly[ | 89.02 | 86.37 | 87.67 | 92.49 | 81.99 | 86.92 | 81.42 | 84.30 | 82.83 | 88.39 | 74.46 | 80.83 |
| AnomalyTrans[ | 92.09 | 95.15 | 93.59 | 99.40 | 96.69 | 91.55 | 96.73 | 94.07 | 96.91 | 97.89 | ||
| InterFusion[ | 81.28 | 92.70 | 86.62 | 89.77 | 88.52 | 89.14 | 80.59 | 85.58 | 83.01 | 83.61 | 83.45 | 83.52 |
| MEMTO[ | 92.07 | 93.76 | 96.61 | 99.23 | 98.34 | |||||||
| DiffAD[ | 92.23 | 95.34 | 93.75 | 96.39 | 97.02 | 94.08 | 96.78 | 95.41 | 96.87 | 98.79 | 97.82 | |
| M3AD | 97.73 | 94.83 | 93.92 | 99.70 | 96.72 | 94.33 | 99.87 | 97.02 | 97.56 | 98.85 | ||
| 模型 | MSL | SMAP | SWaT | PSM | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
| M3AD | 92.10 | 97.73 | 94.83 | 93.92 | 99.70 | 96.72 | 94.33 | 100.00 | 97.02 | 97.56 | 98.85 | 98.20 |
| w/o 卷积层 | 91.51 | 92.89 | 92.20 | 93.70 | 98.27 | 95.53 | 93.43 | 99.78 | 96.50 | 97.60 | 97.71 | 97.66 |
| w/o MLP混合器 | 91.30 | 89.45 | 90.37 | 94.68 | 88.68 | 91.59 | 93.07 | 94.54 | 93.80 | 97.41 | 96.61 | 97.01 |
| w/o Mamba编码器 | 90.61 | 87.93 | 89.25 | 94.00 | 83.10 | 88.21 | 93.12 | 99.64 | 96.27 | 97.64 | 94.53 | 96.60 |
表4 消融实验结果 (%)
Tab. 4 Ablation study results
| 模型 | MSL | SMAP | SWaT | PSM | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
| M3AD | 92.10 | 97.73 | 94.83 | 93.92 | 99.70 | 96.72 | 94.33 | 100.00 | 97.02 | 97.56 | 98.85 | 98.20 |
| w/o 卷积层 | 91.51 | 92.89 | 92.20 | 93.70 | 98.27 | 95.53 | 93.43 | 99.78 | 96.50 | 97.60 | 97.71 | 97.66 |
| w/o MLP混合器 | 91.30 | 89.45 | 90.37 | 94.68 | 88.68 | 91.59 | 93.07 | 94.54 | 93.80 | 97.41 | 96.61 | 97.01 |
| w/o Mamba编码器 | 90.61 | 87.93 | 89.25 | 94.00 | 83.10 | 88.21 | 93.12 | 99.64 | 96.27 | 97.64 | 94.53 | 96.60 |
| [1] | HILAL W, GADSDEN S A, YAWNEY J. Financial fraud: a review of anomaly detection techniques and recent advances[J]. Expert Systems with Applications, 2022, 193: No.116429. |
| [2] | SUN Y, CHEN T, NGUYEN Q V H, et al. TinyAD: memory-efficient anomaly detection for time-series data in industrial IoT [J]. IEEE Transactions on Industrial Informatics, 2024, 20(1): 824-834. |
| [3] | TORABI H, MIRTAHERI S L, GRECO S. Practical autoencoder based anomaly detection by using vector reconstruction error[J]. Cybersecurity, 2023, 6: No.1. |
| [4] | 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. |
| [5] | DU B, SUN X, YE J, et al. GAN-based anomaly detection for multivariate time series using polluted training set[J]. IEEE Transactions on Knowledge and Data Engineering, 2023, 35(12): 12208-12219. |
| [6] | LI D, CHEN D, JIN B, et al. MAD-GAN: multivariate anomaly detection for time series data with generative adversarial networks[C]// Proceedings of the 2019 International Conference on Artificial Neural Networks, LNCS 11730. Cham: Springer, 2019: 703-716. |
| [7] | GU Y, JAZIZADEH F. Time series anomaly detection using generative adversarial network discriminators and density estimation for infrastructure systems[J]. Automation in Construction, 2024, 165: No.105500. |
| [8] | GU A, DAO T. Mamba: linear-time sequence modeling with selective state spaces [EB/OL]. [2024-12-25]. . |
| [9] | LIU Y, TIAN Y, ZHAO Y, et al. VMamba: visual state space model[C]// Proceedings of the 38th International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2024: 103031-103063. |
| [10] | AHAMED M A, CHENG Q. TimeMachine: a time series is worth 4 mambas for long-term forecasting [C]// Proceedings of the 27th European Conference on Artificial Intelligence. Amsterdam: IOS Press, 2024: 1688-1695. |
| [11] | LENZ B, LIEBER O, ARAZI A, et al. Jamba: hybrid Transformer-Mamba language models [EB/OL]. [2024-12-13].. |
| [12] | LI K, CHEN G, YANG R, et al. SPMamba: state-space model is all you need in speech separation [EB/OL]. [2024-12-15].. |
| [13] | SHUMWAY R H, STOFFER D S. ARIMA models[M]// 4th ed. Time series analysis and its applications: with R examples, STS. Cham: Springer, 2017: 75-163. |
| [14] | KAYASTHA N, THOMAS V, GALBRAITH J, et al. Monitoring wetland change using inter-annual landsat time-series data[J]. Wetlands, 2012, 32: 1149-1162. |
| [15] | MA J, PERKINS S. Time-series novelty detection using one-class support vector machines[C]// Proceedings of the 2003 International Joint Conference on Neural Networks. Piscataway: IEEE, 2003: 1741-1745. |
| [16] | QIN Y, LOU Y. Hydrological time series anomaly pattern detection based on isolation forest[C]// Proceedings of the IEEE 3rd Information Technology, Networking, Electronic and Automation Control Conference. Piscataway: IEEE, 2019: 1706-1710. |
| [17] | YIN C, ZHANG S, WANG J, et al. Anomaly detection based on convolutional recurrent autoencoder for IoT time series [J]. IEEE Transactions on Systems, Man, and Cybernetics: Systems, 2022, 52(1): 112-122. |
| [18] | LIN S, CLARK R, BIRKE R, et al. Anomaly detection for time series using VAE-LSTM hybrid model [C]// Proceedings of the 2020 IEEE International Conference on Acoustics, Speech and Signal Processing. Piscataway: IEEE, 2020: 4322-4326. |
| [19] | WANG Y, DU X, LU Z, et al. Improved LSTM-based time-series anomaly detection in rail transit operation environments[J]. IEEE Transactions on Industrial Informatics, 2022, 18(12): 9027-9036. |
| [20] | XU J, WU H, WANG J, et al. Anomaly Transformer: time series anomaly detection with association discrepancy [EB/OL]. [2024-12-11].. |
| [21] | 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. New York: ACM, 2023: 3033-3045. |
| [22] | 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. |
| [23] | 段雪源,付钰,王坤. 基于VAE-WGAN的多维时间序列异常检测方法[J]. 通信学报, 2022, 43(3): 1-13. |
| DUAN X Y, FU Y, WANG K. Multi-dimensional time series anomaly detection method based on VAE-WGAN[J]. Journal on Communications, 2022, 43(3): 1-13. | |
| [24] | PHAM T A, LEE J H, PARK C S. MST-VAE: multi-scale temporal variational autoencoder for anomaly detection in multivariate time series[J]. Applied Sciences, 2022, 12(19): No.10078. |
| [25] | 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. |
| [26] | KIM J, KANG H, KANG P. Time-series anomaly detection with stacked Transformer representations and 1D convolutional network[J]. Engineering Applications of Artificial Intelligence, 2023, 120: No.105964. |
| [27] | WANG Z, PEI C, MA M, et al. Revisiting VAE for unsupervised time series anomaly detection: a frequency perspective[C]// Proceedings of the ACM Web Conference 2024. New York: ACM, 2024: 3096-3105. |
| [28] | GU A, GOEL K, RÉ C. Efficiently modeling long sequences with structured state spaces [EB/OL]. [2024-11-25].. |
| [29] | 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. |
| [30] | ABDULAAL A, LIU Z, LANCEWICKI T. Practical approach to asynchronous multivariate time series anomaly detection and localization[C]// Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. New York: ACM, 2021: 2485-2494. |
| [31] | 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 and Data Mining. New York: ACM, 2021: 3220-3230. |
| [32] | SONG J, KIM K, OH J, et al. MEMTO: memory-guided transformer for multivariate time series anomaly detection[C]// Proceedings of the 37th International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2023: 57947-57963. |
| [33] | 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. |
| [34] | ZHOU B, LIU S, HOOI B, et al. BeatGAN: anomalous rhythm detection using adversarially generated time series[C]// Proceedings of the 28th International Joint Conference on Artificial Intelligence. California: IJCAI.org, 2019: 4433-4439. |
| [35] | XIAO C, GOU Z, TAI W, et al. Imputation-based time-series anomaly detection with conditional weight-incremental diffusion models [C]// Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. New York: ACM, 2023: 2742-2751. |
| [1] | 钟琪, 张淑芬, 张镇博, 菅银龙, 景忠瑞. 面向联邦学习的投毒攻击检测与防御机制[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 445-457. |
| [2] | 魏涵玥, 郭晨娟, 梅杰源, 田锦东, 陈鹏, 徐榕荟, 杨彬. 融合时频特征与混合文本的多模态股票预测框架MATCH[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 427-436. |
| [3] | 韩锋, 卜永丰, 梁浩翔, 黄舒雯, 张朝阳, 孙士杰. 基于多层次时空交互依赖的车辆轨迹异常检测[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 604-612. |
| [4] | 董莉梅, 李雁姿, 李家印, 许力. 基于邻域增强的无监督图异常检测[J]. 《计算机应用》唯一官方网站, 2026, 46(2): 458-466. |
| [5] | 吴俊衡, 王晓东, 何启学. 基于统计分布感知与频域双通道融合的时序预测模型[J]. 《计算机应用》唯一官方网站, 2026, 46(1): 113-123. |
| [6] | 王翔, 陈志祥, 毛国君. 融合局部和全局相关性的多变量时间序列预测方法[J]. 《计算机应用》唯一官方网站, 2025, 45(9): 2806-2816. |
| [7] | 冯兴杰, 卞兴鹏, 冯小荣, 王兴隆. 基于扩散模型的增量式时间序列缺失值填充算法[J]. 《计算机应用》唯一官方网站, 2025, 45(8): 2582-2591. |
| [8] | 王慧斌, 胡展傲, 胡节, 徐袁伟, 文博. 基于分段注意力机制的时间序列预测模型[J]. 《计算机应用》唯一官方网站, 2025, 45(7): 2262-2268. |
| [9] | 闫龙博, 毛文涛, 仲志鸿, 范黎林. 面向城市排水管网缺陷诊断的鲁棒无监督多任务异常检测方法[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1833-1840. |
| [10] | 何玉林, 李旭, 贺颖婷, 崔来中, 黄哲学. 基于最大均值差异的子空间高斯混合模型聚类集成算法[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1712-1723. |
| [11] | 李岚皓, 严皓钧, 周号益, 孙庆赟, 李建欣. 基于神经网络的多尺度信息融合时间序列长期预测模型[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1776-1783. |
| [12] | 黄颖, 高胜美, 陈广, 刘苏. 结合信噪比引导的双分支结构和直方图均衡的低照度图像增强网络[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1971-1979. |
| [13] | 王文鹏, 秦寅畅, 师文轩. 工业缺陷检测无监督深度学习方法综述[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1658-1670. |
| [14] | 陈子和, 陈斌. 基于多表征融合的无监督点云异常检测[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1677-1685. |
| [15] | 潘理虎, 彭守信, 张睿, 薛之洋, 毛旭珍. 面向运动前景区域的视频异常检测[J]. 《计算机应用》唯一官方网站, 2025, 45(4): 1300-1309. |
| 阅读次数 | ||||||
|
全文 |
|
|||||
|
摘要 |
|
|||||
