46
Expert Systems Part 1 1 IE 469 Manufacturing Systems 469 ع ي ن ص ت ل ا م ظ ن ع ي ص

Expert Systems Part 1

  • Upload
    midori

  • View
    50

  • Download
    0

Embed Size (px)

DESCRIPTION

IE 469 Manufacturing Systems 4 69 صنع نظم التصنيع. Expert Systems Part 1. Outline. Introduction to Expert Systems (ES) Components of an ES Building an ES Implementations/References. Introduction. Definitions - PowerPoint PPT Presentation

Citation preview

Page 1: Expert  Systems  Part 1

1

Expert Systems Part 1

IE 469 Manufacturing Systems

صنع نظم التصنيع 469

Page 2: Expert  Systems  Part 1

2

Outline

• Introduction to Expert Systems (ES)• Components of an ES• Building an ES• Implementations/References

Page 3: Expert  Systems  Part 1

3

Introduction• Definitions

• A computer program designed to model the problem-solving ability of a human expert.

Expert Systems Design and Development by Durkin

• A model and associated procedure that exhibits, within a specific domain, a degree of expertise in problem solving that is comparable to that of a human expert.

Introduction to Expert Systems by Ignizio

• A computer system which emulates the decision-making ability of a human expert.

Expert Systems: Principles and Programming by Giarratano and Riley

Page 4: Expert  Systems  Part 1

4

Criteria for Building an Expert System• Does a human know how to solve the problem?

– If no human expert exists, it is not possible to develop rules describing the problem.

– The techniques of solving the problem must be known and defined in order to create an expert system

• Does the problem have a definable solution?– ES shells are designed to select one or more possible solutions from a group.– If all of the possible solutions cannot be specified, writing rules to solve the

problem is difficult.• Is the level of understanding and scope appropriate?

– A problem that has too wide a scope or requires too deep a level of understanding is not appropriate for an ES.

– An ES solves specific problems.• Has the technique for solving the problem been

documented?– Solution may be a decision tree, manual procedure, written instructions, etc.– Well-defined problems can be easily converted to an ES.

Page 5: Expert  Systems  Part 1

5

Level of Understanding

Specific

Wide

SCOPE

Limited Deep

Problems

Level of Understanding

ExpertSystems

Defining the problem to fall within the shaded area of the graph is very important - Problem should NOT have too large a scope or too deep a level of understanding.

Page 6: Expert  Systems  Part 1

6

Why Use an Expert System?

• Preserves knowledge– Builds up the corporate memory of the firm

• Frees expert from repetitive, routine jobs. • Provide novice with expert advice on a specific subject.• Wide distribution of rare human knowledge • Aids in training new employees.• Improves worker productivity.• Provides second opinion in critical situations.

– Especially valuable when tired or under stress

Page 7: Expert  Systems  Part 1

7

Technical Advantages of an Expert System

• Rapid prototype development• Easier verification of software• Easier maintenance of software• Explains its reasoning in English to user when requested• Truly self documenting software• Easier to learn to build rule-based expert systems• Inexpensive technology• Automated consistency checking of knowledge in the knowledge base

Page 8: Expert  Systems  Part 1

8

Comparison of a Human Expert and an Expert System

Factor Human Expert Expert System

Time availability Workday AlwaysGeographic Local Any where availabilitySafety Irreplaceable ReplaceablePerishable Yes NoPerformance Variable ConsistentSpeed Variable Consistent (usually faster)Cost High Affordable

Page 9: Expert  Systems  Part 1

9

Disadvantages of an ES• Brittleness– only have access to highly specific domain knowledge– cannot fall back on more general knowledge when

needed• Lack of Meta-Knowledge

– do not have sophisticated knowledge about their own operation

– cannot reason about their own scope and limitations• Knowledge Acquisition is a bottleneck in applying ES technology to new domains• Validation of an ES is difficult• Expert Systems can make mistakes

Page 10: Expert  Systems  Part 1

10

When to use an Expert System?

Ultimate users agree that payoff will be high Application is knowledge intensive A human expert exists Not a natural-language intensive application A wide range of test cases are available Neither creativity nor physical skills are required

Page 11: Expert  Systems  Part 1

11

Personnel Involved

• Domain Expert– a person who posses some skills that allow him/her to

draw upon past experiences and quickly focus on the core of a given problem.

• User– a person who will use the expert system and ultimately

benefit from the domain expert’s knowledge. • Knowledge Engineer

– a person who designs, develops, and implements expert systems (or other artificial intelligent applications).

Page 12: Expert  Systems  Part 1

12

Phases in Expert System DevelopmentPhase 1

Assessment

Phase 2

Knowledge Acquisition

Phase 3

Design

Phase 4

Test

Phase 5

Documentation

Phase 6

Maintenance

Requirements

Knowledge

Structure

Evaluation

Product

Refinements

Explorations

Reformulations

Page 13: Expert  Systems  Part 1

13

A Hierarchical Model of Intelligence

Wisdom

Knowledge

Information

Data Context+

Vision+Experience+

Page 14: Expert  Systems  Part 1

14

A Knowledge Engineer’s View of Intelligence

Context+

Analysis/Reduction+Rules of Thumb+

Knowledge

Facts

”Raw” Data

Decisions

Page 15: Expert  Systems  Part 1

15

Components of an Expert System• Inference Engine

– Reasons about knowledge– Explains its reasoning– Helps programmer build correct/consistent expert systems

• Knowledge Base– Base is represented in easy to read English sentences– Order of rules is not critical

• The expert system shell ( EXSYS) contains an existing inference engine• The knowledge base is the only part of the system the programmer needs to develop

Page 16: Expert  Systems  Part 1

16

Knowledge Base

• Contains the domain-specific, problem solving knowledge. There are two basic approaches.

– Rule: If-then statements that attempt to replicate the thought process used by the expert. (Known as Rule-Based Reasoning)

– Cases: Collection of previous solutions for situations and generalizes a solution for current situation (Known as Case-Based Reasoning)

Note: there are other ways to represent knowledge

Page 17: Expert  Systems  Part 1

17

Composition of a Rule

IFConditions

THENConditions

and ChoicesELSE

Conditionsand Choices

NOTE:____________REFERENCE______

Page 18: Expert  Systems  Part 1

18

IFIF part is simply a series of test conditions, expressed as Englishsentences or algebraic expressions:

Ex: Today is Wednesday or [X] > 1

The first rule will only be true if today is Wednesday.The second rule will only be true if the variable X > 1.

Test is made by information:provided by the userderived by other rulesobtained from other sources

Tests can be derived with other boolean operators, i.e. AND or OR

Page 19: Expert  Systems  Part 1

19

THENContains conditions similar to if statements, but they are not tests.

They are statements of fact.

IF “today is Wednesday” may or may not be true.

Then “today is Wednesday” is a valid fact if the IF conditions are true.

The valid fact is then added to the knowledge base within the system.

THEN condition may also contain statements that assign a value or assigned value to a numeric or string value.

Page 20: Expert  Systems  Part 1

20

ELSE

ELSE part is the same as the THEN part and is applied if anyof the IF conditions are FALSE.

ELSE part is optional and not needed in most rules.

Page 21: Expert  Systems  Part 1

21

Example of Rule-Based Reasoning

• Rule-based Reasoning– Uses if-then rules:

1. IF you are 150 yds. away, THEN select the 7-iron.2. IF you are in the rough, THEN use the next lower-

numbered club.– Facts on current situation:

• 150yds, on rough, sunny day– Applying the above two rules you will get 6-iron

as output.

Page 22: Expert  Systems  Part 1

22

Another Way to Represent the Knowledge Base:

• Case-based Reasoning– Looks at all related facts as a “case”– Reasons about the differences.– Example. Step 1, Case base from previous games of experts:

• Case 1: (170 yds., in fairway) Answer: 5-iron.• Case 2: (160 yds., in fairway) Answer: 6-iron.• Case 3: (150 yds., in fairway) Answer: 7-iron.• Case 4: (170 yds., in rough) Answer: 4-iron

Page 23: Expert  Systems  Part 1

23

Another Way to Represent the Knowledge Base (Cont.)

• Case-Based Reasoning (second step):– Apply rules about what doesn’t match the case:

a. If the situation is “fairway” and the case is for “rough”,

then use the next higher-numbered club.b. If the situation is “rough” and the case is for “fairway”,

then use the next lower-numbered club.

– Since the situation is “rough” and Case 3 (the best matching case) is for “fairway”, • apply the b. rule above to derive our answer of 6-iron.

Page 24: Expert  Systems  Part 1

24

Reasoning Within an ES

• When to use Rule-Based Reasoning?– When there is a lot of specific expert knowledge on a particular subject and the expert can solve the problem

sequentially.– When an explanation or an audit trail of the solution is required.

• When to use Case-Based Reasoning?—When the user wants to browse similar cases.—When you have lots of typical situations or cases for the

knowledge base.

Page 25: Expert  Systems  Part 1

25

Confidence Modes• One of the most powerful parts of an expert system is being able to create rules which state that an answer is probably, but not definitely, true.

• Process accomplished by assigning confidence modes

• Rule of Thumb -- Use the simplest one that will do the job!

• Ways to assign confidence modes:– 0-10– -100 to 100– Increment/decrement system– Custom formula

Page 26: Expert  Systems  Part 1

26

Makes Noise?

Tree Structured Rules

Model: items of a desk to include a telephone, a computer, a pencil, legal paper, and floppy disks.

Yes

No

Black?

Yellow?

Black?

White?

Telephone

Computer

Floppy Disk

Legal Paper

Pencil

Rectangle?

Cylindrical?

Color?

Color?

Shape?

Start

Page 27: Expert  Systems  Part 1

27

Converting Tree Structure to an Expert System

• Rule 1: IF the item makes noise AND the color is black– THEN telephone - Confidence 9/10

• Rule 2: IF the item makes noise AND the color is white – THEN computer - confidence 10/10

• Rule 3: IF the item does not make noise AND the color is black– THEN floppy disk - confidence 10/10

• Rule 4: IF the item does not make noise AND the color is yellow AND the shape is rectangular – THEN legal paper - confidence 7/10

• Rule 5: IF the item does not make noise AND the color is white AND the shape is cylindrical – THEN pencil - confidence 8/10

Page 28: Expert  Systems  Part 1

28

User

User interfacemay employ:

question-and-answer,

menu-driven,

naturallanguage,

graphicsuser

interface

Knowledge-baseEditor

ExplanationSubsystem

Inference Engine

GeneralKnowledge Base

Case-specificData

Architecture of Expert SystemsKnowledge Engineer

Page 29: Expert  Systems  Part 1

29

Inference Engine Control Strategies

• Control Strategies for Execution of Rules– Backward Chaining

• Begins with a goal and works backwards towards the initial conditions

– Forward Chaining• Starts with available information and then draws

conclusions

Page 30: Expert  Systems  Part 1

30

Which Strategy to Use?

• When to use backward chaining?– When a specific conclusion or set of conclusions is

being sought or tested.– Common use: Classification– Ex. Which one of “these” cars should I buy?

• When to use forward chaining?—When you want all the possible conclusions.—Common use: Diagnosis—Ex. What job positions can I apply for?

Page 31: Expert  Systems  Part 1

31

Backward Chaining• Runs rules in a “goal-driven” way.

• If a piece of information is needed, the program will automatically check all of the rules to see if there is a rule that could provide the needed information.

• The program will then “chain” to the new rule before completing the first rule.

• The new rule may require information that can be found in yet another rule.

• Logic of why the information is needed goes backward through the chain of rules.

Page 32: Expert  Systems  Part 1

32

Backward Chaining ExampleRule 1:IF

The day is hotTHEN Go to the beach

The program needs to know if the day is hot. Program will automatically check allrules to see if there is a rule that tells if the day is hot.

Rule 35:IF

It is summerand It is sunnyTHEN

The day is hot.If there are rules in the system that tests if it is summer or that it is sunny, it will test those rules before rule 35 and test rule 35 before rule 1. The chain will continue until all applicable rules are tested.

Page 33: Expert  Systems  Part 1

33

Forward Chaining• Data-Driven way to run the rules.

• In pure forward chaining rules are simply tested in the order they occur based on available data.

• If information is needed, other rules are NOT invoked.

• Instead, the user is asked for the information.

• Backward chaining systems are not dependent on order, forward chaining rules are.

• Many systems are a hybrid of the two.

Page 34: Expert  Systems  Part 1

34

Meta Rules• Meta rules ( also called control strategies) are rules about how to apply a strategy

• A rule-based system consists of layers of rules

• Meta rules can determine which criteria a set of rules should be instantiated against

• Ex: Two rules meet the firing criteria but result in different outcomes, which rule do you fire:

Meta rule could fire the rule that is most recent Meta rule could fire the rule that is more specific

Page 35: Expert  Systems  Part 1

35

Example of Control StrategyRules: If credit history is less than one year, then applicant is a high credit risk.

If applicant is a doctor then applicant is a low credit risk.

Facts: Cash is 25 years old Cash has 6 months of credit history Cash has been unemployed for three-fifths of a year Cash is a doctor

Meta Rule: If more than one rule meets the criteria then fire the rule that meets the most recent fact.

Cash is a doctor is most recent fact, therefore, applicant is a low credit risk.

Page 36: Expert  Systems  Part 1

36

Example of a Meta-Rule

IF The car will not startAND The electrical system is operating normallyTHEN Use rules concerning the fuel system

Page 37: Expert  Systems  Part 1

37

Meta- Rule Hierarchy

Meta MetaRules

Meta Rules(rules about how to apply rules)

Rules(Domain Knowledge)

Etc.

Page 38: Expert  Systems  Part 1

38

Building an Expert System

• Analysis• Specification• Development• Deployment

Page 39: Expert  Systems  Part 1

39

Analysis• User/expert: Identify a potential

application.• Knowledge Engineer: Is expert system the

answer?– Task is well understood– Expertise exists, is reliable, and the solution is

generally agreed upon– Task is not too hard (but not too easy, either)

Page 40: Expert  Systems  Part 1

40

Specification

• User/Expert and Knowledge Engineer work together to define the objectives of the expert system application:– Inputs– Outputs– Methodology

Page 41: Expert  Systems  Part 1

41

Development• Knowledge Engineer: Learns how the

expert performs task:– Called “knowledge acquisition”.– Must cover current, historical, and hypothetical

cases.• Develop a conceptual model of the ES.

– Framework consists of high-level descriptions of the tasks and situations.

Page 42: Expert  Systems  Part 1

42

Development (contd)

• Decide how the inference, representation, and control structure can be used to replicate the decision process.

• Build the knowledge base.• Verify and validate.

– Am I building the product right?– Am I a building the right product?

Page 43: Expert  Systems  Part 1

43

Deployment

• Install the system for routine use.• Fix bugs, update, and enhance.

Go back to development phase.

This loop remains active throughout thelife cycle of the project.

Page 44: Expert  Systems  Part 1

44

How Do Expert Systems REALLY Differ from Conventional Programming

Languages?

• Primary difference is:– Expert systems are developed by examining ways a human

expert would perform the task.– Conventional programs are developed by examining ways a

computer would perform the task.• When built, both procedural and deterministic.• So the question that often comes out is....

Are expert systems truly intelligent?

Page 45: Expert  Systems  Part 1

45

Expert Systems vs Conventional Programs

Characteristic Conventional Program Expert SystemControl by... Information & control integrated Knowledge separate from

controlSolution by... Algorithm Rules & inferenceExecution Generally sequential Opportunistic rulesInput Must be complete Can be IncompleteDesign Structured Little or noneExpansion Done in major jumps IncrementalRepresentation Numeric SymbolicModify Difficult to modify Easy to modifyResults Final result given Recommendation w/expansionInterface Command interface Natural dialogueAnswers Optimal Solution Acceptable solution

Page 46: Expert  Systems  Part 1

46

Application Categories Re-Visited• Interpretation Inferring situation from observations/data• Prediction Inferring likely consequences of situation• Diagnosis Inferring malfunctions• Design Configuring objects under constraints• Planning Developing plans to achieve goals• Monitoring Comparing observations to plans• Debugging Prescribing remedies for malfunctions• Repair Executing a plan to administer a remedy• Instruction Diagnosing, debugging, and correcting

student performance• Control Managing system behavior• Selection Identifying best choice from a list of

possibilities• Simulation Modeling the interaction between system

components