Disentangled representational learning for anomaly detection in single-lead electrocardiogram signals using variational autoencoder - Kapsecker, Maximilian; Möller, Matthias C.; Jonas, Stephan M. (Computers in biology and medicine, 2025)
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. •β total correlation variational autoencoder encode atomic electrocardiogram features.•Anomalies arise as linear combinations of outliers along interpretable axis encodings.•Fine-tuning ECG models per subject personalizes and mitigates data heterogeneity.•Performance remains competitive, despite the model being unsupervised and explainable.