Abstract
Real-time and accurate detection of cardiac anomalies from electrocardiogram (ECG) signals is critical for timely medical intervention, particularly in remote patient monitoring and wearable health devices. Traditional cloud-based deep learning solutions introduce significant latency and privacy concerns, while existing edge-based approaches often sacrifice model complexity and accuracy due to computational constraints. This paper presents an FPGA-accelerated Transformer architecture designed for real-time ECG anomaly detection in edge-computing biomedical sensors. We propose a highly optimized, quantized Transformer model tailored for resource-constrained FPGAs, leveraging custom hardware accelerators for its computationally intensive self-attention and feed-forward layers. Implemented on a Xilinx Zynq UltraScale+ MPSoC, the system processes ECG data from the MIT-BIH Arrhythmia Database, achieving an F1-score of 98.2% for anomaly detection. Our experimental results demonstrate a significant reduction in inference latency to less than 0.8 milliseconds per ECG segment and an energy efficiency improvement of over 15x compared to equivalent CPU/GPU implementations on edge platforms. This work showcases the potential of FPGA-based acceleration to enable sophisticated deep learning models for critical real-time biomedical applications at the edge, fostering advancements in personalized and pervasive healthcare.