Design a Fuzzy Expert System for Liver and Pancreas Diseases Diagnosis

Fuzzy logic is a branch of artificial intelligence techniques, it deals with uncertainty in knowledge that simulates human reasoning in incomplete or fuzzy data. Fuzzy relational inference that has applied in medical diagnosis was used within the medical knowledge base system to deals with diagnostic activity, treatment recommendation and patient's administration. In this research, a medical fuzzy expert system named (Liv&PanFES) has been developed for diagnosis and decision making of general Liver and Pancreas diseases. The (Liv&PanFES) is a rule based fuzzy expert system, results of laboratory analysis are inserted into the system. This system can define the probable diagnosis on these data, and later on it can pick out the most probable one for disease. 1. Artificial Intelligence in Medicine Artificial Intelligence (AI) is a study to emulate human intelligence into computer technology. The potential of AI in medicine has been expressed by a number of researchers [8][10][17] and [19] summarized the potential of AI techniques in medicine as follows: ß Proved a laboratory for the examination, organization, representation and cataloging of medical knowledge. ß Produces new tool to support medical decision-making, training and research. ß Integrates activities in medical, computer cognitive and other sciences. ß Offers a content-rich discipline for future scientific medical specialty.


Artificial Intelligence in Medicine
Artificial Intelligence (AI) is a study to emulate human intelligence into computer technology.The potential of AI in medicine has been expressed by a number of researchers [8][10] [17] and [19] summarized the potential of AI techniques in medicine as follows: § Proved a laboratory for the examination, organization, representation and cataloging of medical knowledge.§ Produces new tool to support medical decision-making, training and research.§ Integrates activities in medical, computer cognitive and other sciences.§ Offers a content-rich discipline for future scientific medical specialty.

Fuzzy Control in Medicine
Fuzzy control techniques have recently been applied in various medical processes.Fuzzy control compared to classical control theory, which is a fuzzy logic approach to control, offers the following advantages: § The main advantage of using fuzzy control system is the simplicity of the approach , the capacity of dealing with the complex data and solves a problem-control system Methodology [7] [14].§ It can be used in systems, which don't need to measure the parameters of the model and cannot be easily modeled mathematically.In particular systems with non-linear responses that are difficult to analyze may respond to a fuzzy control approach.Hence, many complex systems can be controlled without knowing the exact mathematical model of them [3][12].§ Using fuzzy control to identify the diseases form the symptoms which helps to develop Fuzzy rules that can be stored in the knowledge base and can be fired during further decision process [4].§ Continuous variables may be represented by linguistic constructs that are easier to understand, making the controller easier to implement and modify [11].§ Fuzzy controllers may be less susceptible to system noise and parameter changes, in other words, they will be more robust.§ Complex process can be controlled by relatively few logical rules permitting an easily comprehensible controller design and faster computation [12].§ In other word, fuzzy control can be best applied to production tasks, that heavily rely on human experience and intuition, and which therefore rule out the application conventional control methods [11] [14].

Medical Knowledge as a Fuzzy Relation
The knowledge base, which is the central to any Fuzzy Logic System, represents the domain knowledge.A knowledge base contains two types of knowledge: facts and rules.The facts represent various aspects of specific domain that are known before consultation of the system.A rule is an if-then structure that logically relates information contained in the if part to other information contained in the then part [10].
The relationship between symptoms and diagnosis by the concept of medical knowledge was introduced."In a given pathology, we denote S a set of symptoms, D a set of diagnoses and P a set of patients.What we call medical knowledge is a fuzzy relation, generally denoted by R, from S to D expressing of diagnoses".Zadeh's maxmin compositional rule adopted as an inference mechanism.It accepts fuzzy descriptions of the patient's symptoms and infers fuzzy descriptions of the patient's diseases by means of the fuzzy relationships.If a patient's symptom is S i then the patient's state in terms of diagnoses in a fuzzy set D j with the following membership function [7][15] [16]: is the membership function of the fuzzy relation "medical knowledge".With P, a set of patients, and a fuzzy relation Q from P to S, and by "max-min" composition" we get the fuzzy relation T=Q×R with the membership function [3][21]:

The Designed Liver & Pancreas Fuzzy Expert system(Liv&PanFES)
The design structure, application and working principles of Liver& Pancreas Fuzzy Expert system (Liv&PanFES) has been described for diagnosis of general Liver & Pancreas diseases.
The (Liv&PanFES) is parallel rule-firing system, in which all fireable rules are fired effectively at one time.
During the process with the medical expert system (Liv&PanFES), laboratory test results are converted into fuzzy compatibility values reaching from zero to unity by consideration of the linguistic medical concepts.These fuzzified data are used to infer diagnosis with knowledge contained in a knowledgebase.Fuzzy relations were calculated for all linguistic medical concepts between test results and diagnosis by using the obtained fuzzy sets with the given set of patient data.

Medical Knowledgebase
The examination and laboratory data of the system assigned for the Liver&Pancreas patients were collected from Al-Jamhoree Teaching Hospital.The data then inserted into the system (Liv&PanFES), for the design process: The Total Serum Bilirubin (TSB), (TSB-direct), Serum Glutamic Pyruvic Transaminase (SGPT), Serum Glutamic Oxaloacetic Transaminase (SGOT) and Serum Alkaline Phosphataste (SAP) examinations are used for diagnosis Hemolytic Anemia (HA), Jaundice (JAU), Hepatitis (HEP), Myocardial Infarction (MYI) and Osteomalacia (OST) diseases; which are related with liver diseases.The Fasting Blood Sugar (FBS) and Random Blood Sugar (RBS) examinations are used for diagnosis Hypoglycemia (HYPOGL), Hyperglycemia (HYPERGL) diseases; which are related with pancreas diseases.
The unit that used for all examinations is (mg/dl ).

Inference Methodology
The fuzzy control application structure as shown in Figure (1) has seven crisp input variables , these input parameters represent the patients data.The mamdani model of inference was used.All (Liv&PanFES) fuzzy rules were of the form: " If x 1 is A 1 and y 1 is B 1 then z 1 is C 1 ", Where A 1 , B 1 and C 1 are fuzzy sets.The max-min operators were used for implication throughout for implementing (Liv&PanFES).It was necessary to obtain crisp output for the purposes of evaluation of the fuzzy model , center-of-gravity (centroid) defuzzification was used to produce crisp values on an arbitrary scale of the fuzzy output variable (OutFES) .

Linguistic Variables and Fuzzy Terms
Each of the seven input parameters was assigned a linguistic variable and examination of the data and rules showed that each could naturally be divided into two or three fuzzy terms corresponding to meanings of Low (L), Normal (N), and High (H) for the types laboratory examinations.

Rule Set
Liv&PanFES must contain a set of rules that can deal with fuzzy tags, fuzzy sets and relations and must provide an appropriate output which corresponds to a particular input.
The rules for the fuzzy expert system were obtained by means of knowledge expert-doctor, and had been carefully refined to form a complete and consistent set of classifiers.Part of the developed (Liv&PanFES) fuzzy knowledge base rules are shown in Table (1), total of 90 rules are formed as shown in the appendix.

Table(1): Liv&PanFES fuzzy rules
`For example Rule 40 can be interpreted as follows (as in Table (1)): Rule 40: if patient's TSB is High, patient's TSB-Direct is High, patient's SGPT is High, patient's SGOT is High and patient's SAP is Normal, patient's FBS is Low, patient's RBS is Low, then patient has Hepatitis (HEP) and Hypoglycemia (HYPOGL) diseases; which are related with liver and pancreas diseases.

Fuzzy Operations
The probabilistic family of operators was chosen for the reason that all the rules features conjunction of the input linguistic variables use the fuzzy conjunction operators.
The min operator is used for conjunction , the overall truth value of such a rule will obviously by determined solely by the reasoning of the clinician in considering all the parameters.
After the truth degree of each rule is determined, we calculate the truth degree of all rules by taking max between working rules.

Membership functions
In this paper, triangular and trapezoidal membership functions are used.Fuzzy membership functions for the medical factors for the mentioned laboratory parameters are calculated by the following functions as shown in Figures (2)
The performance of the model is tested for 100 patients, the results show that the all diagnosis using (Liv&PanFES) system is correct.

Conclusions
The developed diagnosis module (Liv&PanFES) consists of expert system and fuzzy logic techniques to perform diagnostic tasks.A set of rules will be defined using the patients disease database as well as the expert knowledge on the disease domain (from doctors).The designed expert system uses the rules to diagnose patient's illness base on their laboratory tests.In addition , fuzzy logic is integrated to enhance the reasoning when dealing with fuzzy data.The combination of expert system and fuzzy logic that forms a hybrid (expert-fuzzy) system could increase the system performance and has been implemented successfully.

Figure( 4 ):
Figure(4): Calculation of the value OutFES represents the diagnosis of a patient affected by HEP depending on the following laboratory test values (TSB=13.5,TSB(direct)=4 , SGPT=42 , SGOT =22.5 , SAP =65 , FBS =78 , RBS= 120 ).From Mamdani max-min inference we will obtain the membership function of our system, max (rule 4, rule 5) = rule 5, then we calculate the crisp output.The crisp value of the output is calculated by the method of center of gravtity defuzzifier.As it is seen from Figure (4), the value of OutFES=35, this means that the patient has the Hepatitis (HEP) disease (see Figure(3)).Another examples for implementation of the (Liv&PanFES) system for patients disease diagnosis shown in figures(5,6,7,8,9,10,11,12 and 13)  with patients laboratory tests values, fired rules (16), (54), (1), (3 and 29 then rule3 is max), (89),(19), (72 and 81 then rule 72 is max), (71) and (56) are values of output term (OutFES) that refer to the diagnosis of the patient complaint.The performance of the model is tested for 100 patients, the results show that the all diagnosis using (Liv&PanFES) system is correct.