ECG-Atrial-Fibrillation-Classification-Using-CNN
ECG-Atrial-Fibrillation-Classification-Using-CNN copied to clipboard
This is a CNN based model which aims to automatically classify the ECG signals of a normal patient vs. a patient with AF and has been trained to achieve up to 93.33% validation accuracy.
ECG based Atrial Fibrillation Classifier using 1D CNNs
A CNN based to classify the ECG signals of a patient with and without Atrial Fibrillation. Accuracy Achieved: 93.33%.
Data Preprocessing Notebook
·
Model Notebook
·
Report Bug
Table of Contents
- Table of Contents
- About The Project
- Jupyter Notebooks - nbViewer
- Dataset Information
-
How to Run
- Hardware Used for the Experiment
- Built With
- Changelog
- Contributing
- License
- Future Improvements
-
Contact
- Animikh Aich
About The Project
This is a CNN based model which aims to automatically classify the ECG signals of a normal patient vs. a patient with Atrial Fibrillation and has been trained to achieve up to 93.33%
validation accuracy.
The CNN used here is 1D Convolutional Neural Networks.
Jupyter Notebooks - nbViewer
- Dataset Preparation Notebook
- Model - Main Notebook Containing the Dataset Loader and Model Architecture
Dataset Information
- Download the dataset from MIT-BIH Atrial Fibrillation Database
Note: The dataset has been moved from the original URL. Hence, the dataset provided above may be different from the one that was originally used to create this project.
How to Run
The experiment should be fairly reproducible. However, a GPU would be recommended for training. For Inference, a CPU System would suffice.
- Download the dataset from the above mentioned link.
- Put them in the desired path and change the path of the
Data_Preprocessing.ipynb
to be able to read the signals from the downloaded CSVs. - Save the processed dataset as a Numpy Object in the desired location.
- In the file
Model.ipynb
read the saved processed dataset and train the model. - Any unknown dataset can be then classified by using
model.predict()
function after themodel
has been trained successfully.
Hardware Used for the Experiment
- CPU: AMD Ryzen 7 3700X - 8 Cores 16 Threads
- GPU: Nvidia GeForce RTX 2080 Ti 11 GB
- RAM: 32 GB DDR4 @ 3200 MHz
- Storage: 1 TB NVMe SSD (This is not important, even a normal SSD would suffice)
- OS: Ubuntu 20.10
Alternative Option: Google Colaboratory - GPU Kernel
Built With
Simple List of Deep Learning Libraries. The main Architecture/Model is developed with Keras, which comes as a part of Tensorflow 1.x
Changelog
Since this is a Proof of Concept Project, I am not maintaining a CHANGELOG.md at the moment. However, the primary goal is to improve the architecture to make the predicted masks more accurate.
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.
Future Improvements
This is a preliminary attempt and is a work-in-progress:
- In this particular implementation, only 10 Normal patients' data and 10 Abnormal patients' data has been taken and used. The entire dataset has not been used. Using the complete dataset may significantly improve the model accuracy.
- The CNN architecture can be further modified so as to find an optimal architecture that will learn better than the existing one.
- As per experimentation, SGD (Stochastic Gradient Descent) optimizer works the best. However, with further change in model architecture, other optimizers like Adam and RMSProp may outperform the rather primitive SGD optimizer.
Contact
Animikh Aich
- Website: Animikh Aich - Website
- LinkedIn: animikh-aich
- Email: [email protected]
- Twitter: @AichAnimikh