Skip to content
AI.info

Research

A novel approach to classification of ECG arrhythmia types with latent ODEs

Overview Research area: Machine learning for health — in particular, deep generative time-series modeling applied to electrocardiogram (ECG) arrhythmia classification. Technical level: Intermediate. T

A novel approach to classification of ECG arrhythmia types with latent ODEs
arXiv
2511.16933
Published
2025-11-21
Authors
Angelina Yan, Matt L. Sampson, Peter Melchior

AI summary

Overview

Research area: Machine learning for health — in particular, deep generative time-series modeling applied to electrocardiogram (ECG) arrhythmia classification.

Technical level: Intermediate. The paper combines two standard components (a latent ODE encoder and a gradient boosted decision tree) but assumes familiarity with generative latent-variable models, ODE solvers, and classification metrics.

Scope: The paper presents an end-to-end pipeline that encodes single-lead ECG waveforms into latent vectors with a path-minimized latent ODE, then classifies arrhythmia types with a gradient boosted decision tree, testing how well performance survives aggressive downsampling from 360 Hz to 90 Hz and 45 Hz.

What This Paper Is About

Wearable ECGs allow long-term continuous heart monitoring but must sample at lower rates to save battery, which degrades the waveform shape that arrhythmia diagnosis depends on. The authors ask whether a model trained on high-frequency ECG can produce feature representations that remain informative even when the input signal is heavily downsampled. Their goal is a classification pipeline that keeps accuracy roughly stable across sampling frequencies, so that lower-power sensors do not force a loss in diagnostic quality.

Key Contributions

  1. A latent ODE feature extractor for ECG. The authors train a path-minimized latent ODE on 360 Hz single-lead (MLII) ECG beats and use the encoder to compress each waveform into a low-dimensional latent vector. The latent space uses 45 hidden and 45 latent dimensions.

  2. A modular two-stage classification pipeline. Instead of an end-to-end deep classifier, the latent ODE encoder is paired with a gradient boosted decision tree (GBDT), allowing the classification stage to be swapped independently of the encoder. At test time, the pipeline draws n random latent samples per ECG and takes the mode as the final predicted class.

  3. A robustness test across three sampling frequencies. Each waveform is encoded from data natively at 360 Hz and from naive downsampled versions at 90 Hz and 45 Hz (achieved by taking every nth entry), with macro-averaged AUC-ROC of 0.984, 0.978, and 0.976 respectively.

  4. Quantification of residual class-imbalance failure. The paper reports per-class metrics across all five AAMI classes, showing where low sampling frequency hurts most (the minority S and F classes).

Main Findings

  • Minimal degradation with downsampling: Macro-averaged AUC-ROC was 0.984 at 360 Hz, 0.978 at 90 Hz, and 0.976 at 45 Hz. Macro-averaged accuracy fell from 87.0% at 360 Hz to 85.9% at 90 Hz to 82.9% at 45 Hz; macro-averaged precision was 0.85, 0.84, 0.82; recall 0.87, 0.85, 0.83; and F1 0.86, 0.85, 0.82.

  • Strong performance on the majority classes: For class N (10,988 beats), accuracy was 98.0%, 97.7%, and 97.7% at 360 Hz, 90 Hz, and 45 Hz, with precision, recall, and F1 all reported as 0.98 across the three frequencies. For class V (918 beats), accuracy was 93.9%, 93.6%, and 92.6%. For class Q (1,001 beats), accuracy was 95.4%, 94.3%, and 93.3%.

  • Minority classes are the weak point: Class S (327 beats) reached accuracy of 75.2%, 70.5%, and 70.1% across the three frequencies, with F1 of 0.72, 0.68, and 0.67. Class F (99 beats) reached accuracy of 72.3%, 69.6%, and 60.8%, with F1 of 0.72, 0.72, and 0.63.

  • The largest single drop is class F at 45 Hz: Accuracy for F fell from 72.3% at 360 Hz to 60.8% at 45 Hz, and class S fell from 75.2% at 360 Hz to 70.1% at 45 Hz.

  • Confusion between minority and normal beats: The normalized confusion matrices show S and F are most commonly mislabeled as N, and this problem becomes particularly clear in the 45 Hz trial.

  • Discrepancy between AUC and F1 signals class imbalance: The paper notes that the gap between AUC-ROC values (0.984, 0.978, 0.976) and macro-averaged F1 values (0.86, 0.85, 0.82) indicates the model still suffers from class imbalance, with poor minority-class performance dragging down the macro averages.

  • Latent space organizes by arrhythmia class: A UMAP projection of encoded test-set vectors shows similar class labels clustering together, which the authors take as evidence that the latent ODE produces meaningful encodings.

  • Faithful reconstruction with few dimensions: Using only 45 latent dimensions, the trained latent ODE reconstructs randomly sampled ECG time series with close agreement to the true signal.

Methodology in Plain English

The authors start with the PhysioNet MIT-BIH Arrhythmia Database, which contains 48 two-channel ECG recordings from 47 individuals sampled at 360 Hz. They use only the modified limb lead II (MLII) channel because most wearables are single-lead devices. After denoising and peak matching following Liu et al. (2020), they extract 88,887 beats and label each one into one of the five AAMI categories: normal (N), ventricular (V), supraventricular (S), fusion of normal and ventricular (F), and unknown (Q).

The core model is a latent ODE, specifically a path-minimized variant from Sampson and Melchior (2025) that replaces the usual variational loss component with an L2 regularizer minimizing point-to-point distance within a single latent trajectory. The ODE function is a two-layer feed-forward network with width 50 and Tanh activations, solved with the Tsit5 (Tsitouras 5/4) solver with adaptive steps and initial dt = 0.001, trained for 50,000 steps (about 2 hours on a single NVIDIA A100). This encoder compresses each waveform into a single latent vector.

Those latent vectors become the inputs to a scikit-learn gradient boosted decision tree with 1,000 trees and a maximum depth of 8. Because the classes are imbalanced, the authors apply SMOTE to the latent feature vectors so that training sees equal numbers per class. During testing, they sample n random latent vectors per ECG and take the mode of the n predictions as the final label. To test frequency robustness, they naively downsample the ECG by taking every nth entry to reach 90 Hz and 45 Hz, then run the same trained pipeline.

Why This Matters

Impact on research. The work sits at the intersection of generative time-series modeling and clinical signal processing. It demonstrates that a learned continuous-time latent representation can act as a frequency-robust feature extractor, and it shows that keeping the encoder and the classifier as separate stages still yields competitive discrimination. The reported AUC-versus-F1 gap also gives a concrete example of how class imbalance can hide behind strong aggregate scores in ECG benchmarks.

Real-world applications.

  • Wearable cardiac patches or smartwatch ECG that must run at low sampling rates to preserve battery, where a frequency-robust classifier could extend usable monitoring time.
  • Long-term ambulatory monitoring for paroxysmal or asymptomatic arrhythmias that a short clinic ECG would miss.
  • Remote or low-resource settings where continuous cardiologist review is not feasible and automated triage is needed.
  • Triage of large volumes of wearable waveform data, since the pipeline reduces a full waveform to a compact latent vector before classification.

Industry relevance. Consumer device makers and digital health companies trade off signal fidelity against battery life. A pipeline whose AUC-ROC only drops from 0.984 to 0.976 between 360 Hz and 45 Hz suggests a path toward smaller sensors and longer battery life without a proportional loss in detection quality — though the paper explicitly has not tested inference or memory cost on edge devices.

Future Directions

  • Training on larger and more balanced data. The authors state that MIT-BIH is small (47 individuals) and heavily imbalanced, and that larger datasets with better representation of the undersampled S and F classes are needed.
  • Testing on real wearable data. All experiments use a public clinical database, not a wearable dataset; the authors plan to evaluate the pipeline on a larger wearable dataset of raw ECG signals.
  • Edge-device benchmarking. Practical deployment testing is missing, so inference latency and memory costs on constrained hardware remain unmeasured.
  • Alternative oversampling strategies. The authors suggest that alternate oversampling techniques beyond SMOTE, and greater tree depth exploration, may help the minority classes — they note that increasing GBDT depth tended to bias the classifier toward the majority class during validation even with balanced training classes.

Target Audience

Machine learning researchers working on time-series generative models, especially latent ODEs and neural differential equations; computational cardiology and clinical ML researchers interested in automated arrhythmia detection; and practitioners in wearable health technology evaluating the trade-off between sampling frequency, battery life, and diagnostic accuracy. The paper is written at a level accessible to readers comfortable with standard supervised learning and basic deep learning, with detailed architecture and training settings provided in the appendices.

Authors’ abstract

12-lead ECGs with high sampling frequency are the clinical gold standard for arrhythmia detection, but their short-term, spot-check nature often misses intermittent events. Wearable ECGs enable long-term monitoring but suffer from irregular, lower sampling frequencies due to battery constraints, making morphology analysis challenging. We present an end-to-end classification pipeline to address these issues. We train a latent ODE to model continuous ECG waveforms and create robust feature vectors from high-frequency single-channel signals. We construct three latent vectors per waveform via downsampling the initial 360 Hz ECG to 90 Hz and 45 Hz. We then use a gradient boosted tree to classify these vectors and test robustness across frequencies. Performance shows minimal degradation, with macro-averaged AUC-ROC values of 0.984, 0.978, and 0.976 at 360 Hz, 90 Hz, and 45 Hz, respectively, suggesting a way to sidestep the trade-off between signal fidelity and battery life. This enables smaller wearables, promoting long-term monitoring of cardiac health.

Read the original paper