The Impact of Temporal Context Length and Encoding Strategies on Self-Supervised ECG Representation Learning

Ahmed Sameh, Ramzi Al-Sharawi, Yogatheesan Varatharajah
8/13/2026
cs.LGeess.SP
contrastive-ssl

Official code: muha-0/ecg-ssl-representation-learning (2 stars, Python, MIT, last commit 2026-08-31).

Abstract

Self-supervised electrocardiogram (ECG) models are often trained on a few seconds of ECG signal and, increasingly, on discretized token sequences. It remains unclear whether these choices sacrifice information needed for rhythm inference and longitudinal consistency in real-world ambulatory recordings.

Show full abstract

We present a controlled study on the Icentia11k single-lead dataset that varies (i) the input horizon (16 seconds, 1 minute, 5 minutes, and 10 minutes) and (ii) the front-end representation (continuous convolutional patch embeddings vs. fixed vector-quantized tokens), while holding the Transformer backbone and training protocol constant. Representations are assessed by downstream abnormal rhythm detection and by patient-level retrieval that probes cross-session stability. Our results show that increasing temporal context beyond 16-second snapshots yields stronger transfer and higher retrieval accuracy, with the strongest performance achieved by the 5- and 10-minute models, indicating improved capture of slow-varying rhythm dynamics and individual-specific structure. Across all evaluated horizons, continuous patch embeddings outperform discretized tokens, suggesting that quantization can discard clinically relevant waveform detail. These findings motivate ECG foundation models that emphasize extended context and continuous encoders for clinical prediction and similarity-based applications. Our code and pretrained models are publicly available at https://github.com/muha-0/ecg-ssl-representation-learning.

View on arXivView PDF

Code Implementations(1)

MIT

Controlled study of self-supervised ECG representation learning: 16s vs 10m context and VQ vs CNN patch encoders on Icentia11k, evaluated via rhythm detection and patient-level retrieval.

20PythonFeb 9, 20263 months agoMIT

Similar Papers

Cite this paper

@article{sameh2026impact,
  title  = {The Impact of Temporal Context Length and Encoding Strategies on Self-Supervised ECG Representation Learning},
  author = {Ahmed Sameh and Ramzi Al-Sharawi and Yogatheesan Varatharajah},
  year   = {2026},
  eprint = {2608.12695},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.12695v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.12695.svg)](https://codeofpaper.com/paper/2608.12695)

Discussion