Heart Disease Classification from ECG Images Using Convolutional Neural Networks and Transformer-Based Models
摘要
This research used transformer-based models and convolutional neural networks (CNNs) to analyze ECG images of people based on heart conditions. The three pre-trained CNN models are densenet169, densenet201, and resnet152; the other one is the transformer-based model employed in this study, swin-base-patch4-window7-224. To create a balanced dataset, we utilized image augmentation to create a total of 8376 image data points out of the 2610 image data points that we collected, which included four classes. Abnormal heartbeat, history of MI, myocardial infarction, and normal person ECG are the four classes of our image dataset. To take the E.C.G. signals from the images, turn the images into grayscale images. After that, split the dataset into three parts: training, testing, and validation. After passing the train images to the pre-trained machine learning models for training, we used the test dataset, and we got the best accuracy of 94% in the Resnet152 convolutional neural networks (CNNs) model and the swin-base-patch4-window7-224 vision transformer model (Vits).