Implementing Deep Neural Networks on ARM-Based Microcontrollers: Application for Ventricular Fibrillation Detection
Open Access
- 13 February 2025
- journal article
- research article
- Published by MDPI AG in Applied Sciences
- Vol. 15 (4) , 1965
Abstract
GPU-based deep neural networks (DNNs) are powerful for electrocardiogram (ECG) processing and rhythm classification. Although questions often arise about their practical application in embedded systems with low computational resources, few studies have investigated the associated challenges. This study aims to show a useful workflow for deploying a pre-trained DNN model from a GPU-based development platform to two popular ARM-based microcontrollers: Raspberry Pi 4 and ARM Cortex-M7. Specifically, a five-layer convolutional neural network pre-trained in TensorFlow (TF) for the detection of ventricular fibrillation is converted to Lite Runtime (LiteRT) format and subjected to post-training quantization to reduce model size and computational complexity. Using a test dataset of 7482 10 s cardiac arrest ECGs, the inference of LiteRT DNN in Raspberry Pi 4 takes about 1 ms with a sensitivity of 98.6% and specificity of 99.5%, reproducing the TF DNN performance. An optimization study with 1300 representative datasets (RDSs), including 10 to 4000 calibration ECG signals selected by random, rhythm, or amplitude-based criteria, showed that choosing a random RDS with a relatively small size of 80 resulted in a quantized integer LiteRT DNN with minimal quantization error. The inference of both non-quantized and quantized LiteRT DNNs on a low-resource ARM Cortex-M7 microcontroller (STM32F7) shows rhythm accuracy deviation of <0.4%. Quantization reduces internal computation latency from 4.8 s to 0.6 s, flash memory usage from 40 kB to 20 kB, and energy consumption by 7.85 times. This study ensures that DNN models retain their functionality while being optimized for real-time execution on resource-constrained hardware, demonstrating application in automated external defibrillators.Keywords
Funding Information
- Bulgarian National Science Fund (KΠ-06-H42/3)
This publication has 70 references indexed in Scilit:
- Neural Networks Implementations on FPGA for Biomedical Applications: A ReviewSN Computer Science, 2024
- Efficient Edge-AI Models for Robust ECG Abnormality Detection on Resource-Constrained HardwareJournal of Cardiovascular Translational Research, 2024
- A simple approach for quantizing neural networksApplied and Computational Harmonic Analysis, 2023
- Hardware implementation of 1D-CNN architecture for ECG arrhythmia classificationBiomedical Signal Processing and Control, 2023
- Myocardial infarction detection based on deep neural network on imbalanced dataMultimedia Systems, 2021
- Deep Model Compression and Architecture Optimization for Embedded Systems: A SurveyJournal of Signal Processing Systems, 2020
- Kalman-based Spectro-Temporal ECG Analysis using Deep Convolutional Networks for Atrial Fibrillation DetectionJournal of Signal Processing Systems, 2020
- Machine learning techniques2020
- Heartbeat Classification Using 1D Convolutional Neural Networks2019
- A novel hybrid network of fusing rhythmic and morphological features for atrial fibrillation detection on mobile ECG signalsNeural Computing and Applications, 2019