
BeatGraph: Self-Supervised Heartbeat Graphs for Infant ECG Representations from the Home Environment
BeatGraph is a self-supervised ECG representation model that tokenizes signals at the level of individual heartbeats rather than fixed-length patches, using a shared beat encoder, a Transformer for temporal ordering, and residual graph attention layers to relate beats within a 30-second window, pretrained via masked-beat embedding prediction. Evaluated on a new 3,408-hour, 143-infant home/classroom/lab ECG corpus, it improves macro-F1 over baselines by 0.076–0.158 on sleep-wake, infant-state, activity-source, and affect tasks, and transfers well to the pediatric ZZU-pECG benchmark (0.892 AUROC) and adult PTB-XL under linear evaluation despite infant-only pretraining.
What it claims
Making the heartbeat the token, instead of a fixed-length patch, yields an ECG encoder that works on single-channel infant wearable data. On four infant tasks it reaches F1 between 0.589 and 0.923. The paper also gives three results the summary does not:
- PTB-XL, linear evaluation: BeatGraph matches ST-MEM but trails it after full fine-tuning.
- ZZU-pECG: 0.892 AUROC, within 0.001 of the best published self-supervised ECG model, not ahead of it.
- PTB-XL, adult pretraining, single channel: the same architecture pretrained on adult ECG instead scores 0.825 against 0.804 for ST-MEM under linear evaluation.
The released corpus is 3,361 unlabeled hours plus only 47.5 labeled hours (state and affect), from 143 infants aged 3–11 months, with subject-level splits.
How it works
- Beat graph. R-peaks are found with NeuroKit using an infant-tuned configuration on 30 s windows sampled at 1000 Hz. Each beat is cropped around its R-peak, with pre/post lengths scaled from the window's median RR interval and clipped to fixed bounds. Crops run 350–675 samples (median 384, at a mean of 137 bpm). Each window keeps at most N=80 beats, zero-padded with a validity mask. The graph is complete over valid beats.
- Beat encoder (shared). A 1-D conv stack (1→32→64 channels) followed by global average pooling. The result is concatenated with [RR_prev, RR_next], projected to d=128 and layer-normalised.
- Temporal Transformer. 2 layers, 4 heads, pre-norm, sinusoidal positional encoding.
- Graph attention. 3 residual GATv2 layers, 4 heads of width 32, attending over all beat pairs.
- Readout. An attention-weighted mean concatenated with a layer-normalised per-dimension standard deviation over beats, giving z ∈ R^256. The std term is there to preserve heart-rate variability, which a plain mean discards.
flowchart LR W[30s window] --> M[Mask 30% of beats] W --> T[Unmasked pass, stop-grad] M --> E[Transformer + GATv2] --> D[Linear decoder] D --> L[L2 on masked beats] T --> L W --> B[Two augmented views, EMA target] B --> Y[BYOL cosine loss x0.5] L --> O[Total loss] Y --> O
Pretraining has two terms:
- Masked beat-embedding prediction. 30% of valid beats are replaced by a learned mask token before the Transformer. The model predicts the post-Transformer embeddings H(1) of an unmasked, stop-gradient pass.
- BYOL regulariser. λ=0.5, EMA decay 0.99. It is there to block constant-embedding collapse.
The schedule is 100 epochs, using the final checkpoint.
Fine-tuning uses a residual-MLP head for 20 epochs, again using the final checkpoint. For 12-lead external data, the single-channel beat encoder runs per lead, the 12 embeddings are concatenated, and missing leads are zero-filled. Shorter external records form one graph each; the mask absorbs the smaller beat count.
Evidence
- Infant tasks: macro-F1 gains of 0.076–0.158 over the strongest baseline per task. The tasks are sleep-wake (2-class), infant state (4-class), activity source (2-class) and affect (2-class). Baselines are ECG-FM, HuBERT-ECG, BYOL, MTAE and ST-MEM. Per-task numbers are not in the fetched text.
- ZZU-pECG: 14,190 records from hospitalized children aged 0–14, 0.892 AUROC.
- PTB-XL: results as above, under both infant and adult pretraining.
- Ablations: listed as covering beat detection, graph attention, tokenization and beat-window capacity, but the results are not in the fetched text.
Limits
- High heart rates degrade the representation:
- 1.7% of windows exceed 160 bpm and are truncated to the first 80 beats.
- Above 171 bpm, adjacent crops overlap (5.1% of beat pairs).
- Depends on R-peak detection. The input is built from detected peaks, so detection errors on noisy wearable signals feed straight into the graph. The detection ablation's result is not shown.
- Small labeled set. The labels cover 47.5 h; the fine-tuning tasks rest on that.
- Weaker on adult ECG after full fine-tuning. For adult 12-lead use, infant pretraining loses to ST-MEM once fully fine-tuned.
- Status. The paper is marked "Submitted for review."
- Release details unknown. The fetched text is truncated mid-method. It gives no code or weights link, no corpus access procedure and no licence; check these before planning to use the data.
Organisations named here
- Mohammad Nur Hossain Khan
- PTB-XL
- ZZU-pECG
Technologies named here
- BeatGraph
- Transformer
Techniques named here
- Heartbeat-graph representation
- Masked-beat embedding prediction
- Shared beat encoder
- Transformer with positional encoding
- Residual graph attention layers
- Attention pooling
Related in research



