Giter Site home page Giter Site logo

animikhaich / ecg-atrial-fibrillation-classification-using-cnn Goto Github PK

View Code? Open in Web Editor NEW
47.0 3.0 18.0 146 KB

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.

Home Page: http://animikh.me/

License: MIT License

Jupyter Notebook 100.00%
cnn-classification cnn-keras deep-learning ecg ecg-signal classification atrial-fibrillation ecg-signals patient tensorflow 1d-convolution 1d-cnn

ecg-atrial-fibrillation-classification-using-cnn's Introduction

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

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

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 Information

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.

  1. Download the dataset from the above mentioned link.
  2. 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.
  3. Save the processed dataset as a Numpy Object in the desired location.
  4. In the file Model.ipynb read the saved processed dataset and train the model.
  5. Any unknown dataset can be then classified by using model.predict() function after the model 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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. 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:

  1. 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.
  2. The CNN architecture can be further modified so as to find an optimal architecture that will learn better than the existing one.
  3. 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

ecg-atrial-fibrillation-classification-using-cnn's People

Contributors

animikhaich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ecg-atrial-fibrillation-classification-using-cnn's Issues

CNN Model Predcition

I am new to machine learning, can anybody tell me how to predict with any dataset after training it successfully?

What is the files in Train and Test folder?

In the Data_Preprocessing.ipynb, there are lines that I don't understand is you can see below

root_folder_train = 'C:\Users\animi\Documents\Dataset\ECG Dataset\Train\'
root_folder_test = 'C:\Users\animi\Documents\Dataset\ECG Dataset\Test\'

I saw your code show below:

samples (1).csv 7680
samples (2).csv 7680
samples.csv 7680
samples (1).csv 7680
samples (2).csv 7680
samples.csv 7680

Can you explain more how I can get those files?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.