Classification of normal and abnormal heart by classifying PCG signal using MFCC coefficients and CGP-ANN classifier

Globally, A leading cause of death is heart disease and a serious public health concern. The anomalies in heart sound appears before the heart disease symptoms. The sounds are type of auscultation, which is a process dealing with sounds in a body that generates due to mechanical vibrations of organs, Auscultation is a potential method in medical science to detect abnormalities in heart sounds and in case of suspicion The patient follows up with a referral for other evaluations, such as an electrocardiogram. In medical sciences early detection of symptoms are of major importance, this research work is a good step toward the detection of abnormalities in heart before symptom appearing by processing the phonocardiogram (PCG) signal. In this paper PCG signals are classified by utilizing the features of Mel frequency cepstral coefficients (MFCC) through Cartesian Genetic Programming - Artificial Network (CGP-ANN) Classifier. The diagnostic accuracy of proposed methodology is found 99.50% which is more than other classifiers like Support Vector Machine (SVM) and Convolutional Neural Network (CNN). The accuracy of model as compared to other models can prove the performance superiority of the proposed system


Introduction
Cardiac auscultation is the most common test for assessment of heart sounds. ECG and PCG signals both are techniques for diagnosing heart problems. Placing the stethoscope to chest is simplest way to get phonocardiogram (PCG) signals but at the same time they are complicated signals which cannot be interpreted visually. They lose precision when disturbed by noises like breathing or other sounds. Recently heart normality and abnormality diagnosing is new research area for researchers. The majority of research in the field of auscultation is done from 1980s, where other promising methods such as echocardiography replaced it [1]. However, research trends in PCG increased in recent years due to advances in computational powers and signal processing techniques. Heart sound analysis is difficult due to the sudden frequency fluctuations, complicated nature and non-stationary nature of heart sounds. Mostly researchers have used FFT and wavelet techniques on heart sounds for cardiac abnormalities [2].
In the area of digital signal processing, specifically in the area of voice processing, i.e. feature extraction from speech and heart sound (PCG signals) is done well by Rabiner et al [3]. PCG signals can be obtained using an electronic stethoscope, which responds to sound waves similarly to a standard acoustic stethoscope but instead measures changes in the electric field instead of air pressure changes. Electronic stethoscopes can capture, playback, and store the signals for later processing. Electronic stethoscopes cost a lot of money and are not widely available. Therefore, a PC, an amplifier circuit, and an electronic chest piece are used in the proposed works. In stored sounds there are S1 and S2 which are most important sounds in a cardiac cycle, Closing of AV valves leads to S1 sound which is longest and most harmful. S2 happens when the semi-lunar valves are closed. S2 is shorter and of higher frequency while comparing to S1. In the process of diagnosing, the pattern of S1 and S2 sounds is recorded for research. In diagnoses of heart as normal or abnormal there are two jobs by processing PCG signal such as feature extraction and classification [4]. In past these diagnoses based on various features extraction techniques and classifiers i.e. Utilising weighted SVM and the gammatone frequency cepstral coefficient (GFCC), classification may be performed with a maximum accuracy of 90.30% [4,6]. For PCG signal categorization, a four-layer 1D CNN is used, and its overall accuracy is 79%. Heart sound characteristics are retrieved in several studies using MFCC and linear predictive coding (LPC) and classified though A daboost ensemble classifier with maximum accuracy 89% accuracy [7].
The proposed work extracts features from PCG through MFCC as PCG signal is sound signal and MFCC shows best performance in sounds signals and for classification Cartesian Genetic Programming -Artificial Network CGP-ANN is used, the average accuracy achieved by proposed system is 99.3% which is higher than all discussed techniques.
Our major contribution is: • Classification through CGP-ANN rather than conventional classifiers such as ANN, SVM • The accuracy of our model is increased by using CGP-ANN • The system is computationally efficient as compared to SVM and CNN In coming sections, the anatomy of heart about normality and abnormality are discussed then discussion is proceeded to the modelling of proposed model and the excremental results.   [9] There are four valves in total, two of which are atrioventricular and two of which are semilunar, such as the four valves are the tricuspid valve, aortic valve, pulmonary valve, and mitral or bicuspid valve.

The Heart Anatomy
These valves stop blood from flowing backwards. The normality and abnormality of the heart and flow of blood to and from body is discussed physiology of the heart.

Physiology
There are main two physiology of heart. Normal physiology: The body's deoxygenated blood enters the right atrium, travels through the right ventricle, and is then discharged into the pulmonary artery to the lungs. The left atrium is where oxygenated blood returns to heart from lungs, after which is pumped to the body through the aorta from the left ventricle. The flow from areas of higher pressure to areas of lower pressure is caused by the chamber's blood pressure rising when the heart contracts [10]. The atria contract, generating a high pressure that opens the atrioventricular valves, allowing blood to flow to the low-pressure ventricles. Two main phases make up the heart's pumping cycle [9].: • Systole

• Diastole
When the heart muscles, specifically the ventricular muscle, contract during systole, blood is pushed into the pulmonary artery and aorta.
The time when the heart cavities enlarge as blood fills them is known as diastole. Diastole is shorter than systole.
When ventricular systole starts, all of the valves are closed, resulting in an iso-volumic contraction. The semilunar valves open to allow blood to eject through the aorta and pulmonary artery when blood artery pressure exceeds ventricular pressure. The semilunar valves close, the ventricles relax, and a new cardiac cycle starts as the pressure gradient changes. The heart is normal operating.
Abnormal physiology: Abnormal physiology the heart's function may be occurred due to a variety of factors. It is possible that the disease is inherited or that it is developed over time. Then oxygenated blood in left of the heart and deoxygenated blood in the right of heart is mix as a result, causing the heart to fail known as a septal defect. The heart is normal in this case. If heart is normal or abnormal it produces the sound signal called PCG, and these sounds can help us to detect normal and abnormal heart.

Theories behind Origin of Heart Sounds
There are two theories behind the origin of heart sounds- • The cardiac sounds come from a point source close to the valves, according to the valvular theory. Most likely, this presumption is overblown.
• The cardio hemic theory contends that the heart and blood are two parts of a larger system that vibrates together [11].

Normal Heart Sounds
Blood flow is typically laminar, but when it contacts an obstruction or travels through a narrow aperture, it becomes turbulent, which is why small-hole valves are used in blood flow. As a result of turbulence heart and blood vibrate. These vibrations, according to the cardio hemic theory, are the source of heart sounds.
The following are examples of common heart sounds [10]: • S1: A heart sound caused by the atrioventricular valves closing during ventricular systole.
• S2: The cardiac sound that signals the start of diastole when the semi-lunar valves close.
• S3: The first phase of fast ventricular filling, which correlates to the early diastolic cardiac sound.
• S4: A late diastolic cardiac sound that correlates to atrial contraction.
Systole is the term used to describe the region between S1 and S2. Diastole is the time frame from S2 to S1 of the following cycle. Diastole is larger than systoleS1 and S2, often known as Fundamental Heart Sounds, are well recognized out of these four (FHS). The first two sounds are frequently audible, whereas the next two are not. The terms "lub" and "dub" are commonly used to describe these two noises. The lub sound is referred to in medicine as "S1," while the dub sound is referred to as "S2". The heart rate should be between 60 and 100 beats per minute when at rest ("lub dubs").

Abnormal Heart Sounds
Extra sounds are sometimes heard in addition to the typical heart sounds. These may be visible as a result of heart problems. The following are some examples of abnormal cardiac sounds: Long sequences of sounds that are not one sound are called murmurs. Blood turbulence can produce a sound that is audible with stethoscope which is what causes murmurs. Murmurs can be used to identify a variety of heart issues. The mummers occurs as bellow.
Systolic murmur. Systolic murmur is the term used to describe a murmur that occurs in the systole, which is the space between S1 and S2.
Diastolic murmur. Diastole, the interval between S2 and S1 of the next cycle, is where the murmur is present, hence the name diastolic murmur. Murmur is indicated by the asterisks (*) in the above description.

Phonocardiography (PCG)
From an etymology perspective, phonocardiography refers to the procedure of recording heart sounds. Digital signals are created from the recorded heartbeats made by an electronic stethoscope and it is a modern process.

Salient Features of Phono Cardiography
Given that heart sounds and murmurs do not fall within the human audibility range, phonocardiography is the best method for detecting and treating the subtle differences that can be overlooked during auscultation. This is due to the fact that the audibility range has nothing to do with graphically depicting heartbeats. This promotes accurate diagnosis [11].
• Heart issues can be detected early by heart sounds.
Therefore, when PCG signal is appropriately analysed, it can result in early, effective, and affordable treatment.
• In rural primary health care facilities, when the stethoscope is the only diagnostic tool accessible, the use of PCG will be very advantageous. It might be feasible to perform automatic auscultation by employing an electronic stethoscope. You can also ask an expert for advice by sending PCG signals through an electronic medium.
• In some cases, such as those involving infants, it is also the only alternative that can be used because ECG and other procedures cannot be used.

The Model for PCG Diagnoses
This section the proposed system for PCG signal classification as normal and abnormal is discussed in detail. The dataset of heart signals is taken from [12].   = 2595 log 10 (1 + 700 ) (1)

Fig. 4. Steps to computation of MFCC coefficients
From PCG signal (which is sound signal) the features are extracted through MFCC by applying the above steps mentioned in block diagram, then stored in excel sheet and is labeled (i.e. 1 for normal and 0 for abnormal heart sound) for further classification through CGP-ANN.

Cartesian genetic programming Artificial Neural Network
The genetic programming algorithm CGPANN is based on Cartesian genetic programming. Artificial neurons with weighted connections and non-linear activation functions are used as network nodes in CGPANN. CGPANN uses directed acyclic networks to represent graph. These graphs are represented by a two-dimensional grid of gene-based nodes; the genes that make up a genotype are referred to as genotype genes. As demonstrated in Fig. 5, node genes in CGPANN are integers that can be inputs, functions, or outputs. The input genes specify the source of a node's data, the function genes specify the operations the node does on that data, and the output genes specify the location of the user's output. Some nodes may be ignored when genotype is decoded. When outputs of some nodes are not used in computation of output, the node is referred to as a junk node. When this happens, the program that appears from decoding of a genotype is referred to as a phenotype. In CGP, the genotype is of fix length. Contrarily, the size of the phenotypic can be anywhere between 0 and the total number of genotype-defined nodes. A network would result in zero nodes if all programme outputs and inputs were connected directly. The number of nodes in a phenotype and genotype will be equal when every node in the graph is taken into account while computing the output [13].
CGPANN includes three parameters that the user can choose when creating a CGPANN classifier. The amount of columns, rows and levels-back are all factors to consider. They are represented by the letters , and , respectively. The product of the first two parameters, Ln=ncnr, determines the maximum number of computational nodes. The parameterl controls how linked the encoded graph is. The columns from which a node receives its inputs are restricted by levels-back. A node can only receive inputs from nodes in the column to its left or from a principal input if l=1. The outputs of any node in the first two columns or a major input can be connected to a node's inputs if l=1 [15].
Consider that a CGPANNs genotype having m number of nodes and number of input per node to be a. Then node genes must be , 1 , 1 , 2 , 2 , … . , . The genotype ( ) is represented by . 1 , 2 , … . as shown Fig.  6.

Mutation
The proposed work first creates a set of genotypes, passes the data from it, and then verifies what proportion of PCG signals are classified as normal and abnormal. Then, using an evolutionary method, the best genotypes evolve from one generation to the next 1 + (where = 4 or 9) [13]. In this method, the parent genotype is left unaltered, and 4 or 9 children are created by calling mutation function on the parent genotype. To produce offspring the mutation operator is denoted by μr used in CGPANN, the value of μr is generally taken 5% or 10% [13].
An allele that is randomly selected for a gene location is altered to another acceptable random value in this point mutation operator. When a gene for a function is chosen for mutation, a valid value is the address of any function in the set of functions; however, when a gene for an input is chosen for mutation, a valid value is the address of the output of any preceding node in the genotype or of any programme input. Address of any genotype node's output or the address of a programme input are also acceptable values for a programme output gene.

Evolutionary Strategy
In CGPANN, the proposed algorithm produces genotypes and then apply 1+ λ (where λ=4 or 9) evolutionary strategies to evolve best genotypes from one generation to the next. Below is the pseudo-code for the proposed algorithm training and testing [13].
• Make a training matrix with the features that need to be classified, along with an output vector that has the classification outcome.
• Set the number of inputs per node, the number of node rows, columns, and outputs for CGPANN.
• Create a ten-genotype beginning population as follows: • A matrix of nodes with randomly chosen activation functions (sigmoid or hyperbolic tangent) are used to represent each genotype.
• Each node receives information either at random from the system or from a node in the column to its left.
• Each node's input is assigned a random number between -1 and +1 as a weight.
• The system's output nodes are designed to be connected to any node's output or a system input randomly.
• The fittest genotype and its nine clones are used to form a new population. Each duplicate gets 10% of its replicas randomly altered (Mutation Rate), resulting in nine offspring.
• The fitness of the parents and children is evaluated, and genotype with the best performance is selected as next parent. The offspring will be picked if both the parent and the offspring are equally fit. From generation to generation, the best fitness value improves until the required fitness level is reached or the number of iteration reaches a specified threshold.
• After the network has evolved using test inputs, its performance is assessed.
• As a result of its prior training, the system is now prepared to classify a new pattern.

Results
In this section, the results of the experiments are discussed in depth according to the experimental parameters.

Percentage Accuracy
The system's performance metric for determining the extent to which a PCG is classified by the system is percent accuracy. This can be conveyed in several ways.
%Accuracy= (True Positive +True Negative)/ (Total number of Sample) True Positive samples are those of a PCG claiming to be true by the system if they are normal, whereas True Negative samples are those of a PCG signal claiming to be false if they are abnormal. In both the training and testing phases of network, the system's percent accuracy is measured.

The Percentage Accuracy of CGP-ANN
The features i.e. MFCC coefficients are calculated from the datasets (the two different datasets are used in this paper) by applying the MFCC feature extraction techniques for training and testing of the CGP-ANN. Each testing and training data set contains 100 PCG samples half of them are Normal heart PCG samples and others are abnormal. For verification that heart is normal or abnormal the CGP-ANN classifier is used. All the results are summarized in Table 1 and Table 2.
In Table 1 the dataset-A is used, the MFCC Coefficient are keep constant i.e.13 for dataset A and B as DCT of 13 points has good performance in [13] while number of nodes and input per node is varied and the results are obtained by training the classifier for more than 10 thousand times and then test the classifier through testing dataset. The summarized results are shown in table 1 it is clear from table that the CGPANN genotype of 26 nodes and 4 or 5 inputs per nodes has best performance in classification of normal and abnormal heart. When the input per node are increased the classifier is trained for specific dataset i.e. over trained which is not good. Similarly in Table 2 the data set B is used and it clear from the table that CGPANN classifier of 26 nodes has higher accuracy.

Conclusion
The classification of normal and abnormal heart sounds with heart murmurs is investigated in this paper. Mel frequency cepstrum coefficient used to extract features and the CGP ANN classifiers are used to diagnose heart normality and abnormality from sounds emitted by heart. During the experimentation, a general error of 0.50% and a diagnosis accuracy of 99.50% percent are obtained while using 26 nodes genotype. Comparing the results of this study with the previous studies showed that the present study produces a high degree of accuracy.

Acknowledgment
A special grant from the Vice Chancellor Prof. Dr. Zaffar M. Khan, Shuhada-e-APS University of Technology (UoT) Nowshera provided significant financial support for this research work.
The authors would like to thank UoT Nowshera, for providing Hi-Tech laboratory facilities to perform the experimental work. [17] M. K. Jalagam, and V. K. Mittal, "Recent studies on applications using biomedical signal processing: a review", 2nd Global Conference for Advancement in Technology. IEEE, 2021.