Skip to content

A machine learning model that categorizes an ECG to determine whether the patient has myocardial infarction, abnormal heartbeat, history of MI, or a normal heartbeat.

Notifications You must be signed in to change notification settings

androidvitb/Heart-disease-prediction-using-ECG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heart Disease Prediction Using ECG and Vision Transformer (ViT)

This project combines machine learning and computer vision techniques to analyze electrocardiogram (ECG) data and classify heart conditions into four categories:

  1. Myocardial Infarction
  2. Abnormal Heartbeat
  3. History of Myocardial Infarction
  4. Normal Heartbeat

The project uses the Vision Transformer (ViT) model fine-tuned on ECG-XRAY images and is hosted on the Hugging Face Model Hub.


Repository Under: AcWoC'25

Club: Android Club, VIT Bhopal University


Table of Contents

  1. Dataset
  2. Features
  3. Requirements
  4. Usage
  5. Training the Model
  6. Evaluating the Model
  7. Classifying User-Provided Images
  8. Model Deployment
  9. Results
  10. References
  11. Acknowledgments

Dataset

The dataset used for training and evaluation is located in the Dataset directory and can also be accessed from the Hugging Face Dataset Hub:
ECG-XRAY Dataset

It consists of ECG recordings labeled according to the aforementioned categories.


Features

  • Vision Transformer (ViT): Fine-tuned for medical image classification.
  • ECG Analysis: Classifies images into four heart condition categories.
  • Evaluation Metrics: Includes accuracy, precision, recall, and confusion matrices.
  • User Input Classification: Supports real-time ECG image classification.
  • Model Hosting: Published on Hugging Face Hub for easy reuse.

Requirements

Ensure you have the necessary Python packages installed before running the project. Dependencies include:

  • transformers
  • datasets
  • torch
  • Pillow
  • scikit-learn

Install them using:

pip install -r requirements.txt

About

A machine learning model that categorizes an ECG to determine whether the patient has myocardial infarction, abnormal heartbeat, history of MI, or a normal heartbeat.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published