Manuscript Offprint

arXiv:2609.31546

BeatGraph: Self-Supervised Heartbeat Graphs for Infant ECG Representations from the Home Environment

Mohammad Nur Hossain Khan, M. S. Krafczyk, Beverly G. Bolster, Nancy McElwain, Mark A. Hasegawa-Johnson, Bashima Islam

ABSTRACT

Electrocardiogram (ECG) foundation models typically tokenize the signal into fixed-length patches that ignore cardiac structure, so a patch may split a heartbeat and the number of beats contained in each patch shifts as heart rate varies. This matters most for infants, whose heart rates are higher than adults and whose ECG differs from the adult, clinic-recorded 12-lead data on which these models are built. A model for infant ECG should therefore reason about heartbeats directly rather than recover them from arbitrary patches. We propose BeatGraph, which makes the heartbeat its unit of representation, modeling each 30-second window as a graph of beats. A shared beat encoder turns each heartbeat into a feature vector from its waveform and inter-beat intervals, a Transformer with positional encoding orders the beats in time, and residual graph attention layers relate every beat to every other before attention-based pooling produces a window-level representation. We pretrain BeatGraph on our new corpus of unlabeled infant recordings by predicting the embeddings of masked beats, then fine-tune it for each task. This single backbone supports sleep-wake detection, infant-state classification, activity-source identification, meaning whether movement is infant- or caregiver-initiated, and infant affect recognition, improving macro-F1 over the strongest baseline on each task by 0.076 to 0.158. It also transfers across age groups, reaching 0.892 AUROC on the ZZU-pECG pediatric benchmark among children 0 to 14 years of age, within 0.001 of the best published self-supervised ECG model, and matching that model under linear evaluation on the adult PTB-XL benchmark despite pretraining only on infant recordings. Finally, to our knowledge, we release the first public infant ECG corpus collected in homes, classrooms, and laboratory settings with state and affect labels. This corpus contains 3,408 hours of single-channel ECG from 143 infants aged 3 to 11 months, with unlabeled pretraining data, benchmark tasks, and subject-level splits.

1 INTRODUCTION

Beat-to-beat cardiac activity is regulated by the autonomic nervous system, which shows immense development during the first years of life (Porges & Furman, 2011; Harteveld et al., 2021). This cardiac activity tracks sleep and wake organization, arousal, attention, and emotion regulation, and heart-rate variability, in particular, is a well established marker of infant autonomic regulation that undergirds such behavioral states (Porges & Furman, 2011; Graziano & Derefinko, 2013). Audio and video recordings can capture observable behaviors, yet a quietly distressed or drowsy infant leaves little trace in either. Because electrocardiography (ECG) indexes autonomic function directly, it can be used to assess a wider array of infant states, including those with no outward behavioral expression. Useful representations of infant ECG could therefore support unobtrusive measurements of infants' states and affect that video or audio signals miss. The obstacle is not the signal but the model. Existing ECG representation models are built for adult clinical data and model assumptions do not hold for single-channel recordings collected over long periods in naturalistic settings.

Recent ECG foundation models are predominantly trained on adult clinical datasets, usually standardized 12-lead recordings of ten seconds from patients in controlled resting conditions (Na et al., 2024; McKeen et al., 2025; Nguyen et al., 2025; Liu et al., 2024; Tian et al., 2024). Some architectures depend on this format directly, modeling the spatial relationships among leads or adapting to different lead subsets (Na et al., 2024). Infant ECG falls outside this distribution; autonomic regulation is still maturing through the first years of life (Harteveld et al., 2021), so resting heart rate is close to twice the adult rate (Fleming et al., 2011; Rijnbeek et al., 2001). Beat morphology differs as well: the infant heart is right-ventricular dominant and shifts toward the adult pattern over the first months, and the PR, QRS, and QT intervals are all substantially shorter, so waveform features that adult criteria treat as abnormal are normal at this age (Rijnbeek et al., 2001; Davignon et al., 1979). Recording conditions also differ, and it is here that the mismatch with clinical ECG is widest. Wearable home sensors use fewer leads by design, to keep the device small and comfortable for an infant (Islam et al., 2024), which removes the 12-lead structure that ECG foundation models typically rely on. Fine-tuning adult models does

Figure

Figure 1: Performance of BeatGraph compared with self-supervised baselines on four infant tasks (macro-F1) and two external benchmarks (AUROC).

not address these differences, because the mismatch is in what the model was built to represent.

Pretraining on infant ECG data provides a clear solution given that human labels of infant behavioral and affect states (e.g., sleeping, crying) are costly to collect while infant wearables can produce hundreds of thousands of unlabeled segments during ordinary activity. The open question is how to present that signal to the model. Most self-supervised time-series and ECG models divide a recording into fixed-length patches and reconstruct or contrast them (Nie et al., 2023; Zerveas et al., 2021; Na et al., 2024; Kiyasseh et al., 2021; Mehari & Strothoff, 2022). Fixed-length patches do not reflect cardiac structure. A patch boundary can fall in the middle of a heartbeat, and the number of beats inside a patch changes with heart rate, which for the fast infant rate means a patch-based model must recover the beat structure before it can reason about relationships between beats.

We introduce BeatGraph, which makes the heartbeat the unit of representation. For each thirty-second window, R-peak detection is used to locate individual beats, and each beat becomes a node in a graph. This approach directly answers the tokenization problem because the model no longer has to recover beat structure from arbitrary patches. A shared beat encoder turns each beat into a feature vector from its waveform and its inter-beat intervals. Thus, both morphology and rate variability are captured at the node level, which are the two channels through which cardiac information is expressed. A Transformer with positional encoding then orders the beats in time, and residual graph attention layers (Vaswani et al., 2017; Veličković et al., 2018; Brody et al., 2022) operate over all beat pairs, so the model can connect similar cardiac cycles that are not adjacent in the window. An attention-based pooling step then combines the beats into a single window-level representation. We pretrain BeatGraph on the unlabeled infant corpus by masking a subset of beats and predicting their embeddings from the surrounding beats and a self-distillation regularizer (Grill et al., 2020), then fine-tune it with task-specific heads for downstream tasks.

To train and evaluate BeatGraph, we collected a corpus of single-channel ECG from an infant wearable sensor used in home, classrooms, and laboratory settings. Our experiments show that this single infant-pretrained encoder transfers across tasks and across populations. BeatGraph is fine-tuned for four infant tasks: sleep-wake state classification, four-class infant state classification, infant- or caregiver-initiated movement, and infant affect recognition, reaching an F1-score of 0.589 to 0.923. We further evaluate whether the learned representation transfers beyond the population and recording environment used for pretraining. On the ZZU-pECG pediatric benchmark, BeatGraph achieves comparable performance, despite pretraining exclusively on home recordings from infants aged 3 to 11 months. On PTB-XL, it matches ST-MEM under linear evaluation, though it trails after full fine-tuning. Pretrained on adult ECG instead, the same architecture leads all compared methods under linear evaluation and reaches 0.825 against 0.804 for ST-MEM in the single-channel setting.

Development of infant ECG models has been held back by the data itself. Open infant ECG recordings are scarce; the ones that exist come from small clinical samples (e.g., hospital monitoring of ten preterm infants (Gee et al., 2017)), and larger pediatric datasets are drawn from sleep laboratories (Lee et al., 2022). Neither setting captures continuous recordings of infants in their natural environments, such as home, and neither carries infant states and affect labels that are central to assessing early developmental processes. We release the corpus used in this work to close that gap. It contains 3,408 hours of ECG from 143 infants aged 3 to 11 months, of which 3,361 hours are unlabeled for pretraining and 47.5 hours carry infant state and affect labels for the benchmark tasks. To our knowledge, it is the first public corpus of infant ECG collected in naturalistic settings with behavioral state and affect labels, and supports pediatric representation learning without adapting adult pipelines.

Figure

Figure 2: Overview of BeatGraph. R-peak detection converts each ECG window into a complete graph of heartbeats, encoded by a shared beat encoder, a temporal Transformer, and residual GATv2 layers, then pooled by variability-preserving attention into a window embedding. The model is pretrained with masked beat-embedding prediction and self-distillation.

References (60)