vectfit3.m

ECGencode

Compact and computationally efficient deep learning feature encoder for ECG signals

Brief description

The visual interpretation of electrocardiogram (ECG) data is driven by human pattern recognition and requires in-depth medical knowledge. Although state-of-the-art deep learning models can automate and improve ECG feature extraction and analysis, they face deployment challenges, particularly on medical edge devices, due to their extensive computational demands and large parameter counts. To address these limitations, this work introduces ECGencode, a novel deep learning feature encoder optimised for ECG data. ECGencode is characterised by its intuitive, compact, and expert-inspired architecture, drawing from the Filter Bank Common Spatial Patterns method traditionally used in EEG signal analysis. It leverages depthwise and separable convolutions to provide state-of-the-art analysis performance at a fraction of the computational cost. Designed for intuitive model configuration and providing a latent space that retains the structure of an ECG, ECGencode can be incorporated into a wide variety of ECG analysis models. Furthermore, a novel spatial Gaussian noise regularisation technique is introduced, promoting the learning of more generalisable features. ECGencode stands out for its reduced computational requirements, using only 3.79% of the trainable parameters and 12.39% of the FLOPs compared to the benchmark model for normal sinus rhythm atrial fibrillation detection and new-onset prediction. Furthermore, an LSTM-extended ECGencode model matches the performance of leading multi-label classification models with a tenfold reduction in parameters. These attributes position ECGencode as a highly efficient tool for ECG analysis, with the potential to facilitate its adaptation in resource constrained cardiac diagnostics and monitoring settings.

Key features

  • ECG Specific, Compact, and Expert-Inspired Architecture: ECGencode efficiently transforms high-dimensional raw 12-lead ECG data into a compact, information-rich latent space, preserving the structure of an ECG. The novel DL model architecture, inspired by the expert approved Filter Bank Common Spatial Patterns technique, introduces a novel Spatial Gaussian Noise layer for regularisation across both lead and channel dimensions improving generalisability.
  • Computationally Efficient and Low-Parameter Design: Characterised by its low parameter count and the utilisation of depthwise and depthwise separable convolutions, ECGencode delivers SOTA-level performance with significantly reduced computational demands. A binary classification model incorporating ECGencode, designed for NSR AFib detection and new-onset AFib prediction, achieves comparable results to, and in some cases outperforms, SOTA models while requiring over twenty times fewer parameters and reducing FLOPs by tenfold. Such efficiency facilitates deployment on resource-constrained edge devices, without reducing the classification performance.
  • Intuitive Model Configuration and Interpretable Architecture: ECGencode’s DL architecture supports intuitive model configuration tuning, closely aligned with ECG signal characteristics, and produces an interpretable latent space mirroring the ECG leads over time structure. Each layer is configured for a distinct, visually interpretable task, from temporal frequency filtering to spatial reduction into augmented leads, enriching model transparency and understanding.
  • Versatile By Design: Deliberately proposed as a feature encoder rather than a complete model, ECGencode is highly adaptable, supporting diverse configurations and extensions tailored to specific ECG analysis tasks. Its flexible and easy-to-adopt nature makes ECGencode an ideal building block for developing clinically viable DL models, closing the gap between the performance of computationally expensive models and the resource constraints found in medical edge devices.

Code availability

The code can be requested via email . Be sure to include at least the purpose of the request (scientific or commercial) and your affiliation.

Publication

  • ECGencode: Compact and Computationally Efficient Deep Learning Feature Encoder for ECG Signals pdf
    L. Bontinck, K. Fonteyn, T. Dhaene, D. Deschrijver
    Expert Systems with Applications, Volume 255, Part C , 1 December 2024, 124775.
    DOI: 10.1016/j.eswa.2024.124775
pdf image widget