cs.LGAug 24, 2026

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

Authors: Wenhan Jiang, Zhipeng Deng, Jiale Zhou, Haolin Wang, Yafei Ou, Yefeng Zheng

Organizations: Westlake University, Hangzhou, China · Hokkaido University, Sapporo, Japan · RIKEN, Japan

Abstract

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.

Figures & tables

Explore similar work

May 23, 2026

HeartBeatAI: An Interpretable and Robust Deep Learning Framework for Multi-Label ECG Arrhythmia Detection

While Deep Learning (DL) enhances automated electrocardiogram (ECG) analysis, clinical deployment is hindered by class imbalance and the generalization gap. This paper presents HeartBeatAI, a deep learning framework combining domain generalization, multi-scale feature aggregation, and clinical explainability for robust 12-lead ECG classification. Moving beyond image-based paradigms, HeartBeatAI integrates a Squeeze-and-Excitation (SE) ResNet to isolate diagnostic leads alongside a Multi-Layer Concentration Pipeline to capture macro-rhythm and micro-morphological anomalies. To mitigate domain shift, the framework employs MixStyle regularization and Label Smoothing. Rigorous benchmarking across four large-scale datasets using intra-source and Leave-One-Domain-Out (LODO) protocols demonstrates high performance (98% Macro F1-score) under intra-source conditions. However, LODO evaluations reveal significant degradation in detecting rare anomalies, highlighting a persistent challenge in cross-institutional deployment.
Oct 17, 2026

Transport What Shares the Conduction Pathway: Normal-Anchored SPD Geometric Transport for Source-Free Patient Adaptation of Holter and Patch ECG

Electrocardiogram (ECG) beat classifiers lose accuracy on new patients and devices, and source-free adaptation methods that assume class-balanced target batches fail on real recordings, whose label-free prefix is 87.9--98.6% normal beats. We propose Normal-Anchored Geometric Transport (NAGT, GA_NS), which estimates a closed-form symmetric positive-definite congruence map from label-free normal anchors in the first 5 min of each recording and applies it only to the normal and supraventricular prototypes, keeping the ventricular and fusion prototypes fixed. The score offsets and decision rules were set on MIT-BIH only; the rate-invariant RR head (relA) was adopted after the development databases (INCART, SVDB) had been opened; the frozen model was then evaluated once on Icentia11k chest-patch recordings under a pre-registered protocol. In 493 patients (973 recordings, 3,615,388 evaluated beats), NAGT reached an arrhythmia macro-F1F_1 J=12(S-F1+V-F1)=48.7%J = \frac{1}{2}(\text{S-}F_1 + \text{V-}F_1) = 48.7\% [95% CI 42.1, 54.7] versus 34.5% without adaptation (ΔJ=+14.1ΔJ = +14.1 [+8.6, +19.3] pp; 59.8% versus 43.9% in non-AF) and outperformed all five Holm-adjusted comparators, including AdaBN, Tent and T3A. In the 75-patient test subgroup of the historical split (73 analyzed), the gain was not significant (+6.1 [-8.5, +23.4] pp). Adaptation takes a median of 5.8 ms per record without back-propagation.
Aug 31, 2026

Beat-Synchronous Tokenization for ECG Transformers

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.