CS Paper Radar

Beat-Synchronous Tokenization for ECG Transformers

Ahmed Sameh, Nolan Wilson, Max Enderlein, Yogatheesan Varatharajah

cs.LG eess.SP ·submitted 2026-08-31 07:25 UTC · v1
published

Abstract

Transformer-based electrocardiogram (ECG) models commonly tokenize waveforms into fixed temporal patches. Though convenient, fixed patching can split heartbeat structures across token boundaries. We study beat-synchronous tokenization as a physiologically grounded alternative, comparing fixed patches with three beat-aligned strategies: resampled beats, adaptive pooled beats, and resampled beats augmented with R--R interval information. Experiments span two settings: 10-second 12-lead diagnostic classification on PTB-XL after MIMIC-IV-ECG masked pretraining, and 60-second single-lead rhythm classification on Icentia11k after patient-level contrastive pretraining. On PTB-XL, resampled beat tokens achieve the highest mean macro Area Under the ROC Curve (AUROC; 0.8945) and nearly match the best fixed-patch macro Area Under the Precision-Recall Curve (AUPRC; 0.7414), reducing average sequence length from 100 to 11.2 tokens. On Icentia11k, beat-synchronous tokenizers obtain comparable AUPRC to fixed patching with better stability across runs. These results suggest morphology-preserving beat tokenization is a compact, competitive alternative to fixed temporal patching.

Comment
6 pages, 1 figure, 3 tables. Accepted at the 2026 IEEE International Workshop on Machine Learning for Signal Processing (MLSP 2026)

Closest papers

Nearest neighbours by meaning across the whole index.

On the role of the tokenizer in ECG transformer models

cs.LG cs.AI ·2026-09-14 ·Jiawei Li, Fabio Bonassi, Johan Sundström, Thomas B. Schön, Antônio H. Ribeiro
code/datahot direction similarity 0.75
Abstract

Tokenization determines both the physiological content presented to an ECG Transformer and the sequence over which attention operates. We compare eight tokenization strategies across Transformer, Informer, Reformer, and FEDformer on the nine-label CPSC2018 classification task. The input projection and principal backbone capacity are controlled to isolate the effect of token construction. Median-beat and HeartLang tokenization achieve mean macro-AUCs of 0.893 and 0.889 across the four backbones, compared with 0.822 and 0.824 for point-wise and patch-wise tokenization. Pooling the two physiology-aware representations yields an 8.2% relative improvement in macro-AUC. They also reduce mean sequence length from 1,250 to 158 tokens and mean peak training memory from 5.21 to 0.27 GB. The results show that aligning tokens with ECG morphology can improve both predictive performance and memory efficiency without increasing backbone capacity. The source code is available on https://github.com/LeeJarvis996/ecg_tokenizer.

0.35

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

cs.LG eess.SP ·2026-08-13 ·Ahmed Sameh, Ramzi Al-Sharawi, Yogatheesan Varatharajah
publishedcode/data similarity 0.72
Abstract · Accepted at the 48th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC 2026). 6 pages, 2 figures…

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

0.41

Test-Time Adaptation for ECG Classification via SQI-Gated Self-Training and Beat-Rhythm Consistency

cs.LG ·2026-08-24 ·Wenhan Jiang, Zhipeng Deng, Jiale Zhou, Haolin Wang, Yafei Ou +1 more
top venue similarity 0.69
Abstract · Accepted at MICCAI 2026

Deep learning models for electrocardiogram (ECG) classification often suffer from significant performance degradation when deployed in unseen domains due to shifts in acquisition devices and patient populations. Test-time adaptation (TTA) offers a practical solution by adapting models using only unlabeled data at inference time. However, existing TTA methods often underperform on ECG tasks, since naive online updates ignore the hierarchical beat-rhythm structure of cardiac cycles and are vulnerable to signal artifacts, which leads to unstable adaptation and model drift. We propose BeatRhythm-TTA, an ECG-tailored TTA framework that explicitly accounts for ECG's noisy observations and structured beat-rhythm semantics under domain shift. First, to handle pervasive ECG artifacts, we introduce a Signal Quality Index (SQI)-gated adaptation scheme that selectively filters out low-quality signals to prevent harmful updates. Second, to leverage ECG's beat-rhythm semantics, we enforce dual-level consistency so the model preserves beat morphology and rhythm dynamics while adapting to shifted acquisition conditions. Extensive experiments on multi-label ECG diagnosis across three adaptation protocols, using PTB-XL as the source domain and CPSC2018/Georgia as two target domains, demonstrate the effectiveness of our method, yielding an average +2.70% relative improvement in Macro-F1 over the best competing method.

0.55

Learning Cardiac Features: ECG Biometrics Across Time and~Exercise

cs.AI q-bio.TO ·2026-09-18 ·Luca Thiebaud, Paul Chauchat, Mustapha Ouladsine, Stéphane Delliaux
published similarity 0.66
Abstract

Electrocardiograms (ECGs) carry subject-specific patterns enabling reliable individual discrimination, forming the basis of ECG biometrics. Beyond authentication, this paradigm holds significant potential to secure sensitive cardiac data and to serve as a pretext task in self-supervised learning. Yet, most studies remain confined to singlesession, resting data, leaving robustness to temporal and physiological variations largely untested. We address this gap by evaluating ECG biometrics under realistic conditions involving exercise-induced stress and cross-session variability. A Siamese ResNet with late multi-lead fusion strategy is trained on a large ECG dataset extracted from cardiopulmonary exercise tests and evaluated with a exercise-and time-aware protocol, as well as on public benchmarks. This first extensive assessment of ECG biometrics under combined physiological and temporal variability achieves an intra-session rest-to-peak EER of 1.7% and stateof-the-art 3.9% on the CYBHi dataset. Findings support the presence of an intrinsic cardiac signature resilient to physiological and temporal drift.

0.32

Compact and Decodable Electrocardiogram Text for Large Language Models

cs.CL ·2026-11-17 ·Elif Dorukbaşı, İlker Türker
code/data similarity 0.66
Abstract · 9 pages, 5 figures, 5 tables. Preprint of a chapter submitted to "Advances in Artificial Intelligence and Data Science: Methods, Systems, an…

When a twelve-lead electrocardiogram is written as text for a large language model, the number of tokens has to be balanced against the information lost through compression. This paper presents a deterministic encoding that writes eight independent leads as amplitude letters and exact time gaps and recovers the remaining four limb leads algebraically. The key points are selected with a cardiac-cycle-dependent tolerance, the amplitudes are parameterized by a 26-letter logarithmic codebook learned from a training set, and a 10-step tolerance schedule keeps all records within a fixed token budget. The encoding was applied to 21,388 records from the public PTB-XL database and evaluated using an exact decode-and-re-encode round trip, waveform reconstruction error, and a paired comparison of convolutional classifiers trained with 5 different seeds on signals from the original and decoded databases. All records were contained in 4,080 tokens (average: 2,866 tokens, 64.3% fewer than a per-sample transcription), and all stored lead strings were exactly reproduced. The average correlation between the decoded and reference signals was 0.982. The macro-averaged area under the receiver operating characteristic curve was 0.9167 for the reference signals and 0.9157 for the decoded signals (paired difference -0.0010; 95% patient-level bootstrap interval, -0.0028 to 0.0007), within the pre-specified non-inferiority margin of -0.010; this is not a confirmatory result, because the test fold had been used during encoder development. The diagnostic content of a compact text can therefore be preserved, while the language model's ability to read the text is yet another matter.

0.46

ECG for laboratory values:A comprehensive physiological and technical analysis

cs.LG cs.AI ·2026-10-20 ·Walentin Palanchuk
code/data similarity 0.64
Abstract · 78 pages, 17 figures, source code under https://github.com/WPalanchuk/ECG-for-Labvalues

Laboratory measurements are essential for clinical decision making but typically require invasive blood sampling. Recent research suggests that ECG recordings may contain information beyond cardiac rhythm and provide information related to laboratory values. This thesis investigates NT-proBNP prediction from ECG recordings and patient metadata using a multimodal deep learning framework, while considering the physiological plausibility of ECG-based prediction. It also compares a 1-lead configuration using lead II with the corresponding 12-lead configuration. Additional experiments on glucose, hemoglobin, and potassium are presented in the appendix. Regression, binary classification, and three-class classification experiments were conducted using MIMIC-IV, with the three-class task based on clinically established thresholds. The 12-lead configuration consistently achieved better performance. Regression reached a mean absolute error of 534.98 pg/mL for 1-lead and 514.27 pg/mL for 12-lead. Binary classification achieved AUROCs of 0.849 and 0.876, respectively, while three-class classification achieved macro-averaged AUROCs of 0.738 and 0.752. The results indicate that precise NT-proBNP regression remains challenging, whereas broader concentration ranges can be classified more effectively. The findings are consistent with the physiological hypothesis that ECG characteristics and NT-proBNP concentrations reflect shared cardiovascular processes. ECG-based NT-proBNP prediction may therefore provide complementary information, particularly for classifying broader concentration ranges. However, laboratory measurements remain necessary, and validation on independent datasets is required.

0.37

ECGJev: Question-Conditioned Option Scoring for 12-Lead ECG Interpretation

cs.LG eess.SP ·2026-11-01 ·Zhuoyuan Li, Xidong Wu, Hanyu Cui, Jiansong Gao, Rongrong Fu +2 more
code/datahot direction similarity 0.64
Abstract · 5 pages (4 pages plus ethics statement and references), 2 figures. Submitted to IEEE ISBI 2027. Zhuoyuan Li and Xidong Wu contributed equall…

Clinical interpretation of a 12-lead electrocardiogram (ECG) often requires answering targeted diagnostic questions with clear, quantifiable decisions. We introduce ECGJev, the first ECG framework built on a decision decoder, a pretrained language model trained to return a probability for every listed option. A question-conditioned bridge compresses frozen waveform and spectrogram features into 16 ECG tokens, and a two-stage procedure adapts the bridge and low-rank adapters on the decoder's native option readout using diagnostic labels alone, scoring all options for a question in one forward pass. Evaluated across four ECG benchmarks, ECGJev achieves the highest macro-F1 on CPSC2018 (80.46%), PTB-XL (71.68%) and Chapman (96.86%), and generalizes competitively to the small-sample PTB cohort. Concept probes and perturbation analyses further show that its predictions rely directly on the ECG input, remain stable under option-order and wording variations, and transfer zero-shot to unseen waveform concepts. Our code is available at https://github.com/zhuoyuanli-lab/ECGJev.

0.34

ECGWmark: Deep Watermarking of Electrocardiogram Signals With Error-Correcting Codes

eess.SP cs.CRcs.CV ·2026-10-09 ·Kuan-Yu Chen, Kuan-Chen Wang, Yu Tsao, Jian-Jiun Ding
similarity 0.64
Abstract · 10 pages, 3 figures, 4 tables

Wearable electrocardiogram (ECG) recordings pass through multiple networks and systems before automated interpretation, making patient metadata vulnerable to loss. Digital watermarking embeds this metadata directly into the signal. However, conventional ECG watermarking methods fail under temporal desynchronization, and waveform similarity does not guarantee downstream diagnostic preservation. This article presents ECGWmark, a deep watermarking framework for single-lead ECG. A fully convolutional generator embeds the payload without signal quantization, a detector decodes the message frame by frame and verifies watermark presence, and a frozen arrhythmia classifier penalizes changes that would alter diagnostic predictions. To bridge the gap between bit accuracy and whole-message recovery, payloads are protected by extended Hamming codes, validation-selected interleaving, and soft-decision decoding. On the MIT-BIH Arrhythmia Database, ECGWmark maintains over 90\% bit accuracy under time shifts of 10 to 50 samples, where transform baselines fall to chance level. With the coding layer, the protected 16-bit payload achieves 99.86\% exact recovery on clean segments and sustains over 90\% recovery under time shifts, 10\% sample deletion, and 10\% packet loss. Inter-patient evaluation confirms improved ventricular-beat sensitivity with preserved macro-F1. Requiring only 0.56 million parameters and about 15~ms per segment on a desktop CPU, ECGWmark highlights the need to assess physiological watermarking through whole-message recovery and diagnostic consistency.

0.18