Giter VIP home page Giter VIP logo

deeplearningecg's Introduction

DeepECG

Basic Overview

Atrial Fibrillation detection with a deep probabilistic model. Backend for Diagnose Report app. Use PhysioNet dataset for model training and testing.

Dependencies

The following dependencies are required.

Usage

I have already ran training for you. You can use the saved model in dirichlet_model folder to predict right away. But make sure to change the path in direchlet_model/checkpoint according to your path.

If you want to train again by yourself, run this following notebook file: dirichlet_model_training.ipynb, download the dataset and start training. Notice that on 1000 epochs, the training will take some time. Mine took about 8-9 hours on Tesla K80.

For the project I'm working on, I create some shell file and python files to convert and predict stuffs.

  • To predict whether an image is AF (Atrial Fibrillation) or not:
predict <image file path>

It will return something like this

[{'target_pred': {'A': 0.021675685, 'NO': 0.9783243},
  'uncertainty': 0.0073926448822021484}]

Which A is – Atrial fibrillation N – Normal rhythm, O – Other rhythm, so NO is no problem.

See more in test.ipynb for more test case and example.

  • To generate image from csv:
gnuplot -e "fileIn='csv/04015.csv'; fileOut='uploads/04015.png'" csv2img.gnuplot
  • To convert single file to csv and image:
./raw2img <filename without extension>
  • To convert image to csv:
python img2csv.py '<full path to file>'
  • To convert MAT to csv:
python mat2csv.py "raw/A00001.mat"
  • To convert csv to signal, with Gain equal 1000, Frequency 300Hz. Notice that you can specify -f mean from which line (remove if from beginning of file) and also -t mean to which line.
wrsamp -i raw/A00001.csv -o raw/A00001-converted -G 1000 -F 300 -z
  • To convert signal back to MAT:
wfdb2mat -r raw/A00001-converted

License

This project is licensed under the terms of the MIT license.

deeplearningecg's People

Watchers

James Cloos avatar  avatar

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.