Gastric Diagnosis Expert System using the Fuzzy Mamdani Method

The stomach is one of the important digestive organs in humans. Gastric disease is inflammation of the stomach lining caused by microorganisms, this disease is caused more by Helycobacterpylori bacteria, apart from being caused by bacteria, stomach disease can also be caused by irregular lifestyle and eating patterns. Diseases that attack the stomach are still considered trivial by the general public, so not many people know about stomach diseases and the symptoms that exist. This is what causes people to be reluctant to see a doctor when they suffer from pain that attacks the stomach. When a disease attacks the stomach, people only use experience or intuition to cure it, so it is not treated properly. By using an expert system, patients can save time going to the hospital and can improve service to patients. The results of the Mamdani fuzzy logic calculations require a report on the possibility of stomach disease suffered by the user/patient, examples of possibilities are small, somewhat large and large based on the highest value results. It is hoped that with this system, it will be easier for patients to diagnose gastric diseases to carry out prevention and early diagnosis and treatment.


Introduction
Nowadays, people's lifestyles that always want to be practical and tend to be unhealthy make the body susceptible to disease.Diseases are created from small habits such as delaying meal times and irregular eating patterns.Frequently delaying meal times causes the stomach to produce excess acid, thus triggering various stomach diseases [ 1].
The stomach is one of the important digestive organs in humans.Gastric disease is inflammation of the stomach lining caused by microorganisms, this disease is caused more by Helycobacterpylori bacteria, apart from being caused by bacteria, stomach disease can also be caused by irregular lifestyle and eating patterns [2].
Diseases that attack the stomach are still considered trivial by the general public, so not many people know about stomach diseases and the symptoms that exist.This is what causes people to be reluctant to see a doctor when they suffer from pain that attacks the stomach.When a disease attacks the stomach, people only use experience or intuition to cure it, so it is not treated properly.In an examination the doctor will detect a disease in the patient's body with the patient's symptoms or complaints.The activity carried out by the patient is to meet face to face with the doctor and the doctor will ask about the symptoms that arise in the patient.The manual system has a weakness in that the patient has to come to see a doctor to consult or have the patient's disease checked and the patient also has to prepare the costs needed to have the disease checked.The information currently available is only information that explains a disease with existing symptoms, so patients or in this case users have to search one by one to make an initial diagnosis of the illness they are suffering from [ 3].Such a manual system can be made easier with an information system where the patient does not need to go to the doctor to diagnose the disease the patient is suffering from.By using an expert system, patients can save time and improve patient service.An expert system is a computer program that represents and performs reasoning with the knowledge of several experts to solve problems or provide advice.An expert system is a system that uses human knowledge where this knowledge is entered into a computer and then used to solve problems that usually require human expertise or expertise.This expert system is designed to imitate the expertise of an expert in answering questions and solving problems and is very helpful in making decisions in diagnosing gastric diseases through the symptoms felt by the patient [ 4].
The expert system for diagnosing stomach diseases is implemented using the Fuzzy Mamdani method.The Mamdani fuzzy method is a system built with clear definitions, working methods and descriptions based on fuzzy logic theory and has several processes such as fuzzy rules, inference, fuzification and defuzzification capable of handling the ambiguity and uncertainty of the variables used in determining disease. in the stomach [ 5] [6].
Mamdani fuzzy logic is a method that is very flexible and has tolerance for existing data.The Fuzzy Mamdani method can help minimize the role of internal medicine doctors, so that patients can detect the type of stomach disease they are suffering from earlier [ 7][8].
Fuzzy logic is a rule-based decision making method used to solve gray problems in systems that are difficult to model or have ambiguity.Fuzzy Mamdani is a method that is very flexible and has tolerance for existing data.Fuzzy logic is widely used in various research because it can be used to make measurements on various phenomena that have subtle or vague characteristics and uncertainty.And able to solve very complex problems and make decisions [9].
Fuzzy logic is widely used in various research, such as previous research, namely the application of fuzzy logic in optimizing the production of goods using the Mamdani method [10].Determining production quantities based on demand and supply using fuzzy logic and the Mamdani method [11].Research journal article entitled Application of Fuzzy Logic in Optimizing Palm Oil Production at Pt. Waru Kaltim Plantation Using the Mamdani Method, emphasizes and conveys that, like crisp sets, there are several operations that are specifically defined to combine and modify fuzzy sets.The membership value as a result of 2 sets is often known as fire strength or α-predicate [12].Design of a fuzzy logic application in determining production volume using the Mamdani method [13].Prediction of furniture production quantities using a fuzzy inference system [14].System for determining the calculation of folding gate production quantities [15].
Based on these problems, the author wants to discuss and find solutions in building this expert system, through thesis research with the title "Expert System for Diagnosis of Gastric Disease Using the Fuzzy Mamdani Method (Case Study: Dr. Reksodiwiryo Hospital Padang)".In designing this web-based expert system, the author used the PHP programming language and MySQL database.It is hoped that with this system, it will be easier for patients to diagnose gastric diseases to carry out prevention and early diagnosis and treatment.

Research methodology
In preparing research, it is necessary to have a framework with clear stages, this framework is used to solve a problem that is being discussed by the researcher, the framework is in Figure 1.

Figure 1. Research Framework
A fuzzy system is capable of processing linguistic reasoning so that its design does not require complicated mathematical equations.Fuzzy logic is a way to map an input space into an output space.The Mamdani method is the method most often encountered when discussing fuzzy methodologies.This is possible because this method was the first method developed and successfully applied in control system design.The calculation steps for the fuzzy mamdani method are as follows: 1. Identifying data such as symptom data, disease type data and solution data.2. Determine the weight of each symptom 3. Define a decision tree 4. Fuzzy Sets , In the Mamdani Method, both input variables and output variables are divided into one or more fuzzy sets 5. Rule Composition: Unlike monotonous reasoning, if the system consists of several rules, then the inference is obtained from a collection of rules .
((  ): symptoms input by user B which are declared as a disease set against symptom A.   (  ): a knowledge-based symptoms of a set of diseases to symptom A, where A={a1, a2, a3, ..., an}.
6. Confirmation (Defuzzy fication), The input of the defuzzy fication process is a fuzzy set obtained from the composition of fuzzy rules, while the resulting output is a number in the fuzzy set domain.

Data analysis
The data analysis stage is the most important stage in developing a system, because at this stage an evaluation will be carried out to identify existing problems, system design and the steps needed for the desired design to arrive at the expected analysis.Data processing and assessment will later find solutions to resolve existing problems.The data variables obtained are a collection of types of disease, symptoms of disease and solutions or ways of treating them obtained from various sources of information such as survey results at Dr. Hospital.Reksodiwiryo Padang through a direct interview with Dr. Rasyid, Sp.PD as well as books, journals and the internet.The following data will be used as research objects:

Symptom Data
The symptom data used in the expert system for diagnosing stomach diseases includes 25 symptoms.The symptoms can be seen in Table 1: The taste of food/drink returning to the mouth (regurgitation) so that the mouth feels sour and bitter.Source: Dr. Rasyid, Sp.PD

Disease Type Data
The number of diseases processed in the expert system for diagnosing stomach diseases is six types of disease, as in Table 2:

Process Analysis
The process stages use the fuzzy mamdani calculation method, which uses symptoms of stomach disease which have a value (weight).The variables (diseases), symptoms and symptom weights used in this study can be seen in table 4 and are as follows:  The weight of each symptom is different, but there are also the same weights.The weight of each symptom describes the influence of the symptom on stomach disease.The greater the severity of these symptoms, it can be concluded that these symptoms are the dominant symptoms of disease in sufferers of stomach disease.

Decision Tree
A decision tree is a tree that is used as a reasoning procedure to obtain answers to the problems entered.The decision tree of the expert system for diagnosing gastric diseases is depicted in Figure 2 below:

Fuzzy Sets
Meanwhile, in the Mamdani method, both input variables and output variables are divided into 1 or more fuzzy sets .In this study, three categories of Fuzzy sets were obtained, namely normal, moderate and dominant symptoms, where the weight of the set variables will be entered for each disease symptom as in the table in table 4. The fuzzy set table can be seen in table 5 below.:

Rule Components
To find out the type of stomach disease suffered, a fuzzy value calculation process is needed based on the symptoms input by the user.The fuzzy value process consists of two parts, namely: the suitability value of each symptom for a disease and the calculation of the fuzzy conditional probability value of a disease based on the results of user input of symptoms.For example, the following symptom data entered by user B can be seen in table 6 below:  From the results obtained from the calculations above, it is necessary to report the possibility of stomach disease suffered by the user/patient, examples of possibilities are small, somewhat large and large based on the highest value results.The diagnosis result value for each disease is taken after two commas and converted into a percentage.So the calculation for the diagnosis of gastric disease suffered by the user/patient is: P(U 1 ) = 0,4001 x 100 = 40,01% From the percentage results above, it is likely that 40.01% of the illnesses suffered by users/ patients are gastritis.
P(U 4 ) = 0,2626 x 100 = 26,26% From the percentage results above, it is quite likely that 26.26% of the illnesses suffered by users/ patients are dipepsia syndrome.

Conclusion
After building a web-based expert system at Dr. Reksodiwiryo, users/patients can diagnose stomach diseases quickly and easily so that users/patients can minimize the time they have to come to the hospital.Can provide knowledge for patients to obtain information in identifying stomach diseases.After using the Fuzzy Mamdani method to help patients diagnose gastric disease at Dr. Reksodiwiryo can be done precisely and accurately.The expert system diagnoses stomach diseases based on the symptoms felt by the patient so that they get solutions for treatment so that the disease does not get worse.

5 G004
taste of food/drink returning to the mouth (regurgitation) so that the mouth feels sour and bitter.5

Table 1 .
Symptom Data

Table 2 .
Disease Type Data

Table 3 .
Solution Data

Table 4 .
Variables, Symptoms and Symptom Weights

Table 5 .
Fuzzy Set Table

Table 6 .
Case Table

Table 7 .
Data Fit Table