Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Intelligent Systems and Control Rule-based expert systems n Introduction, or what is knowledge? n Rules as a knowledge representation technique n The.

Similar presentations


Presentation on theme: "1 Intelligent Systems and Control Rule-based expert systems n Introduction, or what is knowledge? n Rules as a knowledge representation technique n The."— Presentation transcript:

1 1 Intelligent Systems and Control Rule-based expert systems n Introduction, or what is knowledge? n Rules as a knowledge representation technique n The main players in the development team n Structure of a rule-based expert system n Characteristics of an expert system n Forward chaining and backward chaining n Conflict resolution n Summary

2 Introduction, or what is knowledge? n Knowledge : theoretical or practical understanding of a subject or a domain. n sum of what is currently known, and apparently knowledge is power. n Domain expert: a person with deep knowledge (of both facts and rules) and strong practical experience in a particular domain. n In general, an expert is a skilful person who can do things other people cannot. n The area of the domain may be limited.

3 n The human mental process is internal, and it is too complex to be represented as an algorithm. n However, most experts express knowledge in form of rules: IFthe ‘traffic light’ is green THENthe action is go IFthe ‘traffic light’ is red THENthe action is stop

4 n How do you represent knowledge in AI? n Commonly type of knowledge representation: IF-THEN structure relates given information (facts) in IF part to some action in THEN part. n A rule provides some description of how to solve a problem. n Rules are relatively easy to create and understand. n IF part: antecedent (premise or condition) THEN part: consequent (conclusion or action). Rules as a knowledge representation technique

5 IF  antecedent  THEN  consequent  n A rule can have multiple antecedents joined by the keywords AND (conjunction), OR (disjunction) or both. IF  antecedent 1  AND  antecedent 2  OR  antecedent 2 ... AND  antecedent n  OR  antecedent n  THEN  consequent 

6 n The antecedent incorporates : an object (linguistic object) and its value linked by an operator. n The operator identifies the object and assigns value. n Operators, e.g. is, are, is not, are not assign a symbolic value to a linguistic object. n Expert systems can also use 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

7 Rules can represent relations, recommendations, directives, strategies and heuristics: n Relation IFthe ‘fuel tank’ is empty THENthe car is dead n Recommendation IFthe season is autumn ANDthe sky is cloudy ANDthe forecast is drizzle THENthe advice is ‘take an umbrella’ n Directive (control) IFthe car is dead ANDthe ‘fuel tank’ is empty THENthe action is ‘refuel the car’

8 n Strategy IFthe car is dead THENthe action is ‘check the fuel tank’; step1 is complete IFstep1 is complete ANDthe ‘fuel tank’ is full THENthe action is ‘check the battery’; step2 is complete n Heuristic IFthe spill is liquid ANDthe ‘spill pH’ < 6 ANDthe ‘spill smell’ is vinegar THENthe ‘spill material’ is ‘acetic acid’

9 The main players in the development team n Members of the expert system development team: n domain expert n knowledge engineer n programmer n project manager n end-user n The success of expert system entirely depends on how well members work together.

10 The main players in the development team

11 Domain expert :knowledgeable/skilled person capable of solving problems in a domain (specific area). has greatest expertise in a given domain. This expertise is to be captured in the expert system. Expert communicates knowledge, participates in expert system development. Domain expert is the most important player in expert system development team.

12 n The knowledge engineer: designs, builds and tests testing an expert system: n interviews domain expert to find out how a particular problem is solved. n establishes what reasoning methods expert uses to handle facts and rules and decides how to represent them in the expert system. n chooses some development software or an expert system shell, or looks at programming languages for encoding the knowledge. n tests, revising and integrates the expert system into the workplace.

13

14 n Programmer: n Writes the actual programming, describing domain knowledge in terms that a computer can understand. n Has skills in conventional programming n symbolic programming in such AI languages as LISP, Prolog n some experience in the application of different types of expert system shells are useful.

15 n Project manager: leader of the expert system development team, responsible for keeping the project on track. n makes sure that all deliverables and milestones are met, interacts with expert, knowledge engineer, programmer and end-user. n end-user: a person who uses expert system when it is developed. n user interface of the expert system is also vital for the project’s success; end-user’s contribution here can be crucial.

16 n Production system model: foundation of the modern rule-based expert systems. n The production model is based on the idea that humans solve problems by applying their knowledge (expressed as production rules) to a given problem. n The production rules are stored in the long-term memory n Problem-specific information or facts in the short- term memory. Structure of a rule-based expert system

17 Production system model

18 Basic structure of a rule-based expert system

19 n knowledge base: contains domain knowledge useful for problem solving. In a rule-based expert system, the knowledge is represented as a set of rules. n Each if-then rule specifies a relation, recommendation, directive, strategy or heuristic n When condition (if) part of a rule is satisfied, rule is said to fire and the action part is executed n Database includes a set of facts used to match against the IF (condition) parts of rules stored in the knowledge base (e.g. customer information)

20 n Inference engine: carries out reasoning to reach a solution. It links rules in knowledge base with facts in database. n Explanation facilities: how a particular conclusion is reached and why a specific fact is needed. n User interface: means of communication between a user seeking a solution to problem and an expert system.

21 Complete structure of a rule-based expert system

22 n Expert system (ES) is built to perform at a human expert level in a narrow, specialised domain. n The most important characteristic of ES is high- quality performance. n 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, e.g. in an emergency. Characteristics of an expert system

23 n ES apply heuristics to guide the reasoning and reduce search area for a solution. n A unique feature of an expert system is its explanation capability. n Expert systems employ symbolic reasoning when solving a problem. Symbols are used to represent different types of knowledge such as facts, concepts and rules.

24 Can expert systems make mistakes? n Even a brilliant human expert can make mistakes. Therefore ES built to perform at a human expert level also should be allowed to make mistakes. n But we still trust experts, even we recognise that their judgements are sometimes wrong. Likewise, at least in most cases, we can rely on solutions provided by expert systems, but mistakes are possible and we should be aware of this.

25 n In ES, knowledge is separated from its processing ( knowledge base and the inference engine are split up). n A conventional program is a mixture of knowledge and the control structure to process this knowledge. This leads to difficulties in understanding and reviewing the program code, as any change to the code affects both the knowledge and its processing. n When an ES shell is used, a knowledge engineer simply enters rules in the knowledge base. Each new rule adds some new knowledge and makes the expert system smarter.

26 Comparison of expert systems with conventional systems and human experts

27 Comparison of expert systems with conventional systems and human experts (Continued)

28 Forward chaining and backward chaining n The matching of rule IF parts to the facts (rule firing) produces inference chains. n The inference chain indicates how an expert system applies the rules to reach a conclusion.

29 Inference engine cycles via a match-fire procedure

30 An example of an inference chain

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

32 Example A = temperature > 35 oC B = Window is closed C = humidity is high E = Oxygen is low X = AC is OFF L = It is raining Y = Condition is bad

33 Forward chaining

34 n Forward chaining is a technique for gathering information and then inferring from it whatever can be inferred. n However, in forward chaining, many rules may be executed that have nothing to do with the established goal. n Therefore, if our goal is to infer only one particular fact, the forward chaining inference technique would not be efficient.

35 Backward chaining n Backward chaining is the goal-driven reasoning. n In backward chaining, ES has the goal (a hypothetical solution) and inference engine attempts to find evidence to prove it. n First, knowledge base is searched to find rules that might have the desired solution. n Such rules must have the goal in their THEN (action) parts. If such a rule is found and its IF (condition) part matches data in the database, then the rule is fired and the goal is proved. However, this is rarely the case.

36 Backward chaining n Thus inference engine puts aside rule it is working with (the rule is said to stack) and sets up a new goal, a subgoal, to prove the IF part of this rule. Then the knowledge base is searched again for rules that can prove the subgoal. n The inference engine repeats the process of stacking the rules until no rules are found in the knowledge base to prove the current subgoal.

37 Example B = Window is closed E = Fan is OFF X = AC is ON Y = Temp is medium Z = Condition is good

38 Backward chaining

39 n 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. n However, if your expert begins with a hypothetical solution and then attempts to find facts to prove it, choose the backward chaining inference engine. Choosing between forward and backward chaining

40 n Rule 1: IFthe ‘traffic light’ is green THENthe action is go n Rule 2: IFthe ‘traffic light’ is red THENthe action is stop n Rule 3: IFthe ‘traffic light’ is red THENthe action is go Conflict resolution

41 n Rule 2 and Rule 3, have same IF part. Thus both of them can fire when the condition part is satisfied. These rules represent a conflict set. n The inference engine must determine which rule to fire from such a set - this is called conflict resolution.

42 n In forward chaining, BOTH rules would be fired. Rule 2 is fired first as the topmost one, and as a result, its THEN part is executed and linguistic object action obtains value stop. n However, Rule 3 is also fired because the condition part of this rule matches the fact ‘traffic light’ is red, which is still in the database. As a consequence, object action takes new value go.

43 Methods used for conflict resolution n Fire rule with highest priority. In simple applications, place the rules in a priority order in the KB - works well for ES with around 100 rules. Rule 1: Priority 100 if Infection is Meningitis AND Patient is Child THEN Prescription Number_1 Rule 2: Priority 90 if Infection is Meningitis AND Patient is Adult Then Prescription Number_2

44 Fire most specific rule - also known as longest matching strategy. assumes a specific rule processes more information than a general one. Rule 1: IF season is Fall AND sky is cloudy AND forecast is rain THEN advice is Stay home Rule 2: IF season is Fall THEN advice is take umbrella

45 n Fire rule that uses data most recently entered in database - needs time tags attached to each fact in database. n In the conflict set, ES first fires rule whose antecedent uses data most recently added to database. Rule 1: IF forecast is rain (entered 2:00 pm today) THEN advice is take umbrella Rule 2: IF weather is wet (entered 3:12 pm today) THEN advice is stay home

46 Metaknowledge n Metaknowledge: knowledge about knowledge. Metaknowledge is knowledge about the use and control of domain knowledge in an ES. n In rule-based ES, metaknowledge is represented by metarules. A metarule determines a strategy for use of task-specific rules in the expert system.

47 n Metarule 1: Rules supplied by experts have higher priorities than rules supplied by novices. n Metarule 2: Rules governing rescue of human lives have higher priorities than rules concerned with dealing with traffic jam. Metarules

48 n Natural knowledge representation. An expert usually explains his rules as: “In such-and-such situation, I do so-and-so”. These expressions can be represented quite naturally as IF-THEN production rules. n Uniform structure. Production rules have the uniform IF-THEN structure. Each rule is an independent piece of knowledge. Advantages of rule-based expert systems

49 n Separation of knowledge from its processing: effective separation of the KB from inference engine - possible to develop different applications using same ES shell. n Dealing with incomplete and uncertain knowledge. Most rule-based ES are capable of representing and reasoning with incomplete and uncertain knowledge. Advantages of rule-based ES

50 n Opaque relations between rulesindividual production rules are relatively simple and self- documented, their logical interactions within the large set of rules may be opaque. Rule-based systems make it difficult to observe how individual rules serve the overall strategy. n Ineffective search strategy: an exhaustive search through all the production rules during each cycle. Expert systems with a large set of rules (over 100 rules) can be slow, and thus large rule-based systems can be unsuitable for real-time applications. Disadvantages of rule-based expert systems

51 n Inability to learn - rule-based ES do not have an ability to learn from the experience. n Unlike a human expert, who knows when to “break the rules”, an expert system cannot automatically modify its knowledge base, or adjust existing rules or add new ones. The knowledge engineer is still responsible for revising and maintaining the system. Disadvantages of rule-based expert systems


Download ppt "1 Intelligent Systems and Control Rule-based expert systems n Introduction, or what is knowledge? n Rules as a knowledge representation technique n The."

Similar presentations


Ads by Google