Real-time Assessment of ECG Classification based on Time-series Data and Other Types of Features - Tran, Thanh-Luan; Thai, Bao-Toan; Tran, Vy-Khang; Nguyen-Thi, Xuan-Nhi; Nguyen, Chi-Ngon; Nguyen, Van-Khanh (Directorate for Research and Community Services, Institut Teknologi Bandung, 2025)
Cardiovascular diseases are the leading cause of mortality worldwide. An increasing number of studies have applied artificial intelligence (AI) to identify anomalies and classify electrocardiograms (ECGs), supporting early detection and diagnosis. This study proposes and evaluates the classification of ECG signals based on time-series data and features extracted via fast Fourier transform (FFT) and discrete cosine transform (DCT), implemented on resource-limited microcontroller units (MCUs) for selected AI models. Two models, the artificial neural network (ANN) and the convolutional neural network (CNN), were proposed for classifying five common ECG labels. These models were trained and tested with three types of input data: time-series data, FFT features, and DCT features, sourced from an available database. After training, the optimized models were quantized to assess their accuracy before being deployed in real-time to measure inference time on the ESP32 MCU. Before quantization, the ANN model achieved the highest accuracy with both DCT and time-series inputs (98.0%); meanwhile, the CNN model performed best with time-series input (97.0%). After quantization, the ANN maintained the highest accuracy with time-series input (97.1%), followed by the ANN with DCT at 95.6%. CNN models remained stable, with post-quantization accuracy of 95.8% for time-series input, 94.9% for DCT, and 90.0% for FFT. In contrast, ANN with FFT input showed a significant drop to 65.6%.