MedMamba: Multi-View State Space Models with Adaptive Graph Learning for Medical Time Series Classification

Da Zhang, Bingyu Li, Zhiyuan Zhao, Hongyuan Zhang, Junyu Gao, Xuelong Li

Continuous monitoring of medical time series (MedTS), such as electroencephalograms (EEGs) and electrocardiograms (ECGs), is a cornerstone of modern healthcare. However, analyzing these complex signals presents significant computational and modeling challenges. Enter MedMamba, a novel end-to-end architecture that combines the linear efficiency of State Space Models (SSMs) with domain-specific inductive biases to achieve state-of-the-art clinical monitoring.

The Challenges of Medical Time Series

Deep learning models face three primary hurdles when processing MedTS data:

  1. Local vs. Global Dynamics: Clinically relevant features range from transient, high-frequency "spikes" to slow, long-term rhythms. Models must capture both simultaneously.
  2. Non-stationarity and Baseline Drift: Real-world clinical recordings are noisy. Patient movement or sensor artifacts often cause "baseline drift"—slow shifts in the signal that obscure true diagnostic patterns.
  3. Latent Channel Interactions: In multi-channel recordings (like a 12-lead ECG), the spatial relationships between sensors are critical but often dynamic or unknown. Many models either assume a fixed anatomical relationship or ignore these correlations entirely.

While Transformers have become the gold standard for sequence modeling, their quadratic computational cost ($O(T^2)$) makes them prohibitively slow and memory-intensive for high-frequency, long-duration medical recordings.

The MedMamba Architecture

To overcome these limitations, MedMamba builds upon the Mamba architecture—a selective State Space Model known for scaling linearly with sequence length. The authors inject three specialized modules tailored to the physics of physiological signals:

  • Multi-Scale Convolutional Embedding (MCE): Rather than a standard linear projection, MedMamba employs parallel depthwise convolutions with varying kernel sizes. This acts as a filter bank, allowing the model to capture both sharp transient events and broader morphological trends directly at the input stage.
  • Tri-branch Differential State Space Encoder (TDSSE): To combat baseline drift, the model processes signals through three parallel views:
  • Raw Branch: Captures the original signal morphology.
  • Differential Branch: Utilizes first-order differences to suppress slow-moving offsets and highlight dynamic changes.
  • Frequency Branch: Uses Fast Fourier Transforms (FFT) to isolate specific rhythmic bands (e.g., Alpha waves in EEGs). These views are fused using learnable gates that dynamically adjust based on signal quality.

  • Spatial Graph Mamba (SGM): Treating sensors as nodes in a graph, this module learns a sample-conditioned, directed dependency structure. By applying sparsity and acyclicity (DAG) priors, the model ensures that the learned channel relationships are interpretable and robust against overfitted noise, eliminating the need for predefined anatomical maps.

Experimental Setup and Key Results

The researchers evaluated MedMamba across five diverse, public datasets, including EEG data (ADFTD, APAVA, TDBRAIN) and ECG data (PTB, PTB-XL). Crucially, the evaluation utilized a Subject-Independent (SI) setting, testing the model on entirely unseen patients to accurately reflect real-world clinical utility.

State-of-the-Art Performance

MedMamba achieved the top F1 score across all five datasets in the rigorous SI setting. For instance, on the ADFTD dataset, it significantly outperformed the next best model (MedGNN) in both Accuracy and AUROC. The results demonstrate that injecting domain-specific inductive biases yields better performance than simply scaling up models, as MedMamba outperformed much larger architectures like GPT4TS (which relies on a frozen LLM backbone).

Unmatched Efficiency and Robustness

The linear scaling of SSMs proved to be a perfect match for medical data. MedMamba occupied a "sweet spot" of high accuracy with a low memory footprint and fast training times, often requiring less than half the GPU memory of Transformer-based competitors like MedFormer or KEMed. Furthermore, when researchers intentionally injected artificial baseline drift or dropped sensor channels, MedMamba degraded much more gracefully than its peers, highlighting its resilience to hardware failures and noise.

Limitations and Future Directions

While MedMamba represents a significant leap forward, the authors note a few areas for future development. Currently, the model relies on supervised learning, requiring expensive, high-quality labeled data; future iterations could explore self-supervised pre-training. Additionally, while the dynamically learned graphs are mathematically sound, they require rigorous clinical validation to ensure the identified causal links are biologically accurate. Finally, expanding this time-series framework to incorporate multi-modal data—such as medical imaging (MRI/CT) or clinical text—could pave the way for more holistic clinical decision-support systems.

Summary updated

BibTeX
@inproceedings{zhang2026medmamba,
  author = {Da Zhang and Bingyu Li and Zhiyuan Zhao and Hongyuan Zhang and Junyu Gao and Xuelong Li},
  title = {{MedMamba: Multi-View State Space Models with Adaptive Graph Learning for Medical Time Series Classification}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=qPqJH0heR0},
}
Figure