lecture 18. recap knowledge representation –semantic networks, facts, rules, logic: propositional...
TRANSCRIPT
Lecture 18
Recap
• Knowledge Representation– Semantic networks, Facts, Rules, Logic:
propositional and predicate logic
• Reasoning– Deductive (logical), inductive (generalization),
Abductive (approx backward e.g. carry umbrella), heuristic, monotonic
– Rules of inference: Modus Ponens, Modus Tolens, And-elimination, And-introduction
– Resolution Refutation
Course Outline
Introduction
Problem Solving
Algorithms
KRR
Expert Systems
Uncertainty
Learning
Planning
Advanced Topics
Conclusion
History and Evolution• Expert Systems at the forefront of AI rebirth.• Realization in the late 60 that the general framework of
problem solving was not enough to solve all kinds of problem. GPS separates knowledge from control
• Realization that specialized knowledge is a very important component of practical systems.
• People observed that systems that were designed for well-focused problems and domains, out performed more ‘general’ systems.
• Importance of expert systems as the earliest AI systems and the most used systems practically.
History and Evolution• One of the pioneering systems: DENDRAL (1960’s)• developed at Stanford for NASA• Chemical analysis of Martian soil for space mission• Given mass spectral data, determine molecular
structure.• In the laboratory, generate and test method used:
various possible hypothesis (molecular structures) are generated and tested (matched to data)
• Early realization that experts use certain heuristics to rule out certain options. Encode that knowledge in the system
• Moral: ‘Intelligent behavior is dependent, not so much on the methods of reasoning, but on the knowledge one has to reason with’ Durkin
History and Evolution• MYCIN( mid 70s)• Developed at Stanford to aid physicians in diagnosing
and treating patients with a particular blood disease. • Motivation for MYCIN
– Few experts, availability constraints– Immediate expertise often needed, life-threatening condition
• Tested in 1982. diagnosis on ten selected cases, along with a panel of human experts. Scored higher than human experts
• Importance:– Demonstrated that expert systems could be used for solving
practical problems– Pioneering work on the structure of ES (separate knowledge and
control), as opposed to Denderal, Mycin used the same structure that is now formalized for ESs.
History and Evolution• R1/XCON (late 70s) one of the most cited ES.• Developed by DEC( Digital Equipment
Corporation)• Computer configuration assistant• One of the most successful expert systems in
routine use.• Estimated saving is $25million per year• Example of how ES can increase productivity of
organization, by assisting existing experts
What is an Expert?
• What characterizes an ‘Expert’– Specialized knowledge in a certain area– Experience in the given area– Explanation of decisions– A skill set that enables the expert to translate
the specilized knowledge gained through experience into solutions.
– e.g. Skin specialist, heart specialist, car mechanic, architect, software designer.
What is an expert system?
• “A computer program designed to model the problem solving ability of a human expert” Durkin
• Aspects of the human expert that we wish to model– Knowledge– Reasoning
Comparison of a Human Expert and an
Expert System• Example: medical ES modelling a doctor,
discuss each of the following issues in that context.
• The ES outperforms the ‘average’ doctor and is available in regions where people may not have access to any medical care at all otherwise.
ComparisonIssues Human Expert Expert System
Availability Limited Always
Geographic location Locally available Anywhere
Safety considerations
Irreplaceable Can be replaced
Durability Depends on individual
Non-perishable
Performance Variable High
Speed Variable High
Cost High Low
Learning Ability Variable/High Low
Explanation Variable Exact
Replacement of Expert• Raises many eyebrows!• Not very practical in some situations, but feasible in
others• Consider drastic situations, e.g. where safety or location
is an issue, e.g. a mission to Mars.• Oil Exploration Company
– France based oil exploration company maintains a number of oil wells.
– Problem: drills become stuck. This typically occurs when the drill hits something that prevents the drill from turning.
– Often delays due to this cause huge losses (order of 100, 000 $ per day) until n expert can arrive at the scene to investigate.
– Solution: deploy an expert system. – A system called ‘Drilling Advisor’ (Elf-Aquitane 1983)
developed.
Assisting an Expert
• Most commonly found application• Aiding expert in routine task to increase
productivity• Aiding in managing complex situations
(May draw on experience of other individuals)
• Solves by recalling problems• XCON• Lending Advisor
How are Expert Systems Used?
• Diagnosis • Interpretation• Prescription• Design• Planning• Control• Instruction• Prediction• Simulation
Control Applications
• Adaptively govern/regulate the behavior of a system
• E.g. controlling a manufacturing process, or medical treatment
• Obtain data about current system state, reason and predict future state, recommend/execute adjustments
• Example: VM
Design
• Configure objects under given constraints.
• e.g. XCON
• Often use non-monotonic reasoning, because of implications of steps on previous steps.
• Eg. PEACE (Dincbas 1980) CAD tool to assist in design of electronic structures.
Diagnosis and Prescription
• Identify system malfunction points.• Have knowledge of possible faults as well as
diagnosis methodology extracted from technical experts
• E.g. diagnosing patients syptoms.• Malfunctioning electronic structures• Most diagnosis ES have a prescription
subsystem.• Such system are usually interactive, building on
user information to narrow down diagnosis.
Instruction and Simulation
• Guide the instruction of a student in some topic. Tutoring applications
• Example: GUIDON( Clancey 1979)– Instructs students in diagnosis of bacterial infections– Strategy: presents user with case (of which it has
solution), analyzes the students response. It compares the students approach to its own and directs student based on differences.
• Simulation– Model a process or system for operational study. – May be used along with tutoring applications
Interpretation
• ‘Produces an understanding of situation from given information’ Durkin
• Example FXAA (1988) provides financial assistance for a commercial bank. Looks at thousands of transactions and identifies irregularities. Automated audit.
Planning and Prediction
• E.g. recommending steps for a robot to carry out certain steps
• Cash management planning• SMARTPlan is a strategic market planning
expert (Beeral, 1993). Suggests appropriate marketing mix required to achieve economic success.
• Predictions systems infer likely consequences from a given situation. – Reason with time ordered information
Appropriate Domains for Expert Systems
• Can the problem be effectively solved by conventional programming?
• Suited to ill-structured problems• Is the domain well-bounded?
– e.g. a headache diagnosis system may eventually have to have domain knowledge of many areas of medicine, not easy to limit diagnosis to one conventional area.
• Practical Issues– Is some human expert willing to cooperate?– Is the experts knowledge especially uncertain and
heuristic? if so, ES may be useful
Lecture Summary
• Historical Perspective• Human Expert vs. Expert System• Why Expert Systems?
– Increase Availability– Reduce Cost– Permanence– Expertise drawn from multiple sources– Reliability– Fast Response– Steady and consistent– Explanation facility
• How are expert systems used• Examples of expert systems: SMARTPlan, R1/XCON,
MYCIN
Recap• Human Expert vs. Expert System• Why Expert Systems?
– Increase Availability– Reduce Cost– Permanence– Expertise drawn from multiple sources– Reliability– Fast Response– Steady and consistent– Explanation facility
• How are expert systems used (replace, assist)• Examples of expert systems: SMARTPlan, R1/XCON,
MYCIN
Application Areas
• Medicine (MYCIN)• Manufacturing
• Business (SMARTPlan)
• Engineering (R1/XCON) PEACE, CAD tool to assist in design of electronic structures.
• Agriculture
• Education (GUIDON)
Expert System Structure
• Lets look at how an expert (say a doctor) solves a problem:– Focused area of expertise– Specialized Knowledge (Long-term Memory, LTM)– Case facts (Short-term Memory, STM)– Reasons with these to form new knowledge– Solves the given problem
• Lets define the corresponding concepts in an Expert System.
Expert System Structure
ConclusionsSolution
Inference EngineReasoning
Case/Inferred Facts(stored in Working Memory)
Case Facts (stored in STM)
Domain Knowledge (stored in Knowledge Base)
Specialized Knowledge (stored in LTM)
DomainFocused Area of Expertise
Expert SystemHuman Expert
Expert System Structure
USER
Working Memory
Analogy: STM
-Initial Case facts
-Inferred facts
Knowledge Base
Analogy: LTM
- Domain Knowedge
Inference Engine
Expert System
Knowledge Base• Part of the expert system that contains the domain
knowledge– Problem facts, Rules– Concepts– Relationships
• One of the roles of the expert system designer is to act as a knowledge engineer.
• Knowledge acquisition bottleneck• You have to get information from the expert and encode
it in the knowledge base, using one of the knowledge representation techniques we discussed in KRR.
• As discussed, one way of encoding that knowledge is in the form of IF-THEN rules. We saw that such representation is especially conducive to reasoning.
Working Memory
• ‘Part of the expert system that contains the problem facts that are discovered during the session’ Durkin
• A session is one consultation.• During a consultation:
– User presents some facts about the situation.– These are stored in the working memory.– Using these and the knowledge in the knowledge
base, new information is inferred and also added to the working memory.
Inference Engine• Processor in an expert system that matches the facts
contained in the working memory with the domain knowledge contained in the knowledge base, to draw conclusions about the problem
• The inference engine works with the knowledge base and the working memory, and draws on both to add new facts to the working memory.
• If our knowledge is represented in the form of IF-THEN rules, the Inference Engine has the following mechanism
– Match given facts in working memory to the premises of the rules in the knowledge base, if match found, ‘fire’ the conclusion of the rule, i.e. add the conclusion to the working memory.
Expert System Example: Family
Knowledge BaseRule 1:
IF father (X, Y)AND father (X, Z)THEN brother (Y, Z)
Rule 2:IF father (X, Y)THEN payTuition (X, Y)
Rule 3:IF brother (X, Y)THEN like (X, Y)
Working Memoryfather (M.Tariq, Ali)father (M.Tariq, Ahmed)
brother (Ali, Ahmed)payTuition (M.Tariq, Ali)payTuition (M.Tariq,Ahmed)like (Ali, Ahmed)
Expert System Example: Raining
Knowledge BaseRule 1:
IF person(X)AND person(Y)AND likes (X, Y)AND sameSchool(X,Y)THEN
friends(X, Y)Rule 2:
IF friends (X, Y)AND weekend()THEN
goToMovies(X)goToMovies(Y)
Rule 3:IF goToMovies(X)AND cloudy()THEN
carryUmbrella(X)
Working Memoryperson (Ali)person (Ahmed)cloudy ()likes(Ali, Ahmed)sameSchool(Ali, Ahmed)weekend()
friends(Ali, Ahmed)goToMovies(Ali)goToMovies(Ahmed)carryUmbrella(Ali)carryUmbrella(Ahmed)
Recap
• The main components of an ES are– Knowledge Base (LTM)– Working Memory (STM)– Inference Engine (Reasoning)
Lecture Summary
• Explanation Facility
• Characteristics of Expert Systems
• Inference Mechanisms– Forward Chaining– Backward Chaining
Explanation Facility
• Module of an expert system, that allows transparency of operation, by providing the an explanation of how it reached the conclusion.
• In the above example, how does the expert system draw the conclusion that Ali likes Ahmed?
Explanation
Knowledge BaseRule 1:
IF father (X, Y)AND father (X, Z)THEN brother (Y, Z)
Rule 2:IF father (X, Y)THEN payTuition (X, Y)
Rule 3:IF brother (X, Y)THEN like (X, Y)
Working Memoryfather (M.Tariq, Ali)father (M.Tariq, Ahmed)
brother (Ali, Ahmed)payTuition (M.Tariq, Ali)payTuition (M.Tariq,Ahmed)like (Ali, Ahmed)
How?
Characteristics of an Expert System
• Separates Knowledge From Control
– Knowledge Base, Working Memory and Inference Engine
– Comparison to traditional programs that mix a program’s knowledge and control.
– Separation allows changes to the knowledge to be independent of changes in control and vice versa.
Characteristics of an Expert System
• Possesses Expert Knowledge– Embodies expertise of human expert
• Focuses Expertise– The larger the domain, the more complex the
expert system becomes– E.g. Car Diagnosis Expert (more easily
handled if we make separate ES components for engine problems, electricity problems, etc.)
Characteristics of an Expert System
• Reasons with Symbols (KR)
• Reasons Heuristically
• Permits Inexact Reasoning
• Is Limited to Solvable Problems
• Thrives on Reasonable Complexity
• Makes Mistakes
Programming vs Knowledge Engineering• Conventional Programming
– Sequential, three step process: Design, Code, Debug• Knowledge Engineering
– The process of building an expert system– Assessment, knowledge acquisition, design, testing,
documentation and maintainace.• Major differences
– Conventional programming focuses on solution– ES programming focuses on problem.– You don’t just program an ES and consider it ‘built’. It grows as
you add new knowledge– Once framework is made, addition of knowledge dictates growth
of ES.
People Involved in an Expert System Project
• Domain Expert– ‘A person who posses the skill and knowledge to solve a specific
problem in a manner superior to others’ Durkin– For out purposes, an expert should have:
• Expert Knowledge in the given domain• Good Communication Skills• Availability• Readiness to co-operate
• Knowledge Engineer– ‘A person who designs, builds and tests an Expert System’
Durkin– Plays key role. Identifies, acquires and encodes knowledge.
• End-user
Inference Strategies
• Forward Chaining
• Backward Chaining
Forward Chaining• How does a doctor go about diagnosing a patient.
– Asks for symptoms– Infers diagnosis from symptoms
• Data-driven approach• Forward Chaining: “Inference strategy that begins
with a set of known facts, derives new facts using rules whose premises match the known facts, and continues this process until a goal sate is reached or until no further rules have premises that match the known or derived facts.
• This approach is similar to modus ponens.
Doctor Example
• Rules– Rule 1IF The patient has deep coughAND We suspect an infectionTHEN The patient has Pneumonia– Rule 2IF The patient’s temperature is above 100THEN Patient has fever– Rule 3IF The patient has been sick for over a
fortnightAND The patient has a feverTHEN We suspect an infection
Doctor example
• Case facts:– Patients temperature= 103– Patient has been sick for over a month– Patient has violent coughing fits
• Approach– Add facts to working memory (WM)– Take each rule in turn and check to see if any of its
premises match the facts in the WM– When matches found for all premises of a rule, place
the conclusion of the rule in WM.– Repeat this process till no more facts can be added.
Doctor Example First Pass
Temp= 103
Sick for a month
Coughing fits
Unknown1, 2
Suspect infection
Temp= 103
Sick for a month
Coughing fits
Patient has fever
True, fire rule2, 1
Temperature>100
Temp= 103
Sick for a month
Coughing fits
True1, 1
Deep cough
Working MemoryStatusRule, premise
Doctor Example Second Pass
Temp= 103
Sick for a month
Coughing fits
Patient has fever
True3, 1
Sick for over fortnight
Temp= 103
Sick for a month
Coughing fits
Patient has fever
Infection
True, fire3, 2
Patient has fever
Temp= 103
Sick for a month
Coughing fits
Patient has fever
Unknown1, 2
Suspect infection
Temp= 103
Sick for a month
Coughing fits
Patient has fever
True1, 1
Deep cough
Working MemoryStatusRule, premise
Doctor Example Third Pass
Temp= 103
Sick for a month
Coughing fits
Patient has fever
Infection
Pneumonia
True, fire1, 2
Suspect infection
Temp= 103
Sick for a month
Coughing fits
Patient has fever
Infection
True1, 1
Deep cough
Working MemoryStatusRule, premise
Now no more facts can be added to the WM. Diagnosis: Patient has Pneumonia
Issues
• The forward chaining inference engine infers all possible facts from the given facts
• Has no way of distinguishing between important and unimportant facts. Therefore, equal time spent on trivial evidence as well as crucial facts
Conflict Resolution
• When happens when the premises of two rules match the given fact. Which should be fired? If we fire both, they may add conflicting facts. E.g– IF you are bored
AND you have no cash
THEN go to a friend’s place– IF you are bored
AND you have a credit card
THEN go watch a movie