3. The aim of this study is to develop an algorithm to detect and classify the types of electrocardiogram (ECG)
signal beats By using Continuous Wavelet Transform (CWT) & Deep Neural Network. The goal is to train a CNN to
distinguish Between ARR, CHF and NSR.
Early detection of arrhythmia and effective treatment can prevent deaths caused by cardiovascular disease (CVD).
In clinical practice, the diagnosis is made by checking the electrocardiogram (ECG) beat-by-beat, but this is
usually time-consuming and laborious. In the paper, we propose an automatic ECG classification method based on
Continuous Wavelet Transform (CWT) and Convolutional Neural Network (CNN). CWT is used to decompose ECG
signals to obtain different time-frequency components, and CNN is used to extract features from the 2D-
scalogram composed of the above time-frequency components. Considering the surrounding R peak interval (also
called RR interval) is also useful for the diagnosis of arrhythmia, four RR interval features are extracted and
combined with the CNN features to input into a fully connected layer for ECG classification. By testing in the MIT-
BIH arrhythmia database, our method achieves an overall performance of 70.75%, 67.47%, 68.76%, and 98.74% for
positive predictive value, sensitivity, F1-score, and accuracy, respectively. Compared with existing methods, the
overall F1-score of our method is increased by 4.75~16.85%. Because our method is simple and highly accurate, it
can potentially be used as a clinical auxiliary diagnostic tool. 3
Abstract
5. 5
Types of ECG Signals for Classification.
ECG Signal Database.
Converting 1D ECG signals to image Using CWT Scalogram.
Transfer Learning via pretrained AlexNet deep CNN.
MATLAB Code for CWT Scalogram Image database creation.
MATLAB Code for AlexNet Traning and Validation.
Contents
6. 6
👉ARR: Arrhythmias
👉CHF: Congestive Heart Failure
👉NSR: Normal Sinus Rhythm
Types of ECG Signals for Classification
The goal is to train CNN
to distinguish Between
ARR,CHF and NSR.
7. 7
ECG Signals Database
We use ECG signals of three categories:
Cardiac Arrhythmia (ARR)
Congestive Heart Failure (CHF) and
Normal Sinus Rhythms (NSR).
These signals are obtained from 162 ECG recordings from three PhysioNet databases:
MIT-BIH Arrhythmia Database (96 Recordings) [ARR Signals]
MIT-BIH Normal Sinus Rhythm Database (30 Recordings) [NSR Signals] and
BIDMC Congestive Heart Failure Database (36 Recordings) [CHF Signals].
8. 8
Here data variable is a matrix of size 162 X 65536. It means it carries total 162 ECG signals of size
65536 samples each. From labels, we get types of ECG signals information. That is,
1:96 are ARR signals (96)
97:126 are CHE signals (30) and
127:162 are NSR signals (36)
Place the ECGData.mat file in current working directory.
Load the this file in workspace by load command.
ECG Signals Database
>>load('ECGData.mat’); %Load ECG data
>> data = ECGData.Data; %Get Signal Values in data
>> labels = ECGData.Labels; %Get Labels in labels
9. 9
For our problem, we pre-process the database. Each recording is of 65,536 samples
therefore, it can be broken into small signals of length 500 samples to increase
the size of database to make it appropriate to train a CNN. For this purpose,
ECG Signals Database Preparation
We take 30 recordings of each type (ARR, CHF, NSR) to have equal distribution.
Each recording is broken in to 10 pieces of length of 500 samples.
Therefore, each category will provide 300 recordings of size 500 samples and total will be
900 recordings.
Out of 900 recordings, 750 will be used for training and 150 will be used for testing.
10. 10
Now we will convert all the 1D signals into images using Continuous Wavelet Transform (CWT)
so that they can be fed as input to some CNN for classification. For this purpose,
ECG Signals to Image conversion using CWT
We take CWT of each 1D signal and all the coefficients are arranged to form a CWT Scalogram.
Each Scalogram s represented in colormap of type jet of 128 colors. .
Scalogram is converted in to image and saved in folders corresponding to each class.
Each image is of size 227x227 (To be used for AlexNet) in RGB color format.
After conversion we have total 900 scalogram images saved in three folders corresponding to each
category ARR, CHF and NSR.
11. 11
For Continuous Wavelet Transform (CWT), we take following parameters.
Wavelet used is ‘Analytic Morlet (amor)’.
This wavelet has equal variance in time and frequency.
Analytic wavelets are wavelets with one-sided spectra, and are complex valued in the time
domain.
These wavelets are a-good-choice for obtaining a time-frequency-analysis using the CWT.
12 wavelet bandpass filters per octave (12 voices per octave) are used for CWT.
ECG Signals to Image conversion using CWT
12. 12
For ECG signal classification, we will use a pretrained deep CNN: AlexNet.
AlexNet has been trained on over a million images and can classify images into 1000 object
categories.
Fine tuning a pretrained CNN to perform classification on a new collection of images is called
Transfer learning.
Transfer learning is quick and easy rather than training a CNN from scratch which requires
millions of input images, lots of training time and high speed efficient hardware.
Transfer Learning via AlexNet
23. Time schedule to complete this task
Week 1 : Research and collect data, learn to work with MATLAB.
Week 2 :We will Learning How to convert 1D ECG signals to image using CWT coefficients in the
form of Scalogram. And we Start researching on ECG signals making aspects,
Week 3 : We will learn what is transfer learning and How we can train Alex naft which is a deep CNN
on our set of images. With the help of Matlab we will design the Database creation.
Week 4 : We will come with Complete ECG Signals Classification using Continuous Wavelet
Transform (CWT) & Deep Neural Network design, carry out simulations and test controller.
23