You are on page 1of 7

241-320 Design Architecture and Engineering for Intelligent System Suntorn Witosurapot

Contact Address: Phone: 074 287369 or Email: wsuntorn@coe.psu.ac.th

Lecture 14: Reasoning under Uncertainty (Fuzzy System)

January 2010

Preview:
One drawback of the logical approach to reasoning is that an agent can rarely ascertain the truth of all propositions in the environment In fact, propositions (and their logical structure) may be inappropriate for modelling some domains especially those involving uncertainty Fuzzy logic can formalize approximate knowledge and reasoning, hence giving us rational decisions

Outline
Motivation Fuzzy Sets Fuzzy (Linguistic) Variables Fuzzy Logic Fuzzy Inferences: IF-THEN Rules

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

What does Fuzzy Logic mean?


Fuzzy logic was introduced by Lotfi Zadeh (UC Berkeley) in 1965. Fuzzy logic () is based on fuzzy set theory, an extension of classical set theory. Fuzzy logic did not attract any attention until the 1980s (fuzzy controller applications)

What does Fuzzy Logic mean? (cont.)

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

Fuzzy is Just Human


Humans primarily use fuzzy terms: large, small, fast,

Fuzzy is Economical
Fuzziness as a principle of economics: Precision is expensive. Only apply as much precision to a problem as necessary.

slow, warm, cold, ...


We say: If the weather is nice and I have a little time, I will probably go for a work along the river. We dont say: If the temperature is above 24 degrees and the cloud cover is less than 10 percent, and I have 3 hours time, I will go for a work with a probability of 0.47.
241-320 Design Architecture & Engineering for Intelligent System

Precision may not significant in the real world


241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

Fuzzy System

Outline
Motivation Fuzzy Sets Fuzzy (Linguistic) Variables Fuzzy Logic Fuzzy Inferences: IF-THEN Rules

Basics of Fuzzy Sets


Example: the set of young people

We can define a characteristic function for this set:

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

10

Basics of Fuzzy Sets (cont.)


Fuzzy set theory offers a variable notion of membership: A person of age 25 could still belong to the set of young people, but only to a degree of less than on, say 0.9.

Fuzzy Membership Function

Now the set of young contains people with ages between 20 and 30, with a linearly decreasing degree of membership.
241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

11

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

12

Fuzzy Membership Function (cont.)


Shapes for Membership Functions

Fuzzy Membership Function (cont.)


Typically, triangular membership functions are chosen for fuzzy numbers.

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

13

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

14

Testing for your understanding


Improve the following set of tall man to cover better representation of the tallness of a person.

Testing for your understanding: Solution


The improved set can be defined by a continuously inclining function.

It just says that people taller than or equal to 6 feet are tall.
241-320 Design Architecture & Engineering for Intelligent System

So the 1st person has a membership of 0.3 and so is not very tall. The 2nd person has a membership of 0.95 and so he has a high degree of membership in the fuzzy set of tall men.
241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

15

Fuzzy System

16

In essense
A fuzzy set is a collection of objects that might belong to the set to a degree, varying from 1 for full belongingness to 0 for full non-belongingness, through all intermediate values. Fuzzy logic is a generalization of standard logic, in which a concept can possess a degree of truth anywhere between 0.0 and 1.0. Fuzzy logic is used for reasoning about inherently vague concepts. Ex: for the tallness, we might say that Michael Jordan is tall,' with degree of truth of 0.9
241-320 Design Architecture & Engineering for Intelligent System

Outline
Motivation Fuzzy Sets Fuzzy (Linguistic) Variables Fuzzy Inferences: IF-THEN Rules

Fuzzy System

17

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

18

Fuzzy (Linguistic) Variables


Fuzzy Linguistic Variables are used to represent qualities spanning a particular spectrum Can be seen as the vocabulary of a Fuzzy Logic System Example, Temp: {Freezing, Cool, Warm, Hot} Q: What is the temperature? A: It is warm. Q: How warm is it? A: ?? -> This somehow refers to the Membership Function

Fuzzy (Linguistic) Variables (cont.)


Temp: {Freezing, Cool, Warm, Hot} Degree of Truth or "Membership"

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

19

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

20

Fuzzy (Linguistic) Variables (cont.)


Q: How cool is 36 F ? A: It is 30% Cool and 70% Freezing

Fuzzy (Linguistic) Variables: Example


Linguistic variables/
Fuzzy label Always Very strong Strong More or less strong Medium More or less weak Weak Very weak No Numerical interval [1.00, 1.00] [0.95, 0.99] [0.80, 0.94] [0.65, 0.79] [0.45, 0.64] [0.30, 0.44] [0.10, 0.29] [0.01, 0.09] [0.00, 0.00]
Fuzzy System

Typical value 1.0 0.99 0.9 0.7 0.5 0.3 0.2 0.05 0.0
22

0.7

0.3

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

21

241-320 Design Architecture & Engineering for Intelligent System

Outline
Motivation Fuzzy Sets Fuzzy (Linguistic) Variables Fuzzy Logic Fuzzy Inferences: IF-THEN Rules

Fuzzy Logic
How do we use fuzzy membership functions in predicate logic? Fuzzy logic Connectives: Fuzzy Conjunction, Fuzzy Disjunction, Operate on degrees of membership in fuzzy sets

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

23

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

24

Fuzzy Disjunction
AB max (A, B) A B = C "Quality C is the disjunction of Quality A and B"

Fuzzy Conjunction
AB min(A, B) A B = C "Quality C is the conjunction of Quality A and B"

(AB = C) (C = 0.75)
241-320 Design Architecture & Engineering for Intelligent System

(AB = C) (C = 0.375)
Fuzzy System

25

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

26

Question: Fuzzy Conjunction


Calculate A B given that A is 0.4 and B is 20
0.9 0.7

Outline
Motivation Fuzzy Sets Fuzzy (Linguistic) Variables Fuzzy Logic Fuzzy Inferences: IF-THEN Rules

Determine degrees of membership: A = 0.7 B = 0.9 Apply Fuzzy AND A B = min(A, B) = 0.7
241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

27

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

28

Fuzzy Inferences: IF-THEN Rules


A fuzzy rule is a linguistic expression of causal dependencies between linguistic variables in form of if-then statements. General form: IF <antecedent> then <consequence> Example: If temperature is cold and oil price is cheap Then heating is high Linguistic variables
241-320 Design Architecture & Engineering for Intelligent System

Example: Fuzzy Control


Fuzzy Control combines the use of fuzzy linguistic variables with fuzzy logic Example: Speed Control Q: How fast am I going to drive today? A: It depends on the weather. -> So, this implies disjunction or conjunction of fuzzy operations

Linguistic values
Fuzzy System

29

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

30

Example: Fuzzy Control (cont.)


Temp: {Freezing, Cool, Warm, Hot}

Example: Fuzzy Control (cont.)


Rules:
If it's Sunny and Warm, drive Fast Sunny(Cover) Warm(Temp) Fast(Speed)

Cover: {Sunny, Partly, Overcast}

Speed: {Slow, Fast}

If it's Cloudy and Cool, drive Slow Cloudy(Cover) Cool(Temp) Slow(Speed) Driving Speed is the combination of output of these rules...

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

31

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

32

Example: Fuzzy Control (cont.)


Q: How fast will I go if it is 65 F 25 % Cloud Cover ?

Example: Fuzzy Control (cont.)


Fuzzification: Calculate Input Membership Levels 65 F Cool = 0.4, Warm= 0.7

25% Cover Sunny = 0.8, Cloudy = 0.2

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

33

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

34

Example: Fuzzy Control (cont.)


Fuzzification: Calculate Input Membership If it's Sunny and Warm, drive Fast Sunny(Cover)Warm(Temp)Fast(Speed) 0.8 0.7 = 0.7 Fast = 0.7 If it's Cloudy and Cool, drive Slow Cloudy(Cover)Cool(Temp)Slow(Speed) 0.2 0.4 = 0.2 Slow = 0.2
241-320 Design Architecture & Engineering for Intelligent System

Example: Fuzzy Control (cont.)


Defuzzification: Constructing the Output Speed is 20% Slow and 70% Fast

Find centroids: Location where membership is 100%

Fuzzy System

35

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

36

Example: Fuzzy Control (cont.)


Defuzzification: Constructing the Output Speed is 20% Slow and 70% Fast

Example: Fuzzy Control (cont.)


Defuzzification: Constructing the Output Speed is 20% Slow and 70% Fast

Speed

= weighted mean = (2*25+...


Fuzzy System

Speed

= weighted mean = (2*25+7*75)/(9) = 63.8 mph


Fuzzy System

241-320 Design Architecture & Engineering for Intelligent System

37

241-320 Design Architecture & Engineering for Intelligent System

38

Notes:
Fuzzy Logic Control allows for the smooth interpolation between variable centroids with relatively few rules This does not work with crisp logic (traditional Boolean) a crisp number x, denoting the most typical value Provides a natural way to model some types of human expertise in a computer program

Fuzzy inference: In essence


Inputs to a fuzzy system can be: fuzzy, e.g. (Score = Moderate), defined by membership functions; exact, e.g.: (Score = 190); defined by crisp values Outputs from a fuzzy system can be: fuzzy, i.e. a whole membership function. exact, i.e. a single value is produced .

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

39

241-320 Design Architecture & Engineering for Intelligent System

Fuzzy System

40

You might also like