Giter VIP home page Giter VIP logo

ecg-time-series-classification's Introduction

Machine Learning for Healthcare Project 1

This repository contains different deep learning models for classifying ECG time series. Our models are trained and tested on the well-known MIT-BIH Arrythmia Database and on the PTB Diagnostic ECG Database. For a detailed discussion of the models and their performances on the given data we refer to the written report.


Getting started

We use a Conda environment for dependency management. Therefore the minimal requirements are Conda. To create an environment, open an Anaconda prompt and run the following:

conda env create -f environment_ml.yml

If antivirus related permission issues or os access errors occur, running the Anaconda prompt on administrator mode avoids such issues.

Add your files

The data input files should be added into a new folder input/. For our model training and evaluating, we used the same data as the baselinemodel and the same train test split.


Models

All evaluated models can be found in this package. To import the models to your program use the following import statements:

from models import *

The models are scikeras.Wrappers.KerasClassifier classes. For a detailed instruction on how to use them the reader is referred to the SciKeras documentation. The following models are implemented (see /models/) in the respective self-explanatory files:

CNNs

  • Baseline
  • DoubleConvCNN
  • VanillaCNN

ResNets

  • ResNetDS
  • ResNetSmall
  • ResNetStandard

UNET

  • Unet

RNNs

  • BaseRNN
  • BiDirLSTM
  • ConvLSTM
  • VanillaLSTM
  • VanillaRNN

Ensembles

  • LogRegEnsemble
  • MeanEnsemble
  • PretrainedEnsemble
  • VotingEnsemble

Testing and Evaluation

The code that we use for evaluating different models is in the respective subfolders. Further the code for the final models are also included. The following gives a brief overview over the corresponding files. To reproduce our results from the report, follow the exact order of the tasks and their corresponding scripts as they are described in the following.

Task 1

For the steps taken to implement and evaluate the vanilla models, refer to the following files. or a demonstration of model performance, VanillaCNN.ipynb and Final_RNN_Based_Models.ipynb notebooks must be run.

Code Description
/CNNs/VanillaCNN.ipynb Vanilla CNN training and testing, hyperparameter tuning
/RNNs/Final_RNN_Based_Models.ipynb RNN based models training and testing
/RNNs/RNN_Models_Hyperparam_Search.ipynb RNN based models hyperparameter tuning

Task 2

For the steps taken to develop the models improving those of Task 1, refer to the following files. For a demonstration of model performance, refer again to Final_RNN_Based_Models.ipynb as it contains extended RNN based models as well. For a demosntration of ResNet model performance, ResNet.ipynb notebook must be run.

Code Description
/ResNet/ResNet.ipynb ResNet training and testing, hyperparameter tuning
/RNNs/Final_RNN_Based_Models.ipynb RNN based models training and testing
/RNNs/RNN_Models_Hyperparam_Search.ipynb RNN based models hyperparameter tuning

Task 3

Code Description

Task 4

For transfer learning models to run without issues, having the Task 2 models run and saved already is required. Refer to the notebooks in the Task 2 section. To display ResNet transfer learning model training and performance, run TransferResNet.ipynb. To display the training and performance of RNN based models, run Transfer_Learning_RNN_Based_Models.ipynb notebook.

Code Description
/CNNs/TransferResNet.ipynb Transfer Learning for ResNet
/RNNs/Transfer_Learning_RNN_Based_Models.ipynb Transfer Learning for RNN based models

Authors

Mert Ertugrul
Johan Lokna
Nora Schneider

ecg-time-series-classification's People

Contributors

ertugrulmert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

chrismanzala

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.