Academia.eduAcademia.edu

Manuscript

The development of machine learning technology and its algorithms has led to a significant breakthrough in the medical field. The ability to diagnose and predict diseases with high accuracy has been achieved with the help of machine learning. This capability is particularly useful in creating systems that can automatically analyze medical test data without the need for a doctor's presence. This paper focuses on designing a system for analyzing data obtained from spectrophotometric analysis to diagnose heart diseases. Different classification methods such as K Nearest Neighbor, Parzen, Bayesian, Multilayer Perceptron, and RBF have been used in this research. It also suggests unbalanced, non-normalized, and whitened data as pre-processing methods. In addition, Genetic algorithm has been used to optimize hyperparameters. Experimental reports and results show that KNN, Parzen, One-layer perceptron and Two-layer perceptron classifiers have an accuracy of 75.64%, 80.67%, 84.74%, and 71.66%, respectively. And the RBF neural network and the Bayesian method with whitened data and optimized parameters have higher accuracy than other methods and can detect the subject's health or disease with 100% accuracy and analysis providing the expert audience with a detailed description of the methods used to diagnose heart diseases.

Comparative Analysis of optimized Machine Learning Algorithms for Heart Disease Severity Recognition Using Spectrophotometric analysis Masoud Sistaninejhad Department of Electrical Engineering Seraj University Tabriz, Iran [email protected] Saman Rajebi Department of Electrical Engineering Seraj University Tabriz, Iran [email protected] Abstract—The development of machine learning technology and its algorithms has led to a significant breakthrough in the medical field. The ability to diagnose and predict diseases with high accuracy has been achieved with the help of machine learning. This capability is particularly useful in creating systems that can automatically analyze medical test data without the need for a doctor’s presence. This paper focuses on designing a system for analyzing data obtained from spectrophotometric analysis to diagnose heart diseases. Different classification methods such as K Nearest Neighbor, Parzen, Bayesian, Multilayer Perceptron, and RBF have been used in this research. It also suggests unbalanced, non-normalized, and whitened data as pre-processing methods. In addition, Genetic algorithm has been used to optimize hyperparameters. Experimental reports and results show that KNN, Parzen, One-layer perceptron and Two-layer perceptron classifiers have an accuracy of 75.64%, 80.67%, 84.74%, and 71.66%, respectively. And the RBF neural network and the Bayesian method with whitened data and optimized parameters have higher accuracy than other methods and can detect the subject's health or disease with 100% accuracy and analysis providing the expert audience with a detailed description of the methods used to diagnose heart diseases. Keywords—heart disease; Classification; KNN; Bayesian method; MLP; RBF; Genetic algorithm I. Siamak Pedrammehr Faculty of Design Tabriz Islamic Art University Tabriz, Iran [email protected] system using a gamma camera (IE skating), which makes it possible to provide real 3D information [1]. This 3D information is usually provided as cross-sectional cuts from the Shooting location, but can be freely modified or manipulated. SPECT in using radioactive materials and gamma-ray detection is like PET, but it is significantly cheaper than PET because it uses long-term radioisotopes [2, 3]. As shown in Figure 1, SPECT allows precise location in 3D space, and can be used to provide information about the local function of the internal organs. Using the obtained images from SPECT, data classification can diagnose the disease. The features resulting from spectrophotometric in addition to general information such as gender, age, etc. are used for data classification [3]. The described data has been collected at the University of Colorado in Denver (Denver, CO 80217) and Ohio Medical College, OH, U.S.A. This paper uses this data to diagnose the heart failure without human intervention. For this purpose, different types of classifiers have been investigated and optimized. Parzen; INTRODUCTION Heart failure (HF) is also known as chronic heart failure (CHF) occurs when the heart is unable to pump and maintain blood flow to the body to meet the needs of the body. Symptoms of heart failure usually include shortness of breath, excessive fatigue, and swelling of the leg. Common causes of heart failure, such as heart attack, high blood pressure, atrial fibrillation, valvular heart disease, excessive alcohol consumption, infection, and chiropody are unknown. Heart failure is diagnosed based on the history of symptoms and physical examination, and the image of the SPECT from the heart. Computed tomography with the diffusion photon (SPECT, or less commonly known, as SPET) is one of the methods for imaging with gamma rays. This method is very similar to the conventional nuclear kinetics of a typical solar Fig. 1. A view of the SPECT scanner device II. METHODOLOGY In this section, first, by using different classification methods, the accuracy of each of them is measured. The effect of different parameters of classifiers on their accuracy is evaluated. Finally, by using evolutionary algorithms, we will try to increase the accuracy of one of the classifiers as much as possible. A. K Nearest Neighbor Methods The K nearest neighbor is a non-parametric statistical method that is used for statistical classification and regression. In both cases, K contains the closest training samples in the data space and its output varies depending on the type used in classification or regression. According to the specified value for K, it categorizes a test unlabeled example among its K nearest neighbors in the training set. Various methods have been proposed to calculate the neighborhood distance or give weight to different neighbors. A fundamental approach to the KNN is shown in the flowchart of Figure 2 [4-7]. According to the flowchart shown in Figure 2, the KNN classifier was designed and its correct classification rate (CCR) was reported as 75.64%. The confusion matrix of this classification, which represents the correctly and incorrectly classified examples of each class, is presented in Table 1. As shown, class two samples are classified with good accuracy compared to class one. The standard score (Z-Score) is used to convert data distribution from normal to standard. The data was whitened according to the Equation (1) and the KNN process was repeated again. New feature = old feature - The average of features in all data (1) standard deviation of that feature in all data Whitening the data caused a significant improvement in the accuracy of the KNN classifier so its correct classification rate increased from 75.64% to 96.15%. The confusion matrix of whitened data classification by KNN is presented in Table 2. The accuracy of the nearest neighbor classification is influenced by the number of nearest neighbors (k) used. In Figure 3, you can see how different k values affect the correct classification rate. Based on Figure 3, altering the value of K did not impact the accuracy of KNN in this dataset. Thus, since the classifier operates faster with lower K values, K=3 is deemed the optimal number of neighbors. B. Parzen Method To determine the test sample class in a given neighborhood range, we select the class with the highest number of members. This method is similar to KNN, as it doesn't require a specific number of neighbors from a particular class to be within the neighborhood range. The appropriate range value is often determined through trial and error. When Parzen's classification is used on our whitened data, it results in a correct classification rate of 80.67%. However, this value is only the most accurate within Parzen's neighborhood ranges. It is important to note that this method is less accurate than the KNN method and has some weaknesses. TABLE 2. confusion matrix of KNN classifier with whited data Classes Class 1 Class 2 Fig. 2. Class 1 36 0 Flowchart of the base KNN classifier TABLE 1. KNN classifier Confusion Matrix Classes Class 1 Class 2 Class 1 23 3 Class 2 16 36 Fig. 3. The effect of K value on CCR in KNN method Class 2 3 39 C. Bayesian Method The Bayesian method is a straightforward approach to classifying data. It involves measuring the probability density function of each class to determine the likelihood of assigning the test data to a particular class. Figure 4 depicts the flowchart of this method. Through the use of the Bayesian method, 39 out of 39 data were accurately assigned to class one, while all 34 data were correctly placed in class two. The classification accuracy was 88.46%. You can view the confusion matrix of the Bayesian method in Table 3. Based on the Bayesian algorithm's mathematical formulas, σ is a parameter that is derived from Equation (2). Here, X represents the training data and μ is the mean of each class within the training data. Additionally, m in Equation (3) is a fixed coefficient that is added to the diagonal elements of the covariance matrix. This coefficient plays a crucial role in improving classification accuracy. 𝜎 = ∑(𝑋 − µ) ∗ (𝑋 − µ) 𝜎𝑖,𝑗 = 𝜎𝑖,𝑗 + 𝑚 ′ (2) 𝑖≠𝑗 (3) To enhance the accuracy of classification, it is important to determine the best value for m. This can be achieved through the use of optimization algorithms like the genetic algorithm. D. Genetic algorithm The genetic algorithm is a computer science search technique that finds approximate solutions to mathematical, optimization, and search problems. It uses evolutionary biology techniques, such as heredity, biological mutation, and Darwin's principles of selection, to predict or match patterns. This approach is often a good alternative to regression-based prediction techniques. Genetic algorithm modeling is a programming technique that uses genetic evolution to solve problems. Inputs are transformed into solutions through a process modeled on genetic evolution, and the fitness function evaluates the solutions as candidates. If the problem's exit condition is met, the algorithm ends. The algorithm is based on repetition, and most of its parts are chosen as random processes. The steps to implement the genetic algorithm are as follows: • • • • • • • Creating the initial population and evaluating it. Apply crossover on chromosomes and evaluating it. Apply Mutation on chromosomes and evaluating it. Merge the initial, crossover and mutant populations. Sort and then truncate the populations. If the stop conditions are not met, we go to step 2. The end [8, 9] TABLE 3. Confusion matrix of the Bayesian method Classes Class 1 Class 2 Class 1 39 5 Class 2 0 34 Fig. 4. Flowchart of the Bayesian method The application of the genetic algorithm to the Bayesian algorithm resulted in an optimal value of m at 5.985, with a 100% success rate in correct classification. Tata 5 depicts the evolution of the fitness function values throughout the iterations, while Table. 4 displays the confusion matrix of the Bayesian method after applying the best fitness value. E. Neural Network Computational systems known as Artificial Neural Networks (ANN) or connectionist systems are based on the biological neural networks and astrocytes present in animal brains. These systems learn by sampling certain rules, often unplanned. In a typical ANN implementation, the connection between artificial neurons is represented by a real number, and the output of each neuron is calculated using a nonlinear function of its total inputs. The connections between these artificial neurons are referred to as edges. A simplified view of the neural network is presented in Figure 6 [10-16]. Fig. 5. Genetic Algorithm best fitness values TABLE 4. Confusion matrix of the Bayesian method with G.A Classes Class 1 Class 2 Class 1 39 0 Class 2 0 39 Fig. 6. A simple view of Neural Network F. Perceptron The preprocessor algorithm in machine learning is a type of supervised learning that uses binary classifications. A binary classifier determines whether an input, which is represented by a vector of numbers, belongs to a specific class or not. This classification is based on a linear prediction function that uses a set of weights and a characteristic vector. When multiple prosthetics are combined into an artificial neural network, each output neuron operates independently, allowing for separate learning of each output. Figure 7 provides a basic illustration of a perceptron neural network. In order to analyze the data using a neural network, a singlelayer perceptron with 27 neurons in the hidden layer and a tansiq transfer function for both the hidden and output layers was created. You can view the network design in Figure 8. The single layer perceptron Neural Network achieved a correct classification rate of 84.74%. The neural network's performance is influenced by the number of neurons and the activation function. After evaluating various neuron quantities for the first hidden layer and implementing tansig activation function for the hidden and output layers, it was discovered that the highest correct classification rate was achieved when there were 5 neurons. The performance of the neural network for different neurons can be seen in Figure 9. Fig. 7. A simple view of perceptron Neural Network Fig. 8. A simple view of Single Layer Perceptron NN Fig. 9. The chart of CCR values of different neurons. To evaluate more accurately, a two-layer perceptron neural network was created. The first hidden layer had 5 neurons and used a tansig activation function. The second hidden layer had 10 neurons and used a purelin transfer function. The output layer used a tansig activation function. After using this network to classify data, the correct classification rate was 71.66%. This performance was weaker than that of the single-layer perceptron neural network. Figure 10 displays the design of the network. G. RBF The radial basis function network, developed by Broomhead and Lowe in 1988, is a classification method that utilizes kernel functions, specifically gaussian kernels, placed at strategic locations in the input space. These kernel functions are used to create a map through weighted-sum interpolation, and the network has one hidden layer consisting of gaussian nodes and an output layer of linear nodes with full inter-layer connections. The weights assigned to the hidden nodes encode both the center and standard deviation of the basis functions, with each hidden node calculating a gaussian kernel function based on the Euclidean distance between the input and basis function center. The output node's activation is then determined by a weighted sum of the hidden node outputs. In this study, a RBF classifier with 1,000 basis function nodes was utilized, determined to be adequate through experimentation. To expedite the training process, all center locations were randomly selected from the training set, a method shown to be effective in previous experiments. Each basis function is a gaussian with diagonal covariance, and the standard deviation is set to be the Euclidean distance between the basis function and the nearest other basis function, multiplied by a global scaling factor. This factor was determined to be one through experimentation. Weights assigned to the output nodes were determined through a pseudo matrix inversion using singular value decomposition. For a visual representation of a simple radial basis function network, see Figure 11. Fig. 10. A simple view of two-layer perceptron Neural Network III. Fig. 11. Schematic representation of RBF neural network A single-layer RBF neural network with 40 hidden layer neurons was created to assess the data. This resulted in an accuracy of 75.59%. Further testing was conducted with varying numbers of neurons, and the best classification result was achieved with 55 neurons, resulting in 100% accuracy. Figure 12 depicts the 40-neuron RBF network design, while Figure 13 displays the accuracy graph of the RBF neural network for different neuron numbers. Fig. 12. We analyzed the spectrophotometric data of 260 people, with 130 in the healthy group (class 1) and 130 in the disease group (class 2). We tested different classification methods using 70% of the data for training and 30% for testing. The nearest neighbor algorithm with Euclidean distance had an accuracy of 75.64%. To analyze the data in more detail, we normalized and standardized it and reclassified using the same algorithm, resulting in an accuracy of 96.15%. We also used Perzen's algorithm, which had an accuracy of 88.76%. The Bayesian algorithm had an accuracy of 88.46% without normalization and 100% after optimization with the genetic algorithm. The singlelayer neural network had an accuracy of 84.74%, the two-layer perceptron neural network had an accuracy of 71.66%, and the RBF neural network with 55 neurons had an accuracy of 100%. Based on accuracy and execution time, the best classification method was the Bayesian network with normalized and standardized data and optimized parameters. A bar chart in Figure 14 and Table 5 show the accuracy and execution time of each classifier. A view of the simple radial basis function network Fig. 14. Fig. 13. RESULTS Chart of the execution time and CCR of all methods The chart of CCR values with different neurons for RBF. TABLE 5. Table of execution time and CCR of each method Row 1 2 3 4 5 6 7 8 Method Euclidean distance Euclidean distance with whitening Parzen Bayesian Bayesian method with whitening and genetic algorithm One layer perceptron neural network Two-layer perceptron neural network RBF neural network CCR (%) 75.64 96.15 80.76 88.46 100 84.74 71.66 100 Execution time (second) 0.014158 0.047787 0.432878 0.043837 0.045042 3.654818 1.404208 4.46548 References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] K. Hongyu, Z. Xue, L. Li, Y. Qijian, S. Weinian, and L. Tiewei, "Early severe coronary heart disease and ischemic heart failure in homozygous familial hypercholesterolemia," Medicine, 2018. P. H. Pretorius, M. A. King, K. L. Johnson, Y. Yang, and M. N. Wernick, "Towards personalized injected patient doses for cardiac perfusion SPECT imaging: A retrospective study," in 2016 IEEE Nuclear Science Symposium, Medical Imaging Conference and Room-Temperature Semiconductor Detector Workshop (NSS/MIC/RTSD), 2016, pp. 1-3. P. A. Pellikka, L. She, T. A. Holly, G. Lin, P. Varadarajan, R. G. Pai, et al., "Variability in Ejection Fraction Measured By Echocardiography, Gated Single-Photon Emission Computed Tomography, and Cardiac Magnetic Resonance in Patients With Coronary Artery Disease and Left Ventricular Dysfunction," JAMA Network Open, vol. 1, pp. e181456e181456, 2018. S. Andarabi, A. Nobakht, and S. Rajebi, "The Study of Various Emotionally-sounding Classification using KNN, Bayesian, Neural Network Methods," in 2020 International Conference on Electrical, Communication, and Computer Engineering (ICECCE), 2020, pp. 1-5. Z. Jafari, A. M. Yousefi, and S. Rajebi, "INVESTIGATION ON DIFFERENT PATTERN CLASSIFICATION METHODS AND PROPOSING THE OPTIMUM METHOD WITH IMPLEMENTATION ON BLOOD TRANSFUSION DATASET," 2007. V. Yousefi, S. Kheiri, and S. Rajebi, "Evaluation of K-Nearest neighbor, Bayesian, Perceptron, RBF and SVM neural networks in diagnosis of dermatology disease," International Journal on Technical and Physical Problems of Engineering (IJTPE), pp. 114-120, 2020. A. Zirjam and S. Rajebi, "Applying Different Pattern Recognition Methods for Identifying Skin Diseases," Europe, vol. 23, p. 20.3, 2020. S. Katoch, S. S. Chauhan, and V. Kumar, "A review on genetic algorithm: past, present, and future," Multimedia Tools and Applications, vol. 80, pp. 8091-8126, 2021. S. Mirjalili and S. Mirjalili, "Genetic algorithm," Evolutionary Algorithms and Neural Networks: Theory and Applications, pp. 43-55, 2019. Z. Jafari, S. Rajebi, and S. Haghipour, "Using the Neural Network to Diagnose the Severity of Heart Disease in Patients Using General Specifications and ECG Signals Received from the Patients." Z. Jafari, A. M. Yousefi, and S. Rajabi, "Using different types of neural networks in detection the body's readiness for blood donation and determining the value of each of its parameters using genetic algorithm," Innovaciencia Facultad de Ciencias Exactas Físicas y Naturales, vol. 8, pp. 1-10, 2020. S. Mirzayi and S. Rajebi, "Diagnosis of Epilepsy Using Signal Time Domain Specifications and SVM Neural Network," Machine Learning Research, vol. 5, p. 28, 2020. S. Salimi, M. S. Nobarian, and S. Rajebi, "Skin disease images recognition based on classification methods," International Journal on Technical and Physical Problems of Engineering, vol. 22, pp. 78-85, 2015. S. Sarabi, M. Asadnejad, S. T. Hosseini, and S. Rajebi, "Using Artificial Intelligence for Detection of Lymphatic Disease and Investigation on Various Methods of Its," Issue, vol. 43, pp. 58-65, 2020. S. Sarabi, M. Asadnejad, and S. Rajabi, "Using neural network for drowsiness detection based on EEG signals and optimization in the selection of its features using genetic algorithm," Innovaciencia, vol. 8, pp. 1-9, 2020. M. Saraei, S. Rahmani, S. Rajebi, and S. Danishvar, "A Different Traditional Approach for Automatic Comparative Machine Learning in Multimodality Covid-19 Severity Recognition," International Journal of Innovation in Engineering, vol. 3, pp. 1-12, 2023.