Git Product home page Git Product logo

femiogundare / electrocardiogram Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.95 MB

Automatic Detection of Atrial Fibrillation in Ambulatory Electrocardiograms using a Deep Neural Network.

Home Page: https://oluwafemi-ogundare.medium.com/automatic-detection-of-atrial-fibrillation-in-ambulatory-electrocardiograms-using-a-deep-neural-5f45e6ed4ed2

Python 2.51% Jupyter Notebook 97.49%
deep-learning neural-network tensorflow keras heart electrocardiogram

electrocardiogram's Introduction

Automatic Detection of Atrial Fibrillation in Ambulatory Electrocardiograms using a Deep Neural Network

Objective

The electrocardiogram is a fundamental tool in the everyday practice of clinical medicine. It is crucial for diagnosing a wide spectrum of heart abnormalities from arrhythmias to myocardial infarction. The combination of widespread digitization of ECG data and the development of algorithmic paradigms that can benefit from large-scale processing of raw data may provide substantial improvements to ECG interpretation.

Atrial fibrillation (AF) is is the most common sustained cardiac arrhythmia, occurring in 1โ€“2% of the general population. This arrhythmia is associated with significant morbidity, carrying a 4- to 5-fold increased risk for ischemic stroke. AF is often silent, with patients occasionally presenting with stroke as the first manifestation of the arrhythmia. Other patients have troubling symptoms such as palpitations or dizziness, but traditional monitoring has been unable to define an arrhythmia. Despite the enormity of this problem, AF detection remains problematic, because it may be episodic. Therefore, periodic sampling of heart rate and rhythm could be helpful to establish a diagnosis in these conditions.

ECG GIF

Data

Data used in this project underwent expert annotation for 4 rhythm classes: normal sinus rhythm (N), atrial fibrillation (A), other rhythm (O), and noise (~). A total of 8528 ECG recordings, each lasting from 9s to 61s, and of variable lengths, were present in the dataset. Each ECG recording was taken by a patient and was recorded by the AliveCor ECG device, which is a Food and Drug Administration (FDA)-cleared, single-lead, ambulatory ECG monitor that continuously records data from a single vector (modified Lead I [LA-RA]) at a frequency of 300Hz, which in theory has each of the two electrodes of the ECG monitor in each hand. A good number of the ECG recordings were inverted (RA-LA) since the device did not require the patients to rotate it in any particular orientation.

ECG Monitor

ECG Plots

ECGs of Atrial fibrillation, normal sinus rhythm, other rhythm and noise.

ECG Plots

Neural Network Architecture

The model was built using Keras, utilizing TensorFlow as the backend.

NN Architecture

Results

On evaluation, the neural network returned the following results:

Class Precision Recall Specificity NPV F1
A 0.662 0.810 0.967 0.985 0.729
N 0.899 0.818 0.855 0.748 0.857
O 0.653 0.693 0.852 0.874 0.672
~ 0.317 0.565 0.966 0.988 0.406

Future Updates

  1. Get more data and retrain the neural network.
  2. Increase the batch size to 32, 64 or 128. (The batch size of 2 used during training is probably too small.)

electrocardiogram's People

Contributors

femiogundare avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.