CSM10 Intelligent Information Systems
Total Page:16
File Type:pdf, Size:1020Kb
CSM10 Intelligent Information Systems Week 4 1 Reasoning in the real world Case study: MYCIN Coursework project and report CSM10 Spring Semester 2007 Intelligent Information Systems Professor Ian Wells 2 The journey so far ... • introduction to the module • what is intelligence? • cognitive processes • how we perceive, remember, solve puzzles • how a computer can solve problems • representing knowledge using semantic networks and production rules • reasoning in the real world • case study (MYCIN), uncertainty, chess, problems 3 3 Intelligence Perception & cognitive processes Knowledge representation Real-world reasoning 4 Inside an expert system: MYCIN A case study of one of the first major expert systems and an analysis of its performance when compared with humans at solving complex problems 5 Once upon a time ... • it is a dark night in 1972 • you are on holiday in the USA • you have to be admitted to hospital • the doctor prescribes antibiotics • what should you do .... ? • be very worried ... !! 6 6 Treatment of infection • _____ % acceptable • _____ % questionable • _____ % clearly irrational • (Roberts & Visconti: Am J Hosp Pharm 1972) 7 7 History of MYCIN • diagnosis of bacteraemias • suggestions for suitable therapy • PhD thesis - Edward Shortliffe (Stanford 1974) • project lasting 10 years + 5 more PhDs • numerous offspring e.g. EMYCIN, PUFF, CLOT • only Oncocin was ever used routinely • foundation for much of today’s KBS technology 8 8 MYCIN • if ... then production rules • backward chaining inference • management of uncertainty • explanation & justification • complex but bounded domain • concrete and assessable output 9 9 MYCIN rule - English if: the gramstain of the organism is negative and: the aerobicity of the organism is anaerobic and: the morphology of the organism is rod then: the genus of the organism is bacteroides with a certainty factor of 0.6 10 10 MYCIN rule - LISP ($AND (SAME CNTXT GRAM GRAMNEG) (SAME CNTXT MORPH ROD) (SAME CNTXT AIR AEROBIC)) (CONCLUDE CNTXT CLASS BACTEROIDES TALLY 0.6) 11 11 MYCIN rule - Prolog rule(150, Context, genus, bacteroides,0.6) :- same(Context, gramstain, gramneg), same(Context, aerobicity, anaerobic), same(Context, morphology, rod). 12 12 Certainty factors • every deduced or requested value has a Cf • tally of a rule is lowest Cf of its components • Cf for rule x tally = Cf of new value deduced • Cf combined = Cf1 + Cf2 x (1 - Cf1) • if Cf = 1 all alternatives are deleted 13 13 MYCIN structure Clinical Users Consultation Program Static Dynamic Knowledge Knowledge about Disease about Patient and Therapy Context Tree Explanation Program Properties of Contexts and Values of Clinical Clinical Parameters Parameters Production Acquisition Rules details Knowledge Acquisition Program Tables and Lists Infectious Diseases Experts 14 14 MYCIN objects Clinical Context Value Parameter Person Jones Name Culture Blood Site Organism Coccus Morphology Drug 100mg bd Dose Operation 20 Jan 2004 Date Properties Certainty Value format Factor Text Askable 15 15 MYCIN context tree Patient-1 Culture-1 Culture-2 Operation-1 Organism-1 Organism-2 Organism-1 Therapy-1 Drug-1 Drug-2 Drug-3 16 16 MYCIN analysis Meta-rules Control Backward chaining Relationships Rule categories Production rules Certainty factors Context tree Clinical parameters Contexts Objects 17 17 MYCIN on trial • blinded evaluation by Yu et al (1979) • ten selected disease case histories • 8 doctors + original + MYCIN • 10 x 10 conclusions sent to 8 experts • evaluators not aware MYCIN included 18 18 MYCIN’s performance Dept. of Infectious Diseases fellow 60% University faculty member 1 62.5% University faculty member 2 60% University faculty member 3 57.5% University faculty member 4 55% University faculty member 5 42.5% Hospital house officer 45% Hospital medical student 30% Actual therapy prescribed 57.5% MYCIN 65% 19 19 MYCIN’s family tree DENDRAL MYCIN EMYCIN GUIDON PUFF GRAVIDA CLOT NEOMYCIN ONCOCIN 20 20 ONCOCIN • Stanford Oncology Clinic • routine operation from 1981 to 1987 • 30 to 60 protocols of 40 to 60 pages each • multiple drugs - up to ten per treatment • 80% of plans accepted by experts • used as an advisor by less specialised doctors • enter their plans for comments; integrated into system • eventually replaced by newer systems (Protégé, EON) 21 21 MYCIN revisited ... 22 rule 9 states that: the context has a genus neisseria provided that: the gramstain is gramneg and: the morphology is coccus or ... rule(9, Context, genus, neisseria) :- same(Context, gramstain, gramneg), same(Context, morphology, coccus). trace(Context, Parameter, Value) :- know(Context, Parameter, Value); deduce(Context, Parameter, Value); ask(Context, Parameter, Value). 23 23 PROSE1 - A RECONSTRUCTION OF MYCIN IN PROLOG ============================================ Enter <start.> when ] ? prompt appears ] ?start. m - menu - details of available routines h - help - instructions for use of Prose system s - select knowledge base f - full consultation of expert system b - abbreviated consultation only k - list the knowledge acquired l - list all rules in memory p - return to Primos - ek - edit knowledge base ep - edit Prose file tn - turn on trace mode tf - turn off trace mode pr - return to Prolog command level 24 24 > h PROSE.1 - a reconstruction of the essential features of MYCIN ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ ‘full’ gives a complete ‘MYCIN-like’ consultation establishing patient, infection and culture before proceeding to identify the organism ‘brief’ moves directly to the identification of the organism Confidence Factors ------------------------- once the essential patient data has been entered, an optional ‘confidence factor’ in the range -1 (definitely not) to 1 (definitely true) can be added to the evidence supplied (a Cf of 1 is assumed if omitted) eg. > gramneg .75 N.B. once ‘start.’ has been entered, no . is required at the end of each line 25 25 > s > choose from : bugs - identification of organisms using MYCIN rules bugs > knowledge base loaded ... source: subset of MYCIN rules from Bramer/Shortliffe goal: to determine the genus of an organism > f ------------------------- patient1 ------------------------- [1] Surname of patient : Smith [2] Sex : Male [3] Age : 37 26 26 ------------------------- infection1 ------------------------- [4] Enter the date at which the infection first appeared : 23/8/89 The most recent culture associated with infection1 will be referred to as : ------------------------- culture1 ------------------------- [5] Enter the date on which the culture was obtained : 25/8/89 The first significant organism from culture1 will be referred to as : ------------------------- organism1 ------------------------- [6] Enter the gramstain of organism1 ... gramneg [7] Enter the morphology of organism1 ... rod 27 27 [8] Enter the aerobicity of organism1 ... anaerobic Rule 35 succeeds with a confidence factor of 0.6 [9] Enter the site of organism1 ... ? Please enter one of the following : unknown armpit blood csf urine blood [10] Enter the portal of organism1 ... gi .6 Rule 200 succeeds with a confidence factor of 0.54 28 28 PROSE.1 concludes that the genus of organism1 is bacteroides with a confidence of 81.5 percent > k > knowledge acquired during the consultation session: the gramstain of organism1 is gramneg with a Cf of 1 the morphology of organism1 is rod with a Cf of 1 the aerobicity of organism1 is anaerobic with a Cf of 1 the site of organism1 is blood with a Cf of 1 the portal of organism1 is gi with a Cf of 0.6 the genus of organism1 is bacteroides with a Cf of 0.816 > p > returning to Primos ... OK, 29 29 PROSE expert system shell Conclusions User Explanations input Actions Strategic layer Strategic rules Foreign clauses & rules Static Dynamic Facts Facts Unknowns Deductions Deductive layer Deductive rules Management of uncertainty 30 (Ahmad & Wells 1985) 30 PROSE applications • Clinical Biochemistry and medical knowledge • original design aim and achievement • front end to WASP • Wallingford Storm Sewer Project • allowed non-expert engineers to use the system • intelligent tolerancing module for Medusa • Prime CAD/CAM program • replaced numerous rule books and tables • BAC Journeyman project • something to do with things that fly and go bang 31 31 Book reviews Recommendations for further study ... or just for enjoyment! 32 Book review • alternative basic text • more technical approach than Negnevitsky • updated version of early classic! 33 Book review • how to apply cognitive psychology to software development • well recommended for all hard-core coders! • easy to read and good to dip into from time to time 34 Expert system shells Introduction to Penny 35 Expert system shells • an expert system with the knowledge removed • performance and design can be improved in the process • first example was EMYCIN • CLIPS is an expert system language - not a shell • Penny is an expert system shell written in 4D • based on production rules and Markov algorithm 36 36 Expert system shell for 4D 37 Download from www.4dcoop.com 37 38 38 39 39 Why change from CLIPS? • look at www.ghg.net/clips/CLIPS.html • CLIPS is free, well documented & powerful but ... • still a text-based system • not easy to use in a real-world setting • Windows versions not very stable • MSc students wanted something more modern! 40 40 Advantanges of Penny over CLIPS • written specifically for this course! • 4D is a modern and open environment • plenty of scope for GUI and visual effects • internal working easier to understand and modify • teaches