Weakly Supervised P Wave Segmentation in Pathological Electrocardiogram Signals Using Deep Multiple-instance Learning

Jakub Hejc1, Richard Redina2, David Pospisil3, Ivana Rakova4, Zdenek Starek5, Jana Kolarova6
1International Clinical Research Center, St. Anne's University Hospital, Brno, Czech Republic; Department of Pediatric, Children's Hospital, The University Hospital Brno, Brno, Czech Republic, 2International Clinical Research Center, St. Anne's University Hospital, Brno, Czech Republic; Department of Biomedical Engineering, Brno University of Technology, Brno, Czech Republic, 3Department of Internal Medicine and Cardiology, University Hospital Brno and Faculty of Medicine of Masaryk University, Brno, Czech Republic, 4International Clinical Research Center, St. Anne's University Hospital, Brno, Czech Republic, 5International Clinical Research Center, St. Anne's University Hospital, Brno, Czech Republic; 1st Department of Internal Medicine, Cardio-Angiology, Faculty of Medicine, Masaryk University, Brno, Czech Republic, 6Brno University of Technology


Abstract

Background: Obtaining training labels for ECG segmentation tasks relies on manual labeling of individual waves. This is usually time-consuming and lacks reliability in complicated rhythms. To alleviate this issue, we developed an automated pipeline for labelling a part of atrial wave in pathological ECGs using intracardiac electrograms as a reference. The cost of using this label source is incomplete information about overall duration, which we aim to address in this work.

Methods: We adopted a 1D fully-convolutional feature pyramid network (FPN) based on modified ResNet as our backbone architecture. P-wave detection was performed using fixed-size regions of interest (ROI) at different scales of extracted features. A bag label was assigned to each ROI according to a multiple-instance learning paradigm. ROI instance probability distribution vectors were aggregated by a semi-learnable pooling layer consisting of a multilayer perceptron followed by max-pooling. We trained and validated our model on an internal database containing 3265 short-term ECGs recorded in 708 patients (41.7 % women, median age 36.6 years) with various arrhythmias including premature beats, supraventricular tachycardias (1036 cases) and atrial fibrillation (458 cases).

Results: We achieved an overall validation Dice score of 0.811 for MIL aggregated probabilities. By thresholding normalized activation maps, we reached a sensitivity and predictive value of 0.63 and 0.69 for P-wave onset and 0.64 and 0.66 for P-wave offset on the validation subset. Most of the misclassified segments occurred during arrhythmias when the P-wave was superimposed on the QRS complex.

Conclusion: Our method successfully localized most of the P-waves occurring within ST and TQ segments during various pathological scenarios and differentiated well between atrial fibrillation and other rhythms. The framework showed promising performance in embedding the P-wave vector representation into a deep model with the possibility of transfer to other related tasks such as arrhythmia classification.