《计算机应用》唯一官方网站 ›› 2026, Vol. 46 ›› Issue (10): 3199-3205.DOI: 10.11772/j.issn.1001-9081.2025080958

• 数据科学与技术 • 上一篇    

基于对比学习与Mamba的时间序列异常检测方法Mamba-ADCL

赵志宏1,2(), 刘栩硕2   

  1. 1.石家庄铁道大学 石家庄市人工智能重点实验室,石家庄 050043
    2.石家庄铁道大学 信息科学与技术学院,石家庄 050043
  • 收稿日期:2025-08-21 修回日期:2025-09-04 接受日期:2025-09-15 发布日期:2026-10-21 出版日期:2026-10-10
  • 通讯作者: 赵志宏
  • 作者简介:刘栩硕(2001—),男,河北石家庄人,硕士研究生,主要研究方向:时序数据分析、异常检测。
  • 基金资助:
    石家庄市市级科技计划项目(2512100201A);中国铁路南宁局集团有限公司科研计划项目(工25-2)

Mamba-ADCL: time series anomaly detection method based on contrastive learning and Mamba

Zhihong ZHAO1,2(), Xushuo LIU2   

  1. 1.Shijiazhuang Key Laboratory of Artificial Intelligence,Shijiazhuang Tiedao University,Shijiazhuang Hebei 050043,China
    2.School of Information Science and Technology,Shijiazhuang Tiedao University,Shijiazhuang Hebei 050043,China
  • 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:
    Science and Technology Program of Shijiazhuang(2512100201A);Scientific Research Program of China Railway Nanning Group Company Limited(Gong 25-2)

摘要:

针对现有的时间序列异常检测方法普遍存在对标注数据依赖性强、在复杂场景下的建模能力不足等问题,提出一种基于对比学习与Mamba的时间序列异常检测方法Mamba-ADCL(Anomaly Detection in time series via Contrastive Learning with Mamba)。该方法设计双分支Mamba结构,利用共享权重结构和对比学习策略,有效扩大正常与异常样本间的特征差异,提升模型鲁棒性与泛化能力;同时,提出时域与频域协同建模的表征方法,将时间序列数据转换为频域表示,并与时域数据共同构建双视角的对比学习机制,从而增强对异常模式的识别能力。在4个公开数据集MSL、SMAP、SWaT和PSM上的实验结果表明,Mamba-ADCL的F1-score相较于AnomalyTrans(Anomaly Transformer)分别提升了2.22、0.22、3.86和0.35个百分点,相较于时频掩码自编码器(TFMAE)分别提升了2.43、0.52、0.70和0.28个百分点,验证了该方法在时间序列异常检测中的有效性。

关键词: Mamba, 对比学习, 时间序列异常检测, 自监督学习, 频域

Abstract:

To address the issues of the existing time series anomaly detection methods, such as the heavy reliance on labeled data and the insufficient modeling capability in complex scenarios, a Mamba-ADCL (Anomaly Detection in time series via Contrastive Learning with Mamba) was proposed. In the method, a dual-branch Mamba structure was designed, in which a shared-weight framework and a contrastive learning strategy were employed to enhance the feature discrepancies between normal and abnormal samples effectively, thereby improving model robustness and generalization. Meanwhile, a representation method with collaborative time-domain and frequency-domain modeling was introduced, in which time series data was transformed into frequency representations and combined with time-domain data to construct a dual-view contrastive learning mechanism jointly, thereby enhancing the recognition ability for abnormal patterns. Experimental results on four public datasets, MSL, SMAP, SWaT, and PSM show that the F1-score of Mamba-ADCL is improved by 2.22, 0.22, 3.86, and 0.35 percentage points compared with that of AnomalyTrans (Anomaly Transformer), and by 2.43, 0.52, 0.70, and 0.28 percentage points compared with that of TFMAE (Temporal-Frequency Masked AutoEncoder), which verifying the effectiveness of Mamba-ADCL in time series anomaly detection.

Key words: Mamba, contrastive learning, time series anomaly detection, self-supervised learning, frequency domain

中图分类号: