All Projects → manideep2510 → ECG-acquisition-classification

manideep2510 / ECG-acquisition-classification

Licence: Apache-2.0 license
Single Lead ECG signal Acquisition and Arrhythmia Classification using Deep Learning

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ECG-acquisition-classification

automatic-ecg-diagnosis
Scripts and modules for training and testing neural network for ECG automatic classification. Companion code to the paper "Automatic diagnosis of the 12-lead ECG using a deep neural network".
Stars: ✭ 156 (+280.49%)
Mutual labels:  ecg, ecg-signal, ecg-classification
ecg-classification
ECG signal classification using Machine Learning
Stars: ✭ 43 (+4.88%)
Mutual labels:  ecg-signal, ecg-classification
ECG analysis
No description or website provided.
Stars: ✭ 32 (-21.95%)
Mutual labels:  ecg, ecg-signal
Hefei ECG TOP1
“合肥高新杯”心电人机智能大赛 —— 心电异常事件预测 TOP1 Solution
Stars: ✭ 109 (+165.85%)
Mutual labels:  ecg, ecg-classification
measure-stress-hrv-android
Get stress measurement results in your Android app using Welltory heart rate variability algorithms
Stars: ✭ 24 (-41.46%)
Mutual labels:  ecg
Kervolution
Kervolution implementation using TF2.0
Stars: ✭ 20 (-51.22%)
Mutual labels:  keras-tensorflow
100DaysOfMLCode
I am taking up the #100DaysOfMLCode Challenge 😎
Stars: ✭ 12 (-70.73%)
Mutual labels:  keras-tensorflow
HealthyPi
OBSOLETE. Replaced by https://github.com/Protocentral/protocentral-healthypi-v3
Stars: ✭ 64 (+56.1%)
Mutual labels:  ecg
Final-year-project-deep-learning-models
Deep learning for freehand sketch object recognition
Stars: ✭ 22 (-46.34%)
Mutual labels:  deep-convolutional-networks
faster rcnn
An implementation of Faster R-CNN applied to vehicle detection.
Stars: ✭ 22 (-46.34%)
Mutual labels:  keras-tensorflow
uncertainty-wizard
Uncertainty-Wizard is a plugin on top of tensorflow.keras, allowing to easily and efficiently create uncertainty-aware deep neural networks. Also useful if you want to train multiple small models in parallel.
Stars: ✭ 39 (-4.88%)
Mutual labels:  keras-tensorflow
WGAN GP
Keras model and tensorflow optimization of 'improved Training of Wasserstein GANs'
Stars: ✭ 16 (-60.98%)
Mutual labels:  keras-tensorflow
GTAV-Self-driving-car
Self driving car in GTAV with Deep Learning
Stars: ✭ 15 (-63.41%)
Mutual labels:  keras-tensorflow
Xtreme-Vision
A High Level Python Library to empower students, developers to build applications and systems enabled with computer vision capabilities.
Stars: ✭ 77 (+87.8%)
Mutual labels:  keras-tensorflow
potato-disease-classification
Potato Disease Classification - Training, Rest APIs, and Frontend to test.
Stars: ✭ 95 (+131.71%)
Mutual labels:  keras-tensorflow
arrhythmia-ecg-analysis-pds
Arrhythmia Classification through Characteristics Extraction with Discrete Wavelet Transform & Machine Learning
Stars: ✭ 19 (-53.66%)
Mutual labels:  ecg-signal
CRNN-OCR-lite
Lightweight CRNN for OCR (including handwritten text) with depthwise separable convolutions and spatial transformer module [keras+tf]
Stars: ✭ 130 (+217.07%)
Mutual labels:  keras-tensorflow
cnn-visualization-keras-tf2
Filter visualization, Feature map visualization, Guided Backprop, GradCAM, Guided-GradCAM, Deep Dream
Stars: ✭ 21 (-48.78%)
Mutual labels:  keras-tensorflow
NeuralNetworks
Implementation of a Neural Network that can detect whether a video is in-game or not
Stars: ✭ 64 (+56.1%)
Mutual labels:  keras-tensorflow
KerasMNIST
Keras MNIST for Handwriting Detection
Stars: ✭ 25 (-39.02%)
Mutual labels:  keras-tensorflow

Single Lead ECG Signal acquisition and classification using Deep Convolutional Networks

Single Lead ECG signal Acquisition and Arrhythmia Classification using Deep Learning

Team Members: Manideep Kolla, Durga Prasad, Konda Chandu

This project contain two parts,

  1. ECG signal Acquasition

  2. Arrhythmia classification of the acquired ECG signal.

Files

  • ecg : This folder contains all the files for training and testing of the deep learning algorithm and this code will be used to classifiy the acquired signals. The code in this folder is developed by the awesome team of Awni et al, StanfordML Group. I have just modified it to work with python3 and few other changes for my comfort of use.

  • arduino.ino : Aurdino code for the 4th order Notch filter, displaying ECG signal in computer, calculating instantanious BPM, etc.

  • classification.ipynb(Not yet tested) : Code to automaticaly create a file of the acquired ECG signal by reading from the serial moniter, convert that into required format and classify.

  • val.json : Json file that specifies the path of the saved .mat file of the acquired signal. Please change the path of the .mat filein this Json file for testing according to your present working directory

Dependensies

About ECG Singnal Acquasition: Filters, Amplifiers, their circuits and their values

Electrocardiogram (ECG) is a recording - a graph of voltage versus time - of the electrical activity of the heart using electrodes placed on the skin. These electrodes detect the small electrical changes that are a consequence of cardiac muscle depolarization followed by repolarization during each cardiac cycle (heartbeat).

The prototype developed here focuses on the acquisition of the heart’s electrical activity with a simple electrical circuit. This electrocardiograph joins Arduino features with analog circuit and acquires, amplifies and filters a very weak signal obtained from the body.

The acquired ECG signal is used to monitor and display the heart rate in real time. The following cardiac cycle shows the generation of different waves in an ecg signal.

  • The P-wave represents the wave of depolarization that spreads from the SA node throughout the atria.

  • The QRS complex reflects the rapid depolarization of right and left ventricles. Since the ventricles are the largest parts of the heart, in terms of mass, the QRS complex usually has much larger amplitude than the P-wave.

  • The T-wave represents the ventricular repolarization of the ventricles.

Block Diagram

Discussions on Design with Illustrations; Circuit Connections

Single Channel acquisition is done with electrodes on both the arms which are used to drive the circuit above. Reference is given to the right leg. The signal has an amplitude between 1 and 5mV which are difficult to visualize directly. For this reason, the system was designed to have a gain of around 1000.

The bandwidth of a normal ECG is not very wide and the fundamental frequency is approximately 1 Hz. The harmonic content decreases until is practicably negligible beyond 60Hz however, the system higher cutoff frequency was fixed to be 150Hz as part of the QRS complex is lost if filtered at lower cutoff frequencies.

ECG signal gets interfered by many artifacts which need to be filtered out. Main sources of noise in the ECG signal are Baseline wander (low-frequency noise), Power line interference
( 50Hz noise from a power line), Muscle noise (EMG interference) an electrical interference from other equipment. Various filters are used to remove these disturbances.

To remove the common mode noise INA128U (Instrumentation Amplifier) was used having a high CMRR of 120db. The gain of the amplifier was set to 29 (so that output will be between +9 and -9)

To remove the baseline noise a high pass filter of cutoff frequency 0.05 Hz is used. A second order Butterworth filter was designed using opamp OPA27, a low noise amplifier to reduce noise amplification. The function of this filter is to eliminate the direct voltage in the signal and the resulting signal would be between + and - 5mv.

An amplification stage with a gain of 41. This gives a total gain of 1255.

A low pass filter with 3db bandwidth at 150 Hz. This ensures unwanted frequencies in the ECG spectrum to be filtered off.

Power line interference(50 Hz) is a major design artifact. To remove this an Arduino(nano) was programmed to function as a second order IIR notch filter of 2Hz bandwidth. Cutoff frequencies are 48Hz and 52Hz. Coefficients are derived from Matlab.

y = 0.6022 * x - 0.6022 * x1 + 0.6022 * x2 + 0.6022 * y1 - 0.2043 * y2;

X is the output from the low pass filter. Y is the output from the notch filter.

Heart Rate Monitor:

The time interval between two high amplitude R waves (R-R Interval) is used to calculate the instantaneous heart rate. Thresholding was done in Arduino to detect the R peaks and thereby calculate heart rate.

A 16x2 LCD display is connected to Arduino to display beats per minute(BPM).

Our Circuit

Results

Single lead ECG detection using three electrodes was performed and the resulting ECG signal after passing through the cascade of the above filters was visualized using Arduino Serial plotter. Signal was sampled at a frequency of 500Hz. The entire circuit is assembled on a breadboard and powered through two 9v batteries making the prototype portable. Any abnormal heartbeat is indicated to the subject. The placement of electrodes also plays a role in the generation of different waves. We placed the positive electrode on the left hip, a negative electrode on the right shoulder and a electrode from the left hand wrist is given as a ground reference. This placement of electrodes is along the axis of heart alignment. Our observed ECG is

Here we take a look at each individual heartbeat, plotting all the 70 heartbeats in the sampled data (9000 data points) synchronized by their R peak, looks like below.

Here is the variation of Heart Rate throughout the sampled data,

About Classification of Arrhythmias from ECG Signals

A 1D convolutional deep neural network is developed to detect arrhythmias in arbitrary length ECG time-series.

A convolutional DNN is trained on this dataset to detect arrhythmias, which takes as input the raw ECG data (sampled at 300 Hz, or 300 samples per second) and outputs one prediction every 256 samples (or every 1.28 s), which is being called as the output interval. The network takes as input only the raw ECG samples and no other patient- or ECG-related features. The network architecture has 34 layers; to make the optimization of such a network tractable, we employed shortcut connections in a manner similar to the residual network architecture.

Distinct from some other recent DNN approaches, no significant preprocessing of ECG data, such as Fourier or wavelet transforms, is needed to achieve strong classification performance.

You can download the single lead ECG signals for training here: https://physionet.org/challenge/2017/training2017.zip

For detailed information please refer to Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network by Awni Y. Hannun*, Pranav Rajpurkar*, Masoumeh Haghpanahi*, Geoffrey H. Tison*, Codie Bourn, Mintu P. Turakhia, Andrew Y. Ng.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].