expert systems
TRANSCRIPT
An Introduction to Expert Systems
Dr Iman Ardekani
Basics Applications Development Structure Inferencing Methods
Content
By Iman Ardekani
Iman Ardekani
What is an expert system?
By definition, an expert system is a computer program that
simulates the thought process of a human expert to solve
complex decision problems in a specific domain.
Basics
Its form?Its
Functionality?Its ideal goal?
Its responsibility?
Iman Ardekani
What is an expert system for?
For operating as an interactive system that responds to
questions, asks for clarifications, makes recommendations,
and generally aid the decision making process.
Examples:
Computer diagnosis and troubleshooting, medical diagnosis,
and even delicate medical surgery
Basics
Iman Ardekani
How an expert system operates?
It uses both facts and heuristics to solve difficult decision
problems based knowledge acquired from an expert.
Have you tried NHS expert systems? Discover how its
operates and explain it in one short paragraph.
Basics
Iman Ardekani
Why we need it?
Because of limitations associated with conventional human decision-making
processes, including:
• Humans expertise is very scarce.
• Humans get tired form physical or mental work load.
• Humans have limited working memory.
• Humans are unable to comprehend large amount of data quickly.
• Humans are slow in recalling information stored in memory.
• Humans are subject to deliberate or inadvertent in their action.
• Humans can deliberately avoid decision responsibilities.
• Humans lie, hide and die.
Basics
Iman Ardekani
Why we need it?
Because of limitation associated with conventional programming and
traditional decision-making support, including:
• They are algorithmic in nature and depend only on raw machine
power.
• They do not make use of the effective heuristic approaches used
by human expert.
• They are not easily adoptable to changing problem environment.
• They seek explicit and factual solutions that may not be
possible.
Basics
Iman Ardekani
What are main applications of expert systems?
• Interpreting and identifying
• Predicting
• Diagnosing
• Designing and planning
• Monitoring
• Debugging and testing
• Instructing and training
• Controlling
Applications
Iman Ardekani
• The best application candidates for expert systems
are those dealing with expert heuristics for solving
problems.
• Calculation-intensive applications with very
exacting requirements are better handled by
traditional decision support tools or conventional
programming.
Applications
Iman Ardekani
Hierarchy of expert systems development process
Expert System Development
Time
Task
s
Background
Concepts
Problem selection
Knowledge acquisition
Knowledge representation
Tool selection
Development
Test
Implementation and integration
Maintenance
Iman Ardekani
What is a successful expert system?
The one with making decision process similar to that of human brain.
How human brain makes a decision?
By using mixture of factual and heuristic knowledge.
What is heuristic knowledge?
It is composed of intuition, judgment and logical inference. It is an
indisputable strength of human.
Lets answer the first question more accurately now:
Successful expert systems are those combine facts and heuristics and thus
merge human knowledge with computer power in solving problems.
Expert System Development
Iman Ardekani
Expert systems are organized in 3 distinct levels:
1. Knowledge Base consists of problem solving rules,
procedures, and relevant data.
2. Working Memory refers to task-specific data for the
problem under consideration.
3. Inference Engine is a generic control mechanism
that applies the knowledge base to the task-specific
data to arrive at some solutions or conclusion.
Expert Systems Structure
Iman Ardekani
Expert Systems Structure
Knowledge Base
Inference Engine
Problem Data
Expertise
Iman Ardekani
Expert Systems Structure
Human experts or consulting firm
User
Commercial vendor e.g, VP-Expert
Knowledge Engineers Knowledge Base
Problem Data
Inference Engine
Iman Ardekani
Knowledge Base Structure
• It constitutes problem solving rules, facts or intuitions that a
human expert might use in solving problems in a given
problem domain.
• It is usually stored in terms of if-then rules.
Example
IF the patient has headache THEN ask how long he/she has
suffered this pain.
Expert Systems Structure
Iman Ardekani
How to create the knowledge base:
1. The knowledge engineer establishes a dialog with the
human expert to elicit knowledge.
2. The knowledge engineer codes the knowledge explicitly in
the knowledge base.
3. The expert evaluates the expert system and gives a
critique to the knowledge engineer.
Expert Systems Structure
Iman Ardekani
Try NHS online expert system for an imaginary
scenario. Discover the if-then rules for the chosen
scenario.
Expert Systems Structure
Iman Ardekani
General methods of inferencing:
1. Forward Reasoning (data-driven) – reasoning from facts to
the conclusions resulting from those facts – best for
prognosis, monitoring, and control.
2. Backward Reasoning (query driven) – reasoning in reverse
from a hypothesis, a potential conclusion to be proved to
the facts that support the hypothesis – best for diagnosis
problems.
Inferencing Methods
Iman Ardekani
Example for forward reasoning
Knowledge Base Rules:
① IF (Symptom1, X) AND (Symptom2, X) THEN ADD (Allergy, X)
② IF (Season, Spring) THEN ADD (Symptom1, Iman)
③ IF (Season, Spring) THEN ADD (Symptom2, Iman)
④ IF (Allergy, X) OR (Asthma, X) THEN ADD (Inhaler Needed, X)
⑤ IF (Inhaler Needed, X) THEN DEL (Happy X)
⑥ IF (Symptom1, X) THEN DEL (Swimming, X)
Inferencing Methods
Rule
s Pri
ori
ty
Iman Ardekani
Let us assume that initially we have a working memory (user data) with
Step 1:
Inferencing Methods
(Season, Spring)
(Happy Iman)
(Swimming, Iman)
(Symptom1, Iman) 2
3 x
(Season, Spring)
(Happy Iman)
(Swimming, Iman)
(Symptom1, Iman)
(Season, Spring)
(Happy Iman)
(Swimming, Iman)
Updated working memory:
Iman Ardekani
Step 2
Inferencing Methods
Knowledge Base Rules
① IF (Symptom1, X) AND (Symptom2, X) THEN ADD (Allergy, X)
② IF (Season, Spring) THEN ADD (Symptom1, Iman)
③ IF (Season, Spring) THEN ADD (Symptom2, Iman)
④ IF (Allergy, X) OR (Asthma, X) THEN ADD (Inhaler Needed, X)
⑤ IF (Inhaler Needed, X) THEN DEL (Happy X)
⑥ IF (Symptom1, X) THEN DEL (Swimming, X)
(Symptom1, Iman)
(Season, Spring)
(Happy Iman)
(Swimming, Iman)
(Symptom2, Iman) 3
x6
Iman Ardekani
Step 3
Inferencing Methods
(Symptom1, Iman)
(Season, Spring)
(Happy Iman)
(Swimming, Iman)
(Symptom2, Iman)
x6
1(Allergy, Iman)
Knowledge Base Rules
① IF (Symptom1, X) AND (Symptom2, X) THEN ADD (Allergy, X)
② IF (Season, Spring) THEN ADD (Symptom1, Iman)
③ IF (Season, Spring) THEN ADD (Symptom2, Iman)
④ IF (Allergy, X) OR (Asthma, X) THEN ADD (Inhaler Needed, X)
⑤ IF (Inhaler Needed, X) THEN DEL (Happy X)
⑥ IF (Symptom1, X) THEN DEL (Swimming, X)
Iman Ardekani
Step 4
Inferencing Methods
(Symptom1, Iman)
(Happy Iman)
(Swimming, Iman)
(Symptom2, Iman)
4(Allergy, Iman)
Inhaler Needed, Iman
6
Knowledge Base Rules
① IF (Symptom1, X) AND (Symptom2, X) THEN ADD (Allergy, X)
② IF (Season, Spring) THEN ADD (Symptom1, Iman)
③ IF (Season, Spring) THEN ADD (Symptom2, Iman)
④ IF (Allergy, X) OR (Asthma, X) THEN ADD (Inhaler Needed, X)
⑤ IF (Inhaler Needed, X) THEN DEL (Happy X)
⑥ IF (Symptom1, X) THEN DEL (Swimming, X)
(Season, Spring)
x
Iman Ardekani
(Happy Iman)
Step 5
Inferencing Methods
5
6
Knowledge Base Rules
① IF (Symptom1, X) AND (Symptom2, X) THEN ADD (Allergy, X)
② IF (Season, Spring) THEN ADD (Symptom1, Iman)
③ IF (Season, Spring) THEN ADD (Symptom2, Iman)
④ IF (Allergy, X) OR (Asthma, X) THEN ADD (Inhaler Needed, X)
⑤ IF (Inhaler Needed, X) THEN DEL (Happy X)
⑥ IF (Symptom1, X) THEN DEL (Swimming, X)
(Season, Spring)
(Symptom1, Iman)
(Swimming, Iman)
(Symptom2, Iman)
(Allergy, Iman)
Inhaler Needed, Iman
x
Iman Ardekani
(Swimming, Iman)
Step 6
Inferencing Methods
Knowledge Base Rules
① IF (Symptom1, X) AND (Symptom2, X) THEN ADD (Allergy, X)
② IF (Season, Spring) THEN ADD (Symptom1, Iman)
③ IF (Season, Spring) THEN ADD (Symptom2, Iman)
④ IF (Allergy, X) OR (Asthma, X) THEN ADD (Inhaler Needed, X)
⑤ IF (Inhaler Needed, X) THEN DEL (Happy X)
⑥ IF (Symptom1, X) THEN DEL (Swimming, X)
6
(Season, Spring)
(Symptom1, Iman)
(Symptom2, Iman)
(Allergy, Iman)
Inhaler Needed, Iman
Iman Ardekani
Final Working Memory
Inferencing Methods
(Season, Spring)
(Symptom1, Iman)
(Symptom2, Iman)
(Allergy, Iman)
Inhaler Needed, Iman
Iman Ardekani
Example for backward reasoning
Knowledge Base Rules:
① IF (Symptom1, X) AND (Symptom2, X) THEN ADD (Allergy, X)
② IF (Season, Spring) THEN ADD (Symptom1, Iman)
③ IF (Season, Spring) THEN ADD (Symptom2, Iman)
④ IF (Allergy, X) THEN ADD (Inhaler Needed, X)
⑤ IF (Asthma, X) THEN ADD (Inhaler Needed, X)
⑥ IF (Season, Spring) THEN ADD (Weather, Rainy)
⑦ IF (Year, 2010) THEN ADD (Economy, Bad)
Inferencing Methods
Rule
s Pri
ori
ty
Iman Ardekani
Let us assume that initially we have a user facts set (user data) with
and we want to prove that Iman needed an Inhaler that time.
Step 1:
Inferencing Methods
(Season, Spring)
(Year, 2012)
Inhaler Needed, Iman
(Allergy, Iman)
x 5
4
Iman Ardekani
Step 2: (we don’t need update the working memory)
Step 3:
(Season, Spring) is among the initial facts, so it is proven that (Inhaler
Need, Iman)
Inferencing Methods
1(Allergy, Iman)
(Symptom1, Iman)
(Symptom2, Iman)
(Symptom1, Iman)
(Symptom2, Iman) 2
3
(Season, Spring)
Iman Ardekani
Forward Reasoning vs. Backward Reasoning
Whether you use forward or backwards reasoning to solve a
problem depends on the properties of the rule set and initial facts.
Sometimes, if you have some particular goal (to test some
hypothesis), then backward reasoning will be much more
efficient, as you avoid drawing conclusions from irrelevant facts.
However, sometimes backward Reasoning can be very wasteful
- there may be many possible ways of trying to prove
something, and you may have to try almost all of them before
you find one that works.
Inferencing Methods
Iman Ardekani
Forward Reasoning may be better if you have lots of things you want to
prove, when you have a small set of initial facts; and when there tend
to be lots of different rules which allow you to draw the same
conclusion
Backward Reasoning may be better if you are trying to prove a single
fact, given a large set of initial facts, and where, if you used forward
reasoning, lots of rules would be eligible to fire in any cycle.
Inferencing Methods
The End