ECG based Atrial Fibrillation Classifier using 1D CNNs
Table of Contents
- Table of Contents
- About The Project
- Jupyter Notebooks - nbViewer
- Dataset Information
- How to Run
- Future Improvements
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
- 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.ipynbto 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.ipynbread the saved processed dataset and train the model.
- Any unknown dataset can be then classified by using
model.predict()function after the
modelhas 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
Simple List of Deep Learning Libraries. The main Architecture/Model is developed with Keras, which comes as a part of Tensorflow 1.x
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.
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
Distributed under the MIT License. See LICENSE for more information.
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.