Wearable technology enables the unsupervised recording of electrocardiogram (ECG) signals. Analyzing these high-dimensional ECG data poses challenges regarding statistical approaches and explainability. This work investigates the feasibility of medically explainable anomaly detection through disentangled representational learning of ECGs and personalization to mitigate inter-subject variations. Five open-source ECG datasets were converted into a set of denoised one-second traces of lead I signal, each covering individual features such as wave morphologies and pathologies. A beta total correlation variational autoencoder was optimized on four of these datasets for 68 systematic parameterization variants. The best-performing model revealed disentanglement in the 12-dimensional embedding space, specifically between atrial- and ventricular features. Within the embedding space, a k-nearest neighbor classifier was evaluated on a left-out test set tailored for anomaly detection. The result is a F1 score of 0.94 for the binary prediction of sinus rhythm and the pathological classes: Left bundle branch block, right bundle branch block, myocardial infarction, and AV block (1st degree). The 90.94% accuracy in anomaly detection falls within the range of established detectors (89.38%-99.77%) but offers the advantage of being explainable and largely unsupervised. Model fine-tuning for each of 100 randomly sampled individuals of the Icentia11k dataset mitigated inter-subject variations. The associated F1 score for predicting normal, premature atrial contraction, and premature ventricular contraction from the embedding space was 0.93. The distribution plots of pathologies along the explainable axis were reasonably consistent with medical expertise. The results suggest the presented disentangled variational autoencoder as a robust method for explainable ECG representation.
Keywords: Electrocardiography; Explainable anomaly detection; Personalization; Representational learning.
Copyright © 2024 The Authors. Published by Elsevier Ltd.. All rights reserved.