Worldwide, cardiac arrhythmia disease has become one of the most frequent heart problems, leading to death in most cases. In fact, cardiologists use the electrocardiogram (ECG) to diagnose arrhythmia by analyzing the heartbeat signals and utilizing electrodes to detect variations in the heart rhythm if they show certain abnormalities. Indeed, heart attacks depend on the treatment speed received, and since its risk is increased by arrhythmias, in this chapter the authors create an automatic system that can detect cardiac arrhythmia by using deep learning algorithms. They propose a deep convolutional neural network (CNN) to automatically classify five types of arrhythmias then evaluate and test it on the MIT-BIH database. The authors obtained interesting results by creating five CNN models, testing, and comparing them to choose the best performing one, and then comparing it to some state-of-the-art models. The authors use significant performance metrics to evaluate the models, including precision, recall, sensitivity, and F1 score.
TopIntroduction
Today, heart disease is responsible for numerous deaths, and on the report of the World Heart Federation, more than 17 million people die each year (Namara et al., 2019). In fact, Cardiac Arrhythmia is one of the most frequent diseases that affect a very large number of people around the world; it is more prevalent in people over the age of 60, as they often use medications that affect the functioning of the heart. Arrhythmia can be defined as irregular or changing heartbeats, and these changes are felt by people most of the time (Sahoo & Prakach, 2011), it can be harmless and occur to healthy people, but some abnormal rhythms can be serious and even cause death. Besides, irregular heartbeats can lead to poor blood flow that can affect other organs, injuring or stopping them permanently (Humphreys et al., 2013)). Moreover, cardiac arrhythmias may be undetected, because it does not have any indications or symptoms until the doctor examines the patient and notice the heartbeats disorder. In general, arrhythmias can be manifested by certain signs such as: chest pain, breathing problems, slow heartbeats, fast heartbeats, pounding in the chest, anxiety, fatigue, dizziness, sweating and fainting (Mayo Clinic, 2021). In addition, knowing how the heart normally works can help to figure out the reason behind cardiac arrhythmias. The heart has four chambers, two upper chambers are named atria and two lower chambers named ventricles (Mayo Clinic, 2021). Actually, the cardiac rhythm is managed by a cardiac stimulator named sinoatrial node, situated in the right atria called atrium. Then, the sinoatrial node addresses the signals produced by each heartbeat; these signals pass through the atria, which compresses the heart muscles and pumps the blood into the ventricles (Mayo Clinic, 2021). Afterward, the signals arrive at a group of cells named the AV node, where they slacken off; this minor delay allows the ventricles to be able to fill with blood (Mayo Clinic, 2021). Finally, when signals attain the ventricles, the chambers of the heart push the blood to the lungs or the rest of the body (Mayo Clinic, 2021). Furthermore, this cardiac signaling occurs at a rate of 60 to 100 beats per minute in a healthy heart. An irregular heartbeat can be caused by a variety of factors, including: recent heart attack, heart arteries that are clogged, cardiomyopathy, a high blood pressure, COVID-19 infection, stress, certain medications without prescription, etc. (Mayo Clinic, 2021). However, people can avoid arrhythmias by making some lifestyle changes, adding modifications that minimize the heat disease risks. The following are examples of a heart healthy lifestyle: a heart-healthy diet is one of the most important things for health, staying physically active, maintaining a healthy weight, caffeine and alcohol should be consumed in moderation or not at all, smoking cessation, take medications exactly as prescribed and inform the doctor about prescriptions, even those purchased without a prescription (Mayo Clinic, 2021). The ECG is a cardiology technique utilized to record the electrical impulses of the heart’s contraction and relaxation (Isin & Ozdalili, 2017), these recordings are widely used to diagnose and detect heart diseases, and it is a one-dimensional (1D) signal that represents a heartbeat. Additionally, an ECG can be performed by numerous methods; this test usually requires placing electrodes which are a certain number of sensors on different place of the body particularly the chest, arms, and legs and these sensors are attached to an ECG recording device (NHS choices, 2022). Normally, patients need to remove upper clothes before connecting the electrodes and the chest need to be cleaned, this test often needs few minutes (NHS choices, 2022). Moreover, there are three main types of ECG; doctors specify the type based on the patient’s symptoms and problem. At first, a resting ECG performed while the patient is in a relaxed situation, next, a stress ECG is done while the body is exercising, finally, Holter monitor where the electrodes monitoring the heart for one of more days at home (NHS choices, 2022). In fact, each heartbeat includes three different waves P, QRS which consists of the Q wave, R wave, S wave, and T wave. Firstly, the P wave corresponds to the atrial depolarization, next, the QRS is triggered, and each QRS complex does not completely present the three Q, R or S waves; it is the ventricular depolarization, then the T wave represents the ventricular repolarization (Ullah et al., 2021). Classifying Arrhythmia using ECG is distinguishing between normal and abnormal heartbeats that are represented by ECG recording signals. However, the enormous challenge) with manual ECG signals analysis is to detect and categorize wave-forms that clinical experts and doctors might take hours to realize and are susceptible to errors (World Health Organization, 2022). Thus, the automatic detection and categorization of cardiac arrhythmias could significantly reduce the morbidity and mortality rates. Therefore, the authors propose a new workflow for arrhythmia detection using ECG images, and as mentioned earlier, these images are provided by the well-known public MIT-BIH arrhythmia database (Moody et al., 2021). To the authors' knowledge, they are among the few papers to have used ECG signal recordings as 2D images to classify cardiac arrhythmia using a deep CNN. The suggested workflow starts with loading the transformed ECG signals into 2D images. Then, unifying and resizing the shape of these images. Next, the pre-processed images are divided into three parts, namely training, validation and test sets. Thereafter, the authors build and train the models to find out the best-performing one by evaluating their scores. Finally, they evaluate the scores of the best model. Figure 1 exposes the authors suggested workflow with some details.