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

2026-08-24Machine Learning

Machine Learning
AI summary

The authors address the problem that deep learning models for ECG classification don't work well when used with new devices or patient groups. They propose BeatRhythm-TTA, a method that adapts models during testing by focusing on good quality ECG signals and preserving the natural heartbeat and rhythm patterns. This approach helps avoid mistakes caused by noisy signals and unstable updates. Experiments show that their method improves performance compared to other techniques when applied to different ECG datasets.

ECG classificationdeep learningtest-time adaptationbeat-rhythm structuresignal quality indexmodel driftdomain shiftcardiac cyclesmulti-label diagnosisMacro-F1 score
Authors
Wenhan Jiang, Zhipeng Deng, Jiale Zhou, Haolin Wang, Yafei Ou, Yefeng Zheng
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.