MedMamba: Recasting Mamba for Medical Time Series Classification

ZhengXiao He, Huayu Li, Xiwen Chen, Janet M. Roveda, Jinghao Wen, Siyuan Tian, Ao LiarXiv 2026 · arXiv · OpenReview

TL;DR

This paper introduces MedMamba, a novel deep learning architecture specifically designed for medical time series classification (like ECGs and EEGs). By incorporating domain-specific inductive biases of physiological signals—centralized spatial dependencies, multi-timescale temporal patterns, and non-causal context—MedMamba achieves state-of-the-art performance with significantly improved efficiency compared to existing Transformer-based methods.

What Problem Does This Paper Address?

Interpreting medical time series data, such as electrocardiograms (ECGs) and electroencephalograms (EEGs), is crucial for diagnosing various conditions. However, this interpretation is often complex, time-consuming, and requires expert knowledge. Automated analysis is highly desirable, especially with the rise of continuous monitoring. Existing deep learning models face challenges:

  • CNNs and RNNs: Struggle with capturing long-range dependencies.
  • Transformers: While good at long-range dependencies, they incur quadratic complexity, which is computationally expensive for long sequences, and their generic attention mechanisms don't fully leverage the inherent structure of physiological signals. They can also introduce redundant interactions that are misaligned with how these signals are structured.

The core problem is developing an efficient and accurate model that can effectively capture the unique temporal and spatial characteristics of medical time series without the computational burden of traditional Transformers.

Methods

MedMamba is built upon three key "inductive biases" derived from the nature of physiological signals:

  1. Spatial Centralization: Medical signals often have diagnostically relevant information concentrated in a subset of channels. MedMamba addresses this with a channel-mixing module. This module acts like a lightweight, adaptive spatial filter that reparameterizes the channel space before temporal modeling, reducing redundancy and aligning the representation with dominant physiological subspaces.
  2. Multi-Timescale Temporal Composition: Physiological signals exhibit dynamics at various timescales (e.g., fast spikes vs. slow rhythms). MedMamba uses multi-scale convolutional tokenization. This involves parallel convolutional "stems" with different strides to process the signal at multiple temporal resolutions simultaneously, mitigating resolution mismatches and capturing both fine-grained details and broader trends.
  3. Non-Causal Contextual Dependency: For offline analysis, medical patterns often depend on both past and future signal information. MedMamba employs bidirectional Mamba blocks. These blocks leverage the efficient, linear-time selective scan mechanism of Mamba but operate in both forward and backward directions, allowing the model to consider the full temporal context within a segment.

These components are integrated into a principle-driven pipeline: channel mixing for spatial refinement, multi-scale embedding for temporal decomposition, and bidirectional Mamba blocks for efficient global context modeling.

Datasets

MedMamba was evaluated on six publicly available medical time-series benchmarks across three modalities:

  • ECG: PTB (binary classification), PTB-XL (multi-class classification)
  • EEG: ADFTD (challenging, high inter-subject variability), APAVA, SleepEDF (long-sequence sleep staging)
  • Human Activity: UCI-HAR (smartphone sensor data)

The experiments were conducted in a subject-independent setting to simulate real-world generalization to unseen patients.

Key Insights and Ideas

  • Domain-Specific Biases are Crucial: The paper strongly argues that generic sequence models are suboptimal for medical time series. Explicitly incorporating signal properties like spatial centralization and multi-timescale dynamics leads to significant improvements.
  • Channel Mixing as a Spatial Filter: The channel mixing module isn't just about mixing features; it acts as an adaptive spatial filter that suppresses noise and amplifies diagnostically relevant cross-channel patterns, leading to more concentrated and discriminative representations.
  • Multi-Scale Tokenization is Key for Temporal Heterogeneity: Using multiple convolutional stems with different strides is vital for effectively capturing events that occur at vastly different temporal scales, a common characteristic of physiological signals.
  • Bidirectional Inference for Offline Tasks: For tasks where the entire segment is available (like most clinical diagnoses), bidirectional processing offers a more natural and effective inductive bias than purely causal models.
  • Efficiency Gains from SSMs: The core of MedMamba's efficiency comes from the State Space Model (SSM) backbone, which scales linearly with sequence length, unlike the quadratic scaling of Transformer attention.

Key Results

  • State-of-the-Art Performance: MedMamba consistently outperformed strong baselines across all six datasets and multiple metrics (accuracy, F1-score, AUROC).
  • Specific Achievements:
    • 85.97% accuracy on the PTB ECG dataset.
  • New state-of-the-art on the challenging ADFTD EEG dataset with 54.72% accuracy and 52.01% F1-score.
  • Strong performance on long-sequence tasks like SleepEDF.
  • Significant Speedup: MedMamba achieved a 4.6x speedup in inference compared to Medformer, highlighting its practicality for real-time applications.
  • Improved Representations: t-SNE visualizations showed that MedMamba learns more discriminative and well-separated feature representations compared to Medformer, especially on complex datasets.
  • Ablation Studies: All proposed components (multi-scale embedding, bidirectional scanning, channel mixing) contributed positively to the overall performance, with multi-scale modeling showing the largest gain.

Limitations and Future Work

  • Limitations: The paper acknowledges that while MedMamba shows strong performance, its effectiveness is demonstrated on specific benchmark datasets. Real-world clinical deployment would require further validation.
  • Future Work:
    • Self-supervised Pre-training: Leveraging large amounts of unlabeled physiological data for pre-training could further enhance representation quality.
  • Cross-Modal Fusion: Integrating information from multiple modalities (e.g., ECG and EEG simultaneously) could capture more comprehensive diagnostic information.
  • Prospective Clinical Studies: Conducting real-time inference studies in clinical settings is proposed as the ultimate validation of MedMamba's practical utility.

Summary updated

Abstract

Medical time series, such as electrocardiograms (ECG) and electroencephalograms (EEG), exhibit complex temporal dynamics and structured cross-channel dependencies, posing fundamental challenges for automated analysis. Conventional convolutional and recurrent models struggle to capture long-range dependencies, while Transformer-based approaches incur quadratic complexity and often introduce redundant interactions that are misaligned with the intrinsic structure of physiological signals. To address these limitations, we propose MedMamba, a principle-driven multi-scale bidirectional state space architecture tailored for medical time series classification. Our design is guided by three key inductive biases of physiological signals: spatial centralization, multi-timescale temporal composition, and non-causal contextual dependency. These principles are instantiated through a lightweight channel-mixing module for cross-channel reparameterization, multi-scale convolutional tokenization for temporal decomposition, and bidirectional Mamba blocks for efficient global context modeling with linear complexity. Extensive experiments on six benchmark datasets spanning EEG, ECG, and human activity signals demonstrate that MedMamba consistently outperforms state-of-the-art methods across diverse modalities. Notably, it achieves 85.97% accuracy on PTB and establishes new state-of-the-art performance on the challenging ADFTD dataset (54.72% accuracy and 52.01% F1-score). Strong results on long-sequence benchmarks, such as SleepEDF, further validate its capability in modeling long-range dependencies. Moreover, MedMamba achieves a speedup of 4.6x in inference, highlighting its practicality for real-time clinical deployment. These results suggest that principle-guided state space modeling offers an effective and scalable alternative to Transformer-based approaches for medical time series analysis.
BibTeX
@misc{he2026medmamba,
  author = {ZhengXiao He and Huayu Li and Xiwen Chen and Janet M. Roveda and Jinghao Wen and Siyuan Tian and Ao Li},
  title = {{MedMamba: Recasting Mamba for Medical Time Series Classification}},
  year = {2026},
  eprint = {2605.05214},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.05214},
}
Figure