Hybrid PSO-RBFNN and Proposed Algorithms of DDDWT for the Heart Disease Classification

This paper introduced a Particle Swarm Optimization-Radial Basis Function Neural Networks (PSO-RBFNN)-based system for heart disease detection that used the PSO algorithm to optimize RBFNN parameters. The newly developed signal digital algorithm presents the results of a new image contrast enhancement approach using Double Density Discrete Wavelet transform DDDWT for extraction of features, using adaptive DDDWT for the elimination of noise


INTRODUCTION
ECG is a key tool for cardiac anomaly diagnosis and detection.The ECG is a bio-electric signal that tracks the heart muscle electrical activity and transmits to the body surface in the form of signals as electrical events.Therefore, it is important to propose and develop more and better-automated methods for heart disease detection.Recently Electro Cardiogram (ECG) analysis has been growing for human health diagnosis became a very helpful tool to assure the patient's help.The ECG is important pointers to provide helpful information from the reflected waveform shape of the nature, of heart diseases [1].The physician diagnosis has a difficult problem and misdiagnosis can be occurring sometime with the ECG recorder.Therefore, artificial intelligence with the ECG recorder can be considered as one of the best techniques for the classification of ECGs into different diagnostic groups for early diagnosis of a heart attack.
Many researchers have introduced several methods for extracting ECG features to improve the accuracy of the ECG signal classification.In [2], Proposed a general comparison of ECG signal detection algorithm ' noise sensitivity.In [3], a proposed new approach to process the cardiac electric signals (ECG), by using neural networks.In [4], proposed ANN combined with different pre-and post-processing techniques that are designed and evaluated for ischemia detection, arrhythmia classification, recognition of heart diseases.In [5], wavelet application and neural network developed to design a diagnostic system for ECG signals.ANN and FFT were used together with a crosscorrelation to perform all component analyses of the ECG signal.In [6], a proposed multi-level feature of the DDDWT for signal decomposition into several levels, each level representing a particular feature.For our work, we have used MATLAB to analyze the EEG signals.The survey shows that double density discrete wavelet transform (DDDWT) is the most effective method to evaluate EEG signals.The DDDWT transition is the most effective.This method usually fits in where the signals are very ephemeral, i.e. when the signal frequency changes quickly in terms of time.DDDWT domain.For specific medical images, findings from traditional edge detectors are compared.Edge detectors with second level DDDWT are introduced and relative results are provided.The multi-resolution wavelet-based tests are higher than traditional edge-based approaches.The soft edge detectors work for medical images in equal measure [7,8].In [9] Neuro-fuzzy network consisted of two cascades-connected sub-networks; the fuzzy self-organizing layer which performs a pre-classification function, followed by MLP as the final ECG classifier.
Radial base function Neural networks are the types of neural networks whose activation functions in the hidden layer are radially symmetrical, their output depends on the distance between a vector that stores the input data and a weight vector called the center.RBFNN has been used in many applications such as approximation of functions, system control, speech recognition, prediction of the time series, and classification.[10] In this paper, a combination of DDDWT and PSO-RBFNN has been developed for pattern recognition of the ECG wave for common heart disease.First, the brief deception of common such as Normal, Angina, MI, RBBB, and LBBB heart disease has been introduced in detail.Second, 12lead ECG data collected from Baghdad Hospital, then selecting suitable data sets, to design the required ANN system.The third, The ECG samples were processed and standardized to produce a data set using DDDWT applied to PSO-RBFNN DDDWT's methods have been used to remove the ECG features and to train PSO-RBFNN.The model has 13 input nodes representing the 13 ECG features data, 40 nodes in the hidden layer, and five output nodes representing Normal, Angina, MI, RBBB, and LBBB.Finally, the Simulation results have been compared with the related methods to improve the overall system performances.
This study aims to determine the optimum, easier, and cheaper diagnostic system for normal heart disease diagnostics, the new approach to integrating DDDWT hybrid soft computing with an active filter for BW noise reduction decreases distortion of the S-T segment of the ECG signal and the higher frequencies of sampling.The suggestion to use this technique for BW noise reduction when evaluating the variance of the S-T section in the ECG signal.For better results, many researchers are still working on BW noise reduction without distorting the waveform.

METHODOLOGY
The proposed method steps are shown below and have been carried out to feature extraction and regeneration as a digital time-series signal.
1) Scanning the 12-lead ECG paper, convert it into greyscale levels, and select the desired signal.2) Separation of the desired signal from its background (lines of the square grid).
3) The signal and the background lines must be finite thickness (one pixel must represent width lines).4) Calculate the size of the small and large square of the background (scaling).5) Signal period identification and find feature extraction.

I. Scanning, Selecting, and Converting
Typically, the 12-lead ECG signals are printed by a thermal trace on the paper at 25mm/ sec speed [11].The optical scanning technology was used to scan ECG paper at 300 dpi (pixel or dots per inch) and stored as a color image in many types of format files such as jpg, gif, and gif [11].

II. Signal Extraction and Digitization
This step is to isolate the target object (signal) from its background in the selected (cropped) image and then digitizing it.First, finding the grey threshold.Many algorithms are doing quite a good job of finding the grey threshold, such as Mean or Median, Iterative Method, K-means, and Otsu algorithm.The Otsu's algorithm is used in image processing and computer vision to automatically execute the histogram form based on the threshold.[12] Alternatively, the greyscale image can be converted into a binary image.The method assumes that the image is threshold consists of two-pixel or bi-modal histogram levels, then calculates the optimum threshold individually; those two classes to minimize their combined spread.[13].The grey threshold method uses Otsu's algorithm, which chooses a threshold to minimize the infra-class variation of the white and black pixels.Multidimensional arrays are transformed into 2-D arrays automatically using reshape.The function of the grey thresh ignores any imaginary part, which is not zero [14,15].

III. Signal Lines Slandering
In the ECG scanning, the image represents the width of the signal line and background grid lines in several pixels.According to that, the reading of the amplitude and time can be readable at many values.The method used in this step to achieve the slandering of the signal line and background grid lines are a time slice method (or top-bottom method).The time slice method is the vector of the pixels' positions that consist of numbers transmitted from a scanner device when it scans the ECG paper.The time of the light pixel, mention to the pixel whose value is the index line.The index line is represented as a sequence of vertically aligned rectangles having a width of one pixel in the horizontal axis and having a line-height or thickness at each point in the vertical axis.The following is the proposed algorithm.
• Read the image of the extraction ECG signal from the previous algorithm.
• For each column, specify the neighboring pixel locations for the black color.
• Specify the top and bottom pixel locations.
• Calculate the middle pixel location.
• Set all the pixels in the 225, except the middle pixel set it to 0.
• Show the new image.After that, we will convert the extracted ECG signal from an image into a time-series signal.
• Specify the locations of the black color pixels of the new image.
• Record the values of all black color locations in the vector.
• Plot the new vector.

FEATURE EXTRACTION
Processing of features is the processing and conversion of the ECG signal into a set of features.The ECG features are a collection of relevant data from the ECG signal for the identification process.This paper used DDDWT with a proposed special domain to extract diagnostic data from the ECG signal (real-time ECG parameters) shown in Table I.

Classification
PSO This technique employed multi-variable functions with optimized multi-local points.The fundamental part of this algorithm uses the bird's flock behavior.The PSO has characteristics of rapid integration and simple implementation in combination with other optimization approaches [16].In the optimization of particle swarms, each of the population is called a particle.In standard PSO, each particle updates its velocity and its position in each iteration after the initialization of the population.At the end of each iteration, predefined cost functions will evaluate the performance of all the particles.The research section, therefore, clearly demonstrated the efficacy of hybrid PSO approaches to the diagnosis of diseases relative to other current methods [17].
The particle swarm optimization is the simulation of the knowledge, involvement of the social organism.So, in the n-dimensional space, each entity is treated as an accurate particle within the velocity vector and position vector of the particle defined as Xi(t) = (Xi1(t) ...., Xi2(t), Xin(t)) and Vi(t) = (Vi1(t), Vi2(t) ...., Vin(t)).The particles travel in line with the following equations: X id (t + 1) = V id (t + 1) + X id (t) Where the parameters r1 and r2 are constant numbers at random in the range (0, 1), c1 and c2 are the acceleration coefficients, Vector Pg = (Pg1, Pg2, ..., Pgm) is the best particle in the world and is known as the best global (g-Best) spot.Next, the vector Pi = (Pi1, Pi2…, Pim) Is the best previous position of the particle (best fitness value) I am known as the best personal position (p-Best), ... Generally, in the range (-Vmax, Vmax), the value of Vid is reduced.Inertia weight w was first introduced by [ 20] to speed up the convergence rate [18].
In various phases, such as learning algorithms, connections, and RBFNN architecture, PSO has been used to improve RBFNN.Each PSO-based RBFNN hybrid solution, called a particle fly to find the optimum solution in the solution space.The fitness function is used to evaluate the particles to get the optimal solution.Initializing the values of the particles of RBFNN parameters with values that are gated from the k-means method while particle values of the bias and weights are randomly selecting initially or from the LMS method.To update the particles using the Eq. ( 2) and Eq. ( 3).The implementation protocol for the global version of PSO is as shown in Figure 1.The input layer forwards the input vector coordinates to each of the nodes in the input vector Layer in hiding.Every node in the hidden layer then calculates an activation as per the Radial Based Related Function (RBRF).Each node in the output layer, latterly, it computes a linear combination of Hidden Node activations, Optimizing RBFNN parameters with PSO, the fitness value of each particle is the value of the error function evaluated at the particle's current position and the particle's position vector corresponds to the network's parameter matrix.

RESULTS AND DISCUSSION
In this paper, the RBFNN used to learn heart disease.The experiment was done with and without using PSO to pre-train RBFNN connection weights, and the results showed that using PSO to pretrain connection weights improved correct classification.Figure 2 shows the comparison between RBFNN and PSO-RBFNN pre-training; it can be distinctly viewed that the PSO-RBFNN with a smaller size of the network without making any concessions on classification performance.The RBFNN needs more than 50 hidden neurons to reach the classification performance of the PSO-RBFNN, which needs about 30 neurons in the hidden layer.

Figure 2: Comparison of the PSO-RBFNN and RBFNN
The hybrid neural network model has 13 input nodes trained with 40 nodes for the hidden layer and five output nodes representing Normal, LBBB, RBBB, MI, and, Angina.The Simulation results compared with the classifications of the previous research, where overall correct classification proved with good performance and accuracy up to 99.19%.This hybrid algorithm has achieved high classification accuracy.The PSO-RBFNN model's classification results for 248 test data were shown in Table II.The uncertainty matrix in Table III below displays the effects of the ECG assessment using the PSO-RBFNN method.This matrix will show the rate of misclassification of an ECG signal as another.The confusion matrix is specified in the rows by the desired classification and the actual network output columns.The PSO RBFNN model's classification output was calculated from the measurement of statistical parameters, such as sensitivity based on Eq. ( 4) and ( 5), specificity, and accuracy, as shown in Table IV.
Where TP is the correctly detected peaks (True Positive), FP is the incorrectly detected peaks (False Positive), FN is the undetected peaks (False Negative), and TB is the maximum peak analysis [19,20].

CONCLUSIONS
This paper provides, a new newly developed PSO algorithm was proposed to train the RBFNN more effectively in the classification of the ECG signals.PSONN is trained for EGG signals by minimizing the search space error function based on weights and biases.This error value is used as a particle's fitness function to guide it towards a more promising solution.The best global particle corresponded to the optimal trained following sufficient iterations.On several sides, PSO was used to develop RBFNN, such as network architecture, learning algorithms, and network connections.The results show that PSO is an efficient alternative to ANN training in terms of accuracy and effectiveness compared to the supervised learning algorithms.The hybrid algorithm based on PSO-RBFNN has been trained to classify the EGG signals for five cases of the heart diseases, and the results achieved high classification performance compared with the other classifications of the previous research, where the classification performance was carried out with 99.82% for specificity and 99.57% for sensitivity.Finally, PSO-RBFNN is one of the most important forms of artificial neural networks (ANNs).It is defined by better approximation, more superficial structures of the network, and faster algorithms of learning.

1 -
An alternative ECG using the Double Density Discrete Wavelet Transform function extraction algorithm in the fifth level system by: In being, Denoise ECG signal; then 2-R-wave Detection by Heartbeat Calculation; 3-next step, the Q & S Waves Detection; Either QRS-onset Detection or QRS-offset Detection 4-Calculation the QRS-Duration; consists of both the P and T of Wave Detection 5-P-Wave Detection Includes all of P-offset Detection and P-onset Detection, while T-Wave Detection Includes all of T-offset Detection and T-onset Detection 6-In any case, it is necessary to know the Calculation Duration, T-Duration & P-Duration, then Calculation PR-Segment and ST-Segment, respectively.7-If case P-Duration Calculation then PR-Segment Calculation, go to the PR-Interval Calculation.8-Finally, knowledge can be obtained from the QT-Interval after calculating all Duration and Detection cases.

Figure 1 :
Figure 1: The general structure of the RBF NN

TABLE IV : PSO-RBFNN classification performance.
Many investigators studied the description of ECG signals and implemented numerous preprocessing methods, many-dimensional reduction techniques, filtering techniques, classifiers, and also a variety of investigators used the ECG Signal Description database.TableVshows our simulation results compared with the ECG classifications that have previous research has been carried out.The performance measures are Specification 99.82%, Sensitivity 99.57%.The below explorations of feature selection methodology with several Optimization technique classifiers are used to define and classify regular and various cardiac arrhythmias.These techniques are crucial and essential measures for assessing overall system output and medical diagnosis.