A CNN-based project for classifying ECG heartbeats using the MIT-BIH Arrhythmia dataset.
- Dataset: MIT-BIH Arrhythmia
- Input: 187-sample ECG signals per heartbeat
- Model: Convolutional Neural Network (CNN)
- Output: Predicted heartbeat class
arrhythmia.ipynb: Jupyter notebook with data preprocessing, model training, and evaluation.ecg_model.keras: Trained Keras model (can be converted to TensorFlow.js for web integration)
- This is a work-in-progress project for research and learning purposes.
- Demonstrates the full pipeline from data preprocessing to CNN-based ECG classification.
You can input your own ECG signals to test the model using a CSV file.
-
Each row should contain 187 numeric ECG values corresponding to a single heartbeat.
-
Example (
sample_ecg.csv): -
Each row represents one heartbeat.
- Go to the ECG prediction endpoint:
/predict - Upload your CSV file containing ECG rows.
- The model will return a predicted class for each heartbeat.
import requests
url = "http://localhost:5000/predict"
files = {'ecgfile': open('sample_ecg.csv', 'rb')}
response = requests.post(url, files=files)
print(response.json())
## Author
Shubham Thakur