copyright of hamzah ahmad fkee, ump bee4333 intelligent control hamzah ahmad ext: 2055/2141 fuzzy...

35
Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Upload: grant-hodge

Post on 23-Dec-2015

222 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

BEE4333 Intelligent Control

Hamzah AhmadExt: 2055/2141

FUZZY EXPERT SYSTEM : FUZZY LOGIC

Page 2: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Today Lessons3.1 Overview of Fuzzy Concepts and Fuzzy

Logic Systems3.2 Definition of Fuzzy Sets

LO1 : Able to understand basic concept of fuzzy sets which is the basis of fuzzy logic system

Achievements : CO2

Page 3: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

FUZZY EXPERT SYSTEM : FUZZY LOGIC

o Introduction, or what is fuzzy thinking?o Fuzzy setso Linguistic variables and hedgeso Operations of fuzzy setso Fuzzy ruleso Summary

Page 4: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Which one comes first?

FUZZY LOGIC

Bicycle tyre pressure : Expert knows how to measure and human may understand on when to re-pump the pressure. But how about computer interpretation?

IC supply voltage : Expert knows a considerable average of voltage stability and range to be supplied, but can system or software define properly as we expect?

Existence of Degree or

Level

Page 5: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

System Paradigm

Classic logic

Range of logicVagueness

Degree of confidence, multi-valued, humanistic

(a) Boolean Logic. (b) Multi-valued Logic0 1 10 0.2 0.4 0.6 0.8 1001 10

.

Page 6: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Definition of Fuzzy Logic

• A set of mathematical principles for knowledge representation based on degree of membership rather than on crisp membership of classical binary logic.[Lotfi Zadeh, 1965]

• Technology proposed to move from probability theory to mathematical logic.

• Fuzzy sets : a set with fuzzy boundaries.

Page 8: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Traffic light fuzzy control[1]Fuzzified

Rule evaluationDepends on the criteria of what the designer would like the system to decide e.g If cycle time is short(15s) And cars behind red density is medium (7s)

And cars behind green density is medium (6s)Then the change is probably not

DefuzzificationDepends on the criteria of what the designer would like the system to decide

e.g calculating the probability to optimize the solution. If more than 50% then thecolour will change. [1]Kaur, D., Konga, E., Fuzzy traffic light controller, Proceedings

of the 37th Midwest Symposium on circuit and system, pp. 1507 - 1510 vol.2, 1994.

Page 9: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Differences between Fuzzy Logic and Probability

Sanjaa, B., Tsoozol, P., Fuzzy and Probability, International Forum on Strategic Technology, 2007. IFOST 2007, pp 141 – 143, 2007

Page 10: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Crisp set vs Fuzzy set

A B

Crisp setFuzzy set

Ax

AxxfA if0,

if1,)(

fA(x): X ® {0, 1}, where

Fuzzy setCrisp setmA(x): X ® [0, 1], where mA(x) = 1 if x is totally in A; mA (x) = 0 if x is not in A; 0 < mA (x) < 1 if x is partly in A.

Page 11: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Crisp and fuzzy sets of short, average and tall men

150 210170 180 190 200160

Height, cmDegreeofMembership

150 210180 190 200

1.0

0.0

0.2

0.4

0.6

0.8

160

DegreeofMembership

Short Average Tall

170

1.0

0.0

0.2

0.4

0.6

0.8

Fuzzy Sets

CrispSets

Short Average Tall

Page 12: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Consider a situation…Reference super set : BEE4333 Course after this defined as BB = {EA00007, EA00008,….,EA00060} of 54 studentsCrisp Subset of X : Excellent Student after this defined as EE : EA00007, EA00020, EA00060

Subset of E, E = { (EA00007, 1), (EA00008, 0),.., (EA00020,1), ….,(EA00021,0), …,(EA00060,1)}

Pair Set = { (EAXXXXX, μE (EAXXXXX)}

Only two values of fuzziness are considered.

E : Fuzzy subset of B if and only if E ={(EAXXXXX, μE(EAXXXXX))}EAXXXXX ϵ B, : B[0,1]

Page 13: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Computer RepresentationA = { (x1, μA(x1)), (x2, μA(x2)),…., (xn, μA(xn)) }

A = { μA(x1)/x1), μA(x2)/x2), …., μA(xn)/xn)}

Membership association

Linear Fit Function is used to represent real data in fuzzy set instead of sigmoid, gaussian and pi as these three(3) increases the computation time.

High voltage = (0/200, 0.5/600, 1/1000)High voltage = (0/200, 1/1000)

Page 14: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Today Lessons3.1 Overview of Fuzzy Concepts and Fuzzy

Logic Systems3.2 Definition of Fuzzy Sets

LO1 : Able to understand basic concept of fuzzy sets which is the basis of fuzzy logic system

Achievements : CO2

Page 15: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Today Lessons3.3 Fuzzy Set Operations3.4 Fuzzy Relation

LO1 : Able to execute fuzzy sets using the common fuzzy operationsLO2 : Able to understand and determine the purpose of fuzzy relations

Achievements : CO2

Page 16: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Linguistic: Affection in Fuzzy• IF sun is shining, THEN temperature is hot.• IF people is happy, THEN society is at peace.• IF stomach is full, THEN ?

Linguistic variablefuzzy variable• Linguistic variable has hedges

– Hedges• Act as fuzzy set qualifiers• Expression on adverbs ; little, few, most, extreme, some• Reflects human thinking• Creates sets of individual operation; dilation(expansion), concentration• Continuumfuzzy intervals; from tall, average, short to slightly tall, tall, moderately

tall etc.

Page 17: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Example

Short

Very Tall

ShortTall

DegreeofMembership

150 210180 190 200

1.0

0.0

0.2

0.4

0.6

0.8

160 170

Height, cm

Average

TallVery Short Very Tall

Page 18: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Hedges in fuzzy logicHedge Mathematical

Expression

A little

Slightly

Very

Extremely

Graphical Representation

[A(x)]1.3

[A(x)]1.7

[A(x)]2

[A(x)]3

Page 19: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Hedge MathematicalExpression Graphical Representation

Very very

More or less

Indeed

Somewhat

2 [A(x )]2

A(x)

A(x)

if 0 A 0.5

if 0.5 < A 1

1 2 [1 A(x)]2

[A(x)]4

Hedges in fuzzy logic (cont’d)

Page 20: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Operations of fuzzy setsThe classical set theory developed in the late 19th

century by Georg Cantor describes how crisp sets caninteract. These interactions are called operations.

Intersection Union

Complement

NotA

A

Containment

AA

B

BA AA B

Page 21: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

ComplementCrisp Sets: Who does not belong to the set?Fuzzy Sets: How much do elements not belong tothe set?The complement of a set is an opposite of this set.For example, if we have the set of tall men, itscomplement is the set of NOT tall men. When weremove the tall men set from the universe ofdiscourse, we obtain the complement. If A is thefuzzy set, its complement ØA can be found asfollows:

mØA(x) = 1 - mA(x)

Page 22: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

ContainmentCrisp Sets: Which sets belong to which other sets?Fuzzy Sets: Which sets belong to other sets?Similar to a Chinese box, a set can contain othersets. The smaller set is called the subset. Forexample, the set of tall men contains all tall men;very tall men is a subset of tall men. However, thetall men set is just a subset of the set of men. Incrisp sets, all elements of a subset entirely belong toa larger set. In fuzzy sets, however, each elementcan belong less to the subset than to the larger set.Elements of the fuzzy subset have smallermemberships in it than in the larger set.

Page 23: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Intersection Crisp Sets: Which element belongs to both sets?Fuzzy Sets: How much of the element is in both sets?In classical set theory, an intersection between two sets contains the elements shared by these sets. For example, the intersection of the set of tall men and the set of fat men is the area where these sets overlap. In fuzzy sets, an element may partly belong to both sets with different memberships. A fuzzy intersection is the lower membership in both sets of each element. The fuzzy intersection of two fuzzy sets A and B on universe of discourse X:mAÇB(x) = min [mA (x), mB (x)] = mA (x) Ç mB(x),where xÎX

Page 24: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Union Crisp Sets: Which element belongs to either set?Fuzzy Sets: How much of the element is in either set?The union of two crisp sets consists of every elementthat falls into either set. For example, the union oftall men and fat men contains all men who are tallOR fat. In fuzzy sets, the union is the reverse of theintersection. That is, the union is the largestmembership value of the element in either set. Thefuzzy operation for forming the union of two fuzzysets A and B on universe X can be given as:mAÈB(x) = max [mA (x), mB(x)] = mA (x) È mB(x),where xÎX

Page 25: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Operations of fuzzy sets

Complement

0x

1

(x)

0x

1

Containment

0x

1

0x

1

AB

NotA

A

Intersection

0x

1

0x

AB

Union0

1

ABAB

0x

1

0x

1

B

A

B

A

(x)

(x) (x)

Page 26: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Fuzzy rules

In 1973, Lotfi Zadeh published his second mostinfluential paper. This paper outlined a newapproach to analysis of complex systems, in whichZadeh suggested capturing human knowledge infuzzy rules.

Page 27: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

What is a fuzzy rule?

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

IF x is ATHEN y is B

where x and y are linguistic variables; and A and Bare linguistic values determined by fuzzy sets on theuniverse of discourses X and Y, respectively.

Page 28: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

What is the difference between classical and fuzzy rules?

Rule: 1 Rule: 2IF speed is > 100 IF speed is < 40 THEN stopping_distance is long THEN stopping_distance is short

The variable speed can have any numerical valuebetween 0 and 220 km/h, but the linguistic variablestopping_distance can take either value long or short.In other words, classical rules are expressed in theblack-and-white language of Boolean logic.

A classical IF-THEN rule uses binary logic, for example,

Page 29: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

We can also represent the stopping distance rules in afuzzy form:

Rule: 1 Rule: 2IF speed is fast IF speed is slowTHEN stopping_distance is long THEN stopping_distance is short

In fuzzy rules, the linguistic variable speed also hasthe range (the universe of discourse) between 0 and220 km/h, but this range includes fuzzy sets, such asslow, medium and fast. The universe of discourse ofthe linguistic variable stopping_distance can bebetween 0 and 300 m and may include such fuzzysets as short, medium and long.

Page 30: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Fuzzy rules relate fuzzy sets. 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.

Page 31: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Fuzzy sets of tall and heavy men

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

IF height is tallTHEN weight is heavy

Tall men Heavy men

180

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Height, cm

190 200 70 80 100160

Weight, kg

120

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Page 32: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

The value of the output or a truth membership grade ofthe rule consequent can be estimated directly from acorresponding truth membership grade in theantecedent. This form of fuzzy inference uses amethod called monotonic selection.

Tall menHeavy men

180

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Height, cm

190 200 70 80 100160

Weight, kg

120

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Page 33: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

A fuzzy rule can have multiple antecedents, forexample:

IF project_duration is longAND project_staffing is largeAND project_funding is inadequateTHEN risk is high

IF service is excellentOR food is deliciousTHEN tip is generous

Page 34: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

The consequent of a fuzzy rule can also include multiple parts, for instance:

IF temperature is hotTHEN hot_water is reduced;

cold_water is increased

Page 35: Copyright of Hamzah Ahmad FKEE, UMP BEE4333 Intelligent Control Hamzah Ahmad Ext: 2055/2141 FUZZY EXPERT SYSTEM : FUZZY LOGIC

Copyright ofHamzah AhmadFKEE, UMP

Today Lessons3.3 Fuzzy Set Operations3.4 Fuzzy Relation

LO1 : Able to execute fuzzy sets using the common fuzzy operationsLO2 : Able to understand and determine the purpose of fuzzy relations

Achievements : CO2