Intelligent ECG Classification Based on Improved Swin Transformer Model
Abstract
INTRODUCTION: Clinical 12-lead Electrocardiogram (ECG) image classification faces key limitations, including insufficient capture of fine-grained waveform details, compromised integration of local-global rhythmic contexts, and suboptimal modeling of multi-lead spatial relationships. OBJECTIVES: This study aimed to propose Swin-LGF-FPN, an intelligent image classification model based on Swin Transformer architecture, to address these challenges and improve the accuracy of ECG image classification for early cardiovascular disease screening. METHODS: The enhanced framework integrated multi-scale Feature Pyramid Network (FPN) modules with an improved Swin Transformer backbone to effectively fuse local and global features. Axial Temporal Attention was incorporated to strengthen temporal feature extraction across ECG waveforms. Gradient-weighted Class Activation Mapping (Grad-CAM) visualizations were used to demonstrate feature saliency. The model was validated on two publicly available datasets: the ECG Images dataset of Cardiac Patients and PTB-XL, with performance compared against baseline models including ResNet-34 and Vision Transformer (ViT). RESULTS: The results indicated that Swin-LGF-FPN significantly outperformed baseline models in key metrics, including overall accuracy and F1-score. Grad-CAM visualizations showed significantly enhanced feature saliency in critical regions, as evidenced by heatmaps superimposed on original images. CONCLUSION: The Swin-LGF-FPN model effectively classifies ECG images, showing robust performance and promising translational potential for early cardiovascular disease screening.
Fields of Study & Subjects
ECG Monitoring and Analysis
Artificial Intelligence in Healthcare
Cardiac electrophysiology and arrhythmias
Publication details
- Journal / source
- EAI Endorsed Transactions on Pervasive Health and Technology
- Volume
- 11
- Publication date
- 2 February 2026