ECG Arrhythmia Classification Using Deep Learning (Convolutional Neural Network) - Part One

The World Heart Federation says Cardiovascular Diseases (CVD) is the world’s most common cause of death, and that CVD cause about 17 million deaths across the globe.
 
ECG Arrhythmia Classification Using Deep Learning 
 
And unfortunately, 1 in 10 people aged between 30 and 70 die from CVD.
 
ECG Arrhythmia Classification Using Deep Learning 
 
Once I saw these stats, I asked myself a few questions:
  1. As an engineer can I do something to solve/minimize this cause?
  2. What is the actual reason of the higher rate of death?
For the second question, I came to know that the lack of proper treatment at the right time is the reason for the severe rate of death due to CVD. It may be because of lack of awareness, lack of expertise, lack of proper checkups and lack of monetary status.
 
Now, the answer to the first question is very simple. How to solve the root causes properly using technology?
 

Lack of awareness

 
The proper awareness about the symptoms, changes in lifestyle etc. should be properly given  online as well as offline.
 

Lack of Expertise

 
We need doctors and technicians with expertise. How can a technologist can contribute to this?
 
Why can’t I mimic the expertise using the technology and machines available to me?
 

Lack of proper checkups

 
It's not so easy to go the hospital regularly and get checkups. Why can’t we create customized devices for checkups? Many start-ups thought the same and we have many ECG monitoring systems available in the market. I was also part of such a product for a couple of years.
 

Lack of monetary status

 
This can be the biggest challenge for a developing or underdeveloped country. So how can we provide the checkups, treatment, etc. at an affordable rate?
 
As a result of the thoughts above, I started thinking of a Deep Learning Model which can predict the abnormalities in ECG signal which can be the primary step towards the fight against CVD.
 
I have identified a technical paper regarding the same from here in which they have classified ECG into seven categories, one class being normal and the remaining six classes are different types of arrhythmia (abnormalities) using deep two-dimensional CNN with greyscale ECG images.
 

Getting Data for Training

 
The most popular dataset of ECG available is MIT-BIIH arrhythmia database.
 
The MIT-BIH Arrhythmia Database contains 48 half-hour excerpts of two-channel ambulatory ECG recordings, obtained from 47 subjects studied by the BIH Arrhythmia Laboratory between 1975 and 1979. Twenty-three recordings were chosen at random from a set of 4000 24-hour ambulatory ECG recordings collected from a mixed population of inpatients (about 60%) and outpatients (about 40%) at Boston's Beth Israel Hospital; the remaining 25 recordings were selected from the same set to include less common but clinically significant arrhythmias that would not be well-represented in a small random sample.
 
The data contains 2 leads named lead1 and lead2. I have used lead 1 for the modeling and CNN is used for modeling.
 
The classes identified are,
  • Normal
  • PAC - Premature atrial contractions
  • LBB - Left bundle branch block
  • PAB – Pulse active bit
  • PVC - Premature ventricular contractions
  • RBB - Right bundle branch block
  • VEB – Ventricular escape beat

Method of modeling

 
As mentioned, 2-D CNN is used for the Deep Learning Model. OpenCV is used for extracting ECG signal images from MIT-BIT datasets.
 

Technologies Used

 
I have used Python for development.
 
Package
Used for
OpenCV
ECG image extraction
Keras
Implementation of CNN
Biosppy
Identify the R peak of single ECG signal
 
What Next?
 
I shall explain the preprocessing, modeling, and evaluation on the next blog.


Similar Articles