Heart Disease Diagnosis Using Tsukamoto Fuzzy Method

for

Membership functions are used to represent fuzzy sets as a consequence of the if-then rule.As a result, the output of inference results from each rule is presented in the form of a crisp set based on α-predicate (fire strength).The final result is obtained by using a weighted average (Satria & Sibarani, 2020;Berlian et. al, 2020;Napitupulu et. al, 2019;Falatehan et al., 2018).
Based on this description, this study aims to help predict the level of risk of heart disease using the Fuzzy Inference System (FIS) with the Tsukamoto fuzzy method.The fuzzy rules used in this paper consist of 44 rules and 11 input variables.The fuzzy rules are obtained from an article by (Iancu, 2018).The use of fuzzy logic was chosen because it has been widely used in disease diagnosis.In addition, the Tsukamoto fuzzy method is used because it is a method that can predict and provide tolerance for fluctuating and flexible data.

Fuzzy Inference System (FIS)
The set of reasoning and fuzzy in the form of IF-THEN is based on a computational framework called the Fuzzy Inference System (FIS) (Setyono & Aeni, 2018).Fuzzy sets are based on extending the range of feature functions so that the fuzzy set will contain real numbers in the interval [0,1].The membership value indicates that the item in the chat universe is not just 0 or 1 but somewhere in between.In other words, the truth value of an item is not just true or false.0 means wrong, 1 means right, and has a value between true and false (Fiano & Purnomo, 2017).
Application programs that use specific reasoning methods to produce fuzzy systems are called fuzzy inference system applications (Napitupulu et. al, 2019).Fuzzy Inference System, also called fuzzy inference engine, is a system that can evaluate all rules simultaneously to produce conclusions, and the order of the rules can be arbitrary (Sari et al, 2021).The Fuzzy Inference System can be carried out using the Tsukamoto method (Reynaldi et. al, 2021;Permadi & Alamsyah, 2020), the Mamdani method (Damayanti et al., 2022), and the Sugeno method (Sari et al., 2021;Reynaldi et. al, 2021).In this research, the fuzzy inference system method is the Tsukamoto method.

Fuzzy Tsukamoto
In the Tsukamoto method, each rule is represented by a fuzzy set with a monotonous membership function.This method is called defuzzification to determine the output value by changing the input (Zaidatunni'mah et. al, 2021).To get output in Tsukamoto fuzzy, 4 stages are needed, namely: Fuzzification, Fuzzy Rule Base, Inference Engine, and Defuzzification.Fuzzification converts system inputs with the firm or crisp values into fuzzy sets and determines the degree of membership in the fuzzy sets.The process for building Rules that will be used in the form of IF-THEN is stored in the fuzzy membership function.Converting fuzzy input into fuzzy output is fuzzifying each predefined Rule (IF-THEN Rules).MIN implication function is used to get the alpha-predicate value for each rule.After that, output of each rule (z value) is calculated using alpha-predicate value obtained.Defuzzification is giving firm or crisp values by transforming back the fuzzy output obtained from the inference engine.The final results are obtained using the average weighting equation using the average Weight Average method (Satria & Sibarani, 2020;Berlian et. al, 2020;Napitupulu et. al, 2019;Falatehan et al., 2018).Formula used to calculate defuzzification is described in Equation 1 as follows.

Research Stage
This study used the Tsukamoto method to detect the level of risk of heart disease based on 11 disease symptoms as input variables.In this study, the steps taken were divided into four stages.The research work is described in Figure 1

Fuzzy Inference System
This study used the Tsukamoto fuzzy method to design a fuzzy inference system.The steps of the Tsukamoto method used in this research consisted of four main processes that was fuzzification, determination of fuzzy rules, application of implication functions, and defuzzification.The inference process in fuzzy is described clearly by (Iancu, 2018) and shown in Figure 2 below.

Figure 2. Fuzzy Logic System
The data were needed in the fuzzy inference system to discover the risk level of heart disease with the Tsukamoto fuzzy method include:

1) Input Variable
Input variables used in this research was also adopted from (Iancu, 2018).They were the symptoms of heart disease, including chest pain, blood pressure, cholesterol, blood sugar, ECG, maximum heart rate, exercise, old peak, gender, thallium, and age.The values of these variables were in the form of numerical and linguistic values.

2) Output Variable
The output variable was the variable that will be used as a diagnosis based on the input variable.The output variable was an integer value between 0 and 4. The greater the value of the number, the greater the risk of heart disease.The research was done by (Fiano & Purnomo, 2017), only used three risk levels.The levels are Small, Medium, and Large.The risk levels defined in this study were Healthy, Small, Medium, Large, and Very Large Levels.The output variable has several value limits, as explained in Table 1 below The rule base is the central part of the fuzzy inference system.The rule base used in this study was obtained from (Iancu, 2018), which consisted of 44 rules.Each rule has one input and one output.Several samples of fuzzy rule used in this research are presented in Table 2 below.

Membership Function
The membership function of each variable was described in detail in this section.1) Chest pain.The variable has 4 values represented by numeric value.The members were 1 for typical angina, 2 for atypical angina, 3 for non-angina, and 4 for without symptoms.2) Blood pressure.It has 4 linguistic values, namely low, medium, high, and very high.The membership function of the blood pressure variable can be seen in Figure 3.

Results & Discussion
In this stage, the method was used to calculate a sample of the patient's condition and was evaluated using more data.

Calculation of Tsukamoto Method
Calculation process was started from a sample of patient's condition as input variables and would be inferenced using Tsukamoto Method to obtain the risk level of the disease.The sample of patient's condition is given in Table 3 below.All of the input variables are applied for fuzzification.The crisp value of the input variables will be converted to fuzzy number using the membership functions of each variable.The result of calculation at each variable in fuzzification is presented in Table 4 as follows.The next step is finding z score for each variable by substituting α-predicate in the membership function of output variable.Based on the results in Table 4, several rules used in continuous step are R1, R8, R19, R30, R35, and R40 for Healthy, R14, R20, R25, R36, and R41 for Low Risk, R7, R18, R21, R26, and R29 for Medium Risk, and R34 for Very Large Risk.The z score obtained from each rule are presented in Table 5.The process is continued by defuzzification step.Equation 1 is used to calculate the result.The calculation process of defuzzification is presented in Table 6.The final calculation is to divide the sum of multiplication between z score and α-predicate by alpha.The result of dividing 11.5925 over 10.3 is 1.1255.The result shows that the patient has a risk level of heart disease of 1.125485.The score is included in the small risk category with membership degree 0.87 and in the medium risk category with membership degree 0.12.

Evaluation
In this stage, the method was evaluated using small number of data.The results generated would be compared with the real output of the dataset to calculate model performance.The dataset for testing is presented in Table 7.Based on the validation results, then the calculation is carried out accuracy using a 5x5 multiclass confusion matrix where the results of the output will be classified by category.The confusion matrix is presented in Table 9.  8, the data predicted right (true positive) by the model was 7 of 12 test data given.The model failed to predict the 4 th , 6 th , 8 th , 9 th , and 11 th data.The 4 th data which is actually healthy is predicted to be small risk.The 6 th data which is actually healthy is predicted to be medium risk.The 8 th data which is actually very large risk is predicted to be large risk.The 9 th data which is actually vary large risk is predicted to be large risk.The last, the 11 th data which is actually small risk is predicted to be medium risk.The model showed that it could diagnose heart disease using Tsukamoto method with an accuracy value of 58%.

Conclusion
Based on the results of the study, it was concluded that the fuzzy logic of the Tsukamoto method can be used to diagnose the risk level of heart disease by using the same components, namely 44 fuzzy rules, 11 input variables, and 5 output variables.Although, the model is capable of performing the diagnostic tasks, the model performance is still limited to an accuracy value 58%.From the testing data given, 7 data can be predicted correctly, and 5 other data failed to be predicted correctly.For further research, it is suggested that the Tsukamoto method can be improved so that it has better performance for diagnosing heart disease.Another suggestion is that input variables can be taken from other heart disease factors.
as follows.

Figure
Figure 1.Research Stage

Figure 3 .
Figure 3. Membership function of blood pressure variable

Figure 6 .
Figure 6.Membership function of ECG variable

Figure 7 .
Figure 7. Membership function of maximum heart rate variable

Figure 8 .
Figure 8. Membership function of old peak variable

Figure 9 .
Figure 9. Membership function of age variable

Figure 10 .
Figure 10.Membership function of output variable

Table 2 .
Fuzzy Rule Rule Risk Level R1 If Chest Pain is Typical Angina then Risk is Healthy R5 If chest pain is without symptoms then Risk is very large R6 If Gender is Female then Risk is Small

Table 7 .
Dataset for Testing CP c BP d Ch e BS f ECG g MHR h E i OP j T k Gender; c Chest pain; d Blood pressure; e Cholesterol; f Blood sugar; g ECG; h Maximum Heart Rate; i Exercise; j Old peak; k Thallium; By using the dataset for testing, the model performance can be seen in Table8below. b

Table 8 .
Dataset for Testing

Table 9 .
Confusion matrix result