Dense Neural Network Based Arrhythmia Classification on Low-cost and Low-compute Micro-controller
Md Abu Obaida Zishan, H M Shihab, Sabik Sadman Islam, Maliha Alam Riya, Gazi Mashrur Rahman, Jannatun Noor
TL;DR
This work tackles the cost and power barriers of continuous ECG monitoring by deploying a compact dense neural network on an Arduino Nano to classify arrhythmias in real-time. It combines Pan-Tompkins-based heartbeat detection with a two-layer dense NN and a carefully crafted quantization/dequantization strategy to fit within 2 KB SRAM. The system achieves a macro F1 score of 78.3% and an accuracy of 96.38% on four arrhythmia classes while consuming about 1.267 KB of memory and 0.001314 MOps per inference, demonstrating viable on-device inference on ultra-low-cost hardware. The results highlight that careful model design and memory management can yield practical, low-power, end-to-end ECG monitoring suitable for deployment on MCUs, with future opportunities in edge and cloud-enabled extensions.
Abstract
The electrocardiogram (ECG) monitoring device is an expensive albeit essential device for the treatment and diagnosis of cardiovascular diseases (CVD). The cost of this device typically ranges from $2000 to $10000. Several studies have implemented ECG monitoring systems in micro-controller units (MCU) to reduce industrial development costs by up to 20 times. However, to match industry-grade systems and display heartbeats effectively, it is essential to develop an efficient algorithm for detecting arrhythmia (irregular heartbeat). Hence in this study, a dense neural network is developed to detect arrhythmia on the Arduino Nano. The Nano consists of the ATMega328 microcontroller with a 16MHz clock, 2KB of SRAM, and 32KB of program memory. Additionally, the AD8232 SparkFun Single-Lead Heart Rate Monitor is used as the ECG sensor. The implemented neural network model consists of two layers (excluding the input) with 10 and four neurons respectively with sigmoid activation function. However, four approaches are explored to choose the appropriate activation functions. The model has a size of 1.267 KB, achieves an F1 score (macro-average) of 78.3\% for classifying four types of arrhythmia, an accuracy rate of 96.38%, and requires 0.001314 MOps of floating-point operations (FLOPs).
