INTELLIGENT SYSTEMS

Download Report

Transcript INTELLIGENT SYSTEMS

Fuzzy Expert Systems

Lecture Outline

What is fuzzy thinking?

Fuzzy sets

Linguistic variables and hedges

Operations of fuzzy sets

Fuzzy rules

Summary

Fuzzy Logic

    

How can we represent expert knowledge that uses vague and ambiguous terms in a computer?

Fuzzy logic is not logic that is fuzzy, but logic that is used to describe fuzziness. Fuzzy logic is the theory of fuzzy sets.

Fuzzy logic is based on the idea that things can be described by a range of linguistic variation.

Temperature, height, speed, distance, beauty  all come on a sliding scale.   The motor is running really hot. Tom is a very tall guy.

Crisp Sets

 Boolean logic forces us to draw lines between members of a class and non-members.  e.g we may say, Tom is tall because his height is 181 cm.  If we drew a line at 180 cm, we would find that David, who is 179 cm, is small.  Is David really a small man or we have just drawn an arbitrary distinction?

Crisp Sets

    A subset U of a set S can be defined as a set of ordered pairs with a first element from the set S, and a second element from the set { 0, 1} This defines a mapping between elements of S and elements of the set { 0, l }. zero is non-membership, one represents membership. The truth or falsity of the statement : x is in U is determined by finding the ordered pair whose first element is x. The statement is true if the second element of the ordered pair is l, and false if it is 0.

 

Fuzzy concepts

Truth values (in fuzzy logic) or membership values (in fuzzy sets) are indicated by a value on the range [0.0,1.0], (0.0 = absolute Falseness ,1.0 = absolute Truth.)   eg “Jane is old.” If Jane's age was 75, we might assign the statement the truth value of 0.80.

The statement could be translated into set terminology:  “Jane is a member of the set of old people.”   This statement would be rendered symbolically with fuzzy sets as: mOLD(Jane) = 0.80

where m is the membership function, operating on the fuzzy set of old people, which returns a value between 0.0 and 1.0.

Fuzzy concepts

 The probabilistic approach yields the natural language statement, “There is a 80% chance that Jane is old,”  The fuzzy terminology corresponds to “Jane's degree of membership within the set of old people is 0.80.”

Fuzzy Logic

   

Fuzzy logic is a set of mathematical principles for knowledge representation based on degrees of membership.

fuzzy logic is multi-valued . It deals with degrees of membership degrees of truth . and Fuzzy logic uses the continuum of logical values between 0 (completely false) and 1 (completely true).

Range of logical values in Boolean and fuzzy logic

0 0 0 1 1 (

a

) Boolean Logic.

1 0 0 0.2

0.4

0.6

0.8

(

b

) Multi-valued Logic.

1 1

Fuzzy Sets

 The basic idea of the fuzzy set theory is that an element belongs to a fuzzy set with a certain degree of membership.  Thus, a proposition is not either true or false, but may be partly true (or partly false) to any degree.  This degree is usually taken as a real number in the interval [0,1].

 The classical example in fuzzy sets is

tall men

. The elements of the fuzzy set “tall men” are all men, but their degrees of membership depend on their height. Name Chris Height, cm 208 Degree of Membership

Crisp Fuzzy

1 1.00

Mark John Tom David Mike Bob Steven Bill Peter 205 198 181 179 172 167 158 155 152 1 1 1 0 0 0 0 0 0 1.00

0.98

0.82

0.78

0.24

0.15

0.06

0.01

0.00

200 210

Height, cm

 The x-axis represents the

universe of discourse

 the range of all possible values applicable to a chosen variable.  In our case, the variable is the man height.  The y-axis represents the

membership value of the fuzzy set

.  In our case, the fuzzy set of “tall men” maps height values into corresponding membership values.

A fuzzy set is a set with fuzzy boundaries.

 Let

X

be the universe of discourse and its elements be denoted as

x

. In the classical set theory,

crisp set A of X is defined as function f

A

(x) called the characteristic function of A

f A

(

x

):

X

 {0, 1}, where

f A

(

x

)    1, 0, if if

x

x

A A

 This set maps universe

X

to a set of two elements. For any element

x

of universe

X

, characteristic function

f A

(

x

) is equal to 1 if

x

element of set

A

, and is equal to 0 if

x

is an is not an element of

A

.

 Fuzzy set

A

of universe

X

is defined by function 

A

(

x

) called the

membership function

of set

A

A

(

x

):

X

 [0, 1], where 

A

(

x

) = 1 if 

A

(

x

) = 0 if

x x

0 < 

A

(

x

) < 1 if

x

is totally in is not in

A

;

A

; is partly in

A

.

 For any element

x

of universe

X

, membership function 

A

(

x

) equals the degree to which

x

is an element of set

A

.  This degree, a value between 0 and 1, represents the

degree of membership

, also called

membership value

, of element

x

in set

A

.

How to represent a fuzzy set in a computer?

 Determine the membership functions.

 In the “

tall men

” example, we can obtain fuzzy sets of

tall

,

short

and

average

men.  The universe of discourse consists of three sets:

short

,

average

and

tall men

.  a man who is 184 cm tall is a member of the

average men

set with degree of membership of 0.1, and he is also a member of the

tall men

set with a degree of 0.4.

Crisp and fuzzy sets of short, average and tall men

Degree of Membership

1.0

Crisp Sets Short Average 0.8

Tall Men 0.6

0.4

0.2

0.0

150 160 170 180 190 200 210

Height, cm Degree of Membership

1.0

0.8

0.6

Short 0.4

0.2

0.0

150 160 170 Fuzzy Sets Average 180 190 Tall Tall 200 210

Representation of crisp and fuzzy subsets

 (

x

)

X

Fuzzy Subset

A

1 0

Fuzziness x

Crisp Subset

A Fuzziness

Typical functions that can be used to represent a fuzzy set are sigmoid, gaussian and pi. However, these functions increase the time of computation. Therefore, in practice, most applications use

linear fit functions

.

In fuzzy expert systems, linguistic variables are used in fuzzy rules.

A linguistic variable is a fuzzy variable

For example:

IF wind is strong THEN sailing is good IF project_duration is long THEN completion_risk is high IF speed is slow THEN stopping_distance is short

 The range of possible values of a linguistic variable represents the universe of discourse of that variable.  For example, the universe of discourse of the linguistic variable

speed

might have the range between 0 and 220 km/h and may include such fuzzy subsets as

very slow

,

slow

,

medium

,

fast

, and

very fast

.

 A linguistic variable includes the concept of fuzzy set qualifiers, called

hedges

. 

Hedges are terms that modify the shape of fuzzy sets. They include adverbs such as very, somewhat, quite, more or less and slightly.

Hedges

  These operations are provided in an effort to maintain close ties to natural language, and to allow for the generation of fuzzy statements through mathematical calculations. . The simplest example is in which one transforms the statement “Jane is old” to “Jane is very old.” The hedge `Very” is usually defined as follows:  m”Very”A(x) = mA(x)^2  Thus, if mOLD(Jane) = 0.8, then mVERYOLD(Jane) = 0.64.

Fuzzy sets with the hedge very

Degree of Membership

1.0

0.8

0.6

0.4

0.2

0.0

150 Very Short 160 Short 170 Average 180 190 200 210

Height, cm

Representation of hedges in fuzzy logic

Mathematical Expression Graphical Representation

A little [ 

A

(

x

) ] 1.3

Slightly Very Extremely [ 

A

(

x

) ] 1.7

[ 

A

(

x

) ] 2 [ 

A

(

x

) ] 3

Representation of hedges in fuzzy logic (continued)

Mathematical Expression Graphical Representation

Very very [ 

A

(

x

) ] 4 More or less 

A

(

x

) Somewhat Indeed 

A

(

x

) 2 [ 

A

(

x

) ] 2 if 0  

A

 0.5

1  2 [ 1  

A

(

x

) ] 2 if 0.5 < 

A

 1

What is a fuzzy rule?

A fuzzy rule can be defined as a conditional statement in the form:

IF x is A THEN y is B

where

x

and

y

are linguistic variables; and

A

and

B

are linguistic values determined by fuzzy sets on the universe of discourses

X

and

Y

, respectively.

What is the difference between classical and fuzzy rules?

A classical IF-THEN rule uses binary logic, for example, Rule: 1 IF speed is > 100 THEN stopping_distance is long Rule: 2 IF speed is < 40 THEN stopping_distance is short

What is the difference between classical and fuzzy rules?

We can also represent the stopping distance rules in a fuzzy form: Rule: 1 IF speed is fast THEN stopping_distance is long Rule: 2 IF speed is slow THEN stopping_distance is short  In a fuzzy system, all rules fire to some extent, or in other words they fire partially. If the antecedent is true to some degree of membership, then the consequent is also true to that same degree.

Fuzzy Rules

• In fuzzy rules, the linguistic variable speed also has the range (the universe of discourse) between 0 and 220 km/h, but this range includes fuzzy sets, such as slow, medium and fast. • The universe of discourse of the linguistic variable stopping_distance can be between 0 and 300 m and may include such fuzzy sets as short, medium and long.

Degree of Membership

1.0

0.8

Fuzzy sets of tall and heavy men

Tall men

Degree of Membership

1.0

Heavy men 0.8

0.6

0.6

0.4

0.2

0.4

0.2

0.0

160 180 190 200

Height, cm

0.0

70 80 100 120

Weight, kg

These fuzzy sets provide the basis for a weight estimation model. The model is based on a relationship between a man’s height and his weight:

IF height is tall THEN weight is heavy

The value of the output or a truth membership grade of the rule consequent can be estimated directly from a corresponding truth membership grade in the antecedent. This form of fuzzy inference uses a method called

monotonic selection

.

Degree of Membership

1.0

Degree of Membership

1.0

Tall men 0.8

0.8

Heavy men 0.6

0.6

0.4

0.2

0.0

160 180 190 200

Height, cm

0.4

0.2

0.0

70 80 100 120

Weight, kg

A fuzzy rule can have multiple antecedents, for example: IF AND project_duration is long project_staffing is large AND project_funding is inadequate THEN risk is high IF OR service is excellent food is delicious THEN tip is generous

The consequent of a fuzzy rule can also include multiple parts, for instance: IF temperature is hot THEN hot_water is reduced; cold_water is increased