CoolFace
Modelpublic

BBracke/demographic-ssm-ecg-age

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes
Model Card

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:

  1. 1.Per-lead convolutional stem with instance normalization and optional MixStyle domain generalization.
  2. 2.Bidirectional Mamba2 backbone with Adaptive Layer Normalization (AdaLN) for demographic conditioning (sex).
  3. 3.Hierarchical attention pooling (temporal pooling $\to$ lead-level pooling) to produce a unified patient-level representation.
  4. 4.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:

python
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.

Dataset / Metric1D-ResNet BaselineProposed Model<br>(sex-conditioned)Proposed Model<br>(sex-agnostic)
CODE-15% Dataset<sup>1</sup>
&emsp; MAE ± STD8.44 ± 7.126.72 ± 5.816.87 ± 5.88
&emsp; $R$ ; $R^2$0.84 ; 0.690.90 ; 0.800.89 ; 0.79
&emsp; Pred. Mean ± STD52.1 ± 18.751.6 ± 18.352.2 ± 18.1
SaMi-Trop Dataset<sup>2</sup>
&emsp; MAE ± STD9.96 ± 7.617.83 ± 6.308.06 ± 6.31
&emsp; $R$ ; $R^2$0.60 ; 0.040.70 ; 0.380.69 ; 0.35
&emsp; Pred. Mean ± STD62.6 ± 14.162.0 ± 12.362.7 ± 12.0

<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).

Model / Age-Gap GroupCODE-15% HR (95% CI)CODE-15% p-valueSaMi-Trop HR (95% CI)SaMi-Trop p-value
1D-ResNet Baseline
&emsp; Underestimation0.81 (0.76–0.86)< 0.0050.95 (0.55–1.64)0.86
&emsp; Overestimation1.80 (1.68–1.92)< 0.0052.38 (1.51–3.74)< 0.005
Proposed Model (sex-conditioned)
&emsp; Underestimation0.78 (0.73–0.83)< 0.0050.86 (0.49–1.50)0.59
&emsp; Overestimation2.06 (1.92–2.21)< 0.0051.76 (1.10–2.80)0.02
Proposed Model (sex-agnostic)
&emsp; Underestimation0.79 (0.74–0.84)< 0.0050.67 (0.36–1.23)0.19
&emsp; Overestimation1.99 (1.85–2.13)< 0.0051.32 (0.81–2.13)0.26

Citation

If you use these model weights, submission results, or code in your research, please cite our MICCAI 2026 paper:

bibtex
@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.