March 1999Dip HI KBS1 Knowledge-based Systems Alternatives to Rules.

Post on 05-Jan-2016

216 views 0 download

Transcript of March 1999Dip HI KBS1 Knowledge-based Systems Alternatives to Rules.

March 1999 Dip HI KBS 1

Knowledge-based Systems

Alternatives to Rules

March 1999 Dip HI KBS 2

Knowledge-based Systems

• Rule-based– heuristic (expert) knoweldge encoded in rules.

• Model-based– reasoning is based on a model of a

device/system.

• Case-based– knowledge is provided by many examples of

solutions to previous cases.

March 1999 Dip HI KBS 3

Problems with Rules

• Fail to work if problem is not anticipated by rules.

• Heuristic rules can be applied inappropriately if some condition is omitted.

• With some understanding of the problematic system these inadequacies could be overcome.

March 1999 Dip HI KBS 4

Model-based Reasoning

• Just as experts revert to first principles when confronted with new or difficult problems…

• Model-based reasoners are based on a representation of the structure and behaviour of the system under analysis.

• Used especially in diagnosis of equipment malfunctions.

March 1999 Dip HI KBS 5

MBR : Diagnosis

• Simulate behaviour of components of device/system.

• Represent component interactions.• Represent known failure modes of components

and interconnections.• Compare actual device performance with that

predicted by the model.• If there is a discrepancy, reason about what

failures could account for observed bahaviour.

March 1999 Dip HI KBS 6

MBR Example

MULT-1

MULT-2

MULT-3

ADD-1

ADD-2

A=3

B=3

E=3

C=2

D=2

(F=12)

(G=10)

Actual F is 10

Predicted outputs

Fig 6.14 of Luger and Stubblefield, Third Edition.

March 1999 Dip HI KBS 7

Reasoning phase

• Generate hypotheses– either ADD-1, MULT-1 or MULT-2 is faulty

• Test each hypothesis– find MULT-2 appears to be OK (since ADD-

2’s output is good).

• Discriminate between surviving hypotheses with further observations.– E.g. check the actual output of MULT-1.

March 1999 Dip HI KBS 8

Problems with MBR

• Intensive knowledge acquisition.

• Requires an explicit domain model, a well-defined theory.– Excludes some medical specialties, financial

applications, ...

• Complex and detailed reasoning, slow?.

• Ignores (possibly valuable) experiential knowledge.

March 1999 Dip HI KBS 9

Problems cont/

• Can only handle problems explained by the model.– A model is a representation of some reality. It

leaves out many aspects. If the things that left out are the cause of the problem, the MBR won’t work.

March 1999 Dip HI KBS 10

Advantages of MBR

• More robust and flexible reasoning

• Can provide causal explanations. May serve a tutorial role.

• Knowledge may be transferable to related tasks.

March 1999 Dip HI KBS 11

Case-based Reasoning

• Rules and models may be difficult to devise for natural domains (e.g. medicine).

• In CBR “knowledge” is held in a case base of real prior problems and their solutions.

• Case-based diagnosis is common– physician matches new case with one seen

previously and uses the diagnosis of the old case as a starting point.

March 1999 Dip HI KBS 12

Application domains

• Technical support help desks

• Classification type problems– see Machine Learning lecture

• Case-based design

• Fraud detection

• Legal planning– much law is precedent (case) based

March 1999 Dip HI KBS 13

Components

• Representation• Retrieval

– Matching engine retrieves cases similar to target case.

• Adaptation• Remembering

Spec

Soln?

T1

MatchingEngine

Target

Case Base

Spec

Soln

B125

Spec

Soln

B127

Spec

Soln

B125

Spec

Soln

B103

March 1999 Dip HI KBS 14

Breathalyser

Gender

FrameSize

Amount

Meal

Duration

Male

1

1

snack

60

BAC 0.2

N-1

Gender

FrameSize

Amount

Meal

Duration

Female

4

4

full

90

BAC 0.8

N-3

Gender

FrameSize

Amount

Meal

Duration

Male

1

3

snack

120

BAC 0.7

N-55

Example cases

• Duration is duration of drinking session.• Perhaps elapsed time should be added as a

case feature?

March 1999 Dip HI KBS 15

Case Representation

• The knowledge engineering task is focused on deciding how to represent cases– what features best characterise cases

• i.e. predictive features

– may require expert analysis• e.g. for image classification the bitmap may need to

be converted to an edge map.

• e.g. height and weight may not be useful in themselves for classifying apples and pears,but height/weight ratio is.

March 1999 Dip HI KBS 16

Case retrieval

• Based on some similarity measure.– e.g number of matching features– e.g. distance measure based on difference

between numeric features

• Indexes may be used to speed the retrieval

March 1999 Dip HI KBS 17

Case indexing - Example

Location: B-Rooms: Age: Rec-Rooms: Kitchen: Rear-Acc.:

Tot-Area: En-Suite: : :

SM-1 3 Modern 2 Large Yes

>1,200 Yes : :

Price £98,000

Indices3 LR4WF

Location: B-Rooms: Age: Rec-Rooms: Kitchen: Rear-Acc.:

Tot-Area: En-Suite: : :

SM-1 2 Modern 1 Small No

<800 No : :

Price £75,000

Indices

March 1999 Dip HI KBS 18

k-Decision Tree

All Cases

SM-1 BR-3BB-1SM-2

1 B-Rm 4 B-Rm3 B-Rm2 B-Rm

Modern Modern

4 WF 3 LR

• Tree can be built automatically (see later).

• What if no. of bedrooms is less important (predictive) than age of house?

March 1999 Dip HI KBS 19

Case Adaptation

• Breathalyser – if actual consumption is 2 more than in

retrieved case add 0.5 to blood alcohol count.

• Property Valuation– for extra bedroom add x% to price

• More complex adaptation may be needed where solutions are plans or designs, rather than single values.

March 1999 Dip HI KBS 20

Retrieval revisited

• Objective: to find the case most applicable to the current one.

• Applicable ?– If there is no adaptation, find case whose

solution we are most confident of reusing• i.e. whose differences don’t invalidate the solution

– With adaptation, find case whose solution is easiest to adapt to current problem

• use an adaptation cost measure instead of similarity measure.

March 1999 Dip HI KBS 21

Advantages of CBR

• May work better than inductive and deductive methods for natural domains.

• Does not require extensive analysis of domain knowledge.

• Existing data and knowledge - case histories, repair logs - are leveraged.

• Shortcuts complex reasoning - may be quicker than rule-based or model-based.

March 1999 Dip HI KBS 22

Problems with CBR

• Lack of deep knowledge -– poor explanation– danger of misapplication of cases.

• Large case base can slow things down– (compute-store tradeoff)

• Knowledge engineering can still be arduous– designing and selecting features– similarity matching algorithms

March 1999 Dip HI KBS 23

Hybrid Systems

• Integrate two or more reasoning methods to get a cooperative effect.

• See Protos system– builds a model from cases with “teacher” help– better explanation and more convincing

March 1999 Dip HI KBS 24

References and Acknowledgements

• Padraig Cunningham provided much of the material on CBR.

• Luger and Stubblefield: Third Edition of “Artificial Intelligence” has a lot more than the previous edition.