Preprint / Version 1

A Compact, Uncertainty-Aware mLSTM Model for Real-Time ECG Delineation on Edge Devices

##article.authors##

  • David Lung Center for Medical Physics and Biomedical Engineering, Medical University of Vienna, Vienna, Austria
  • Philipp Heute Center for Medical Physics and Biomedical Engineering, Medical University of Vienna, Vienna, Austria
  • Manfred Marx Department of Pediatric Cardiology, Medical University of Vienna, Vienna, Austria
  • Thomas Schlöglhofer Department of Cardiac Surgery, Medical University of Vienna, Vienna, Austria
  • Theodor Abart Center for Medical Physics and Biomedical Engineering, Medical University of Vienna, Vienna, Austria
  • Francesco Moscato Center for Medical Physics and Biomedical Engineering, Medical University of Vienna, Vienna, Austria
  • Julia Riebandt Department of Cardiac Surgery, Medical University of Vienna, Vienna, Austria
  • Daniel Zimpfer Department of Cardiac Surgery, Medical University of Vienna, Vienna, Austria
  • Max Haberbusch Medical University of Vienna

DOI:

https://doi.org/10.31224/8818

Keywords:

electrocardiogram waveform analysis, real-time signal processing, recurrent neural networks, wearable medical devices, predictive uncertainty

Abstract

Accurate electrocardiogram (ECG) waveform delineation underpins cardiac diagnosis and screening, yet the most accurate deep-learning models are too large for resource-constrained wearable and implantable systems. We present a compact, uncertainty-aware bidirectional matrix-memory LSTM (Bi-mLSTM) for per-sample P, QRS, and T delineation with only 2,522 parameters. The model operates on beat windows placed by automatic R-peak detection. It was selected and trained on the automatic annotations of the PhysioNet QT Database, frozen, and evaluated against expert annotations of the Lobachevsky University Database (LUDB, 200 subjects) and a clinical cohort of 25 patients with left ventricular assist devices (LVAD-DB). The tolerance-aware macro-F1 was 0.919 on LUDB and 0.875 on LVAD-DB (strict 0.850 and 0.761), the expected calibration error of the raw confidence was 0.054 and 0.041, and low confidence flagged the model’s own errors. Under tolerance-aware scoring, the model exceeded three published architectures with 0.3 to 1.4 million parameters, trained with the same windowing and procedure, on LUDB and matched the strongest of them on LVAD-DB with 119 times fewer parameters. Per record, model-derived QRS duration and QT exceeded the expert values by 12.7 and 11.3ms on LUDB, which supports trend monitoring rather than replacement of expert measurement. On an Arduino Portenta H7 microcontroller, a separately trained earlier version of the same architecture delineated a live recording in real time without quantization, with 128.6ms of processing per beat and 22 kB of memory. Accurate, calibrated, and uncertainty-aware ECG delineation is therefore feasible in real time on resource-constrained devices.

Downloads

Download data is not yet available.

Downloads

Additional Files

Posted

2026-11-16