1 / 57

Rule-Based Expert Systems

Rule-Based Expert Systems. CPS 4801. About the midterm exam. Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March 15, before spring break. Strong AI vs. Weak AI. Strong AI is artificial intelligence that matches or exceeds human intelligence.

davina
Download Presentation

Rule-Based Expert Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Rule-Based Expert Systems CPS 4801

  2. About the midterm exam • Exam on March 13 Tuesday (Tentatively) • Review on March 8 Thursday • Grades will be out by March 15, before spring break.

  3. Strong AI vs. Weak AI • Strong AI is artificial intelligence that matches or exceeds human intelligence. • “Artificial general intelligence” • The weak AI hypothesis: machines can demonstrate intelligence, but do not necessarily have a mind, mental states or consciousness.

  4. “General purpose” intelligence vs. Domain-specific intelligence • “General purpose” intelligence • Understand how the world works in general • requires vast amounts of knowledge about the world. • Domain-specific intelligence • Restricted to a particular domain • Knowledge is deep, but not wide. • Avoids the world knowledge problem, and is much more feasible for implementation.

  5. Expert Systems • Domain expert: A person who has deep knowledge (in the form of facts and rules) and strong personal experience in a particular domain. • An expert system performs at a human expert level in a narrow and specialized domain.

  6. Medical Diagnostics • simple expert system • http://familydoctor.org/familydoctor/en/health-tools/search-by-symptom.html

  7. DXplain DXplainfirst launched in 1986 • Users enter clinical information, then ask DXplain to provide diagnostic decision support • DXplainknowledge base (KB) covers ~2400 diseasesand over 5000 clinical findings (signs, symptoms, epidemiologic data, laboratory findings, etc.) • Demo: http://dxplain.mgh.harvard.edu/dxp/dxp.sdemo.pl • Info: http://lcs.mgh.harvard.edu/projects/dxplain.html

  8. GIDEON Global Infectious Disease and Epidemiology Network • Online application that supports the diagnosis and treatment of infectious diseases • Organized by country of origin • Updated weekly • Info: http://www.gideononline.com/

  9. Characteristics of Expert Systems • Often a tradeoff between accuracy and speed. • Expert systems apply heuristics to guidethe reasoning process.

  10. Reasoning + Knowledge + Facts • Human expertise typically breaks down into: • Ability to reason • Knowledgeabout the domain • Factsabout the particular situation (e.g. this patient’s symptoms) • Expert Systems use symbolic reasoning to solve problems • Symbols represent facts and rules (i.e. knowledge)

  11. Characteristics of Expert Systems • Expert systems provide explanation facilities to display reasoning to users. • How did you come to that conclusion or diagnosis? • E.g., Why do you think I have a migraine? • Well, you have frequent, intense pain in the temple area, associated with nausea. Also, you aren’t taking any medications that are likely to produce these symptoms.

  12. Characteristics of Expert Systems • Expert systems make mistakes • So do human experts! • Users have to be aware of this possibility

  13. Rules • Production rules (most commonly used type) • IF the ‘traffic light’ is green • THEN the action is go • IF the ‘traffic light’ is red • THEN the action is stop

  14. Rules • Any rule consists of two parts: the IF part, called the antecedent (premise or condition) and the THEN part called the consequent (conclusion or action). • IF <antecedent> • THEN <consequent> • Alternate syntax: • <antecedent>  <consequent>

  15. Multiple antecedents • A rule can have multiple antecedents joined by the keywords AND (conjunction), OR (disjunction) or a combination of both. • IF animal is horse-shaped • AND animal has stripes • THEN animal is zebra • IF animal is hippo • OR animal is lion • THEN animal is dangerous

  16. Multiple consequents • Multiple consequents are possible, and are connected by conjunctions. • IF tsunami alarm is sounding • AND date is not first Monday in month • THEN Condition is dangerous • ANDAdvice is “move away from the ocean”

  17. Structure of antecedents and consequents • The antecedent of a rule incorporates two parts: an objectand its value. The object and its value are linked by an operator. • Operators • is, are, is not, are not are used to assign a symbolic value to a linguistic object. • mathematical operators to define an object as numerical and assign it to the numerical value. • IF ‘age of the customer’ < 18 • AND ‘cash withdrawal’ > 1000 • THEN ‘signature of the parent’ is required

  18. Semantics of rules • Relation IF the ‘fuel tank’ is empty THEN the car is dead • Recommendation IF the season is autumn AND the sky is cloudy AND the forecast is drizzle THEN the advice is ‘take an umbrella’ • Directive IF the car is dead AND the ‘fuel tank’ is empty • THEN the action is ‘refuel the car’

  19. Strategy IF the car is dead THEN the action is ‘check the fuel tank’; step1 is complete IF step1 is complete AND the ‘fuel tank’ is full THEN the action is ‘check the battery’; step2 is complete • Heuristic IF the spill is liquid AND the ‘spill pH’ < 6 AND the ‘spill smell’ is vinegar THEN the ‘spill material’ is ‘acetic acid’

  20. So what are facts?

  21. Rule-based expert system • An expert system whose knowledge base (KB) contains a set of production rules.

  22. The Main Players In The Expert System Development Team

  23. Structure of a rule-based expert system

  24. Inference Engine • domain knowledge: IF-THEN rules • data: facts about the current situation • When the IF (condition) part of the rule matches a fact, the rule is fired. • The matching of the rule IF parts to the facts produces inference chains(new facts are discovered).

  25. Inference engine algorithm • Inference engine compares each rulewith facts it already “knows” about,matching the antecedent (IF condition) • When the antecedent matches one ormore known facts, the rule fires andits consequent (THEN) is executed

  26. Inference Chain • An inference chain indicates how an expert system applies rules to reach a conclusion given: A, B, D, E

  27. Inference Chain • An inference chain indicates how an expert system applies rules to reach a conclusion given: A, B, D, E

  28. Inference Chain • An inference chain indicates how an expert system applies rules to reach a conclusion given: A, B, D, E

  29. Two approaches • Forward chaining • Backward chaining

  30. Forward chaining (data-driven search) • Starts with known data (facts). • Firethe rules that have an antecedent that matches facts in the database, and add any resulting facts to the database. • Each rule can fire only once. • Each time only the topmost rule is executed. • When no more rules can fire, stop.

  31. Forward Chaining

  32. Forward Chaining Exercise 1 • Use forward chaining to prove the following:

  33. Forward Chaining Exercise 1 • Facts: • Rules fired: • Use forward chaining to prove the following: A B C D E A B C D E X Y Q R S T Z A B C D E X A B C D E X Y A B C D E X Y Q A B C D E X Y Q R A B C D E X Y Q R S A B C D E X Y Q R S T • Proven: A  X A  Y A & D  Q Q  R R  S Q  T T  Z Z

  34. Forward Chaining Exercise 2 • Use forward chaining to prove the following:

  35. Forward Chaining Exercise 2 • Facts: • Rules fired: • Use forward chaining to prove the following: A B C D E X Y Q R S T Z • Cannot prove: • No more rules left to fire A  X A  Y A & D  Q Q  R R  S Q  T T  Z L

  36. Forward Chaining +/- • Good for answering “What is the situation?” kind of questions (e.g. “What kind of animal is this?”) • Fires a lot of rules, and generates a lot of facts that might be irrelevant to the problem • If our goal is to infer only one particular fact, the forward chaining inference technique would not be efficient.

  37. Backward chaining (goal-driven search) • System has hypothetical solution(s) (e.g. “The patient has type I diabetes”), and tries to prove it. • Find rules that consequents that match the goal. • If antecedents match the facts, stop. • If not, make the antecedents the new subgoals, and repeat.

  38. Backward chaining algorithm • At the first iteration, rule(s) with thedesired goal in the consequent are selected • Stack up and attain many subgoals until.... • If the antecedent matches known data,the rule is fired and the goal is proven • Otherwise, if no rules remain,the desired goal is not proven

  39. Backward chaining

  40. Backward chaining

  41. Backward chaining Exercise 1 • Use backward chaining to prove the following:

  42. Backward chaining Exercise 1 • Facts: • Stack of rules: (subgoals) • Rules fired: • Use backward chaining to prove the following: A B C D E Q T Z A B C D E • Proven: A & D  Q Q  T T  Z Z A & D  Q Q  T T  Z

  43. Backward chaining Exercise 2 • Use backward chaining to prove the following:

  44. Backward chaining Exercise 2 • Facts: • Stack of rules: (subgoals) • Cannot prove: • Subgoal N cannot be proven • Use backward chaining to prove the following: A B C D E N  L L

  45. Backward chaining +/- • Efficient way to prove or disprove a particular hypothesis. • Sometimes more efficient with a small set of hypotheses • Less efficient than forward chaining if large number of hypotheses

  46. Forward vs. backward chaining • If an expert first needs to gather some information and then tries to infer from it whatever can be inferred, choose the forward chaining inference engine. • However, if your expert begins with a hypothetical solution and then attempts to find facts to prove it, choose the backward chaining inference engine.

  47. Forward vs. backward chaining • Forward chaining: best for analysis and interpretation (e.g. DENDRAL (1971) determines molecular structure of soil sample). • Backward chaining: best for diagnosis (e.g. MYCIN (1976) diagnoses infectious blood diseases).

  48. Forward + backward chaining • Most real expert systems use both. • Primary inference is backward chaining. • Switches to forward chaining when new data is added. • Minimizes pointless queries to user (backward chaining), but exploits any facts that are acquired.

  49. Conflict resolution • Rules with identical antecedents (IF conditions) can cause conflicts via their consequents (THEN clauses) • Rule 1: IF the ‘traffic light’ is green THEN the action is go • Rule 2: IF the ‘traffic light’ is red THEN the action is stop • Rule 3: IF the ‘traffic light’ is red THEN the action is go

More Related