Beyond Deep Learning: An Efficient and Explainable Model for ECG Wave Segmentation

Alaa SALAMA1, Amar Kachenoura2, Lotfi Senhadji3, Guy Carrault2, Alfredo Hernandez4, Ahmad KARFOUL5
1University Rennes, Inserm, 2Univ Rennes, Inserm, LTSI - UMR 1099, 3LTSI - Inserm - Univ Rennes, 4INSERM - LTSI U 1099, 5Université de Rennes


Abstract

Early detection of abnormalities and automated interpretation of electrocardiogram (ECG) signals are essential for many clinical applications. A key step in this process is the segmentation of ECG waves (P, QRS and T), which directly affects subsequent ECG analysis. However, this task remains challenging due to noise and artefacts. We previously proposed a three-stage ConvLSTM_MA ECG segmentation pipeline combining preprocessing, a CNN–LSTM model with multi-head attention, and physiology-informed postprocessing. Although outperforming state-of-the-art supervised and unsupervised methods as shown in our previous study, this approach lacks explainability and incurs a high computational cost. To address these limitations, we propose a lightweight, efficient, and fully explainable ECG waves segmentation approach. The method leverages the time–frequency representation of ECG signals and is grounded in their physiological properties. Each time sample is characterized by its spectral components and its temporal neighborhood. The framework consists of: (i) a time–frequency representation applied to a band-filtered ECG signal, and (ii) sample-wise onset/offset detection using a lightweight multi-layer perceptron (MLP) with linear activation function. The segmentation problem is thus formulated, for each time sample, as a linear regression based on frequency features extracted from neighboring samples within a sliding window. To enhance robustness, two complementary estimations are performed for each time sample: a forward (causal) estimation relying on preceding samples, and a backward (anti-causal) estimation based on future samples. A database-independent evaluation was conducted using the PhysioNet QTDB for training and LUDB for testing. The proposed approach outperforms ConvLSTM_MA, achieving an F1-score of 88.9% for T waves (vs. 87.7% for ConvLSTM_MA) and reducing the false detection rate for P waves to -0.247% (vs. -1.816%). It also exhibits linear computational complexity, compared to the quadratic complexity of ConvLSTM_MA. Overall, the method generalizes well to unseen data and provides accurate segmentation, particularly for challenging P and T waves.