L9. Expert System 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Expert System II

by: Dr. Norhazwani MdYunos


Expert Systems
Architecture of an expert system:

Inference
Engine

Expert System
Inference Engine
 The most crucial component of ES.
 It derives the knowledge, i.e., guides the selection
of a proper response to a specific situation which
is called pruning.
 Draw conclusions from the knowledge base.
 Example of drawing conclusion:
 If I tell you: “All boys have a mother”,
and “John is a boy”.
 What can you tell me about John?
You are able to figure out that: “John has a mother”,
without being explicitly told this fact.
Inference Engine
 Three formal approaches used in this case are:
 Production rules – consists of a rule set, a rule
interpreter which specifies when and how to
apply the rules and a working memory which
holds the data, goals and intermediate results.
 Structured objects – use vector representation
of essential and accidental properties.
 Predicate logic – uses propositional and
predicate calculi.
Inference Engine
 The inference engine can work in the following
ways:
 Forward chaining.
 Backward chaining.
 Abduction.
 Reasoning under uncertainty.
Inference Engine

For this course, we will learn how


to infer using knowledge that is
represented in RULES.
Expert systems that store RULES
in their knowledge base are called
RULES-based Expert System

** There is no reason why expert systems cannot be based on


other forms of knowledge representation (frames, semantic
net, etc.).
Inference Engine
 For a knowledge base which knowledge is
represented by rules, then forward chaining and
backward chaining are used to draw conclusions.
 Inference engine, it cycles through three steps:
 Match facts against rules.
 Select a rule.
 Execute the rule.
Inference Engine
 Forward chaining (data-driven):
 Starts from the known initial state and proceeds in the
forward direction to achieve the goal.
 Best for prognosis, monitoring and control.
 Example: CLIPS (C Language Integrated Production
System).

 Backward chaining (query-driven):


 Work backward from the goal/decision and look for
rules that can provided the desired goal/decision.
 Best for diagnosis problems.
 Example: MYCIN (a system which diagnoses and treats
bacterial infections of the blood).
Inference Engine
 The basic steps for Forward chaining (bottom-up
reasoning):
i. The system is given one or more conditions.
ii. The system searches the rules in the knowledge base
for each condition. Those rules that correspond to the
condition in IF part are selected.
iii. Each rule can generate new conditions from the
conclusions of the invoked THEN part, which in turn are
again added to the existing ones.
iv. The added conditions, if any will be processed again (in
step ii). The session ends if there are no new
conditions.
Inference Engine
 The basic steps for Backward chaining (top-down
reasoning):
i. Select a goal state and rules whose THEN portion has
the goal state as conclusion.
ii. Establish sub-goals to be satisfied for the goal state to
be true, from the IF portion of the selected rules.
iii. Establish initial conditions necessary to satisfy all the
sub-goals.
iv. Check whether the given initial state matches with the
established ones. If so, then the goal is one solution. If
not, select another goal state.
Inference Engine
Example – MYCIN (one of the most important Expert
Systems that have been developed).
How MYCIN works:
 MYCIN has a four stage task:
 Decide which organisms, if any, are causing
significant disease.
 Determine the likely identity of the significant
organisms.
 Decide which drugs are potentially useful.
 Select the best drug, or set of drugs.
Inference Engine
Example – How MYCIN works:
 One of the relevant rule is:
IF
1. There is an organism which requires therapy, and
2. Consideration has been given to possible other
organisms which require therapy,
THEN
1. Compile a list of possible therapies, and
2. Determine the best therapy.
ELSE
Indicate that the patient does not require therapy.
Inference Engine
Example – How MYCIN works:
 Another relevant rule is:
IF
1. The gram stain of the organism is gramneg, and
2. The morphology of the organism is rod, and
3. The aerobicity of the organism is aerobic,
THEN
There is suggestive evidence that the identity of the
organism is bacteroides.
Inference Engine
Example – How MYCIN works:
 Another relevant rule is:
IF
1. The identity of the organism is not known with
certainty, and
2. The gram stain of the organism is gramneg, and
3. The morphology of the organism is rod, and
4. The aerobicity of the organism is aerobic,
THEN
There is strongly suggestive evidence that the identity
of the organism is enterobactericeae.
Inference Engine
Example – How MYCIN works:
 This is applied in a mixture of forward and backward
chaining:
“How do I decide if there is an organism requiring
therapy? Well, Rule 90 tells me that organisms
associated with significant disease require therapy.
But I don’t know about any organisms, so I’ll ask
the user … now I can apply RULE 90 to each of these
… but I need to know if the organism is significant.
Now I have a set of rules which tell me whether this
is the case. Let’s see, RULE 38 says that an
organism from a sterile site is significant. I don’t
have any rules for saying if the site was sterile,
so I’ll ask the user … ”
Inference Engine
 So MYCIN starts by trying to apply the control rule, and
this generates sub-goals.
 The first of these is to determine if there is an organism
which needs to be treated.
 This generates another sub-goals, whether the organism is
significant.
 This provokes a question to the user.
 The answer allows other rules to be fired, and these lead to
further questions.
 Eventually, the IF part of the control rule is satisfied, and
the THEN part compiles a list of drugs, and chooses from
it.
Inference Engine

An important feature of any expert system is


that it can explain how it comes up with
conclusions.
Inference Engine
Which to use? – forward chaining or backward
chaining?
 Are we trying to prove a particular decision?
 Use backward-chaining.
 Are we trying to find all possible solutions?
 Use forward-chaining.
Inference Engine
Exercise: Forward chaining – find which goal will be proved.
 R1: If A and B, then E.
 R2: If C and D, then H.
 R3: If E or K, then G.
 R4: If F and G and H, then J.
 Working memory (initial facts): A, B, C, D, F.
Inference Engine
Exercise: Backward chaining – prove the goal J.
 R1: If A and B, then E.
 R2: If C and D, then H.
 R3: If E or K, then G.
 R4: If F and G and H, then J.
 Working memory (initial facts): A, B, C, D, F.
Inference Engine
Expert Systems
Architecture of an expert system:

Inference
Engine

Expert System
Expert System
Guideline to determine whether a problem is
appropriate for expert system solution:
 The need for the solution justifies the cost and effort of
building an expert system.
 Human expertise is not available in all situations where it is
needed.
 The problem may be solved using symbolic reasoning.
 The problem domain is well structured and does not
require common sense reasoning.
 The problem may not be solved using traditional computing
methods.
 Cooperative and articulate experts exist.
 The problem is of proper size and scope.
Expert System
Strength:
 Provide consistent answers for repetitive decisions,
processes and tasks.
 Hold and maintain significant levels of information.
 Reduce employee training costs.
 Centralize the decision making process.
 Create efficiencies and reduce the time needed to solve
problems.
 Combine multiple human expert intelligences.
 Reduce the amount of human errors.
 Give strategic and comparative advantages creating entry
barriers to competitors.
 Review transactions that human experts may overlook.
Expert System
Weaknesses:
 Require a lot of detailed knowledge.
 Restrict knowledge domain.
 Not all domain knowledge fits rule format.
 Expert consensus must exist.
 Experts cannot always clearly explain their logic and
reasoning.
 Knowledge acquisition is time consuming.
 Challenges of automating complex processes.
 Lack of flexibility and ability to adapt to changing
environments.
 Not being able to recognize when no answer is available.
Conclusions
 Very interesting field of AI.
 Expert systems are extremely useful in the right
domain.
 They are inflexible and require a lot of
collaboration between a knowledge engineer and a
domain expert.
 When implemented correctly, experts systems
remove human error from the equation.

You might also like