Attention Enhanced Convolutional Neural Network for Inter-patient Classification of Premature Ventricular Contraction from ECG

Meng Chen1, Yongjian Li1, Wenzhuo Shi2, Shoushui Wei1
1Shandong University, 2Institute of Marine Science and Technology


Abstract

Premature Ventricular Contractions (PVCs) are a common type of cardiac arrhythmia that can be life-threatening if left untreated. Using deep learning methods to address challenges such as data imbalance, inaccurate ECG segment labeling, and noise interference in PVC detection remains a significant endeavor. This study introduces a convolutional neural network (CNN) designed with attention mechanisms to detect PVCs from single-lead electrocardiograms (ECGs).All ECG recordings are resampled to 256 Hz, and R-peak positions detected using the Pan-Tompkins method are used to extract two complete RR intervals as segment lengths. Subsequently, all segments are resampled to 512 points using a resampling method, with the ratio of the original segment length to 512 (RRratio) considered a critical feature for PVC detection. At the same time, this ensures a complete cardiac cycle for heartbeat classification.To prevent waveform distortion caused by denoising algorithms, this study refrained from using preprocessing steps like noise reduction. Furthermore, to address noise interference, weights based on the existing signal quality assessment method are introduced as another key feature for identifying PVCs. A binary focal loss function is employed to mitigate data imbalance issues.The proposed model is trained on 11 recordings from the MIT-BIH Arrhythmia Database (MITDB) and validated on another 11 recordings, excluding pacemaker data. Inter-subject testing is conducted on the remaining 22 recordings from MITDB. On the test dataset, the model achieved a Precision of 82.23%, Recall of 96.67%, F1 score of 87.83%, and overall accuracy of 96.40%, surpassing most existing methods. The experimental results validate the effectiveness of the proposed approach, which shows promise for enhancing PVC detection in long-term ECG monitoring scenarios.