Skip to content

ArrythML-II: An Optimized TinyML Framework for ECG Arrhythmia Detection and Multi-Class Beat Classification on Wearable Devices

Nagarajan S, Kurian Polachan

cs.LG

Abstract

This paper presents ArrythML-II, an optimized TinyML framework for on-device ECG arrhythmia detection and multi-class beat classification on wearable platforms. A systematic hyperparameter optimization framework is developed to identify compact autoencoder architectures for binary ECG arrhythmia detection. A custom scoring mechanism jointly considers detection performance, reconstruction-error thresholds, and model size to guide architecture selection. The framework is further extended to six-class ECG beat classification using a lightweight classifier derived from the optimized autoencoder architecture. Both models are INT8 quantized and deployed using TensorFlow Lite Micro on a custom-developed, battery-operated, single-lead ECG device based on the PSoC~6 microcontroller. The deployed autoencoder and classifier have model sizes of approximately 44~KB and 22~KB, respectively, with end-to-end processing times of 5.1~ms and 4.7~ms per ECG segment. Model inference accounts for 3.95~ms and 1.38~ms of these processing times, respectively. In the refined arrhythmia detection evaluation using the MIT-BIH Arrhythmia Database, the autoencoder achieved an accuracy of 84.76\%, precision of 82.68\%, and recall of 77.99\%. The multi-class classifier achieved 82.29\% accuracy, weighted precision of 90.18\%, and weighted recall of 82.29\%. Beyond offline model evaluation, the wearable platform is validated using preloaded ECG segments, live ECG signals, and an ESP32-S3-based ECG emulator that replays annotated MIT-BIH recordings as analog waveforms. The results demonstrate the feasibility of integrating optimized TinyML models into wearable platforms for real-time ECG analysis.

Create a lesson