Classification of ECG Arrhythmia using Recurrent Neural Networks

Updated August 3, 2022

Download Paper

File format: .pdf, .doc, available for editing

Classification of ECG Arrhythmia using Recurrent Neural Networks essay

Get help to write your own 100% unique essay

Get custom paper

78 writers are online and ready to chat

This essay has been submitted to us by a student. This is not an example of the work written by our writers.


The main objective of the paper is to suggest a method which automates the separation process of regular and irregular beats in an ecg. the researchers used the during the course of their work. The methodology used to achieve the objective of the paper involves giving a large volume of the time-series ecg data as inputs to a long short-term memory network. the dataset is used for both training and testing the neural network.


The process of acquiring the electrical activity of the heart captured over time by external electrodes attached to the skin is known as electrocardiography.

The cell membranes of every cell in the outer layer of the heart have a charge associated with them which depolarizes and repolarizes during each heart beat.

These appear as minute electrical signals at the skin which can be amplified using the electrocardiography technique. the graph of electrical potential versus time is known as a electrocardiograph. as health care move towards preventive medication the utilization of ecg signals by classifying and analyzing them is going to play a more important role in the diagnosis process.

Arrhythmia occurs when the electrical signals which control the heart are not working properly which results in people feeling that their heart is racing fast. Most of the time arrhythmia is harmless but in case it is resulting from a damaged or weak heart it is capable of harmful and potentially fatal symptoms such as stroke and cardiac arrest.  usually it is found to be true that the more fit a person is the lesser his/her heart rate is.

The paper states that there are sixteen types of ecg signals and they were classified into normal and arrhythmia heartbeats. even after gaining years of experience and having obtained a certain level of expertise cardiologists often fail to distinguish between due to the fact that even they are mortals. This paved the way for more innovation and research in this field as better accuracy is needed in this matter as it involves the health of a human being and sometimes it may even be a matter of life and death for some people.

Due to this many machine learning and deep learning algorithms were developed to fulfill the objective of classifying ecg signals correctly which have outperformed cardiologists by a significant margin. Thus the paper aims to provide a machine learning algorithm to classify arrhythmic beats which would reduce a lot of manual work and reduce the burden on doctors. the detected beats can then be taken to the specialists for further insights. The classification of ecg signals has been attempted before using svm model mlp model and many others. svm is a machine learning model which is used for classification problems and regression analysis. mlp is which consists of a minimum of 3 layers namely: an input layer a hidden layer and an output layer.

But all these methods provided lesser accuracy than was expected. many authors have written books and published papers which show how the ecg signal changes form in cases of non-cardiac disorders hypothyroidism esophageal diseases and also due to drugs poisons and electrical shocks. The researchers felt that these papers were useful to them to understand the functioning of the heart but they could not be used for classification purposes as all these studies were based on a particular type of ecg signals and they could not be used to identify other types of diseases.

The paper says that the above problem was largely solved by uspenskiy who created a set of 216 features which he extracted from ecg signals and used them for disease classification. This solution was tried and tested by others on 30 types of diseases and it gave very good results. But even this method is found to have disadvantages such as it does not specify whether this methodology can be applied for new diseases. The other problem is that these 216 features were manually generated due to which there is always a chance of losing some amount of information which is actually present in the data. this shows the need to automate the classification process.

Method used to attain the objective:  it consists of a large number highly interconnected processing units also called neurons which work together to achieve a common objective. Similar to people ann learn by example. The advantageous features of anns are adaptive learning self-organization and real-time operational capability.

A perceptron is a neuron where the inputs are associated with weights. a perceptron is a linear classifier. Rnns are a class of anns which came into existence when the need to process sequential data such as in the case of handwriting and speech recognition came into picture. Sequential data is data where at every instance the current data value is dependant on the data values at previous instances. thus when we try to process and analyze sequential data we cannot afford to process the inputs individually and we must consider the state of the input at previous instances.

Rnns are helpful in such cases as they consist of an internal memory which can be used to store the results of the previous stages. This leads to the output of every stage having traces of the inputs of the previous stages which is the right approach when we work with sequential data. Deep learning is a branch of ml which makes use of many layers of algorithms to form an ann’ which can learn and make informed decisions on its own. rnn and cnn are two fields of deep learning which have already been used to classify ecg signals in other studies. Cnns are used usually for image classification.

It has been observed that cnn does not do a very good job in this case as it divides the data into segments and analyzes them individually. Cutting the data into segments and then processing them leads to a reduction in performance of the classifier. The paper thus tries to improve on this by using an rnn and giving it the current heartbeat as well as the previous heartbeat as input. The researchers have used 128 256 and 100 neurons respectively in the three layers of rnn which has been used. They have performed 9 iterations with this structure.

They have also added a dropout rate of 0.2 after each layer.this is done to avoid over-fitting. a linear activation function with mean square error mse as the loss function has been used. this paper describes the use of three layers of rnn-gru which have 64 128 and 100 neurons respectively. a total of 5 iterations were performed using this structure and a dropout rate of 0.2 is used. again a linear activation function with mse as the cost function is used. this extended memory can be visualized as a gated cell i.e. it decides whether it wants to store or delete information. this paper speaks about using three layers of rnn-lstm having 64 256 and 100 neurons respectively. 5 iterations were performed and a dropout rate of 0.2 is used here as well.

Also the sigmoid activation with mse as the loss function is used. fig: working of long short-term memory lstm network.the paper describes how the mit-bih dataset was used during the research. the very popular mit-bih dataset is used for both training the rnn models and testing purpose.

It contains 47 heartbeat records which are each 30 minutes long. 40% of those records are from cardiac patients. in a 12-lead ecg which is the conventional way 10 electrodes are placed on the chest arms and legs of the patient. the overall magnitude of the electrical potential of the heart is then calculated from 12 different angles and is recorded for usually a period of 10 seconds.

Each of the mit-bih records contains different types of signals based on the placement of the leads: ml2 v1 v2 v4 and v5. the researchers first divided the dataset into 2 parts of 70% and 30% which were used for training and testing the rnn models respectively. the ml2 signals were picked for signal classification and these signals were broken down into chunks of length 720. the sampling rate is considered to be 360 which means that there are 360 segments both before and after the r-peak value of the ecg signal. this ensured that there will be almost 3 heartbeats in one chunk of length 720. the classification of the central beat was done against the 15 possible arrhythmic labels which can be seen clearly when the signals are converted into graphical form.

Performance analysis using the confusion matrix: the performance of rnn models are usually measured using three criteria i.e. accuracy specificity and sensitivity of the classification capability of the model. We need to understand a few terms before analyzing a confusion matrix. true positive cases are where the arrhythmia was detected and the signal actually has arrhythmic heartbeats. true negative cases are where arrhythmia is not detected and arrhythmia is not actually present. False positive cases are where arrhythmia is detected but the signal actually has no signs of arrhythmia. False negative cases are where arrhythmia was not detected but the signals actually belong to an arrhythmic patient.

Accuracy of the classification refers to the total number of heartbeats classified correctly either as normal heartbeat or as an arrhythmic heartbeat. its value ranges between 1.0 which is the ideal value and 0.0 which is the worst possible value. accuracy tp+tn tp+tn+fp+fn sensitivity is calculated as the ratio of the correct number of positive predictions to the total number of positive examples in the training dataset. the best possible value is 1.0 and the worst value is 0.0. sensitivity tp/ tp+fn specificity is defined as the ratio of number of correct negative predictions to the total number of negative examples in the training dataset.

1.0 is the best specificity and 0.0 is the worst specificity. specificity tn/ tn+fp conclusion: the rnn-lstm classifier gives an accuracy of 88.1% when 5 iterations of 3 layers having 64 256 and 100 neurons respectively. this is more than the accuracy obtained by a simple rnn model and a rnn-gru model which gave accuracies of 85.4 and 82.5 respectively. the complexity of the implemented model decreased significantly since no pre-processing of the mit-bih data was done prior to using it. this paper does a binary classification and determines whether arrhythmia is present or not. in future implementations the paper suggests an improved multi-class classifier.

The paper also informs the readers that the classification accuracy can be increased further by increasing the number of epochs an epoch is going through the complete dataset once while training the model and by increasing the number of neurons in the hidden layer. the paper shows that the best results are obtained using long short-term memory in case of binary classification. it also suggests that further work can be done by applying cnns on the mit-bih dataset.

Classification of ECG Arrhythmia using Recurrent Neural Networks essay

Remember. This is just a sample

You can get your custom paper from our expert writers

Get custom paper

Classification of ECG Arrhythmia using Recurrent Neural Networks. (2022, Jul 10). Retrieved from https://samploon.com/classification-of-ecg-arrhythmia-using-recurrent-neural-networks/

We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy

I'm Peter!

Would you like to get a custom essay? How about receiving a customized one?

Check it out