ECG Segmentation using a Neural Network as theBasis for Detection of Cardiac Pathologies

Philipp Sodmann and Marcus Vollmer
Universit├Ąt Greifswald


Introduction: In clinical routine, electrocardiography is an important non-invasive diagnostic tool for the detection of life-threatening diseases of the heart. Subtle changes can be crucial and require years of experience to not be overlooked. To support this task, we created an algorithm that is capable of comprehensively predicting pathological alterations. In order to make the prediction more interpretable, we have not trained an end-to-end model, but a mixture of machine learning algorithms and an expert system, which enables us to visualize intermediate results.

Methods: For ECG segmentation we trained a dilated convolutional neural network (CNN) on tenfold cross-validated data from the 2020 PhysioNet/CinC Challenge. To enlarge the data basis for model building, we further made use of 12-lead ECG's from the Study of Health in Pomerania, SFB TR19 on inflammatory cardiomyopathy, and PTB-XL. The CNN was trained to detect onsets and offsets P and T-waves and QRS complexes in ECG's of arbitrary length. We used categorical accuracy and intersection over union for evaluation of the prediction compared to manual annotations. To increase the efficiency of CNN-based annotations, we have used rule-based active learning to find ECG snippets where prediction is inconclusive. On the basis of the segmented ECG we calculated features that are also used in the clinic, such as percentage of P-waves found, number of extrasystoles and width of QRS complexes. For the final classification of the pathology we used XGBoost.

Results: Our team Heartly AI was able to achieve 96.9 % accuracy and 93.9 % intersection over union on unseen test-data in the segmentation. Our classifier achieved a F1 score of 0.84 (micro) and 0.80 (macro) on a test set and 0.721 F2 score on the hidden test set of the first phase of the challenge with a G2 Score of 0.505 and a geometric mean of 0.603.