Download
chap 2 rule based expert systems n.
Skip this Video
Loading SlideShow in 5 Seconds..
Chap 2: Rule-Based Expert Systems PowerPoint Presentation
Download Presentation
Chap 2: Rule-Based Expert Systems

Chap 2: Rule-Based Expert Systems

200 Views Download Presentation
Download Presentation

Chap 2: Rule-Based Expert Systems

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Chap 2: Rule-Based Expert Systems SCCS451 Artificial Intelligence Week 3 Asst. Prof. Dr. SukanyaPongsuparb Dr. SrisupaPalakvangsa Na Ayudhya Dr. BenjarathPupacdi

  2. Someone with deep knowledge and experience in a particular domain Software Program Expert System A software program with an expert’s knowledge and experience, so it can help us like an expert can.

  3. An Expert’s Knowledge • Knowledge is • An understanding of a subject or domain • The sum of what is currently known • An expert is • A person with deep knowledge / experience in some specific domain • A skillful person who can do things that others cannot • An Expert’s Knowledge • Too complex to be thoroughly represented as an algorithm • Can be simply and effectively represented as rules But, what are rules?

  4. If the crossing light is red then wait.

  5. If the crossing light is green then cross.

  6. If the crossing light is red, then wait. If the crossing light is green, then cross. If <…>, then <…>. Production Rule or Rule

  7. Rules as a Knowledge Representation Technique • In AI, rules are used as the most common knowledge representation. • A rule can be defined as an IF-THEN structure. • Rules provide some description of how to solve a problem. • Rules are relatively easy to create and understand.

  8. A Basic Syntax of a Rule ≥ 1 ≥ 1 <antecedent> THEN <consequent> IF object object value value • Examples: • IF the crossing light is red THEN action is wait. • IF ‘age of customer’ < 18 AND ‘cash withdrawal’ > 2000THEN ‘parent signature’ is required * antecedent == premise == condition * consequent == conclusion == action

  9. More Rule Examples Recommendation • IF customer bought “JAVA: How to program”AND customer bought “Network Programming”THEN recommend “Java Servlet Programming” • IF the person has a feverAND the person has a sore throatAND the person is coughingAND the person has a runny noseTHEN the person has a cold • IF the car is deadAND the fuel tank is emptyTHEN the action is refuel the carOR the action is get a taxi Heuristic Directive

  10. Different Types of Rules • Relation IF the fuel tank is empty THEN the car is dead 2.Recommendation IF the season is autumn AND the sky is cloudy AND the forecast is drizzle THEN the advice is ‘take an umbrella’ 3. Directive IF the car is dead AND the fuel tank is empty THEN the action is ‘refuel the car’

  11. Different Types of Rules – cont. 4. Strategy IF the car is dead THEN the action is ‘check out the fuel tank’; step 1 is complete IF step 1 is complete AND the fuel tank is fullTHEN the action is ‘check the battery’; step 2 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

  12. Someone with deep knowledge and experience in a particular domain Expert’s knowledge is encoded into the system via a set of rules. Software Program Rule-based Expert System A software program with an expert’s knowledge and experience, so it can help us like an expert can.

  13. Rule-based Expert System • A computer program capable of performing at the level of a human expert in a narrow problem area • The most popular expert systems are rule-based. • Applications in • Business • Engineering • Medicine • Geology Let’s see some real-world examples

  14. In developing an expert system… Programmer Domain Expert Expert System End User

  15. In developing an expert system… Project Manager Knowledge Engineer Programmer Domain Expert Expert System End User

  16. Expert System Development Team • Domain Expert • Most important player in the team • Knowledge Engineer • Design, build, and test the system • Pick/interact with the expert • Establish rules • Pick development team • Programmer– Actual coding of the system • Project Manager • Keep everything on schedule • Make sure all milestones are met • End User • Uses the system, e.g. doctors, chemists, etc. • Good user interface design is vital

  17. Expert System Shell • An expert system with the knowledge removed • All the user has to do is to add the knowledge in the form of rules and provide relevant data to solve the problem. • So instead of picking a programmer, the knowledge engineer may pick an expert system shell because the system does not have to be coded. The engineer only have to add the knowledge into the system. • For a small expert system, the project manager, knowledge engineer, or even the expert can be the same person.

  18. Expert System Shell

  19. A real-world example

  20. Another real-world example

  21. A closer look at a rule-based expert system… Project Manager Knowledge Engineer Programmer Domain Expert Expert System End User

  22. Basic Structure of a rule-based expert system A production system model

  23. Basic Structure of a rule-based expert system

  24. Basic Structure of a rule-based expert system • Knowledge base A set of rules obtained from the expert. When the condition part a rule is satisfied, the rule fires and the action part is executed. • Database A set of facts used to match against the condition parts of rules stored in the knowledge base • Inference Engine Carries out reasoning until the system reaches a solution. It links the facts with the rules.

  25. Basic Structure of a rule-based expert system • Explanation facilities Allow the user to ask the system how the conclusion is reached and why a specific fact is needed • User Interface Means of communication between a user seeking a solution to a problem and an expert system

  26. Complete Structure of a Rule-based Expert System

  27. Complete Structure of a Rule-based Expert System • External Interface Allow the system to work with external files or programs written in conventional languages • Developer Interface Includes knowledge base editor, debugging aids, tracing facilities • Runtime knowledge acquisition Asks for needed information whenever it is not available in the database. System continues when the information is obtained.

  28. Characteristics of an Expert System • An expert system is built to perform at a human expert level in a narrow, specialized domain. Thus, the most important characteristic of an expert system is its high-quality performance. No matter how fast the system can solve a problem, the user will not be satisfied if the result is wrong. • On the other hand, the speed of reaching a solution is very important. Even the most accurate decision or diagnosis may not be useful if it is too late to apply, for instance, in an emergency, when a patient dies or a nuclear power plant explodes.

  29. Characteristics of an Expert System • Expert systems apply heuristics to guide the reasoning and thus reduce the search area for a solution. • A unique feature of an expert system is its explanation capability. It enables the expert system to review its own reasoning and explain its decisions. • Expert systems employ symbolic reasoning when solving a problem. Symbols are used to represent different types of knowledge such as facts, concepts and rules.

  30. Can expert systems make mistakes? • An expert system is supposed to imitate a human expert. • Can a human expert make a mistake? • A human expert is only a human after all. • A human expert can make a mistake. An incorrect rule may be fed into the system. • Yes, expert systems can make mistakes.

  31. So conventional programs are better? • In theory, a conventional program always give the same correct solution. • But it can solve a problem if it has all the right data built into it. • When the data is incomplete or contains errors, a conventional program would provide no solution or an incorrect one. • An expert system, on the other hand, can work when the data is incomplete or fuzzy.

  32. 2 Main Differences between Expert Systems and Conventional Programs • Expert systems can work when data is incomplete or fuzzy. That is not the case for conventional programs. • In expert systems, knowledge is separated from its processing. • Expert system shells are commonly used. • Experts systems are easier to build and maintain. Since the knowledge and processing are separated, adding new knowledge, i.e. new rules, can be as easy as entering rules into a text editor.

  33. Comparison - 1

  34. Comparison - 2

  35. Someone with deep knowledge and experience in a particular domain Expert’s knowledge is encoded into the system via a set of rules. Software Program Rule-based Expert System A software program with an expert’s knowledge and experience, so it can help us like an expert can.

  36. How does the system use the rules? • Inference techniques are how an expert system uses the rules to derive to a solution. • There are two common inference techniques • Forward chaining • Backward chaining Today we will talk about Forward Chaining.

  37. First, some terminologies • Rule firing = adding an inferred fact to the database Database Fact: A is x Fact: B is y Fire Knowledge Base Rule: IF A is x THEN B is y

  38. Some terminologies (Cont.) • Inference chain = a sequence of the matching of the rule IF parts Database Fact: A Fact: C Fact: E Fact: B Fact: D Knowledge Base Rule 1: Y & D  Z Rule 2: X & B & E  YRule 3: A  X

  39. Some terminologies (Cont.) • Inference chain = a sequence of the matching of the rule IF parts Database Fact: A Fact: C Fact: X Fact: E Fact: B Fact: D Knowledge Base Rule 1: Y & D  Z Rule 2: X & B & E  YRule 3: A  X

  40. Some terminologies (Cont.) • Inference chain = a sequence of the matching of the rule IF parts Database Fact: A Fact: C Fact: X Fact: E Fact: B Fact: D Fact: Y Knowledge Base Rule 1: Y & D  Z Rule 2: X & B & E  YRule 3: A  X

  41. Some terminologies (Cont.) • Inference chain = a sequence of the matching of the rule IF parts Database Fact: A Fact: C Fact: X Fact: E Fact: B Fact: D Fact: Y Conclusion is Z Knowledge Base Rule 1: Y & D  Z Rule 2: X & B & E  YRule 3: A  X

  42. Inference Chain

  43. Forward Chaining • Forward chaining is the data-driven reasoning. • The reasoning starts from the known data and proceeds forward with that data. • Each time only the topmost rule is executed. • When fired, the rule adds a new fact in the database. • Any rule can be executed only once. • The match-fire cycle stops when no further rules can be fired or a goal is reached.

  44. Forward Chaining

  45. Forward Chaining • Forward chaining is a technique for gathering information and then inferring from it whatever can be inferred. • However, in forward chaining, many rules may be executed that have nothing to do with the established goal. • For example, CL • A real expert system has hundreds of rules. Some may be unrelated to the goal, so forward chaining may not be efficient.

  46. Forward Chaining Exercise • Media Advisor Expert System • The system gives advice on selecting a medium for delivering a training program based on the trainee’s job.

  47. Media Advisor Expert System • Scenario 1: • Traineeis a mechanical technician who maintains ahydraulic system. • System advices a workshop medium. The trainee could learn how basic hydraulic components operate, how to trouble shoot hydraulic problems as well as simple hydraulic repairs.

  48. Media Advisor Expert System • Scenario 2: • Traineeis an insurance clerk. • System advices a lecture/tutorial medium. The trainee could learn from a classroom about the tasks as well as about real applications.

  49. Media Advisor Expert System: Rules 1 – 8 IF THEN Knowledge Base