Test-Time Adaptation for a Generalizable Deep Learning-Based ECG Segmentation

Alaa Salama1, Amar Kachenoura2, Salman ALUHAMMAD ALALI2, Guy Carrault2, Lotfi Senhadji3, Ahmad KARFOUL1
1Université de Rennes, 2Univ Rennes, Inserm, LTSI - UMR 1099, 3LTSI - Inserm - Univ Rennes


Abstract

Context and objective: Accurate segmentation of ECG waves (P, QRS and T) is mandatory, since they are used to determine cardiac abnormalities and are crucial for diagnosing of cardiac pathologies. Although many methods have been proposed to ECG segmentation, this task remains challenging as the ECG is subject to noise that can distort its waveforms. This results in a tedious ECG waves identification and leads to a high False Detection Rate (FDR). ECG segmentation methods can be classified into two main categories: unsupervised and supervised. As artifacts can obscure the onset and offset time points of each ECG wave, unsupervised approaches tend to miss-detect these critical time points. Regarding the supervised approaches, typical DL-based ones, generally over-detect ECG waves, leading to a significant FDR in terms of the number of segmented waves.

Method: To cope with these limitations, a new two-stages DL-based ECG segmentation pipeline is proposed: i) a segmentation stage using a trained a multi-head attention-based CNN-LSTM model, and ii) a Test-Time Adaptation (TTA) stage to adapt training data to target ones during test-time inference. TTA aims to increase the model generalizability to either a corrupted version of the training data or to an unseen data.

Resiults: A database-independent evaluation strategy, using two databases from PhysioNet (QT for training and LU for testing) is employed to compare our pipeline with one of the best supervised method (based on self-attention) and two commonly used unsupervised ones (ECGDeli and ECGKit). Obtained results show that the TTA-based paradigm outperforms the unsupervised methods, with an F1-score enhancement of about 10%, 12% and 6% for P, QRS, and T waves, respectively. Regarding, the supervised method, our pipeline exhibits a reduced FDR of about 14% (P), 19% (QRS) and 24% (T). This confirms the potential of TTA in reducing FDR while maintaining high segmentation quality.