BBracke/demographic-ssm-ecg-age
Demographic-Conditioned State Space Models for ECG-Based Age Estimation
This Hugging Face repository contains the official model weights and MICCAI 2026 submission results for the paper "Demographic-Conditioned State Space Models for ECG-Based Age Estimation".
The full code for preprocessing, training, inference, and evaluation is hosted in the companion GitHub Repository.
Model Architecture
We propose a bidirectional State Space Model (BiMamba2) architecture with demographic conditioning (sex) for ECG-based biological age estimation.
The architecture consists of:
- Per-lead convolutional stem with instance normalization and optional MixStyle domain generalization.
- Bidirectional Mamba2 backbone with Adaptive Layer Normalization (AdaLN) for demographic conditioning (sex).
- Hierarchical attention pooling (temporal pooling $\to$ lead-level pooling) to produce a unified patient-level representation.
- Regression head predicting the normalized biological age (rescaled to 0–100 years).
<p align="center"> <img src="architecture.svg" width="100%" alt="Model architecture"> </p> <p align="center"><em>Overview of the proposed demographic-conditioned bidirectional Mamba2 architecture.</em></p>
Repository Structure
.
├── MICCAI2026_submission_results/ # Directory containing submission prediction files and plots
│ ├── bimamba_code15/ # Proposed Model (sex-conditioned) results on CODE-15%
│ ├── bimamba_code15_agnostic/ # Proposed Model (sex-agnostic) results on CODE-15%
│ ├── bimamba_samitrop/ # Proposed Model (sex-conditioned) results on SaMi-Trop
│ ├── bimamba_samitrop_agnostic/ # Proposed Model (sex-agnostic) results on SaMi-Trop
│ ├── resnet_code15/ # 1D-ResNet Baseline results on CODE-15%
│ └── resnet_samitrop/ # 1D-ResNet Baseline results on SaMi-Trop
├── architecture.svg # SVG visualization of the model architecture
├── LICENSE # MIT License
├── model.pth # Pretrained model weights (Proposed Model - sex-conditioned)For each model variant in the MICCAI2026_submission_results/ directory, you will find:
inference_predictions.csv: Per-exam predictions containing exam IDs, ground-truth chronological ages, and predicted biological ages.inference_history.csv: Summarized regression evaluation metrics (loss, MAE, RMSE, $R^2$, etc.).patient_predicted_chronological_age.csv&patient_median_predicted_chronological_age.csv: Patient-level consolidated predictions.plots/: Bland-Altman, scatter plots, and age-gap distribution histograms.survival/: Summary text files and adjusted survival curves generated using Cox proportional hazards models.
Model Weights (model.pth)
The file model.pth contains the pretrained PyTorch weights for the Proposed Model (sex-conditioned).
How to Load the Model Weights
To load and use these weights, clone the GitHub Repository and use the following PyTorch code snippet:
import torch
from model import MultimodalDeepMambaECG
# 1. Instantiate the model matching the submission configuration
model = MultimodalDeepMambaECG(
num_layers=4,
hidden_dim=128,
num_leads=12,
num_sex_classes=2,
downsample_factor=8
)
# 2. Load the state dictionary from model.pth
checkpoint = torch.load("model.pth", map_location="cpu")
state_dict = checkpoint["model"]
model.load_state_dict(state_dict, strict=False)
model.eval()
# Ready for inference!
# Input traces shape: [batch_size, 12, seq_len] (e.g., [B, 12, 4096] at 400Hz)
# Input sex shape: [batch_size] (0 = Female, 1 = Male)
# Outputs: predicted_age (0-1 range), temporal_attention, lead_attention
# Multiply predicted_age by 100.0 to obtain age in years.MICCAI 2026 Submission Results
1. Quantitative Regression Results
Regression performance evaluated on the CODE-15% and SaMi-Trop datasets. Metrics include Mean Absolute Error (MAE) ± standard deviation (STD), Pearson correlation ($R$), coefficient of determination ($R^2$), and mean predicted ages.
<sup>1</sup> Real Mean ± STD for CODE-15%: 51 ± 20. <sup>2</sup> Real Mean ± STD for SaMi-Trop: 60 ± 13.
2. Prognostic Value (Cox Proportional Hazards Regression)
Age- and sex-adjusted Cox regression for all-cause mortality. Hazard Ratios (HR) compare the Overestimation (ECG-age > chronological age + 8 years) and Underestimation (ECG-age < chronological age - 8 years) groups against the Concordant baseline (ECG-age discrepancy $\le$ 8 years).
Citation
If you use these model weights, submission results, or code in your research, please cite our MICCAI 2026 paper:
@inproceedings{bracke2026demographic,
title = {Demographic-Conditioned State Space Models for ECG-Based Age Estimation},
author = {Bracke, Benjamin and Stang, Andreas and Schmidt, B{\"o}rge and Friedrich, Christoph M.},
booktitle = {Medical Image Computing and Computer Assisted Intervention -- MICCAI 2026},
year = {2026},
publisher = {Springer}
}License
The model weights and code are released under the MIT License.
