Mycin

36
An Expert System MYCIN 1

description

 

Transcript of Mycin

Page 1: Mycin

An Expert System MYCIN

1

Page 2: Mycin

Definition of Expert System• A computing system capable of representing and

reasoning about some knowledge rich domain, which usually requires a human expert, with a view toward solving problems and/or giving advice. Such systems are capable of explaining their reasoning.

• Does not have a psychological model of how the expert thinks, but a model of the expert’s model of the domain.

2

Page 3: Mycin

What is:

• Expertise? Expertise consists of those characteristics, skills and

knowledge of a person (that is, expert) or of a system, which distinguish experts from novices and less experienced people.

• An expert?often outperforming human beings at particular tasks are generally termed as expert.

3

Page 4: Mycin

Distinction Between an Expert System and a Knowledge-Based

System• To be classified as an ‘expert system’ the

system must be able to explain the reasoning process.

• This is often accomplished by displaying the rules that were applied to reach a conclusion.

4

Page 5: Mycin

Rule-Based Expert Systems:Suitable Domains

• Many Rules• No Unifying Theorem• Knowledge can be easily separated from the way

it is used• Updating the knowledge base has to be easy• The knowledge base can be the only [indirect]

communication channel among rules• Clinical/psychological and other domains, rather

than mathematical/physical domains

5

Page 6: Mycin

MYCIN: The Problem

• Roberts & Visconti [1972]:– Only 13% of patients are treated rationally– 66% are being given irrational treatment– 21% are being given questionable treatment

• Irrationality means, for example:– Using a contra-indicated combination– Using the wrong agent for a specific organism– Not taking the required cultures

6

Page 7: Mycin

7

Design Parameter

1. Program must be competent & easy to use

2. Must handle a large, changing body of knowledge

3. Interact with human users

4. Must take time into account

5. Work with incomplete or uncertain information

Page 8: Mycin

8

System Components

• Consultation system– Asks questions– Draws conclusions– Gives advice

• Explanation system– Translates rule to English before display

• Rule acquisition/modification system

Page 9: Mycin

Expert System Structure

User Interface

Environment

Language/Shell

ExplanationFacility

InferenceEngine

KnowledgeBase

Blackboard

9

Page 10: Mycin

Stages in Diagnosis and Treatment

• Decide if there is a significant infection

• Identify the causing organism(s) by clinical and laboratory evidence

• Decide what antibiotic agent the organisms are sensitive to

• Prescribe the optimal drug combination for the particular case

10

Page 11: Mycin

A MYCIN Runtime Example

11

Page 12: Mycin

The MYCIN Architecture

Consultation program

Explanation program

Knowledge-acquisition program

Dynamic patient data

Static factual & judgmental knowledge

Physician user

Infectious diseases expert

12

Page 13: Mycin

A Sample Context Tree

13

Page 14: Mycin

14

Rule Grammar<rules. ::= <premise> <action>

<premise> ::= ($AND <condition> … <condition>)

<condition> ::= (<predicate> <context> <parameter> <value>) | ($OR <condition> … <condition>)

<action> ::= <conclusion> | <instruction>

Page 15: Mycin

15

English Rule

IF strain of org is gramneg and

morphology of org is rod and

aerobicity of org is aerobic

THEN

there is strongly suggestive evidence

(0.8) that the class of org is

enterobacteriacae

Page 16: Mycin

The Knowledge Base• Inferential knowledge stored in decision rules

– If Premise then Action (Certainty Factor [CF])– If A&B then C (0.6)– The CF represents the inferential certainty

• Static knowledge:– Natural language dictionary– Lists (e.g., Sterile Sites)– Tables (e.g., gram stain, morphology, aerobicity)

• Dynamic knowledge stored in the context tree– Patient specific– Hierarchical structures: Patient, cultures, organisms– <Object, Attribute, Value> triples: <Org1, Identity, Strep>– A CF used for factual certainty <Org1, Identity, Staph, 0.6>

16

Page 17: Mycin

17

Static Data Structures

• Simple lists– enumerate organisms and sterile sites known to system

• Knowledge tables– contain clinical parameters and their values under

various circumstances

• Classification system– clinical parameters according the contexts in which

they apply

Page 18: Mycin

18

Dynamic Data Structures

• Context tree– serves to organize information relating to a

particular patient– used to structure clinical problem and relate

contexts to one another– rules are related to the context tree (although

the rules themselves are not organized into either a decision tree or inference network)

Page 19: Mycin

19

Control Structure

• Backward chaining– helps to keep it focuses– facilitates backward reasoning from top level

goal for all queries

Page 20: Mycin

20

Inference Strategy1. Subgoals are generalized (i.e. match with variables)

when possible2. All applicable rules are evaluated before reaching a

decision3. Facts with certainities between –0.2 and +0.2 are treated

as unknown4. Mycin asks for lab for some facts before attempting a

deduction5. A list of rules that fail under the current context is

maintained to avoid re-evaluation6. Premises are evaluated based on known fact before

search is allowed

Page 21: Mycin

21

Goal Rule

IF

there is an org requiring therapy and

consideration has been given to possibilty of other orgs requiring therapy

THEN

compile a list of possible therapies and

select the best alternative from list

Page 22: Mycin

22

Consultation Procedure

• Create a patient context as the top level node in the context tree

• Attempt to apply the goal rule to this particular patient context

• Context tree is fleshed out in an effort to accumulate evidence from user query or inference

• Each node contains accumulated evidence including “lab data” to allow alternation between question selection and rule invocation

Page 23: Mycin

23

Mutually Recursive Procedures

• Monitor– attempts to evaluate premise of current rule– if it fails rule is discarded and next rule from list is

examined (restricted by context)

• Findout– gathers evidence for and against rule premise– if question can be asked control returns to Monitor with

answer– if no question new list of rules to determine truth of

rule premise is returned to Monitor

Page 24: Mycin

24

Mycin Rules

• Had 200 rules in 1976• Meta-rules

– rule pruners similar to alpha/beta cutoffs– rules to reorder relevant domain rules– general (domain free) problem solving

heuristics– some forward (antecedent) reasoning to cut

stupid questions (i.e. skip pregnancy questions for males)

Page 25: Mycin

25

Explanation System

• Can display rule being invoked at any point in consultation

• Record rule invocation and associates them with questions asked and rules invoked

• Use rule index to retrieve particular rules in answer to questions

• Why and how questions answered using goal tree

Page 26: Mycin

26

Rule Acquisition System

• Domain experts allowed to enter and change rules

• Rules translated to Lisp and rule numbers added to “Look-ahead” and “Updated-by” lists

• Does not catch contractions and inconsistencies in large rule-bases

Page 27: Mycin

27

Evaluation

1974• Panel of 5 experts approve 72% of Mycin’s

recommendations for 15 patients

1976• 8 experts (5 faculty, 1 resident, 1 med student, 1 research

fellow) made drug recommendations for 10 patients• Mycin had best match (52%) with actual drug

recommendations used by attending physician

Page 28: Mycin

The Rule Interpreter

• Control structure: goal driven, backward chaining• Attempt to establish values of clinical parameters at

the leaf nodes• The interpreter retrieves a list of rules whose

conclusions bear on current goals, and tries to evaluate these rules

• Questions are asked only when the rules fail to deduce the necessary information

• If the user cannot supply the information, the rule is ignored

28

Page 29: Mycin

A MYCIN Reasoning Tree

29

Page 30: Mycin

The Main MYCIN Algorithm

-Uses Monitor and FindOut to recursively invoke each rule when relevant

30

Page 31: Mycin

The Monitor Mechanism

31

Page 32: Mycin

The FindOut Mechanism

32

Page 33: Mycin

Certainty Factors• Not a Bayesian probability measure, but rather a Certainty Factor

(CF) with its update functions• A Conclude function uses

– The CF of the rule used for making the inference– The minimal CF of the premises (using the Tally function)– The context node about which the conclusion is made– The clinical parameter whose value is added to the dynamic DB– The value of the clinical parameter

• Conclude derives a conclusion including the CF of the result– E.g., “There is suggestive evidence (0.7) that the identity of the organism is

streptococcus”– The CF is mapped into English

• The CF of a context is updated by other evidence (relevant rules)• It is always true that -1 ≤ CF ≤ +1• If CF = +1 then all other hypotheses are rejected

33

Page 34: Mycin

The Evaluation Method

• 15 patients with positive blood cultures (at least one organism)

• 5 Stanford infectious disease experts• 5 experts from other hospitals• All data recorded and given, if asked for, by

the computer or a human expert• All decisions by the computer or the experts

recorded, including the majority opinion

34

Page 35: Mycin

35

Summary

• Mycin combines the advantages of general rule-based system with the advantages of an “inexact” reasoning system

• Mycin has not addressed– how to convert from human terms to certainties– how to normalize across different people’s– how far to propagate certainty factor changes based on

new evidence– how to provide feedback to database to improve

certainty factor accuracy

Page 36: Mycin

Thank You

36