Journal of Computer Applications ›› 2026, Vol. 46 ›› Issue (10): 3199-3205.DOI: 10.11772/j.issn.1001-9081.2025080958
• Data science and technology • Previous Articles
Zhihong ZHAO1,2(
), Xushuo LIU2
Received:2025-08-21
Revised:2025-09-04
Accepted:2025-09-15
Online:2026-10-21
Published:2026-10-10
Contact:
Zhihong ZHAO
About author:LIU Xushuo, born in 2001, M. S. candidate. His research interests include time series data analysis, anomaly detection.
Supported by:通讯作者:
赵志宏
作者简介:刘栩硕(2001—),男,河北石家庄人,硕士研究生,主要研究方向:时序数据分析、异常检测。
基金资助:CLC Number:
Zhihong ZHAO, Xushuo LIU. Mamba-ADCL: time series anomaly detection method based on contrastive learning and Mamba[J]. Journal of Computer Applications, 2026, 46(10): 3199-3205.
赵志宏, 刘栩硕. 基于对比学习与Mamba的时间序列异常检测方法Mamba-ADCL[J]. 《计算机应用》唯一官方网站, 2026, 46(10): 3199-3205.
Add to citation manager EndNote|Ris|BibTeX
URL: https://www.joca.cn/EN/10.11772/j.issn.1001-9081.2025080958
| 数据集 | 维度 | 样本数 | 异常比例/% | |
|---|---|---|---|---|
| 训练集 | 测试集 | |||
| MSL | 55 | 58 317 | 73 729 | 10.5 |
| SMAP | 25 | 135 183 | 427 617 | 12.8 |
| SWaT | 51 | 495 000 | 449 919 | 12.1 |
| PSM | 25 | 132 481 | 87 841 | 27.8 |
Tab. 1 Details of datasets
| 数据集 | 维度 | 样本数 | 异常比例/% | |
|---|---|---|---|---|
| 训练集 | 测试集 | |||
| MSL | 55 | 58 317 | 73 729 | 10.5 |
| SMAP | 25 | 135 183 | 427 617 | 12.8 |
| SWaT | 51 | 495 000 | 449 919 | 12.1 |
| PSM | 25 | 132 481 | 87 841 | 27.8 |
| 模型 | MSL | SMAP | SWaT | PSM | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
| Trans-ADCL | 93.48 | 75.08 | 83.28 | 92.12 | 89.42 | 90.75 | 96.91 | 77.46 | 86.10 | 98.06 | 97.58 | 97.82 |
| w/o SW | 94.71 | 96.14 | 95.42 | 95.82 | 94.77 | 95.29 | 95.93 | 99.76 | 97.81 | 98.15 | 97.13 | 97.64 |
| w/o SG | 94.50 | 91.98 | 93.22 | 96.09 | 97.69 | 96.88 | 95.81 | 99.18 | 97.47 | 98.18 | 97.82 | 98.00 |
| w/o Freq | 94.00 | 82.07 | 87.63 | 94.84 | 84.38 | 89.30 | 93.65 | 98.27 | 95.90 | 98.09 | 94.28 | 96.15 |
| w/o Time | 94.60 | 88.53 | 91.47 | 94.50 | 91.38 | 92.91 | 93.53 | 95.28 | 94.40 | 98.28 | 97.79 | 98.03 |
| Mamba-ADCL | 95.16 | 96.46 | 95.81 | 96.18 | 97.65 | 96.91 | 95.95 | 100.00 | 97.93 | 98.14 | 98.34 | 98.24 |
Tab. 2 Results of ablation experiments
| 模型 | MSL | SMAP | SWaT | PSM | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
| Trans-ADCL | 93.48 | 75.08 | 83.28 | 92.12 | 89.42 | 90.75 | 96.91 | 77.46 | 86.10 | 98.06 | 97.58 | 97.82 |
| w/o SW | 94.71 | 96.14 | 95.42 | 95.82 | 94.77 | 95.29 | 95.93 | 99.76 | 97.81 | 98.15 | 97.13 | 97.64 |
| w/o SG | 94.50 | 91.98 | 93.22 | 96.09 | 97.69 | 96.88 | 95.81 | 99.18 | 97.47 | 98.18 | 97.82 | 98.00 |
| w/o Freq | 94.00 | 82.07 | 87.63 | 94.84 | 84.38 | 89.30 | 93.65 | 98.27 | 95.90 | 98.09 | 94.28 | 96.15 |
| w/o Time | 94.60 | 88.53 | 91.47 | 94.50 | 91.38 | 92.91 | 93.53 | 95.28 | 94.40 | 98.28 | 97.79 | 98.03 |
| Mamba-ADCL | 95.16 | 96.46 | 95.81 | 96.18 | 97.65 | 96.91 | 95.95 | 100.00 | 97.93 | 98.14 | 98.34 | 98.24 |
| 模型 | MSL | SMAP | SWaT | PSM | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
| 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 |
| 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 | 85.45 | 82.50 | 83.95 | 89.41 | 78.13 | 83.39 | 86.15 | 83.27 | 84.69 | 76.93 | 89.64 | 82.80 |
| 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 |
| 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 |
| THOC | 88.45 | 90.97 | 89.69 | 92.06 | 89.34 | 90.68 | 83.94 | 86.36 | 85.13 | 88.14 | 90.99 | 89.54 |
| AnomalyTrans | 92.09 | 95.15 | 93.59 | 94.13 | 99.40 | 96.69 | 91.55 | 96.73 | 94.07 | 96.91 | 98.90 | 97.89 |
| TimesNet | 89.41 | 75.26 | 81.73 | 89.98 | 55.28 | 68.48 | 91.58 | 95.32 | 93.42 | 98.46 | 95.89 | 97.16 |
| TFMAE | 92.92 | 93.84 | 93.38 | 94.25 | 98.62 | 96.39 | 97.42 | 97.05 | 97.23 | 97.66 | 98.25 | 97.96 |
| Mamba-ADCL | 95.16 | 96.46 | 95.81 | 96.18 | 97.65 | 96.91 | 95.95 | 100.00 | 97.93 | 98.14 | 98.34 | 98.24 |
Tab. 3 Results of comparative experiments
| 模型 | MSL | SMAP | SWaT | PSM | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
| 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 |
| 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 | 85.45 | 82.50 | 83.95 | 89.41 | 78.13 | 83.39 | 86.15 | 83.27 | 84.69 | 76.93 | 89.64 | 82.80 |
| 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 |
| 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 |
| THOC | 88.45 | 90.97 | 89.69 | 92.06 | 89.34 | 90.68 | 83.94 | 86.36 | 85.13 | 88.14 | 90.99 | 89.54 |
| AnomalyTrans | 92.09 | 95.15 | 93.59 | 94.13 | 99.40 | 96.69 | 91.55 | 96.73 | 94.07 | 96.91 | 98.90 | 97.89 |
| TimesNet | 89.41 | 75.26 | 81.73 | 89.98 | 55.28 | 68.48 | 91.58 | 95.32 | 93.42 | 98.46 | 95.89 | 97.16 |
| TFMAE | 92.92 | 93.84 | 93.38 | 94.25 | 98.62 | 96.39 | 97.42 | 97.05 | 97.23 | 97.66 | 98.25 | 97.96 |
| Mamba-ADCL | 95.16 | 96.46 | 95.81 | 96.18 | 97.65 | 96.91 | 95.95 | 100.00 | 97.93 | 98.14 | 98.34 | 98.24 |
| 模型 | 参数量/MB | 平均每次迭代时间/s |
|---|---|---|
| AnomalyTrans | 28.10 | 0.434 |
| TimesNet | 19.10 | 0.309 |
| TFMAE | 9.96 | 0.081 |
| Trans-ADCL | 14.37 | 0.174 |
| Mamba-ADCL | 5.17 | 0.255 |
Tab. 4 Comparison of model complexity on PSM dataset
| 模型 | 参数量/MB | 平均每次迭代时间/s |
|---|---|---|
| AnomalyTrans | 28.10 | 0.434 |
| TimesNet | 19.10 | 0.309 |
| TFMAE | 9.96 | 0.081 |
| Trans-ADCL | 14.37 | 0.174 |
| Mamba-ADCL | 5.17 | 0.255 |
| [1] | Pang G, Shen C, Cao L, et al. Deep learning for anomaly detection: a review[J]. ACM Computing Surveys, 2022, 54(2): No.38. |
| [2] | Yang Y, Zhang H, Li Y. Pipeline safety early warning by multifeature-fusion CNN and LightGBM analysis of signals from distributed optical fiber sensors[J]. IEEE Transactions on Instrumentation and Measurement, 2021, 70: No.2514213. |
| [3] | Yamanishi K, Takeuchi J I. A unifying framework for detecting outliers and change points from non-stationary time series data[C]// KDD 2002. New York: ACM, 2002: 676-681. |
| [4] | Moshtaghi M, Bezdek J C, Leckie C, et al. Evolving fuzzy rules for anomaly detection in data streams[J]. IEEE Transactions on Fuzzy Systems, 2015, 23(3): 688-700. |
| [5] | Canizo M, Triguero I, Conde A, et al. Multi-head CNN-RNN for multi-time series anomaly detection: an industrial case study[J]. Neurocomputing, 2019, 363: 246-260. |
| [6] | 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. |
| [7] | Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[C]// NeurIPS 2017. Red Hook: Curran Associates Inc., 2017: 6000-6010. |
| [8] | Xu J, Wu H, Wang J, et al. Anomaly Transformer: time series anomaly detection with association discrepancy[PP/OL]. V5. arXiv (2022-06-29) [2025-05-03].. |
| [9] | Zhang C, Zhang K, Zhang C, et al. How does SimSiam avoid collapse without negative samples? a unified under-standing with self-supervised contrastive learning[PP/OL]. arXiv (2022-03-30) [2025-05-03].. |
| [10] | 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. |
| [11] | Gu A, Goel K, Ré C. Efficiently modeling long sequences with structured state spaces[PP/OL]. V3. arXiv (2022-08-05) [2025-05-03].. |
| [12] | Gu A, Dao T. Mamba: linear-time sequence modeling with selective state spaces[PP/OL]. V2. arXiv (2024-05-31) [2025-05-03].. |
| [13] | Cai X, Zhu Y, Wang X, et al. MambaTS: improved selective state space models for long-term time series forecasting[PP/OL]. arXiv (2024-05-26) [2025-05-03].. |
| [14] | Liang A, Jiang X, Sun Y, et al. Bi-Mamba+: bidirectional Mamba for time series forecasting[PP/OL]. V3. arXiv (2024-06-27) [2025-05-03].. |
| [15] | Zhang W, Huang J, Wang R, et al. Integration of Mamba and Transformer-MAT for long-short range time series forecasting with application to weather dynamics[C]// ICECCE 2024. Piscataway: IEEE, 2024: 1-6. |
| [16] | Wu Y, Meng X, Hu H, et al. Affirm: interactive mamba with adaptive Fourier filters for long-term time series forecasting[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2025, 39(20): 21599-21607. |
| [17] | Geiger A, Liu D, Alnegheimish S, et al. TadGAN: time series anomaly detection using generative adversarial networks[C]// Big Data 2020. Piscataway: IEEE, 2020: 33-43. |
| [18] | Li Y, Peng X, Zhang J, et al. DCT-GAN: dilated convolutional Transformer-based GAN for time series anomaly detection[J]. IEEE Transactions on Knowledge and Data Engineering, 2023, 35(4): 3632-3644. |
| [19] | Fang Y, Xie J, Zhao Y, et al. Temporal-frequency masked autoencoders for time series anomaly detection[C]// ICDE 2024. Piscataway: IEEE, 2024: 1228-1241. |
| [20] | 郑育靖,何强,张长伦,等. 基于GRU-Attention的无监督多变量时间序列异常检测[J]. 山西大学学报(自然科学版), 2020, 43(4): 756-764. |
| Zheng Yujing, He Qiang, Zhang Changlun, et al. GRU-Attention based unsupervised multivariate time series anomaly detection[J]. Journal of Shanxi University (Natural Science Edition), 2020, 43(4): 756-764. | |
| [21] | 黄训华,张凤斌,樊好义,等. 基于多模态对抗学习的无监督时间序列异常检测[J]. 计算机研究与发展, 2021, 58(8): 1655-1667. |
| Huang Xunhua, Zhang Fengbin, Fan Haoyi, et al. Multimodal adversarial learning based unsupervised time series anomaly detection[J]. Journal of Computer Research and Development, 2021, 58(8): 1655-1667. | |
| [22] | 段雪源,付钰,王坤. 基于VAE-WGAN的多维时间序列异常检测方法[J]. 通信学报, 2022, 43(3): 1-13. |
| Duan Xueyuan, Fu Yu, Wang Kun. Multi-dimensional time series anomaly detection method based on VAE-WGAN[J]. Journal on Communications, 2022, 43(3): 1-13. | |
| [23] | Hundman K, Constantinou V, Laporte C, et al. Detecting spacecraft anomalies using LSTMs and nonparametric dynamic thresholding[C]// KDD 2018. New York: ACM, 2018: 387-395. |
| [24] | Abdulaal A, Liu Z, Lancewicki T. Practical approach to asynchronous multivariate time series anomaly detection and localization[C]// KDD 2021. New York: ACM, 2021: 2485-2494. |
| [25] | Mathur A P, Tippenhauer N O. SWaT: a water treatment testbed for research and training on ICS security[C]// CySWater 2016. Piscataway: IEEE, 2016: 31-36. |
| [26] | Zhou B, Liu S, Hooi B, et al. BeatGAN: anomalous rhythm detection using adversarially generated time series[C]// IJCAI 2019. California: IJCAI, 2019: 4433-4439. |
| [27] | Su Y, Zhao Y, Niu C, et al. Robust anomaly detection for multivariate time series through stochastic recurrent neural network[C]// KDD 2019. New York: ACM, 2019: 2828-2837. |
| [28] | Li Z, Zhao Y, Han J, et al. Multivariate time series anomaly detection and interpretation using hierarchical inter-metric and temporal embedding[C]// KDD 2021. New York: ACM, 2021: 3220-3230. |
| [29] | Shen L, Li Z, Kwok J T. Timeseries anomaly detection using temporal hierarchical one-class network[C]// NeurIPS 2020. Red Hook: Curran Associates Inc., 2020: 13016-13026. |
| [30] | Wu H, Hu T, Liu Y, et al. TimesNet: temporal 2D-variation modeling for general time series analysis[PP/OL]. V3. arXiv (2023-04-12) [2025-05-03].. |
| [1] | Jiaming LIU, Fangju AI. Text-ID sequential recommendation model based on multi-strategy contrastive learning and adaptive label smoothing [J]. Journal of Computer Applications, 2026, 46(8): 2477-2484. |
| [2] | Yan GAO, Yudong YAO. Physiological signal extraction and heart rate measurement based on spatial-temporal Mamba model [J]. Journal of Computer Applications, 2026, 46(8): 2699-2707. |
| [3] | Yan WANG, Xi CHEN, Zhongkai ZHAO, Huan ZHOU, Tao WU, Mengge AI, Xuesong XIAO. Similarity-aware link prediction model for ethnic culture knowledge graph [J]. Journal of Computer Applications, 2026, 46(8): 2447-2456. |
| [4] | Dong LI, Yiji ZHAO, Haiyan DING, Hao WU. Soft whitening inspired non-contrastive SSL framework for time-series forecasting [J]. Journal of Computer Applications, 2026, 46(8): 2457-2466. |
| [5] | Guanghui LI, Licheng QU. Dynamic dilated convolution and hierarchical local-global attention model based on improved Lite-Mono architecture [J]. Journal of Computer Applications, 2026, 46(8): 2567-2576. |
| [6] | Huihui LYU, Zhaoman ZHONG, Yu ZHANG, Jidong FAN. Syntactically enhanced aspect-based sentiment analysis via mutual information maximization and contrastive learning [J]. Journal of Computer Applications, 2026, 46(8): 2440-2446. |
| [7] | Yuqi WANG, Yangsen ZHANG, Pu WANG. High school English reading comprehension model integrating knowledge augmentation and contrastive learning [J]. Journal of Computer Applications, 2026, 46(7): 2096-2103. |
| [8] | Haiwei FAN, Wenshuai DING, Hongzheng XING. Knowledge-aware recommendation performance enhancement method based on multi-heterogeneous topology collaboration and hierarchical contrastive learning [J]. Journal of Computer Applications, 2026, 46(7): 2085-2095. |
| [9] | Yu CHEN, Shuaikang QI, Liwei XU, Haotian ZHU. Social bot detection framework fusing multi-scale wavelet enhancement and self-supervised learning [J]. Journal of Computer Applications, 2026, 46(6): 1756-1766. |
| [10] | Haoran YUAN, Huan LIU, Pengfei JIAO, Zhidong ZHAO, Xianfei ZHANG, Zunliang LIU. Masked autoencoder enhanced dynamic heterogeneous graph representation learning model [J]. Journal of Computer Applications, 2026, 46(6): 1728-1737. |
| [11] | Xiaoqin YU, Wuyang SHAN, Junying QIU, Yu LIN, Ronghao YANG, Mao TIAN. Image tampering localization and detection network under brightness-contrast disturbances [J]. Journal of Computer Applications, 2026, 46(6): 1893-1903. |
| [12] | Hang QI, Tingting DONG, Yongqiang NAI, Xian MO. Contrastive collaborative filtering method based on graph diffusion generation and adaptive sampling [J]. Journal of Computer Applications, 2026, 46(6): 1818-1828. |
| [13] | Bingqing LI, Binhao HUANG, Yubei TANG, Baili ZHANG. Quality of service prediction model for data sparsity and cold start problems [J]. Journal of Computer Applications, 2026, 46(6): 1829-1835. |
| [14] | Xinru LIU, Songhua LIU, Lusha QI, Yaofei MENG. Time series forecasting model based on dynamic weighted ensemble [J]. Journal of Computer Applications, 2026, 46(6): 1863-1871. |
| [15] | Jinghong WANG, Xiao CHEN, Yingmei MA, Bi LI, Jusheng MI, Wei WANG. Multi-level neighborhood contrastive attribute graph clustering based on adaptive learning [J]. Journal of Computer Applications, 2026, 46(6): 1836-1843. |
| Viewed | ||||||
|
Full text |
|
|||||
|
Abstract |
|
|||||