YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
ECG-Mamba-V2
ECG-Mamba-V2: Architectural Refinements to a Bidirectional State Space Model for Multi-Label 12-Lead ECG Classification
This paper has been accepted as a letter in Frontiers of Computer Science (FCS).
This repository contains the official code for the paper.
Overview
ECG-Mamba-V2 is a bidirectional state space model for multi-label classification of 12-lead ECG recordings. It refines the ECG-Mamba architecture with:
- bidirectional depthwise convolution in addition to the bidirectional SSM scan,
- the class token placed at the end of the token sequence,
- removal of the output scaling factor,
- uniform dropout (rate 0.1 in every block),
- a cosine annealing schedule with linear warm-up.
Results
Macro-averaged scores, mean over 15 runs (3 seeds x 5 folds), patient-grouped 5-fold cross-validation.
| Dataset | Model | AUPRC | AUROC |
|---|---|---|---|
| PhysioNet/CinC 2021 | ECG-Mamba | 0.6083 | 0.9643 |
| PhysioNet/CinC 2021 | ECG-Mamba-V2 | 0.6494 | 0.9716 |
| PhysioNet/CinC 2020 | ECG-Mamba | 0.5554 | 0.9524 |
| PhysioNet/CinC 2020 | ECG-Mamba-V2 | 0.5681 | 0.9561 |
Complexity: 17.17 M parameters, 17.49 GMac, 252 samples/s (batch size 20, RTX 3090 Ti).
Requirements
Needs a CUDA GPU. mamba-ssm and causal-conv1d must be installed for the fast path.
Data
Download the PhysioNet/CinC Challenge 2021 (and 2020) training data from https://physionet.org/content/challenge-2021/, then build the cross-validation folds:
Recordings that share the proxy patient key (source, age, sex, label set) are kept in the same fold to avoid leakage.
Training
bash ECG_scenario2021.sh (from scripts)
Repeat for folds 0-4 and seeds 0, 1, 2, then average.
Complexity profiling
python compute_flops.py
Citation
@article{ecgmambav2,
title = {ECG-Mamba-V2: Architectural Refinements to a Bidirectional State Space Model for Multi-Label 12-Lead ECG Classification},
author = {<authors>},
journal = {Frontiers of Computer Science},
note = {Letter, accepted},
year = {2026}
}
Acknowledgement
The implementation builds on Vision Mamba (Vim) and Mamba.
License
<MIT / Apache-2.0 — choose one>