Classification single-lead ECG by using conventional neural network algorithm

Cardiac disease, including atrial fibrillation (AF), is one of the biggest causes of morbidity and mortality in the world, accounting for one third of all deaths. Cardiac modelling is now a well-established field. The Convolutional Neural Network (CNN) algorithm offer a valuable way of gaining insight into the dynamic behaviors of the heart, in normal and pathological conditions. Great efforts have been put into modelling the ventricles, whilst the atria have received less focus. This research therefore concentrates on developing models of the heart ECG atria using deep learning. The research developed an experimental result on MIT-BIH dataset for modelling myocyte electrophysiology and excitation waves in 1D & 2D tissues. It includes optimizations such as adaptive stimulus protocols. As examples of application, it is used to investigate effects of a novel anion bearing current on heart atrial excitation and the effect of remodeling on atrial myocyte electrical heterogeneity. A computationally efficient modified CNN anatomically based model of the heart atria is constructed. The aim of this work is to improve the current modified 3D-CNN model includes heterogeneous,theophysically detailed electrophysiology and conduction anisotropy. The full model activates in 121 ms in heart rhythm, in close agreement with clinical ECG data. The model is used, with the toolkit, to investigate the function effects of S140G mutation in MIT-BIH dataset which is associated with familial. The 3D-CNN model forms the core of a boundary element model of the P-wave Body Surface Potential (BSP). The modified CNN model incorporates representations of the heart blood masses. Generated ECGs show qualitative agreement with clinical data. Their morphology is as expected for a healthy person, with a lead duration of 103 ms. The modified CNN model is used to verify an existing algorithm for focal atrial tachycardia location and in providing explanation for a novel clinical phenomenon, using CNN with 99.27% accuracy. Models of the human atria and body surface potential are constructed. The models are validated against both experimental and clinical data. These models are suitable to use as the platform for further research.


Introduction
The heart atria have generally been neglected in studies, compared to the ventricles at least.Many more studies focus on ventricular tissue than heart atrial tissue, and many of the atrial studies focus more on the pacemaker of the heart, than the atria as a whole.The atria have a complex electrophysiology and topology as mentioned in [1].Whilst atrial dysfunction is rarely fatal, atrial arrhythmias are amongst the most common cardiac diseases, reducing the quality of life for hundreds of thousands of people.They have recently been the focus of a variety of clinical and physiological interest, interest which has not yet been reflected in cardiac modelling.Mathematical modelling of the heart offers a way of gaining insight into the cardiac processes and the mechanisms of cardiac disease [2].It is a well-established field of research with numerous international journals and conferences discussing the findings.Mathematical models allow physiological effects to be dissected and quantified in ways that can be difficult for in vivo and in vitro experiments [3].This can be used to inform both further experiments and clinical diagnosis and treatment.Despite these benefits, mathematical modelling has a number of downsides.
Figure 1.The ECG data classification using machine learning based automated modeling [4] One of these is the technical expertise needed to model the heart.It is a non-trivial programming task to setup a computer to solve the equations of a mathematical model.There are existing toolkits which solve this issue, but they have limitations as given in [5].Once the model has been set up, it needs to be used in a variety of experimental protocols, to quantify the behavior of the model and any abnormal conditions the experimentalist is interested in.This task is both complicated, as the experimental protocols can involve complex pacing patterns and require de-tailed measurements to be taken in [6].The task is also quite simple and repetitive, in that the same protocols are wanted to assess many different cell types and abnormal conditions.Finally, such protocols can vary between experimenters, making it harder to compare results between different studies in [7].A problem is that of clinical relevance by computational experiments focus on simplified models of cardiac tissue in one or two dimensions.Whilst such experiments are useful for elucidating complex interactions, they can be of limited use to a clinician as mentioned in [8].The clinical electrocardiologist typically works with external tools such as the ECG.Clinical procedures are more expensive, stressful and sometimes dangerous.Diagnosis therefore depends on using the ECG to infer the activity within the heart.Being able to link the electrical activity within a model to the observed surface ECG can help with this, allowing an atrial model to be used to test hypotheses with direct clinical relevance.

Background
The heart is one of the most important organs in the human body.It is responsible for pumping blood around the arteries and veins of the human body to all of the organs within.The blood carries all of the oxygen, energy and other substances needed for the body to continue to live to all parts of the body as mentioned in [9].It also bears away all of the carbon dioxide and other waste products so that they can be removed.The heart does this via rhythmic and synchronized contractions.The contractions are, in the healthy heart, initiated from one place and synchronized via electrical signals conducted through the heart.This conduction is aided by several specialized cell types as mentioned in [10].The conduction, and the cellular electrophysiology which underpins it, can be modelled mathematically and the equations solved on computers.This research provides the physiological background necessary to understand the functioning of the heart.It explains the theory behind and the normal form of the electrocardiograph.It also introduces the concepts behind mathematical models of cardiac cells, the heart and the ECG.Finally, it discusses existing modelling toolkits, why such toolkits exist and the limitations of toolkits in general and in specific.The right atrium is the location of many of the important sites of the conduction system of the heart.The sinus node, or sino-atrial node (SAN), is located on the right atrial wall, close to the superior vena cava.The SAN is the primary pacemaker for the heart in normal function.It achieves this through specialized cells, known as nodal cells.These cells are what are termed 'autoactive' and are capable of spontaneously exciting as mentioned in [11].
Running down the lateral wall is a muscle ridge, known as the crista terminalis, or terminal crest.The crista terminalis delineates the smooth and rough parts of the right atrial wall.This muscle ridge consists mostly of myocytes-cardiac muscle cells-arranged longitudinally along the main axis of the ridge, and so forms a path of preferential conduction.In addition, these cells have a specialized electrophysiology as mentioned in [12].
At the inferior end of the crista terminalis there is the atrio-ventricular node (AVN).This is another area of specialized nodal cells.These cells are also auto-active, although with a slower natural frequency than the SAN.They therefore only take over in the case of SAN failure.The AVN is the only point of electrical contact between the atrium and ventricles in the normal heart.As well as pro-viding a link between the atria and ventricles this region acts to limit the rate of stimulus, which is passed on to the ventricles, protecting them from excessive atrial pacing rates as mentioned in [13].
Researchers in [14] provided the branching from the crista terminalis and spreading around the muscle wall of the right atrium are the pectinate muscles.Like the crista terminalis, these bundles consist mostly of cells lying end to end, forming pathways of preferential conduction.The conformation of the pectinate muscles varies between individuals; some have complex branching and interwoven patterns, whilst others have simpler and relatively parallel bundles.The first is growing, the second is shrinking, the third is growing, and the fourth is shrinking.Any two successive chirps are now orthogonal.The Augmented Convolutional Neural Network (CNN) [16] was used to construct this work.The YOLO technique (you only look once) is used in this paper to detect cars using infrared imagery [16].The following information is gathered in this paper: The first is a rising Twitter, the second is a falling Twitter, the third is a rising Twitter, and the fourth is a falling Twitter.Any two successive chirps are now orthogonal.The Augmented Convolutional Neural Network (CNN) [17] was used to construct this work.A system for recognizing huge objects using infrared images utilizing infrared image transpose and infrared image searches using infrared image search engines is presented in this research.Data aggregation is a hot issue in machine learning in this article.It can be used for a variety of things, including image segmentation.[18].Many voting models are available, including SVM (Support Vector Machine), KNN (K-Nearest Neighbor), Decision Tree, Logistic Regression, and Backpropagation ANN (Artificial Private Neural Network).We discussed several procedures and approaches for early glaucoma diagnosis, as well as the usage of Absolution, in this post.

[Deep AB] [Deep AB] [Deep AB] [Deep 12]
Convolutional AB Network is a television network that broadcasts in the Many papers investigate the difficulty of diagnosing diseases, and many publications focus on improving diagnostic processes.[19].We claim 88.4 percent accuracy for a 5-row clustering problem in our experience.For combining four criteria to discriminate cancer, we find 92.3 percent, 96.2 percent, and 94.5 to 87.2 percent sensitivity in high sensitivity action.According to popular belief [20].

Motivation
The heart's role is to pump blood around the body, driving the circulation of the blood and everything contained within it.It is one of the most important organs in the body and any malfunction in its behavior could be fatal in very short order.It begins beating in the early stages of pregnancy and continues until death, hopefully many decades later.It beats at an average rate of around 70 beats per minute (bpm) for the adult male and 75 bpm for the adult female.The heart is not, as popular belief would have it, the seat of human emotion.The functioning of the heart is modulated by such emotion however, slowing when we are calm and increasing in rate quite dramatically when we are excited or afraid.Despite being influenced by the brain and our emotional states, the heart drives itself, rather than having the pace-making initiated outside the organ for ECG.The right ventricle must merely pump blood around the lungs and developing too high a pressure there could actually damage the delicate structures.By contrast the left ventricle must develop enough pressure to drive blood around the whole body and as such it is much more muscular.The two ventricles are divided by the ventricular septum.The separating the atria and ventricles is the annulus fibrosus or central fibrous body.This is a dense layer of fibrous tissue.In addition to providing an anchor for the muscle of the heart, it electrically isolates the atria from the ventricles.In the normal heart, the only electrical connection between the atria and the ventricles is at the atrio-ventricular node for ECG.This connects the right atrium to the specialist conduction system of the ventricles.The ECG channel has an activation gate, the black lozenge on the top of the membrane and an inactivation gate, the ball and chain on the underside of the membrane.In panel (i) the gate is not activated and shows a large concentration of ions on the upper side.In panel (ii), the gate activates and ions flow down the ECG channel to the region of lower concentration.In panel (iii), the inactivation gate has moved to close the ECG channel and no more ions flow.

Problem statement
Electroencephalography, or in a shorten word is ECG, is a method to record the neural oscillations (often known as "heart waves") of the heart and illustrate the operation of the body of human by those electrical signals.There are a lot of applications using this technique nowadays, mostly diagnosing epilepsy, it is also used to diagnose sleep disorders and many more.Our objective is to characterize ECG signals according to the specific areas of the heart.We analyze the spatial-temporal patterns of the signals using machine learning tools.Given an ECG signal, the goal is to predict which part of the heart it belongs to.Having such an automatic tool can be very helpful for analyzing the plasticity of the heart, and useful for understanding how heart damage provokes changes in their functionality.It is known that when some area of the heart is damaged, the heart plasticity provokes that other parts can be activated and to have new functionalities in order to mitigate the impact of heart damage.

Algorithm and solution
ECG is a method to record the neural oscillations of the heart and illustrate the operation of the body of human by that electrical signal.A different region of the heart and a different body's activity produce a different type of ECG signal.This study is modifying the method that proposed in [1].Thus, in almost any scenario of recording ECG, one recorder cannot illustrate the whole status of the heart, but we must create a matrix of multiple electrodes to record multiple zones in the heart.Each place in the head will generate a different signal and to be more specific, the electrode map has been normalized and used seamlessly all around the world.Furthermore, each recorder has its own name to specify the region that it records.Electrode when recording the ECG signal it is contained not just only the signal, but also the noise from an extremely noisy environment.Only very tiny electric fields or other electronic devices can affect the recording process of electrode.Besides the noise coming from the recording equipment itself and equipment from the surrounding area, inside the human body, some of the organs also generate electrical signal and it affects the final result.The most significant example of the organs that also create electricity is our heart and our eyes.Heart beats and blinking also affect the ECG signal.Electrocardiography (heart signal) and electrooculography (eyes signal) is the name of these two.

Aim of Contribution
Python is an object-oriented programming language and dynamic and flexible.It is believed that Python is a minimalistic language.Developers can really focus on the real issue, not its syntax.Furthermore, Python is used to solve the problem in this article because the variety in library.Python support very good in processing large amounts of data.Beside amazing feature that come original from Python, Python also support the tools and famous library that widely use in machine learning and more specific in this case is recursive neural network.In this work, we will use Convolutional Neural Network (CNN) for implementation with Scipy for de-noising the signal and Keras to make a recursive neural network.In normal function the heart depolarizes in a rhythmic and controlled fashion, at a rate of 60 to 100 bpm.There exist numerous abnormal rhythms, or arrhythmias, which are diagnosed in patients with heart disease.These can be divided into two broad categories using CNN on MIT-BIH dataset.Slowed heart rate, or bradycardia, with a heart rate below 60 bpm and quickened heart rate, tachycardia, with a sustained heart rate over 100 bpm.Bradycardia and tachycardia manifest in differing ways in the atria and ventricles; this section focuses on atrial manifestations.

Methodology
The normal heartbeat originates in the right atrium, in the sino-atrial node.This study is modifying the method that proposed in [1] this by focusing on the region of auto-active cells regularly depolarizes, sending out excitation waves through the cardiac tissue.These excitation waves spread in all directions along the atrial walls, though they are preferentially conducted along the crista terminalis to another area of specialized cells, the atrio-ventricular node.The atrio-ventricular node slows conduction through it, due to small and low capacitance cells.Each stage is described in the flowchart below.
While the ECG ventricular node is depolarizing, the atria finish their own depolarization.In the right atrium, this spreads from the ECG atrial node and the fast-conducting muscle ridges of the crista terminalis and pectinate muscles.Excitation is conducted to the left atrium through the Bachmann bundle or an inferior muscle bundle.The atrial depolarization leads to the atria contracting and charging the ventricles with blood.
The ECG-ventricular node depolarizing carries the excitation through the central fibrous body and into the bundle of His.The bundle of His is made of fast conducting muscle fibres and soon splits into the left and right bundle branches, which form the start of the 3D-CNN network.The 3D-CNN is made of another specialized layers with 3D-architecture type, and they conduct the electrical signal quickly through the body of the ventricular muscle.The 3D-CNN breaks out on the endocardial surface of the ventricles, the only place they are electrically coupled to the normal ventricular muscle [1].

Figure 3. The flowchart of approach being followed for classification
The most common cause of re-entry is due to unidirectional conduction block.Unidirectional conduction block is a region of tissue which conducts excitation waves in only one direction.Unidirectional conduction block can arise from a number of reasons using CNN.These include injury, such as a scar from cardiac surgery or ischemic injury caused by a blockage of blood vessels within the heart.Unidirectional conduction becomes important when electrical excitation can travel along two separate paths, for example around the openings of the tricuspid or mitral valves, down the crista terminalis or between the atria via the Bachmann's bundle and inferior pathways using CNN with ECG.If there is unidirectional conduction block within such a region, the wave will not propagate along that path.This potentially allows for conduction along the other path to loop back to the first path which will still be excitable.Re-entry occurs when the timing of such a retrograde conduction means that the excitation wave exits the first pathway when the cells beyond are out of the refractory period.Excitation can then propagate again, potentially many times in a sustained re-entry [1].
Regions of unidirectional block can also arise dynamically.This occurs due to heterogeneous restitution properties or slowed conduction.Due to different adaptations to pacing, one region can still be excited when a CNN neighboring region is no longer refractory.When this occurs, the neighboring region can become excited, and so a re-entry occurs.This is a spiral wave, when it occurs way from an anatomical obstacle as it tends to result in the excitation wave spiraling around the region of slowed conduction.There are several types of deep learning to process the signal after all the noise is cleaned.For example, people can use neural networks, Bayesian classifier, clustering and more.Even before applying machine learning method in the data, we have, to be more accurate, it is also can use some technique to reduce the nodes by using nature-inspired algorithms like Genetic Algorithms (GA) and Simulating Annealing (SA).However, in this article, we will focus on using neural networks to map the region of the heart we have with specific heart signal.It is important to know that the signal we have belongs to what part of the heart.So, in this research work we will focus on using neural networks to classify the 4 main regions.Region P and O are very close so we will make it 1 class.
• The electrocardiograph, or ECG, was developed by Einthoven and colleagues at the turn of the 20 th century.The Einthoven ECG used the string galvanometer, developed by Einthoven himself, to record the potential differences between three sets of electrodes, or leads.These electrodes were placed on each arm and on the left leg.These three electrodes form the basis of many ECGs recorded to this day.The string galvanometer was a highly sensitive electrical recording device for its time.For the development of the ECG and the string galvanometer using CNN.Since Einthoven's day, the ECG has been continually refined.This refinement has included both improvements in the way that individual leads are measured, and new leads that are recorded.In addition, there have been a number of specialized lead sets developed for particular purposes, such as exercise recording and 24-hour measurement.Research into new lead sets, to better understand the functioning of the heart, continues to this day.The electric field resulting from several sources in the medium is equal to the sum of the fields which would be produced by each source considered alone.The second principle, that of reciprocity, concerns current flow in the medium.It states that the current flow between two electrodes evoked by a field source in the medium is the same as the current flow through the source evoked by placing a potential difference across the two electrodes equal to the potential difference that would have been created by the field source.

Results and discussion
The terminology used to describe ECG waves is a positive wave, with a deflection above the baseline, and negative waves, with a deflection below the baseline have already been explained.The P-and T-waves can have more complex morphology.A P-or T-wave which shows both positive and negative deflections is termed biphasic.A positive-negative biphasic deflection is one which is first positive and then negative.A wave for which the converse is true is called negative-positive.Cardiac models have a particular importance when it comes to human models.Due to ethical considerations, the supply of human cardiac tissue is limited.Most commonly it comes from posthumous donations of the heart or from biopsies taken during cardiac surgery.Both have obvious disadvantages.In one case, the tissue is dead and thus not suitable for functional studies.In the other, the biopsy itself may be from pathological tissue and is therefore a poor guide to healthy function.
Gathering data from the functioning human heart requires surgical intervention, which must necessarily be kept brief.Models built from our understanding of how the mammalian heart functions and the human electrophysiological data currently available therefore offer some of our best insights into human cardiology.Another benefit, which cannot be wholly ignored, is cost.It is quite possible to perform many cardiac simulations on mid-to high-level desktop PC, costing no more than $1000.This includes modelling of cardiac tissues in three dimensions.Conversely an electrophysiological laboratory can run to tens of thousands of dollars and that does not include raw materials or animal subjects [1].Markov chain models can be highly complex and contain many states.They can be utilized in a variety of ways.One Markov chain can represent the behavior of all the individual channels on the cell.In this case, the total current flowing in the channel will be proportional to the fraction of open states.Cells can also have multiple Markov chains to represent the flow through a channel, each with its own proportions of state occupancy.They also open the possibility of using stochastic simulation techniques where the transition between states is controlled by random chance.

Conclusion
To conclude, the research presents a novel application of deep learning for a single-lead ECG classification.The cardiac simulation toolkit was developed to provide a more systematic frame-work for exploring the properties of cardiac cell and tissue models.It does this through offering a uniform and simple cell interface, a series of standardized Convolutional Neural Network (CNN) and facilities for two dimensional simulations.
It is intended to be easy to script to make constructing more complex numerical experiments as easy as possible.The proposed cardiac simulation toolkits offer graphical interfaces and require specification of the desired ECG results through such interfaces.The toolkit instead has inbuilt knowledge of several simulation protocols.This ensures different investigations use the same protocols [23][24][25][26][27][28][29][30], allowing results to be compared more directly.In addition, by performing specific simulation protocols with a dedicated program, performance optimizations specific to a given protocol are possible with 99.27% accuracy.The novel research proposed allows many aspects of the CNN simulation, including the parameters used in the model, to be specified on the command-line or via simple configuration files.By allowing such control potentially boring and timeconsuming investigations, such as investigating how a property varies with the alteration of a parameter or set of parameters, can be driven externally rather than via repeated manual alterations.This reduces errors and increases productivity.

Figure 2 .
Figure 2. A time dependent ECG channel, represented by the black structure which bisects the membrane (horizontal lines) for positive ions, shown as red circles.The ECG channel has an activation gate, the black lozenge on the top of the membrane and an inactivation gate, the ball and chain on the underside of the membrane.In panel (i) the gate is not activated and shows a large concentration of ions on the upper side.In panel (ii), the gate activates and ions flow down the ECG channel to the region of lower concentration.In panel (iii), the inactivation gate has moved to close the ECG channel and no more ions flow.

Figure 4 .Figure 5 .
Figure 4. Training and Validation Accuracy across epochs Figure 5. Training and Validation Loss epochs Table1.details Model Hyperparameters

Figure 6 .
Figure 6.Classification report showing performance on the test set Models, whether biophysically detailed or not, can concern themselves with the cellular electrophysiology, the mechanical contractions or both.This thesis concerns itself just with electrophysiological models.Models of the mechanics are not considered and are not treated in this description of mathematical modelling.

Figure 7 .Figure 8 .
Figure 7. Confusion Matrix showing actual vs predicted beats of the test set epochs Table 1.details Model Hyperparameters