This project combines machine learning and computer vision techniques to analyze electrocardiogram (ECG) data and classify heart conditions into four categories:
- Myocardial Infarction
- Abnormal Heartbeat
- History of Myocardial Infarction
- 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.
- Dataset
- Features
- Requirements
- Usage
- Training the Model
- Evaluating the Model
- Classifying User-Provided Images
- Model Deployment
- Results
- References
- Acknowledgments
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.
- 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.
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