Skip to content

Machine Learning on ECG to predict heart-beat classification.

License

Notifications You must be signed in to change notification settings

koen-aerts/ECG_ML

Repository files navigation

ECG Machine Learning

This project contains Datalab notebooks that help you download the publicly available MIT-BIH Arrhythmia Database, and do some Machine Learning on it to predict if the heart-beats in your ECG data classify either as "Normal" or "Abnormal".

Many training models on ECG data seem to work around building out a Convolutional Neural Network (CNN) in Keras. A CNN is typically used for classifying image data, for instance is this picture a house or a cat. Keras is the API that makes building such a neural network relatively easy. The model in this project instead uses Tensorflow Estimators.

More details are included in each of the notebook files.

Requirements

  • Google Datalab - Click here to learn how to run Datalab on your local workstation or VM.
  • Python - This may already come installed on your Linux distribution. Recommended version is 3.
  • NumPy
  • Matplotlib
  • wfdb
  • mitdb - You'll need the code from the "datasets" and the "utils" directory. In Python 3 you may see compilation errors for this library. In most cases you just need to put round brackets in the "print" statements - example "print '123'" would become "print('123')". In one case you need to replace an import statement from "import urllib2" to "import urllib.request as urllib2". The error messages from your notebook will guide you to the proper files. Files affected are "datasets/mitdb.py" and "utils/download.py".
  • BioSPPy
  • Tensorflow

Note that most of the above Python libraries are already included in the Datalab Docker image when you install Datalab on your localhost machine.

Disclaimer

Do not use anything from this project to make medical decisions. It is for educational and learning purposes only.

More Info

Mobia Technology Innovations