Automatic Heart Disease Diagnosis System Based on Artificial Neural Network (ANN) and Adaptive Neuro-Fuzzy Inference Systems (ANFIS) Approaches


This paper aims to design and implement an automatic heart disease diagnosis system using MATLAB. The Cleveland data set for heart diseases was used as the main database for training and testing the developed system. In order to train and test the Cleveland data set, two systems were developed. The first system is based on the Multilayer Perceptron (MLP) structure on the Artificial Neural Network (ANN), whereas the second system is based on the Adaptive Neuro-Fuzzy Inference Systems (ANFIS) approach. Each system has two main modules, namely, training and testing, where 80% and 20% of the Cleveland data set were randomly selected for training and testing purposes respectively. Each system also has an additional module known as case-based module, where the user has to input values for 13 required attributes as specified by the Cleveland data set, in order to test the status of the patient whether heart disease is present or absent from that particular patient. In addition, the effects of different values for important parameters were investigated in the ANN-based and Neuro-Fuzzy-based systems in order to select the best parameters that obtain the highest performance. Based on the experimental work, it is clear that the Neuro-Fuzzy system outperforms the ANN system using the training data set, where the accuracy for each system was 100% and 90.74%, respectively. However, using the testing data set, it is clear that the ANN system outperforms the Neuro-Fuzzy system, where the best accuracy for each system was 87.04% and 75.93%, respectively.

Share and Cite:

Abushariah, M. , Alqudah, A. , Adwan, O. and Yousef, R. (2014) Automatic Heart Disease Diagnosis System Based on Artificial Neural Network (ANN) and Adaptive Neuro-Fuzzy Inference Systems (ANFIS) Approaches. Journal of Software Engineering and Applications, 7, 1055-1064. doi: 10.4236/jsea.2014.712093.

1. Introduction

Recently, heart disease has become one of the most prevalent diseases which people are being suffered from. According to statistics, it is one of the most important causes of deaths all over the world (CDC’s report). Many factors, such as clinical symptoms and the relation between the functional and the pathologic manifestations of heart diseases and other human organs rather than heart, complicate the diagnosis of it and result in delay in correct diagnosis decision. Therefore, diagnosing of the heart disease is an essential matter in health care industry and many researchers try to develop medical decision support systems (MDSS) to help physicians. These systems are developed to moderate the diagnosis time and enhance the diagnosis accuracy in addition to supporting increasingly complicated diagnosis decision process [1] [2] .

Currently, hospital information systems using decision support systems have different tools available to obtain data, but they are still restricted. These tools can just answer some simple queries like “identifying the male patients who are below 20 years old, and single who have been treated for heart attack”. However, they are not able to answer complex queries “given patient records, predicting the probability of patients getting a heart disease” as an example [3] .

According to [4] , clinical decisions are often made based on doctors’ intuitions and heuristics experience rather than on the knowledge rich data hidden in the database. They lead to unwanted biases, errors and excessive medical costs which affects the quality of treatment provided to patients [5] . Motivated by the necessity of such a system, in this paper, a method is suggested to efficiently diagnose the heart disease, which results in decreasing medical errors and superfluous practice variation, decreasing diagnostic time and enhancing patient safety and satisfaction.

This paper presents a decision support system for heart disease classification using neural network. The data set used is the Cleveland Heart Database taken from UCI learning data set repository which was donated by Detrano. The data set is being divided into two classes: 0 corresponding to absence of any disease and 1 corresponding to presence of disease.

The rest of the paper is organized as follows. Related works are presented in Section 2. In Section 3, research algorithms and concepts are described. Automated heart disease diagnosis system’s design and implementation details are presented in Section 4. In Section 5, experimental results are presented and discussed in details. The study is finally concluded in Section 6.

2. Related Works

Until now, various classification algorithms have been employed on heart disease data set and high classification accuracies have been reported in the last decade. Cleveland heart disease database is one of the most accurate existing databases. Robert Detrano created this database in V.A. Medical Center, Long Beach and Cleveland Clinic Foundation in 1988. Since 1988, researchers worked a lot on classification of its data by using various classification algorithms and they obtained different accuracy results. The work presented in [6] used Artificial Immune System (AIS) and resulted in 84.5% classification accuracy. The work in [7] utilized a hybrid Neural Network ANN and fuzzy neural network (FNN) and reached the classification accuracy of 86.8%. On the other hand, [8] developed SAS based software by using neural network ensemble method and obtained 89.01% accuracy in classification. Recently, a research employed an MLP Neural Network by using Back propagation algorithm which classifies the data into 5 categories with 97.5% accuracy, whereas the SVM based system achieved 80.41% accuracy. In the presented study, a Multilayer Perceptron Neural Network (MLPNN) with three layers is employed and compared with Support Vector Machine (SVM). Results indicated that a MLPNN with back propagation was more successful than support vector machine for diagnosing heart disease [1] .

In addition to artificial neural network, fuzzy expert systems are also used in MDSS. For Instance a fuzzy expert system was proposed to determine heart disease risk of patient in 2007 and the result of this system was 79% [2] . Recently a research designed a fuzzy expert system for heart disease diagnosis, according to the result obtained from designed system, it was correct in 94% [9] . All these previous studies show the applicability of ANN in this selected area.

3. Research Algorithms and Concepts

Important concepts, architecture theory, and algorithm for Neural Network and Neuro-Fuzzy are described in this section.

3.1. Neural Network Approach

Neural Network (NN) also referred to as Artificial Neural Network (ANN) is a computational model where its functions and methods are based on the structure of the brain. Neural network follows graph topology in which neurons are nodes of the graph and weights are edges of the graph. It consists of so many layers that should be finite in order to decrease time of problem solving. In this paper, neural network is used since it has the potential for supporting medical decision support systems.

In large data sets, it has cost-effective and flexible non-linear modeling since the optimization is easy. In addition, it is accurate in predictive inference. Another important factor is that these models can make knowledge dissemination easier by providing explanation, for instance, using rule extraction or sensitivity analysis [4] . ANN has various models, such as Multilayer Perceptron (MLP), RFB and so forth that are different in terms of architecture and training network which will be discussed in the following sub-sections.

3.1.1. Neural Network Architecture

In ANN, neurons can be arranged in various ways and the weights (connection between neurons) can have different patterns which is called neural network architecture. There are different types of architectures, such as feed-forward, feed-back, fully interconnected net, competitive net and so forth. Some of the most important architectures are introduced in [10] . Feed-forward architecture can have single or multi layer of weights. In single layer feed-forward net, there is only one interconnected weights while in multi layer feed-forward net, more than one interconnected layers of weights can exist. Figure 1 shows feed-forward multi layer architecture.

Fully recurrent network architecture is the simplest sort of architecture in which every neuron is connected to each other. Simple recurrent network is to somehow like fully recurrent network, except that neurons are not fully connected. Competitive network is the same as single layer feed forward architecture. In addition of all attributes related to single layer feed forward architecture, in competitive network there is connection between outputs. Among aforementioned architecture, feed-forward architecture is the most suitable one in terms of time for a large amount of data.

3.1.2. Network Training

The process of training the network aims to achieve the expected output by changing the weights in the connections between network layers. There are three sorts of network training as follows:

・ Supervised Training: In this process, a series of sample inputs are available for the network and the resulted output are compared with expected responses.

・ Unsupervised Training: This process is used for the time that the output of training input vectors are unknown.

・ Reinforcement Training: This process shows the correctness of output result.

In this paper, supervised training is used since it is based on the Cleveland database, whereby all input and expected output data are available.

Figure 1. Multi layer feed-forward architecture.

3.1.3. Multilayer Perceptron (MLP)

In this research, MLP is used as one neural network model since it follows feed-forward architecture and supervised training. Perceptron network has usually a layer of input, a layer of output and one or more hidden layers in between. Figure 2 represents MLP with two hidden layers. The input layer consists of raw data which is patients’ information in the heart diagnostic system. In addition, the hidden layers have weights and generate output layer. In other words, MLP aims to map the input to the output using historical data.

MLP uses back propagation as its training algorithm. This algorithm repeats presentation of the input data to the neural network. In each iteration, the output data is compared with the desired one, error is computed and fed back (back propagated) to the network. This feedback is used to modify the weights of neurons. Finally, the desired output will be generated based on iterations [6] .

3.2. Neuro-Fuzzy Approach

Another model that is used in this work is Neuro-Fuzzy, which is the combination of fuzzy logic and neural networks in order to solve wide variety of real world problems in an effective manner. This combination is for removing the limitation of each model. Since neural networks are good at recognizing patterns and not good at explaining how they achieve their decisions. Fuzzy logic systems that can give inexact reasons, and explain their decisions well but not good at reaching the rules they use to make those decisions [11] . The ability to model a problem domain using a linguistic model instead of complex mathematical is the main advantage of using the Neuro-Fuzzy combination [12] . Therefore, these techniques are complementary to be used together [13] .

In this work, a very famous architecture for Neuro-Fuzzy approach known as Adaptive-Network-based Fuzzy Inference System (ANFIS) is used as introduced in [14] . ANFIS can serve as a basis for constructing a set of fuzzy if-then rules with appropriate membership functions to generate the stipulated input-output pairs. ANFIS tool is embedded now in Matlab, therefore, users have to simply type the command “anfisedit” in Matlab command window in order to use this valuable tool. Figure 3 shows the ANFIS architecture, whereas Figure 4 shows the ANFIS procedure.

4. Automatic Heart Disease Diagnosis System’s Design and Implementation

This section highlights all aspects regarding the data set, design, and implementation for the automatic heart disease diagnosis system.

4.1. The Cleveland Data Set

It is very obvious that data set is an important aspect for developing this kind of systems. The Cleveland data set is very famous and has been widely used as a benchmark for heart disease diagnosis systems. Therefore, the Cleveland data set for heart diseases is used in this project.

The Cleveland data set contains a total number of 303 instances with 13 medical attributes (factors) that are acquired from heart disease data set of Cleveland [15] . Table 1 shows some general information of the Cleveland data set, whereas Table 2 shows a detailed attributes description of the Cleveland data set.

Figure 2. MLP with two hidden layers.

Figure 3. ANFIS architecture [14] .

Figure 4. ANFIS procedure.

Table 1. General information of Cleveland data set.

Table 2. Attributes’ description of Cleveland data set.

It is important to highlight that the Cleveland data set was randomly divided into two main categories namely: Training and Testing data set, which comprise of 80% and 20% of the total Cleveland data set respectively.

Experiments with the Cleveland data set have concentrated on simply attempting to distinguish presence (values H1, H2, H3, and H4) from absence (value H0). Therefore, two main outputs are identified, where the value H0 means heart disease is absent from the patient, and the values H1, H2, H3, and H4 mean heart disease is present in the patient. Table 3 depicts the distribution of disease records for Neural Network and Neuro-Fuzzy approaches.

4.2. System’s MATLAB Graphical User Interfaces (GUIs)

The programming language used for developing the automated heart disease diagnosis system is MATLAB, which is a powerful language for data analysis and visualization. There are many programming languages used in data mining. It is important to know the reasons of choosing MATLAB as data mining tool for this paper. The first advantage of using MATLAB is portability that the users will have the same range of basic functions at their disposal. Second advantage is domain specific representations that points out in MATLAB implementation, all data is the form of matrices [16] . This allows us a variety of algorithms and it is very helpful. In addition, standard neural networks have got multidimensional data which is hard for the human brain to understand. MATLAB makes this problem easy to deal with by 3D graphs and plots [17] . By using MATLAB we can also cluster the data, in which we group the objects that have similar characteristics [18] . Therefore, MATLAB is preferred because of its outstanding data calculation and visual graphic representation function [19] .

As stated earlier, there are two main systems, whereby the first one is based on ANN and the second one is based on Neuro-Fuzzy. Each system has three main modules namely: Training, Testing, and Case-Based Modules.

5. Experimental Results and Analysis

As stated earlier, there are two main approaches used to develop the automated heart disease diagnosis system, which are the ANN and Neuro-Fuzzy. Therefore, each system has been experimented and results have been analyzed in order to compare the performance of the two approaches.

Table 3. Attributes’ description of Cleveland data set.

It is important to highlight that there are two main tests conducted, the first at the training module, where the training data set is tested against the trained Neural Network and Neuro-Fuzzy, and the second at the testing module, where the testing data set is tested against the trained Neural Network and Neuro-Fuzzy. Certain parameters were modified for both systems in order to optimize the systems’ performance and acknowledge their effects on the overall systems’ performance. Finally, the best combination of parameters are selected and used in the systems for future tests. A third test is conducted, where users could input values for a specific case and classify whether the heart disease is present or absent as shown in Table 4.

5.1. Experimental Results for ANN System

Two main parameters have been explored in training the ANN system, which are the maximum number of epochs and number of hidden neurons. Maximum number of epochs ranges from 1000 to 5000 with an increment of 1000, whereas number of hidden neurons ranges from 5 to 15 with an increment of 5. Table 4 shows the obtained results from different combinations of epochs and hidden neurons.

From Table 4, it is clearly found that the ANN system mostly achieved 80% onwards in most combinations of the two parameters. However, it is found that the combination 4000 epochs and 15 hidden neurons achieved the highest accuracy using the training data set, which is 90.74% but did not achieve the highest accuracy using the testing data, which is 85.19%. On the other hand, the combination 5000 epochs and 15 hidden neurons achieved the highest accuracy using the testing data set, which is 87.04% but did not achieve the highest accuracy using the training data, which is 88.43%.

In most systems, the testing data is very important and systems are evaluated on how best they can perform when receiving data from of someone who has not been trained earlier. Therefore, if considering this aspect, the combination of 5000 epochs and 15 hidden neurons is selected since it performs the highest using the testing data set.

It is also seen that the ANN system could successfully classify the user inputs for a specific case, where through the 15 different experiments, the ANN system could classify that data to “Absent” of heart disease, therefore, the case-based module achieved 100% accuracy as far as Table 4 is concerned.

5.2. Experimental Results for Neuro-Fuzzy System

Given separate sets of input and output data, “genfis2” parameter generates a Fuzzy Inference System (FIS) structure using fuzzy subtractive clustering. When there is only one output, “genfis2” may be used to generate an initial FIS for ANFIS training by first implementing subtractive clustering on the data. The parameter “genfis2” accomplishes this by extracting a set of rules that models the data behavior.

The rule extraction method first uses the MATLAB “subclust” function to determine the number of rules and antecedent membership functions and then uses linear least squares estimation to determine each rule’s consequent equations. This function returns an FIS structure that contains a set of fuzzy rules to cover the feature space. Therefore, the “genfis2” is the only parameter that is investigated in this research and it ranges from 0.1 to 1.0 as shown in Table 5.

From Table 5, it is clearly found that the Neuro-Fuzzy system has excellent achievements using training data set, where all values of “genfis2” from 0.1 to 1.0 achieved 100%. However, the Neuro-Fuzzy system could not

Table 4. Experimental results for ANN system with different combination of parameters.

Table 5. Experimental results for neuro-fuzzy system with different values of “genfis2”.

achieve higher accuracy using the testing data set. The best performance using the testing data set was at 0.5, which is 75.93%. In fact, “0.5” is the benchmark value for “genfis2” parameter. It is also noticed that as we increase the value for the “genfis2”, the number of generated rules decreases.

It is also seen that the Neuro-Fuzzy system could not successfully classify all the user inputs for a specific case, where only 6 out of 10 different experiments, the Neuro-Fuzzy system could classify that data to “Absent” of heart disease, and 4 other experiments the Neuro-Fuzzy system failed to successfully classify them. Therefore, the case-based module achieved 60% accuracy as far as Table 5 is concerned.

In most systems, the testing data is very important and systems are evaluated on how best they can perform when receiving data from of someone who has not been trained earlier. Therefore, if considering this aspect, the value for the “genfis2” parameter is fixed at “0.5”.

6. Conclusion and Future Work

This research effort developed two systems based on ANN and Neuro-Fuzzy approaches in order to develop an automatic heart disease diagnosis system. From both Table 4 and Table 5, it is clear that the Neuro-Fuzzy system outperforms the ANN system using the training data set, where the accuracy for each system was 100% and 90.74%, respectively. However, using the testing data set, it is clear that the ANN system outperforms the Neuro-Fuzzy system, where the best accuracy for each system was 87.04% and 75.93%, respectively. This system can be used at hospital level by doctors and physicians to classify the patient’s heart disease. Future work can be through applying various ANN’s architecture and training algorithms for achieving more accurate results.

Conflicts of Interest

The authors declare no conflicts of interest.


[1] Gudadhe, M., Wankhade, K. and Dongre, S. (2010) Decision Support System for Heart Disease based on Support Vector Machine and Artificial Neural Network. IEEE International Conference on Computer and Communication Technology, Allahabad, 17-19 September 2010, 741-745.
[2] Yan, H.M., Jiang, Y.T., Zheng, J., Peng, C.L. and Li, Q.H. (2006) A Multilayer Perceptron-Based Medical Decision Support System for Heart Disease Diagnosis. Expert Systems with Applications, 30, 272-281.
[3] Palaniappan, S. and Awang, R. (2008) Intelligent Heart Disease Prediction System Using Data Mining Techniques. International Journal of Computer Science and Network Security, 8, 343-350.
[4] Wu, R., Peters, W. and Morgan, M.W. (2002) The Next Generation Clinical Decision Support: Linking Evidence to Best Practice. Journal Healthcare Information Management, 16, 50-55.
[5] Adeli, A. and Neshat, M. (2010) A Fuzzy Expert System for Heart Disease Diagnosis. Proceedings of the International Multiconference of Engineers and Computer Scientists, Hong Kong, 17-19 March 2010.
[6] Sivanandam, S.N., Sumathi, S. and Deepa, S.N. (2006) Introduction to Neural Networks Using MATLAB 6.0. McGraw-Hill Education, New York City.
[7] Kahramanli, H. and Allahverdi, N. (2008) Design of a Hybrid System for the Diabetes and Heart Diseases. Expert Systems with Applications, 35, 82-89.
[8] Das, R., Turkoglu, I. and Sengur, A. (2009) Effective Diagnosis of Heart Disease through Neural Networks Ensembles. Expert Systems with Applications, 36, 7675-7680.
[9] Allahverdi, N., Torun, S. and Saritas, I. (2007) Design of a Fuzzy Expert System Determination of Coronary Heart Disease Risk. Proceedings of International Conference on Computer Systems and Technologies, Rousse, June 14-15 2007, 1-8.
[10] Lisboa, P.J. (2002) A Review of Evidence of Health Benefit from Artificial Neural Networks in Medical Intervention. Neural Networks, 15, 11-39.
[11] Fuller, R. (1995) Neural Fuzzy Systems. Abo Akademi University, Turku.
[12] Tung, W.L. and Quek, C. (2002) GenSoFNN: A Generic Self-Organizing Fuzzy Neural Network. Proceedings of IEEE Transactions on Neural Networks Conference, 13, 1075-1086.
[13] Alhanafy, T.E., Zaghlool, F. and El Din Moustafa, A.S. (2010) Neuro-Fuzzy Modeling Scheme for the Prediction of Air Pollution. Journal of American Science, 6, 605-616.
[14] Jang, J.S.R. (1993) ANFIS: Adaptive-Network-Based Fuzzy Inference System. IEEE Transactions on Systems, Man, and Cybernetics, 23, 665-685.
[15] KEEL: A Software Tool to Assess Evolutionary Algorithms for Data Mining Problem.
[16] Trewartha, D. (2006) Investigating Data Mining in MATLAB. Bachelor Dissertation, Department of Science, Rhodes University, Grahamstown.
[17] Harrison, R. (2000) Decision Support Technique Developed in MATLAB Improves the Accuracy of Medical Diagnoses. Department of Automatic Control and Systems Engineering, University of Sheffield, Sheffield.
[18] Zhao, L., Zheng, X.Q. and Wang, S.Q. (2008) Design and Implementation of Spatial Data Mining System (M-SDM) Based on MATLAB. Journal of Computers, 3, 66-70.
[19] Gan, G.J., Ma, C.Q. and Wu, J.H. (2007) Data Clustering: Theory, Algorithms and Applications. ASA-SIAM Series on Statistics and Applied Probability, SIAM, Philadelphia, ASA, Alexandria.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.