Expert System Diagnosis of Bowel Disease Using Case Based Reasoning with Nearest Neighbor Algorithm

Expert System is a computer system that has been entered the base of knowledge and set of rules to solve problems like an expert. One method in the expert system is Case Based Reasoning. To strengthen the retrieve stage of this method, the Nearest Neighbor algorithm is used. Bowel is one of the digestive organs susceptible to disease. The purpose of this study is to implement expert systems using Case Based Reasoning with Nearest Neighbor algorithm in diagnosing bowel disease and determine the accuracy of the system. Data used in this research are 60 data, obtained from medical record RSUD dr. Soetrasno Rembang. Variables used are general symptoms and types of diseases. The level of system accuracy resulting from scenario are 40 data as source case, and 20 data as target case that is equal to 95%.


INTRODUCTION
Expert System is part of high-level specialized software or high-level programming language, which is trying to duplicate the functionality of an expert in a particular field of expertise [1].Expert systems can be used to overcome multiple problems by reasoning using knowledge like an expert [2].On implementation of expert system are not only the problems that rely on algorithm, but also sometimes also the problem that is difficult to comprehend [3].Within the expert system, there is a knowledge base and an inference engine (set of rules) [4].In other words, the expert system is a softwarebased system that makes or evaluates decisions based on rules, defined in the software [5].The purpose of the expert system is not to replace human role, but to present human knowledge into a system form, so it can be used by many people [6].From some previous studies, expert systems provide good results for solving cases that use complex data in cases of prediction or diagnosis, such as diagnosis of lung disease, diagnosis of matic motorcycle damage, treatment of cases based on symptoms, and diagnosis of digestion disease in humans [1,[7][8][9][10] Case Based Reasoning is one part of Artificial Intelligence, which can solve problems in search of solutions of a new case, the system will search for solutions from old cases that have similar problems [11].In looking for a case resemblance, all feature weights are considered equal, meaning no feature is considered more important, so an algorithm needs to be added on it.Nearest Neighbor is an approach method to finding cases by calculating the proximity between new cases and old cases, which based on matching the weights of a number of existing features [12].With this algorithm, not only all features have the same weight but also, there are features that have a higher priority.
Bowel is one of the digestive organs that are susceptible to disease.One of the bowel diseases, diarrhea is the second leading cause of child death in the world with 15 million children dying every year [13].Typhoid fever is also an infectious disease that is easily contagious and can attack many people, so it can cause an outbreak [14].Usually a doctor can diagnosing the disease by analyzing the symptoms that felt by the patient.In the current technological advances, a disease will be detected more quickly through perceived symptoms using a system [15].
Based on the above description, the purpose of this research is to implement expert system Case Based Reasoning with Nearest Neighbor algorithm and know its accuracy in diagnosing bowel disease.

Case Based Reasoning
Case-based reasoning is based on the hypothesis, that the solutions of past problems can be helpful for solving a current problem, whenever there is any resemblance between them [16].There are four stages in Case Based Reasoning [17]: 1) Retrieve, looking for similarities between old cases with new cases and taking the most similar 2) Reuse, reusing the solution of the old cases 3) Revise, repaired the failed solution 4) Retain, save sections of issues that may be useful for the future.

Nearest Neighbor
Nearest Neighbor algorithm is implemented in retrieve Case Based Reasoning stage.The algorithm is to find the closest match of the case that has been stored in the database to the new case by using distance calculation, which determines how similar the two cases by comparing the feature [18].The function of Nearest Neighbor similarities can be formulated as follows [12].i: an individual attribute between 1 s / d n f: similarity function between case T and case S wi: the weight assigned to the i-th attribute

Process Design
The steps of making an expert system for the diagnosis of bowel disease are shown in Figure 1.

System Development
The design of this expert system are using waterfall model.Waterfall is an approach method based on the assumption that major decisions must be made before encoding begins [19].This model is often used by systems analysts in general [20].There are four stages in the waterfall model.The stages are, needs analysis, design, implementation and testing [21].
1) The requirement analysis stage is defining the entire software format, identifying all the needs, and outlines of the created system [22].
2) The design stage is to design applications including interface design, and database structure design [23].To create an interesting web-based application program (website) it must be designed beforehand, so the achieved results are suitable with the predetermined objectives [24].
3) The implementation stage is designing software which realized as a series of program or program unit [25].4) The testing stage is to test whether the system is ready and feasible to use.The tester can define the set of input conditions and perform testing on functional specifications of the program [26].

Data Collecting
The data used in this research is the result of medical records of 60 patients on 2016, who suffer from bowel diseases such as Acute Diarrhea, Tipoid Fever, Appendicitis, Gastroentritis and Colitis taken at RSUD dr.Soetrasno Rembang Regency.The data that used on this system are symptoms experienced by patients in RSUD dr.Soetrasno and the diagnosis result from the responsible doctor.

Expert Interview
The interview was conducted with a specialist in internal disease who is a doctor in RSUD dr.Soetrasno.From the interview, the result is weight value of each symptom in bowel disease shown in Table 1.

1). Retrieve Stage
This stage looks for similarities between the target case (new case) with the source case (old case).The example of target case 1 is in Table 2. Table 2.The Example of Target Case 1 Name Symptom P013 Liquid faeces, gag Target case 1 will be searched for resemblance between source case 1 and source case 2. Example source case 1 is in Table 3.
Table 3.The example of source case 2 in Table 4.
Table 4.If the minimum similarity score is in the range 0.8 -1, then the diagnosis of the old case will be reused for the new case.The similarity value of target case 1 with source case 1 is 0.89, so the diagnosis from source case 1 that is acute diarrhea, can be reused in target case 1.

3). Revise Stage
This stage stores a case that has a similarity score below 0.8.So a target case that has a low resemblance is not immediately discarded but stored for future study materials.

4.) Retain Stage
A case that the expert has reviewed and can be found to be diagnosed at the revision stage will be saved to the database into a new source case for future learning.

Testing
After testing on 60 medical records data of patients with bowel disease in RSUD dr.Soetrano Rembang with 40 data scenario as source case and 20 data as target case, the result of accuracy equal to 95% as seen in Table 5.From the result of medical record test data using the system that has been made, the result are 19 accurate test data with doctor's diagnosis and 1 data which is less accurate because the system uses strong calculation base, so it is not easily influenced by other factors.While the specialist in internal disease as an expert, has other considerations in determining the disease suffered by the patient.

Implementation
The consultation page is a page that users can use to consult.Without the need to login, the user can consult with the system.In consulting, users fill in the name, gender, age and any symptoms experienced.Figure 3 shows the consultation page.

Figure 3. Consultation Page
The diagnosed page is a page that provides diagnosis information from the symptoms input.For the user page, it only displays the symptoms experienced and the results of his diagnosis.In contrast to admin and experts, in addition to displaying the symptoms and diagnosis results, it also displays the results of the calculation method, or level of similarity with the existing source case.Figure 4 show the admin and expert diagnosis page.

CONCLUSION
From the results of the research related to implementation of Case Based Reasoning with Nearest Neighbor algorithm in diagnosing bowel disease in humans using medical record from RSUD dr.Soetrasno Rembang, it can be concluded that Case Based Reasoning has 4 stages.The retrieve stage, by finding the similarity between cases with the calculation of the Nearest Neighbor algorithm.Reuse stage, with a minimum similarity of 0.8 diagnostic results from source case can be reused.Revise phase, target case with a similarity value less than 0.8 will be reviewed by experts.Retain stage, the results of expert review at the revise stage will be stored into the database to serve as a new source case.After implementing 60 medical records data taken from RSUD dr.Soetrasno Rembang with scenarios of 40 source case and 20 target cases, it can be seen that the accuracy of the diagnosis of the system that is equal to 95%.

Figure 1 .
Figure 1.The Steps of Making the Expert System The program flowchart is shown in Figure 2.

Figure 4 .
Figure 4. Result The Admin and Expert Diagnosis Page

Table 1 .
The