The head has a smaller bony nucleus and more delayed in appearance than normal but to start with it is normal Raf. J. of Comp. & Math’s. , Vol. 5, No. 2, 2008 155 Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis Nada N. Saleem Nada_N_S@uomosul.edu.iq Adepa Ismaeel Fatin George College of Computer Sciences and Mathematics\ University of Mosul Received on: 25/9/2007 Accepted on: 20/4/2008 ABSTRACT 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 was applied in medical diagnosis was used within the medical knowledge base system to deal with diagnostic activity, treatment recommendation and patient's administration. In this research, a medical fuzzy expert system named (PedFES) has been developed for diagnosis and decision making of general pediatrics diseases. The (PedFES) is a rule based fuzzy expert system, the results of laboratory analysis are inserted into the system. This system can define the probable diagnosis depending on these data, and later on it can pick out the most probable one for disease. Keyword: fuzzy logic, fuzzy expert system, Pediatrics diseases. تصميم نظام خبير مضبب لتشخيص امراض االطفال ندى نعمت سليم فاتن جورج اديبة اسماعيل جامعة الموصل/ كلية علوم الحاسوب والرياضيات 20/4/2008: ريخ قبول البحثات 25/9/2007: ريخ استالم البحثات الملخص إن المنطق المضبب هو فرع من تقنيات الذكاء االصطناعي, فهو يستخدم المعلومات المضببة أن العالقات المضببة تستخدم في التشخيصات والمعالجة إذوغير الكاملة في محاكاة أسلوب عمل اإلنسان. شخص المعني.الطبية اعتمادا على المعلومات المستخلصة من الفحوصات الخاصة بال Nada Nimat Saleem & Adepa Ismaeel and Fatin George 156 في هذا البحث تصميم نظام مضبب خبير يدخل في متناول المجال الطبي ويساعد في اتخاذ تم القرار فيما يتعلق بتشخيص أمراض األطفال. يعتمد تشخيص النظام المضبب الخبير لتحديد نوعية المرض المصاب به على نتائج التحاليل وتشخيص األمراض الشائعة الخاصة باألطفال. المختبرية, ويستخدم النظام في اتخاذ القرار الكلمات المفتاحية: المنطق المضبب, النظام الخبير المضبب, امراض االطفال 1. Introduction In recent years, computational intelligence has been used to solve many complex problems by developing intelligent systems, and fuzzy logic has proved to be a powerful tool for decision making systems, such as expert systems and pattern classification systems. Fuzzy set theory has already been used in some medical expert systems [1]. One challenge in medical expert systems is the problem of imprecision and uncertainty in both data and knowledge [2]. In practice, it is important to develop techniques for handling such imprecision and uncertainty to enhance the robustness and performance of medical expert systems. Fuzzy logic and fuzzy set theory [3] provide a good framework for managing uncertainty and imprecision in medicine [4], [5], [6] and have been applied to a number of area [7], [5], [8]. The successful development of a fuzzy model for a particular application domain is a complex multi-step process, in which the designer is faced with a large number of alternative implementation strategies. The principle alternatives are in the selection of: - Inference methodology - Linguistic variables and fuzzy terms - Rule set - Fuzzy operators - Membership functions The effect of a fuzzy system is defined by the set of vectors comprising the fuzzy output variables that are obtained from a set vectors representing input variables. Even the simplest modification to the fuzzy system, may alter the input-output mapping of the fuzzy model. Thus the behavior of a fuzzy system is governed by a combination of all these design choices. In a given application there is the additional process of defuzzification to map the output fuzzy sets to the real world. Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis 157 2. 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. [9] summarized the potential of AI techniques in medicine as follows: - Provide a laboratory for the examination, organization, representation and cataloging of medical knowledge. - Produces new tools 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. 3. 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 [10], [11]: - It can be used in systems, which cannot be easily modeled mathematically. In particular systems with non-linear responses that are difficult to analyze may respond to a fuzzy control approach. - As rule-based approach to control, fuzzy control can be used to efficiently represent an expert's knowledge about a problem. - Continuous variables may be represented by linguistic constructs that are easier to understand, making the controller easier to implement and modify. - 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. In other words, 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. Nada Nimat Saleem & Adepa Ismaeel and Fatin George 158 4. Medical Knowledge as a Fuzzy Relation The relationship between symptoms and diagnosis by the concept of medical knowledge was introduced. "In a given pathology, we denote by 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 max-min compositional rule is 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 Si then the patient's state in terms of diagnoses in a fuzzy set Dj with the following membership function [12], [13]:   DdSsdssd RS Ss D ij =  ,,),();(minmax)(  R(s,d) 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 [14].   DdSsPpdsspdp RQ Ss T =  ,,,),();,(minmax),(  5. The Developed Pediatrics Fuzzy Expert System (PedFES) The design structure, application and working principles of a Pediatrics Fuzzy Expert system (PedFES) has been described for diagnosis of general pediatrics diseases. The (PedFES) is a parallel rule-firing system, in which all fireable rules are fired effectively at one time. During the process with the medical expert system (PedFES), 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. Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis 159 5.1 Medical Knowledgebase The examination and laboratory data of the system assigned for the pediatrics patients were collected from Al-Kansaa Teaching Hospital. The data then are inserted into the system (PedFES), for the design process, the Fasting Blood Sugar (FBS), Cholesterol and PH examinations are used for Diabetes Mellitus diagnosis (MELT). The Urine Culture (UC), Serum Creatiniue (S.creatinine) and General Urine Examination (GUE) are used for Urinary Tract Infection disease (UTI) diagnosis. Total Serum Bilirubin (T.S.B_direct), (T.S.B_in_direct) and Hemoglobin (Hb) examination are used for diagnosis of Jaundice disease (JD). The units of the used factors are: FBS (mg/100ml), Cholesterol (mg/100ml), S.creatinine (mg/100ml), T.S.B_direct and T.S.B_in_direct (mg/100ml), Hb (gm/100l). 5.2 Inference Methodology The fuzzy control application structure as shown in figure (1) has nine crisp input variables, these input parameters represent the patients data. The mamdani model of inference was used. All (PedFES) fuzzy rules were of the form "If x1 is A1 and y1 is B1 then z1 is C1", where A1, B1 and C1 are fuzzy sets. The max-min operators were used for implication throughout for implementing a (PedFES). 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 Pediatrics Patients Disease (PPD). 5.3 Linguistic Variables and Fuzzy Terms Each of the nine 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 of laboratory examinations. One output fuzzy variable was used, from the rules it was determined that the output fuzzy variable PPD had eight linguistic terms in it's term_set, these terms represent the pediatric diseases. Nada Nimat Saleem & Adepa Ismaeel and Fatin George 160 Figure(1): The structure of the pediatrics fuzzy expert system 5.4 Rule Set PedFES 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 (PedFES) fuzzy knowledge base rules are shown in the table (1), total of 84 rules are formed as shown in the appendix. Cholesterol FBS PH UC S.creatinine GUE T.S.B-direct T.S.B- indirect Hb PP D Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis 161 Table (1): (PedFES) fuzzy rules Rule No. FBS PH Cholestrol GUE UC S.creatin TSB_ Direct TSB in_direct HB PPD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rule 2 N N N N N N H N L JD Rule 3 N N N H H H N N N UTI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rule 5 N N N H H N N N N UTI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rule 25 H L H N N N H N L MELT & JD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rule 40 H L H N H H N N N UTI& MELT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . For example Rule 25 can be interpreted as follows: Rule 25: if patient’s FBS is High, patient’s PH is Low, patient’s Cholestrol is High and patient’s GUE is Normal, patient’s UC is Normal, patient’s S.crartin is Normal and patient’s TSB_Direct is High, patient’s TSB_indirect is Normal and patient’s HB is Low, then patient has Diabetes Mellitus and Jaundice diseases. 5.5 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 be 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. 5.6 Membership functions Fuzzy membership functions for the medical factors for the mentioned laboratory parameters are calculated by the following functions as shown in the figure (2). Nada Nimat Saleem & Adepa Ismaeel and Fatin George 162 Figure(2): The membership functions of input-output terms 6. Experimental Results For the output factor PPD, the linguistic expressions represent the patients disease. The truth degree of the rules are determined for each rule by aid of the min and then by taking max between working rules. For example, for the input patient laboratory tests values FBS=80, PH=7.5, Cholestrol=100, Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis 163 100= sampleofnumbertotal diagnosisofnumbercorrecttotal eperformanc T.S.B_indirect=0, T.S.B_Direct=0, Hb=15, GUE=8, UC=200 and S.Crartin=1.2. the rules (3) and (5) will be fired as shown in figure (3). From Mamdani max-min inference we will obtain the membership function of our system, max (rule 3, rule 5)=rule 5, then we calculate the crisp output. The crisp value of the PPD is calculated by the method of center of gravity defuzzifier. As you see from figure (3), the value of PPD=35, this means that the patient has the Urinary Tract Infection (UTI) disease (see figure 2). Another example for implementation of the (PedFES) system for patients disease diagnosis shown at figures (4 and 5) with patients laboratory tests values, fired rules (12) and (13) and values of output term PPD that refer to the diagnosis of the patient complaint. 7. PedFES Performance Measurement The (PedFES) system performance can be evaluated by the equation: The performance of the model is tested for 60 patients, the results show that the correct diagnosis using (PedFES) system is 50 and this achieves performance of (83.3٪) . Nada Nimat Saleem & Adepa Ismaeel and Fatin George 164 . . . . . . . . . . . . Figure(3): Calculation of the value PPD represents the diagnosis of a patient affected by Urinary Tract Infection depending on the following laboratory test values (FBS=80, PH=7.5, Cholestrol=100, T.S.B.in.Direct=0, T.S.B.Direct=0, Hb=15, GUE=8, UC=200, S.Crartin=1.2). Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis 165 . . . . . . . . . . . . Figure(4): Calculation of the value PPD represents the diagnosis of a patient affected by Diabetes Mellitus depending on the following laboratory test values (FBS=50, PH=7.5, Cholestrol=300, T.S.B.in.Direct=0.5, T.S.B.Direct=0, Hb=12, GUE=4, UC=75, S.Crartin=0.3). Nada Nimat Saleem & Adepa Ismaeel and Fatin George 166 . . . . . . . . . . . . Figure(5): Calculation of the value PPD represents the diagnosis of a patient affected by Urinary Tract Infection with Jaundice depending on the following laboratory test values (FBS=100, PH=7.3, Cholestrol=150, T.S.B.in.Direct=3, T.S.B.Direct=0, Hb=8, GUE=8, UC=800, S.Crartin=5). Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis 167 8. Conclusions The developed diagnosis module (PedFES) 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. Nada Nimat Saleem & Adepa Ismaeel and Fatin George 168 REFERENCES [1] Nguyen Hoang Phuong and Vladik Kreinovich, 2000, "Fuzzy logic and it's applications in medicine", Institute of Information Technology, National Center for Natural Science and Technology of Vietnam. [2] Hughes, C. "The representation of uncertainty in medical expert systems", Medical Informatics, vol. 14, pp. 269-279, 1989. [3] Zadeh,L.A. "The role of fuzzy logic in the management of uncertainty in expert systems", Fuzzy Set Systems, vol. 11, pp. 199- 227,1983. [4] Adlassnig, K.P. "Fuzzy set theory in medical diagnosis", IEEE Transactions Systems Man Cybernetics, vol. 16, no. 2, pp. 260-265, 1986. [5] Cohen M.E. and D.L.Hudson. "The use of fuzzy variables in medical decision making", in Fuzzy Computing, M.M.Gupta and T.Yamakawa, Eds., pp. 263-271. Elsevier Science, North Holland, 1988. [6] Halim, M. K.M.Ho, and A.Liu, "Fuzzy logic for medical expert systems", Annals Academy Medicine, vol. 19, no. 5, pp. 672-683, 1990. [7] Adlassing, K.P. and G.Kolarz, "CADIAC-2: Computer-assisted medical diagnosis using fuzzy subsets", in Approximate Reasoning in Decision Analysis, MM Gupta and E Sanchez, Eds., pp. 219-247, North-Holland, New York, 1982. [8] Watanabe, H. W.J.Yakowenko, Y.M.Kim, J.Anbe, and T.Tobi, "Application of a fuzzy discrimination analysis for diagnosis of valvular heart disease", IEEE Transactions Fuzzy Systems, vol. 2, no. 4, pp. 267-276, 1994. [9] Hoong N.K., "Medical Information Science-Framework and Potential", International Seminar and Exhibition Computerization for Development- the Research Challenge, Universiti Pertanian Malaysia: Kuala Lumpur, pp. 191-198, 1998. Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis 169 [10] Mamdani, E. H., Qstergaard J.J., Lembessis E., "Use of Fuzzy Logic for Implementing Rule-Based Control of Industrial Processes", In: P.P.Wang, Advances in Fuzzy Sets, Possibility Theory, and Applications, New York: Plenum Press, 1989, pp. 307-323. [11] Klement, E.P., Slany W., "Fuzzy Logic in Artificial Intelligence", Proceedings of the 8th Austrian Artificial Intelligence Conference FLAI '93, Berlin 1995. [12] Sanchez, E., "Medical Diagnosis and Composite Fuzzy Relations", Advances in Fuzzy Set Theory and Applications, Amsterdam: North-Holland 1979, pp. 437-444. [13] Sanchez, E, "Resolution of Composite Fuzzy Relation Equations", Information and Control, 30, 1976, pp. 38-48. [14] William Siler and James J. Buckley, "Fuzzy Expert Systems and Fuzzy Reasoning", Wiley Interscience, 2005. Nada Nimat Saleem & Adepa Ismaeel and Fatin George 170 Appendix: Rule_base Knowledge for (PedFES) System Rule No. FBS PH Cholestrol GUE UC S.creatin TSB_ Direct TSB in_direct HB PPD 1 N N N N N N N N N Normal 2 N N N N N N H N L JD 3 N N N H H H N N N UTI 4 N N N N H H N N N UTI 5 N N N H H N N N N UTI 6 N N N N N N N H N JD 7 H N N N N N N N N MELT 8 H N H N N N N N N MELT 9 H L H N N N N N N MELT 10 H L N N N N N N N MELT 11 L N N N N N N N N MELT 12 L N H N N N N N N MELT 13 N N N H H H H N L UTI& JD 14 N N N N H H H N L UTI& JD 15 N N N H H N H N L UTI& JD 16 N N N N H H N H N UTI& JD 17 N N N H H N N H N UTI& JD 18 N N N H H H N H N UTI& JD 19 H N N N N N H N L MELT& JD 20 H N N N N N N H N MELT& JD 21 H L N N N N H N L MELT& JD 22 H L N N N N N H N MELT& JD 23 H N H N N N H N L MELT& JD 24 H N H N N N N H N MELT& JD 25 H L H N N N H N L MELT& JD 26 H L H N N N N H N MELT& JD 27 L N N N N N H N L MELT& JD 28 L N N N N N N H N MELT& JD 29 L N H N N N N H N MELT& JD 30 L N H N N N H N L MELT& JD 31 H N N N H H N N N UTI& MELT 32 H N N H H N N N N UTI& MELT 33 H N N H H H N N N UTI& MELT 34 H L N N H H N N N UTI& MELT 35 H L N H H N N N N UTI& MELT 36 H N H H H H N N N UTI& MELT 37 H N H N H H N N N UTI& MELT 38 H N H H H N N N N UTI& MELT 39 H L H H H H N N N UTI& MELT 40 H L H N H H N N N UTI& MELT 41 H L H H H N N N N UTI& MELT Design a Fuzzy Expert System for Pediatrics Diseases Diagnosis 171 42 L N N H H H N N N UTI& MELT 43 L N N N H H N N N UTI& MELT 44 L N N H H N N N N UTI& MELT 45 L N H H H H N N N UTI& MELT 46 L N H N H H N N N UTI& MELT 47 L N H H H N N N N UTI& MELT 48 H L N H H H N N N UTI& MELT 49 H N N H H H H N L UTI, JD& MELT 50 H N N N H H H N L UTI, JD& MELT 51 H N N H H N H N L UTI, JD& MELT 52 H N N H H H N H N UTI, JD& MELT 53 H N N N H H N H N UTI, JD& MELT 54 H N N H H N N H N UTI, JD& MELT 55 H N H H H H H N L UTI, JD& MELT 56 H N H N H H H N L UTI, JD& MELT 57 H N H H H N H N L UTI, JD& MELT 58 H N H H H H N H N UTI, JD& MELT 59 H N H N H H N H N UTI, JD& MELT 60 H N H H H N N H N UTI, JD& MELT 61 H L H H H H H N L UTI, JD& MELT 62 H L H N H H H N L UTI, JD& MELT 63 H L H H H N H N L UTI, JD& MELT 64 H L H H H H N H N UTI, JD& MELT 65 H L H N H H N H N UTI, JD& MELT 66 H L H H H N N H N UTI, JD& MELT 67 H L N H H H H N L UTI, JD& MELT 68 H L N N H H H N L UTI, JD& MELT Nada Nimat Saleem & Adepa Ismaeel and Fatin George 172 69 H L N H H N H N L UTI, JD& MELT 70 H L N H H H N H N UTI, JD& MELT 71 H L N N H H N H N UTI, JD& MELT 72 H L N H H N N H N UTI, JD& MELT 73 L N N H H H H N L UTI, JD& MELT 74 L N N N H H H N L UTI, JD& MELT 75 L N N H H N H N L UTI, JD& MELT 76 L N N H H H N H N UTI, JD& MELT 77 L N N N H H N H N UTI, JD& MELT 78 L N N H H N N H N UTI, JD& MELT 79 L N H H H H H N L UTI, JD& MELT 80 L N H N H H H N L UTI, JD& MELT 81 L N H H H N H N L UTI, JD& MELT 82 L N H H H H N H N UTI, JD& MELT 83 L N H N H H N H N UTI, JD& MELT 84 L N H H H N N H N UTI, JD& MELT