53
Expert Systems 1. Linguistic variables: a quintuple (x,T(x),U,G, ) X is the name of the variable; T denotes the term set of x, that is, the set of names of linguistic values of x, with each value being a fuzzy variable denoted by x and ranging over a universe of discourse U which is associated with the base variable u; G is a syntactic rule (grammar) for generating the name, X, of values of x; M is a semantic rule for associating with each X its meaning; M(X) is a fuzzy subset of U. M ~

Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, ) X is the name of the variable; T denotes the term set of x, that is, the set of names

Embed Size (px)

Citation preview

Page 1: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Expert Systems

1. Linguistic variables: a quintuple (x,T(x),U,G, ) X is the name of the variable; T denotes the term set of x, that is, the set of

names of linguistic values of x, with each value being a fuzzy variable denoted by x and ranging over a universe of discourse U which is associated with the base variable u;

G is a syntactic rule (grammar) for generating the name, X, of values of x;

M is a semantic rule for associating with each X its meaning; M(X) is a fuzzy subset of U.

M~

Page 2: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 3: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 4: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

2. Approximate reasoning

Generalized modus ponensPremise A is trueImplication If A then BConclusion B is ture

1) Allow statements that are characterized by fuzzy sets.

2) Relax the identity of the B’s in the implication and the conclusion.

Premise x is A’Implication If x is A then y is BConclusion y is B’

Page 5: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Zadeh’s compositional rule of inference: Let R(x), R(x,y) and R(y) be fuzzy relations in X, XxY, and Y respectively, which act as fuzzy restrictions on x, (x,y), and y, respectively. Let A and B denote particular fuzzy sets in X and XxY. Then the compositional rule of inference asserts, that the solution of the relational assignment equations R(x) = A, R(x,y) = B is given by R(y) = A o B.

Page 6: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Fuzzy Implications

Ordering of fuzzy implications: Fig. 11.2.

nscombinatio

bbcaciubba

nsimplicatioQLbaiacubaa

nsimplicatioRbxaix

bxax

nsimplicatioSbacuba

))),(),((()(

)),(),(()(

}),(|]1,0[sup{

}|}1,0{max{

)),((

Page 7: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Selection of Fuzzy Implications

It must satisfy the following formula:

))](),(()),(),(([sup))(),((

syllogism alhypothetic 3.

))](),(()),(([sup))((

tollensmodus classical 2.

))](),((),([sup)(

:pones modus classical .1

zCyByBxAizCxA

yBxAyBcixAc

yBxAxAiyB

RAB

Yy

Yy

i

schemes reasoning allsatisfy :,,, sgsswus

Page 8: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Multiconditional Approximate Reasoning

Disjunctive if-then rules

Conjunctive if-then rules

jNj

RRn

jNj

RRn

'3

'1

'4

'2

''4

''3

''2

''1

)(

)(

BBBB

RAB

RAB

RAB

RAB

jNj

jNj

jNj

jNj

n

n

n

n

Page 9: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 10: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 11: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 12: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 13: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 14: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

WHAT

使用者

使用者介面

推理機置

知識庫

工作記憶區

知識擷取介面

領域專家

知識工程師

專家系統架構

Page 15: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

• Deduction. Logical reasoning in which conclusion must follow from their premises.

• Induction. Inference from the specific case to the general.

• Intuition. No proven theory. The answer just appears, possibly by unconsciously recognizing an underlying pattern. Expert systems do not implement this type of inference yet. ANS may hold promise for this type of inference since they can extrapolate from their training rather than just provide a conditioned response or interpolation. That is, a neural net will always give its best guess for a solution.

• Heuristics. Rules of thumb based on experience.

Page 16: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

• Generate and Test. Trial and error. Often used with planning for efficiency.

• Abduction. Reasoning back from a true conclusion to the premises that may have caused the conclusion.

• Default. In the absence of specific knowledge, assume general or common knowledge by default.

• Autoepistemic. Self-knowledge• Nonmonotonic. Previous knowledge may be

incorrect when new evidence is obtained.• Analogy. Inferring a conclusion based on the

similarities to another situation.

Page 17: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

3. Reasons for the use of fuzzy set theory in expert systems:

user-machine input/output description, imprecise knowledge uncertainty management.

4. Fuzzy production rules: condition/ conclusion parts contain linguistic variables.

5. Fuzzy frames: allowing slots to contain fuzzy sets as values, allowing partial inheritance through is-a slots.

6. Fuzzy semantic nets.

7. Fuzzy inference.

Page 18: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Medicine

1) Sanchez:Fuzzy set A: the symptoms observed in the

patient.

Fuzzy relation R: the medical knowledge that relates the symptoms to

the diseases.

Fuzzy set B: the possible diseases of the patient

B = A o R

Page 19: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

2) CADIAG-2:

RO:occurrence relation S x D

RC:confirmability relation S x D

RS:occurrence relation P x S

R1 = RS o RO (occurrence indication on P x D)

R2 = RS o RC (confirmability indication on P x D)

R3 = RS o (1-RO) (nonoccurrence indication on P x D)

R4 = (1-RS) o RO (nonsymptom indication on P x D)

=> draw different types of diagnostic conclusions.

Page 20: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

s1 occurs very seldom in patients with d1.S1 often occurs in patients with d2 but seldom

confirms the presence of disease d2.

S2 always occurs with d1 and always confirms the presence of d1; s2 never occurs with d2 and its presence never confirms d2.

S3 very often occurs with d2 and often confirms the presence of d2.

S3 seldom occurs in patients with disease d1.

Page 21: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Example:

Membership function:

991

9950))199/()1((21

501))199/()1((2

10

)99,50,1;( 2

2

x

xx

xx

x

xf

Linguistic terms: always, often, unspecific, seldom, never

Modifier: very (concentration operation u2)

Page 22: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

44.9.9.6.8.7.

3

2

1

3

21

PPP

R

dd

(diagnostic hypotheses:.5< max [ uR1 , uR2])d1 and d2 are suitable hypotheses for p1 and p2.d2 is the acceptable hypothesis for p3

1.156.25.6.25.

3

2

1

4

21

PPP

R

dd

75.25.6.9.

56.8.

3

2

1

1

21

PPP

R

dd

75.5.25.9.7.8.

3

2

1

2

21

PPP

R

dd

d1 is strongly confirmed for p2 (R2) (confirmed diagnosis: uR2(p,d) = 1)

d1 is excluded as a possible diagnosis for p3(excluded diagnosis: uR3(p,d) or uR4(p,d) = 1)

56.25.0175.06.

3

2

1

21

SSS

R

dd

O

109.09.6.7.8.4.

3

2

1

321

PPP

R

SSS

S

75.5.0125.5.

3

2

1

21

SSS

R

dd

C

Page 23: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 24: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 25: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Building Expert Systems by Embedding Analogical Reasoning into Deductive Reasoning Mechanism

Rule knowledge base:IF X1 with (W1,R1) AND

X2 with (W2,R2) AND……

Xm with (Wm,Rm) THEN Y.

1. Wi are fuzzy weight factors, Ri are fuzzy relation matrices.

Page 26: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

PCPILE

TURBO PROLOG

MS-DOS

PC/AT or COMPATIBLE

Page 27: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

EXPERT USER

INTERFACE

ANALOGICAL INFERENCEMECHANISM

DEDUCTIVE INFERENCEMECHANISM

CASE KNOWLEDGEBASE

RULE KNOWLEDGEBASE

Page 28: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

ii

yyyyB )(W)(B)(W)( iii

Deductive Inference Mechanism

1. Bi (y) = Ai o Ri (y) ( max-min composition)

2.

dxx

dxxx

b

b

)(

)(

3. rank(B) = (rank all rules)

Page 29: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

(2) Very very similar: (Sij)1/4

  very similar: (Sij)½

middle similar: (Sij)1

less similar: (Sij)2

less less similar: (Sij)4

(3) Similarity degree: S* = A o S o B = max {min[ (x), S(x,y),[ (y)]}.

Case Knowledge Base1. Case base structure2. Similarity relation matrix: expresses the

relaxation of truth value of an attribute.

mjim

jimSij ,,2,1,

1

||)1()1(

x , yba

A=VT=(0,0,0,.5,1)B=MT=(0,0,.5,1,.5)S=MSS*=0.75

Page 30: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 31: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 32: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Analogical inference mechanism• Do Procedure (CASE) for all cases:

• Do Procedure (QTTRIBUTE) for all attributes:• End DO Procedure ( ATTRIBUTE).

• End Do Procedure (CASE).• Do Procedure (GOAL) for all goals.• End Do Procedure (GOAL).• Return the sort of goals with its similarity possibility value πk

as “approximate solution.”

Procedure (ATTRIBUTE): Determine Similarity Degrees of AttributesUsing the definition of similarity degree of fuzzy truth value, i.e., Eq. 7, we can draw the similarity degree Sij of an attribute Xi between the diagnosed case and past case Ci by the following equation

Page 33: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

)]}(),,(),([minmax{ yyxSxASAS aijjajxy

ijjjij …………(9)

In which Aj = the fuzzy truth value of attribute Xj of the diagnosed case; Aij = fuzzy truth value of attribute Xj of past case Ci; uaj = the mambership function of Aj; and uaij = the membership function of Aij.

Procedure (CASE): Determine Similarity Degree of Cases  For each test case, Ci, we obtain a similarity degree, Si; with respect to the diagnosed case by aggregating all the similarity degrees of attributes with the weighted average method

jj

jijj

i I

SI

S

)(

…………………………………………………(10)

Page 34: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Procedure (GOAL): Determine Aggregated Possibility of Goals

NCB

Si

iki

k

)( …………………………………………………

(11)

in which πk = aggregated possibility of goal Yk; πik = possibility of goal Yk with respect to past case Ci; NCB = number of cases in the case base; and i = 1, 2, …, NCB.

Page 35: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 36: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 37: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Differences between expert systems and fuzzy logic control

1. The existing FLC systems originated in control engineering rather than in AI.

2. FLC models are all rule-based systems.3. By contrast to expert systems FLC serves

almost exclusively the control of production systems such as electrical power plants, kiln cemen plants, chemical plants, etc., that is, their domains are even narrower than than those of expert systems.

Page 38: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

4. In general, the rules of FLC systems are not extracted from the human expert through the system but formulated explicitly by the FLC designer.

5. Finally, because of their purpose, their inputs are normally observations of technological systems and their outputs control statements.

Page 39: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Essential design problems in FLC:1. Define input and control variables, that is ,

determine which states of the process shall be observed and which control actions are to be considered.

– Engine-boiler combination: state variables (steam pressure in boiler, speed of engine)

– Control actions (heat-input to boiler, throttle opening at the input of the engine cylinder)

2. Define the condition interface, that is, fix the way in which observations of the process are expressed as fuzzy sets.

Page 40: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

3. Design the rule base, that is, determine which rules are to be applied under which conditions.

4. Design the computational unit, that is, supply algorithms to perform fuzzy computations. Those generally lead to fuzzy outputs.

5. Determine rules according to which fuzzy control statements can be transformed into crisp control actions.

Page 41: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 42: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 43: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 44: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names
Page 45: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Defuzzification Methods: Center of Area Method

n

kk

n

kkk

CA

c

c

c

cCA

zC

zzCCd

dzzC

zdzzCCd

1

1

)(

)()(

)(

)()(

Page 46: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Defuzzification Methods: Center of Maxima Method

)()(|2

|max|min)(

)()(|],[2

supinf)(

ChzCzM

MzzMzzCd

ChzCcczM

MMCd

kk

kkkkCM

CM

Page 47: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Defuzzification Methods: Mean of Maxima Method

MM

Mzk

MM

dweighted

ChzCcczM

M

z

Cd k

)()(|],[

)(

Page 48: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Defuzzification Methods: parameterized class

MMp

COAp

averagearithmeticp

p

zC

zzCCd

dzzC

zdzzCCd

n

kk

p

n

kkk

p

p

c

c

p

c

c

p

p

1

0

,0

)(

)()(

)(

)()(

1

1

Page 49: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Fuzzy Automata• An automaton is called a fuzzy automaton

when its states are characterized by fuzzy sets, and the production of responses and next states is facilitated by appropriate fuzzy relations

• A  = <X,Y,Z,R,S>– X is a nonempty finite set of input states (stimuli)– Y is a nonempty finite set of output states (stimuli)– Z is a nonempty finite set of internal states (stimuli)– R is a fuzzy relation on Z x Y– S is a fuzzy relation on X x Z x Y

Page 50: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Fuzzy Automata

Fuzzy RelationsR and S

StorageCt = Et+1

Ct

At

Bt

Et

Page 51: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Fuzzy Automata

RSSSCB

SSSCE

RCB

SCE

zzxSxAzzS

r

r

t

n

t

AAA

r

AAA

r

tt

A

tt

jikkt

NkjiA

121

21

...

...

)]),,(),((min[max,

1

1

Page 52: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Fuzzy Automata

3.15.

100

010

001

4

3

2

1

321

z

z

z

z

yyy

R

]4.1[

]4.6.8.1[

6.03.1

1000

1002.

0100

1000

1005.

2.013.

12.4.0

1

1

4

3

2

1

43212

4

3

2

1

43211

A

C

z

z

z

z

zzzzx

z

z

z

z

zzzzx

S

103.4.

1005.

4.013.

14.4.0

4

3

2

1

4321

1

z

z

z

z

zzzz

SA

Page 53: Expert Systems 1.Linguistic variables: a quintuple (x,T(x),U,G, )  X is the name of the variable;  T denotes the term set of x, that is, the set of names

Fuzzy Automata• Deterministic fuzzy automaton (p. 352)

• “o” max-min; other schemes.

• Probabilistic automaton of the Moore type

ZXzxzzxS

ZzyzR

zC

ikZz

jik

iYy

li

Zzi

i

l

i

,each for 1),,(

each for 1),(

1)(1