Diagnosis Heart Disease Using Mamdani Fuzzy Inference Expert System

The death ratio caused by heart diseases is threating around the world. Efficient and accurate diagnosis through information technology can turn over this picture. This article proposed Diagnosis Heart Disease using Mamdani Fuzzy Inference (DHD-MFI) based expert system which intelligently diagnoses heart disease. In an explorative pattern, the current research has taken six conducive variables for the purpose of fuzzy logic technical enhancement in the diagnosis of heart disease. The input fields comprise of age, chest pain, electrocardiography, blood pressure systolic, diabetic and cholesterol are transmitted with the help of Fuzzy rules which are framed in the light of low, normal, high and very high intensity among the input variations. The single output is obtained as a clinical decision support system for the heart diagnosis by using the Mamdani Inference method. The proposed DHD-MFI based expert system gives 94% overall accuracy.


Introduction
Information Technology plays an important role in every aspect of life in this era.Decision support systems based on knowledge, proficiency and logical reasoning ability [1].Fuzzy logic has the ability to handle the uncertainty of data in a proper approach [1,2].Heart disease is the main cause of death all over the world [3].The proper diagnosis of heart disease is very important to survive from death [4].Medical practitioners use their expertise to predict heart disease.Sometimes, doctors may get confused about the diagnosis of heart disease due to many risk factors involved in it [3,4,5].According to Mehdi et.al., heart disease diagnosis is a very difficult task that needs accurate results [6].Computer-Aided Diagnostic (CAD) system is very helpful in diagnosing heart disease condition of the patients.They pointed out that the consideration of accuracy always demands acute diagnosis of heart disease [6].In this regard, the CAD system is very helpful in the diagnosis of heart disease and the suffering level of the patients.In this context, CAD is frequently used for the diagnosis of cardiovascular diseases all over the world but still, medical data faces problems to properly implement it [4,6].To handle this problem the researchers presented a system that is based on fuzzy logic for the heart disease diagnosis.The fuzzy logic system based on CAD with five input variables that consume a short time for the medical process to decide the diagnosis of heart disease.The performance of the proposed system was compared with the previous roughfuzzy classifier system which used an open-source cardiovascular disease dataset.The results have shown 72.6% accuracy which is better than the past work [6].Kasbe and Pippal designed a system with the help of fuzzy logic for the diagnosis of heart diseases [4].This system has used 13 input variables and 1 output variable.The database has taken from V.A. Medical Center, Long Beach, and Cleveland Clinic Foundation.The centroid method was applied for defuzzification.The medical experts, as well as the patients, can use this system with ease.The researchers have observed its accuracy 93.33% which is better than previous systems [4].Aliz Adehsania et.al., observed many existing models for diagnosis heart diseases [5].According to researchers, angiography is the best accurate system for the diagnosis of cardiovascular diseases but this method faces problems and cost issues.So, the researchers found a novelty technique for the diagnosis of heart disease by using data mining.The researchers proposed a model based on the classification to predict heart disease.The results of their model were better than the previous method [5].Adeli and Neshat designed a fuzzy expert system for cardiovascular disease diagnosis based on V.A. Medical Centre, Long Beach and Cleveland Clinic Foundation database [7].The system used 13 parameters as input and one parameter as output.The accuracy of the system was 94% which is better than the existing fuzzy expert systems [7].

Related Work
Anooj has proposed a system based on weight fuzzy rule for the diagnosis of cardiovascular disease [8].In the first step of the system, the weighted fuzzy rules generated from the mining techniques and variable selections and in the second step, a fuzzy rule-based system is developed with the help of weighted fuzzy rules.The selected datasets Cleveland, Hungary, and Switzerland have a large amount of information about heart disease.This clinical decision support system has been tested and experimental results are found much accurate and precise [8].Hassan et.al., stated that heart disease is the main reason for death all over the world [9].The early prediction of cardiovascular disease can help to reduce the death rate.Many systems are available for early prediction of heart disease and still, there is a need to explore more.The researchers proposed a fuzzy soft expert system for the early detection of heart disease based on the fuzzy soft set theory.Their proposed system based on four parts i.e. fuzzy values; fuzzy soft set, fuzzy soft set parameter, and an algorithm.The study based on systolic blood pressure, low-density lipoprotein cholesterol, blood sugar, maximum heart rate, old pack and age variables.It is perceived that the suggested model is supportive for the medical experts in taking decisions regarding heart diseases [9].Akinyokun et.al., designed a model based on the advancement of a Web and Fuzzy Logic-based Expert System for heart disease failure [10].The proposed system comprises a Knowledge Base (which is comprised of a Database), a Fuzzy Logic part, a Fuzzy inference engine, and a decision support engine.All these elements of the system converted into the cognitive and emotional filters as well as tele-prescription facilities.Their proposed model was implemented using JavaScript, Hypertext Mark-up Language and Hypertext Preprocessor with My Structured Query Language as a database.The results shared with heart experts and satisfied with the performance of the system [10].Bhatla et.al., introduced a new technique for coronary illness by using fuzzy logic and data mining [11].This proposed methodology depended on Decision Tree and Naïve Bayes.The six parameters were diminished into four parameters i.e.Chest pain, blood pressure, No. of vessels colored and treadmill test which had less expense of lab test.In the proposed system, the output based on Normal, Low Risk, Medium Risk, and High Risk.The results stored in the database that connected with this model.In the database, the patient's record was maintained.The correctness and efficiency were measured through Naïve Bayes and Decision Tree using fuzzy logic.The results showed 0 for Decision Tree and 0.0072 for Naïve Bayes Classifier [11].Computational intelligence techniques: Fuzzy System [12,13], Swarm Intelligence [14], Evolutionary Computing [15,16] and Neural Network [17] are mostly used in different fields of sciences like Intelligent Diagnose System [12], Smart Health [13], Smart City [18], Cloud Computing [19], Robotics [20], Wireless communication etc. Nowadays, hybrid structures of these four branches are very popular due to their performance [13,14,18].In last decades predictions of the medical disease using machine learning approaches are one of the hot research areas.

Research Methodology
The basic aim of this system is to present an applicable and reliable expert system for the acute diagnosis of heart disease.Figure 1 shows the proposed system research methodology.
In the first phase, relevant variables are selected with the consultation of Medical Practitioners.If variables are less important, then they are discarded.In the second phase, the fuzzification is applied to crisp input values for the transformation of input sets.After that fuzzy rules are applied on fuzzy input sets in fuzzy inference.After fuzzy rules, defuzzification is applied on fuzzy output set which finally converts fuzzy output set into crisp output.

Proposed DHD-MFI Expert System
In proposed DHD-MFI expert system based on six input parameters like Age (A), Blood Pressure systolic (BP), Cholesterol (C), Diabetic (D), Chest Pain (CP) and Electrocardiography (ECG) and one output Diagnosis Heart Disease (DHD) is used as shown in figure 2.

Input Fuzzy Sets:
Statistical values of input fuzzy parameters are used for the diagnosis of heart disease as shown in table 1.In this research, six input parameters are used with the following description.

Output Fuzzy Sets:
The Diagnosis Heart Diseases (DHD) is the output of the proposed DHD-MFI expert system which is shown in table 2.

Fuzzy Inference Engine:
The fuzzy inference engine is the method towards representing an offered contribution to a yield utilizing fuzzy logic [20,21].Membership functions, fuzzy logic operators and IF-Then rules are an important part of the Fuzzy Inference Engine [21].All rules in the fuzzy rule base are combined into a single fuzzy relation that lies under the inner product on the input universe of discourse, which is then viewed as an only fuzzy IF-THEN rule.A suitable operator for combining the rules is union.Let R DHD n be a fuzzy relation that represents fuzzy IF-THEN rule of the proposed expert system which is, The above equation can be written as The rules of the proposed system are interpreted as a single fuzzy relation defined by This combination of rules is called a Mamdani combination.Assume iφε and Ψ be input and output fuzzy sets respectively.We obtain the output of the fuzzy inference engine as Where,   = µi(a, bp, ch, d, cp, ecg) And  = µ 729 (a, bp, ch, d, cp, ecg, DHD) 3.9 Product Inference Engine:

De-fuzzifier:
Defuzzifier is known for generating a quantifiable inference in crisp logic on the basis of fuzzy sets and corresponding membership degree [20,21].It is supposed to be the vital need that is fulfilled for the proper fuzzy control system.Defuzzifier is one of the definitive crucial parts of a fuzzy expert system.In defuzzifier, fuzzy sets converted into the crisp output.Centre of gravity defuzzifier, the center of average defuzzifier and maximum defuzzifier are three sorts of defuzzifier [12,13].The important defuzzifier amongst them is the center of gravity defuzzifier is used in the proposed DHD-MFI expert system.The center of gravity is taken as a useful defuzzifier technique.The center of gravity defuzzifier specifies the δ * as the center of the area covered by the membership function of δ that is The graphical representation of defuzzifier of the proposed Diagnosis Heart Disease-MFI expert system is shown in fig 3 & 4.

Outcomes
Figure 5 shows the accuracy of the proposed DHD-MFI expert system which is plotted after the comparison of predicted proposed system outcomes with human experts.The proposed DHD-MFI expert system has shown 93% accuracy along with the minor probability of error 7% in picking Negative cases.In the same way, this system has selected 94% borderline cases accurately with the probability of error 6%.Furthermore, it is seen that 96% positive cases are accurately identified with the probability of error 4%.Whereas, 94% strongly positive cases are chosen accurately by the system with the probability of error 6%.Finally, the overall efficiency of the system is found 94% and the probability of error is 6%.

Conclusion
The precision of the proposed Diagnosis Heart Disease-Mamdani Fuzzy Inference expert system is 94%.The efficacy of DHD-MFI expert system in the Pakistani context has provided a unique perception of scale in terms of the impact of six variables in driving heart complexity.
When the results of the DHD-MFI expert system are shared with the heart experts, they found them very much helpful in making a decision regarding the level of heart disease.On these bases, the proposed system has provided a novelty of strength and support in the treatment and diagnosis of cardiovascular ailments.

Future Work
The present research work has opened new avenues for future researchers in the field of heart diagnosis.This can be possible by improving the more correctness and accuracy of the proposed system with the help of the neural network, neuro-fuzzy, swarm intelligence and evolutionary computing.The present work can likewise be reached out to another better and reliable treatment (arrangement) of heart diseases like Echocardiogram, Angiograph, and Bypass Surgery.

4 .
Membership Functions:Membership function provides values between 0 and 1. Tram membership function is used in the proposed DHD-MFI based expert system shown in table3.The Proposed DHD-MFI expert system Input/Output (I/O) variables mathematically Membership Functions (MF) are shown in table3.
Fuzzy proposition for the proposed Diagnosis HeartDisease-MFI expert System is: t: a x bp x c x d x cp x ecg → DHD (2) where a, bp, c, d, cp, ecg & dhd represents Age, Blood Pressure Systolic, Cholesterol, Diabetic, Chest Pain, Electrocardiography and Diagnosis Heart Disease respectively.All input and output parameter values are mapped from real range to probability ranges because the fuzzy expert system works on probability range 0-1 [20, 21].Hence, the function t-Norm in equation ( Heart Disease can be written as:   (ℎ) = [  (),   (),   (),   (),   (),   ()] = min�  (),   (),   (),   (),   (),   ()� (4) 3.7 Rule Base: The proposed Diagnosis Heart Disease-Mamdani Fuzzy Inference expert system consists of 6 inputs and 1 output which makes 729 all possible fuzzy rules.The fuzzy rules are developed with the help of medical experts/practitioners.Some fuzzy rules of the proposed system are shown below.Conditional statement IF-THEN fuzzy rules are applied to the membership functions.These IF-THEN rules are part of the fuzzy rule base.Rules surface, rules viewer, etc. are depending upon fuzzy rule base.The fuzzy rule base of our expert system has 729 rules.Rules are denoted by R dhd n , where

Fig. 3
Fig. 3 demonstrates the output of the diagnosis of heart disease based on ECG (X-axis) and Diabetic (Y-axis).It shows that if ECG having values between 0-0.3 and Diabetic values 0-0.5 then there is no chance of Heart Disease.If ECG values greater than 0.3-0.65 and Diabetic values 0.5-0.75 then heart disease is positive.If ECG values 0.65-1 and Diabetic values 0.75 -1 then Diagnosis Heart Disease is strongly positive.

Fig. 4
Fig. 4 displays the output of the diagnosis of heart disease consists of Chest Pain and ECG.If the Chest Pain is noncardiac (0-0.3) and ECG is non-significant (0-0.3) then there is no chance of a diagnosis of heart disease.If Chest

Table 4 .
Proposed DHD-MFI Graphical MF representation of I/O variable