Learning Discriminative Representations of Superimposed P Waves With Weakly Supervised Temporal Contrastive Learning

Jakub Hejc1, Richard Redina2, David Pospisil3, Jana Kolarova4, Zdenek Starek5
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, 2Brno University of Technology; International Clinic Research Centre, St. Anna's University Hospital, Brno, 3Department of Internal Medicine and Cardiology, University Hospital Brno and Faculty of Medicine of Masaryk University, Brno, Czech Republic, 4Brno University of Technology, 5Department of Internal Medicine, Cardioangiology, St. Anne's University Hospital in Brno


Abstract

Background: P-wave morphology and timing hold immense clinical value for diagnosing arrhythmias and conduction disturbances, allowing risk stratification for various cardiac disorders. However, accurate extraction of these features becomes particularly difficult in the presence of pathological rhythms due to low P wave energy, high interindividual variability, and possible overlapping spectral components from superimposed waves.

Methods: Surrogate labels were employed to reformulate the object-wise to a sample-wise (some instances of each wave are labeled) incomplete information problem. A temporal fully-convolutional feature pyramid network (FPN) extracted multi-scale features from the ECG signals. Features were divided into equal-sized temporal regions, whose labels were inferred from individual temporal samples using a multiple-instance learning (MIL) paradigm. Non-sequential embeddings were produced with a multilayer perceptron followed by the computation of alignment-free cosine similarity. A temporal contrastive representation learning (TCRL) approach based on temperature-scaled cross entropy loss minimized the distance between embeddings of similar regions (likely to contain P wave) while maximizing the distance between dissimilar regions. The model was internally-validated on a custom ECG dataset including 3265 short-term recordings (708 individuals) containing premature beats, supraventricular tachycardias (1036 cases), and atrial fibrillation (458 cases).

Results: Compared to our previous work based on a MIL alone, the TCRL approach improved the validation Dice score for region-aggregated probabilities from 81.1% to 81.9%. Subsequently, P wave segmentation on normalized probability maps was significantly improved for TCRL reaching sensitivity and predictive value averaged for both P wave offsets of 70.0% and 80.0% compared to 63.5% and 67.5% for the previous method.

Conclusion: The framework extracts informative representations for P-waves occurring within ST and TQ segments during various pathological scenarios. The proposed TCRL method significantly improves the embedding representation of superimposed P-waves, with potential generalizability to other tasks like arrhythmia classification.