Fuzzy Logic and Fuzzy Systems - GitHub Pages •Introduction •Fuzzy Sets and Membership Functions...
Embed Size (px)
Transcript of Fuzzy Logic and Fuzzy Systems - GitHub Pages •Introduction •Fuzzy Sets and Membership Functions...

Fuzzy Logic and Fuzzy Systems
Xin Yao
Artificial Intelligence: Fuzzy Logic and Fuzzy Systems Fall 2017 Xin Yao
Some material adapted from slides by B. Vrusias, University of Surrey, and by G. Cheng, West Virginia University.

Outline
• Introduction
• Fuzzy Sets and Membership Functions
• Fuzzy Linguistic Variables
• Fuzzy Set Operations and Properties
• Fuzzy Rules
• Fuzzy Inference System
• Summary
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 2

Introduction
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 3
As complexity rises, precise statements lose
meaning, and meaningful statements lose
precision – Lotfi Zadeh (1965)

Introduction (I)
• We rely on common sense to solve problems. How can we represent expert knowledge that uses vague and ambiguous terms in a computer?
• Fuzzy Logic (FL) is not logic that is fuzzy, but logic that is used to describe fuzziness. FL is the theory of fuzzy sets to calibrate vagueness.
• FL is based on the idea that all things admit of degrees. Temperature, height, speed, distance, beauty – all come on a sliding scale.
• FL reflects how people think. It attempts to model our sense of words, our decision making and our common sense. For example, the motor is running really hot. Tom is a very tall guy.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 4

Introduction (II)
• FL is a set of mathematical principles for knowledge representation based on degrees of membership.
• Unlike Boolean logic, FL is multi-valued. It deals with degrees of membership and degrees of truth.
• FL uses the continuum of logical values between 0 (completely false) and 1 (completely true). Instead of just black and white, it employs the spectrum of values, accepting that things can be partly true and partly false at the same time.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 5

Brief History
• Fuzzy, or multi-valued logic, was introduced in the 1930s by Jan Lukasiewicz, a Polish philosopher. While classical logic operates with only two values 1 (true) and 0 (false), Lukasiewicz introduced logic that extended the range of truth values to all real numbers in the interval between 0 and 1.
• For example, the possibility that a man 181 cm tall is really tall might be set to a value of 0.86. It is likely that the man is tall. This work led to an inexact reasoning technique often called possibility theory.
• In 1965 Lotfi Zadeh, published his famous paper “Fuzzy sets”. Zadeh extended the work on possibility theory into a formal system of mathematical logic, and introduced a new concept for applying natural language terms. This new logic for representing and manipulating fuzzy terms was called fuzzy logic.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 6

Zadeh’s Paper on Fuzzy Sets (1965)
L. A. Zadeh: Fuzzy sets. Information and Control (1965) 37,529 Citations

But Why?
• Why fuzzy? • As Zadeh said, the term is concrete, immediate and descriptive; we all know
what it means. However, many people were repelled by the word fuzzy, because it is usually used in a negative sense.
• Why logic? • Fuzziness rests on fuzzy set theory, and fuzzy logic is just a small part of that
theory.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 7

The Term “Fuzzy Logic”
• The term fuzzy logic is used in two senses:
• Narrow sense: Fuzzy logic is a branch of fuzzy set theory, which deals (as logical systems do) with the representation and inference from knowledge. Fuzzy logic, unlike other logical systems, deals with imprecise or uncertain knowledge. In this narrow, and perhaps correct sense, fuzzy logic is just one of the branches of fuzzy set theory.
• Broad Sense: fuzzy logic synonymously with fuzzy set theory
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 8

Fuzzy Logic Applications
• Theory of fuzzy sets and fuzzy logic have been applied to problems in a variety of fields: • taxonomy; topology; linguistics; logic; automata theory; game theory; pattern
recognition; medicine; law; decision support; Information retrieval; etc.
• And more recently fuzzy machines have been developed including: • automatic train control; tunnel digging machinery; washing machines; rice
cookers; vacuum cleaners; air conditioners, ride smoothness control, camcorder auto-focus and jiggle control, braking systems, copier quality control, high performance drives, etc.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 9

Fuzzy Logic Applications
Advertisement: …
• Extraklasse Washing Machine - 1200 rpm. The Extraklasse machine has a number of features which will make life easier for you.
• Fuzzy Logic detects the type and amount of laundry in the drum and allows only as much water to enter the machine as is really needed for the loaded amount. And less water will heat up quicker - which means less energy consumption.
• Foam detection: Too much foam is compensated by an additional rinse cycle: If Fuzzy Logic detects the formation of too much foam in the rinsing spin cycle, it simply activates an additional rinse cycle. Fantastic!
• Imbalance compensation: In the event of imbalance, Fuzzy Logic immediately calculates the maximum possible speed, sets this speed and starts spinning. This provides optimum utilization of the spinning time at full speed.
• Washing without wasting - with automatic water level adjustment: Fuzzy automatic water level adjustment adapts water and energy consumption to the individual requirements of each wash programme, depending on the amount of laundry and type of fabric.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 10

Fuzzy Sets and Membership Functions
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 11

Fuzzy Sets
• The concept of a set is fundamental to mathematics.
• However, our own language is also the supreme expression of sets.
• The elements of the fuzzy set “tall men” are all men, but their degrees of membership depend on their height.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 12

Crisp and fuzzy sets of “tall men”
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 13
150 210170 180 190 200160
Height, cmDegree ofMembership
150 210180 190 200
1.0
0.0
0.2
0.4
0.6
0.8
160
Degree ofMembership
170
1.0
0.0
0.2
0.4
0.6
0.8
Height, cm
Fuzzy Sets
Crisp Sets
The y-axis represents the membership value of the fuzzy set
The x-axis represents the universe of discourse

A Fuzzy Set has 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 fA(x) called the characteristic function of A:
fA(x) : X {0, 1}, where
This set maps universe X to a set of two elements. For any element x of universe X, characteristic function fA(x) is equal to 1 if x is an element of set A, and is equal to 0 if x is not an element of A.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 14
Ax
Axxf A
if0,
if 1,)(

A Fuzzy Set has Fuzzy Boundaries
• In the fuzzy theory, 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 x is totally in A;
µA(x) = 0 if x is not in A;
0 < µA(x) < 1 if x is partly in A.
This set allows a continuum of possible choices. 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.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 15

Classical Logic vs. Fuzzy Logic
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 16
Classical Logic Element x belongs to set A or it does not: (x){0,1}
A=“young”
x [years]
A(x)
1
0
Fuzzy Logic Element x belongs to set A with a certain degree of membership: (x)[0,1]
A=“young”
x [years]
A(x)
1
0

Fuzzy Measures
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 17
150
160
170
180
Very Tall
Tall
Medium
Short
Very Short
CM

Membership Functions (MF)
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 18
Common used Types of Membership Function
Triangular Trapezoid Gaussian

Membership Function: An Example
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 19
Very Tall Tall Medium Short Very Short
150cm 160cm 170cm 180cm
1.0

0,5.0,5.0,0,0
Membership Function: An Example
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 20
Short Medium Tall
0,0,0,1,0
Very Tall Tall Medium Short Very Short
150 160 170 180
1.0

Fuzzy Linguistic Variables (FLV)
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 21

FLV and hedges
• A FLV is a fuzzy variable. For example, the statement “John is tall” implies that the linguistic variable John takes the linguistic value tall.
• A FLV carries with it 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.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 22

Examples of FLV
• color: red, blue, green, yellow, … • age: young, middle-aged, old, very old • size: small, big, very big, … • distance: near, far, very far, not very far, …
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 23
1
0
young middle-aged old
Age
very old
µ

Representation of hedges in fuzzy logic
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 24
HedgeMathematicalExpression
A little
Slightly
Very
Extremely
Graphical Representation
[A(x)]1.3
[A(x)]1.7
[A(x)]2
[A(x)]3

Representation of hedges in fuzzy logic
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 25
HedgeMathematicalExpression
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

Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 26
Fuzzy Set Operations and Properties

Characteristics of Fuzzy Sets
• The classical set theory developed in the late 19th century by Georg Cantor describes how crisp sets can interact. These interactions are called operations.
• Also fuzzy sets have well defined properties.
• These properties and operations are the basis on which the fuzzy sets are used to deal with uncertainty on the one hand and to represent knowledge on the other.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 27

Note: Membership Functions
• For the sake of convenience, usually a fuzzy set is denoted as: A = A(xi)/xi + …………. + A(xn)/xn where A(xi)/xi (a singleton) is a pair “grade of membership”
element, that belongs to a finite universe of discourse:
A = {x1, x2, .., xn}
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 28

Operations of Crisp Sets
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 29
Intersection Union
Complement
Not A
A
Containment
AA
B
BA BAA B

Complement
• Crisp Sets: Who does not belong to the set?
• Fuzzy Sets: How much do elements not belong to the set?
• The complement of a set is an opposite of this set. For example, if we have the set of tall men, its complement is the set of NOT tall men. When we remove the tall men set from the universe of discourse, we obtain the complement.
• If A is a fuzzy set, its complement 𝑨 can be found as follows: 𝝁𝑨 (x) = 1 A(x)
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 30

Containment
• Crisp Sets: Which sets belong to which other sets?
• Fuzzy Sets: Which sets belong to other sets?
• A set can contain other sets. The smaller set is called the subset. For example, the set of tall men contains all tall men; very tall men is a subset of tall men. However, the tall men set is just a subset of the set of men. • In crisp sets, all elements of a subset entirely belong to a larger set. • In fuzzy sets, however, each element can belong less to the subset than to
the larger set. Elements of the fuzzy subset have smaller memberships in it than in the larger set.
• Tall men: (0/180, 0.25/182.5, 0.5/185, 0.75/187.5, 1/190) • Very Tall Men: (0/180, 0.06/182.5, 0.25/185, 0.56/187.5, 1/190)
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 32

Intersection
• Crisp Sets: Which element belongs to both sets?
• Fuzzy Sets: How much of an 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:
AB(x) = min [A(x), B(x)] = A(x) B(x),
where xX
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 33

Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 35
0 1 2
3 x
AB(x)
0 1 2
3 x
B(x)
0 1 2
3 x
A(x)
1 )](),([min )( A xxx BBA

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 element that falls into either set. For example, the union of tall men and fat men contains all men who are tall OR fat.
• In fuzzy sets, the union is the reverse of the intersection. That is, the union is the largest membership value of the element in either set. The fuzzy operation for forming the union of two fuzzy sets A and B on universe X can be given as:
AB(x) = max [A(x), B(x)] = A(x)B(x),
where xX
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 36

Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 38
0 1 2
3 x
B(x)
0 1 2
3 x
A(x)
1
A+B (x)
0 1 2
3 x
)](),([max )( A xxx BBA

Operations of Fuzzy Sets
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 39
Complement
0x
1
( x )
0x
1
Containment
0x
1
0x
1
A B
Not A
A
Intersection
0x
1
0x
A B
Union
0
1
A B
A B
0x
1
0x
1
B
A
B
A
( x )
( x ) ( x )

Properties of Fuzzy Sets
• Equality of two fuzzy sets
• Inclusion of one fuzzy set into another fuzzy set
• Cardinality of a fuzzy set
• An empty fuzzy set
• -cuts (alpha-cuts)
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 40

Equality
• Fuzzy set A is considered equal to a fuzzy set B, IF AND ONLY IF (iff):
A(x) = B(x), xX
A = 0.3/1 + 0.5/2 + 1/3
B = 0.3/1 + 0.5/2 + 1/3
therefore A = B
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 41

Inclusion
• Inclusion of one fuzzy set into another fuzzy set. Fuzzy set A X is included in (is a subset of) another fuzzy set, B X:
A(x) B(x), xX
Consider X = {1, 2, 3} and sets A and B
A = 0.3/1 + 0.5/2 + 1/3;
B = 0.5/1 + 0.55/2 + 1/3
then A is a subset of B, or A B
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 42

Cardinality
• Cardinality of a non-fuzzy set, Z, is the number of elements in Z. • BUT the cardinality of a fuzzy set A, the so-called SIGMA COUNT, is
expressed as a SUM of the values of the membership function of A, A(x):
cardA = A(x1) + A(x2) + … A(xn) = ΣA(xi), for i=1..n
Consider X = {1, 2, 3} and sets A and B A = 0.3/1 + 0.5/2 + 1/3; B = 0.5/1 + 0.55/2 + 1/3 cardA = 1.8 cardB = 2.05
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 43

Empty Fuzzy Set
• A fuzzy set A is empty IF AND ONLY IF:
A(x) = 0, xX
Consider X = {1, 2, 3} and set A
A = 0/1 + 0/2 + 0/3
then A is empty
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 44

Alpha-cut
• An -cut or -level set of a fuzzy set A X is an ORDINARY (CRISP) SET A X, such that:
A={A(x), xX}. Consider X = {1, 2, 3} and set A A = 0.3/1 + 0.5/2 + 1/3 then A0.5 = {2, 3}, A0.1 = {1, 2, 3}, A1 = {3}
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 45

Fuzzy Set Normality
• A fuzzy subset of X is called normal if there exists at least one element xX such that A(x) = 1.
• A fuzzy subset that is not normal is called subnormal.
• All crisp subsets except for the null set are normal. In fuzzy set theory, the concept of nullness essentially generalises to subnormality.
• The height of a fuzzy subset A is the large membership grade of an element in A
height(A) = maxx(A(x))
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 46

Fuzzy Sets Core and Support
• Assume A is a fuzzy subset of X:
• the support of A is the crisp subset of X consisting of all elements with non-zero membership grade:
supp(A) = {x| A(x) 0 and xX}
• the core of A is the crisp subset of X consisting of all elements with membership grade 1:
core(A) = {x| A(x) = 1 and xX}
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 47

Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 48
Fuzzy Rules

Fuzzy Rules
• Fuzzy rules relate fuzzy sets.
• In a FIS (fuzzy interference 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.
• In fuzzy systems, FLV are used in fuzzy rules. Ex:
IF project_duration is long
THEN completion_risk is high
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 49

Fuzzy Rules: An Example
• 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
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 50
Tall men Heavy men
180
Degree ofMembership
1.0
0.0
0.2
0.4
0.6
0.8
Height, cm
190 200 70 80 100160
Weight, kg
120
Degree ofMembership
1.0
0.0
0.2
0.4
0.6
0.8

Fuzzy Rules: An Example
• 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.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 51
Tall menHeavy men
180
Degree ofMembership
1.0
0.0
0.2
0.4
0.6
0.8
Height, cm
190 200 70 80 100160
Weight, kg
120
Degree ofMembership
1.0
0.0
0.2
0.4
0.6
0.8

Fuzzy Rules: Examples
A fuzzy rule can have multiple antecedents: IF project_duration is long AND project_staffing is large AND project_funding is inadequate THEN risk is high The consequent of a fuzzy rule can also include multiple parts:
IF temperature is hot THEN hot_water is reduced; cold_water is increased
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 52

Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 53
Fuzzy Inference System

Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 54
Crisp Input
Fuzzy Input
Fuzzy Output
Crisp Output
Fuzzification
Rule Evaluation
Defuzzification
Input Membership Functions
Rules / Inferences
Output Membership Functions
Fuzzy System

Operation of Fuzzy Systems
• Step 1: Input Fuzzification
• Step 2: Fuzzy Rules Evaluation
• Step 3: Calculate Membership
• Step 4: Activate Fuzzy Rules
• Step 5: Compute Decision Function
• Step 6: Compute Final Decision
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 55

Step 1: Input Fuzzification
• Fuzzifier converts a crisp input into a FLV
• Definition of the MF must • reflect the designer's knowledge
• provide smooth transition between member and nonmembers of a fuzzy set
• be simple to calculate
• Typical shapes of the MF are Gaussian, Trapezoidal and Triangular.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 56

Example
• Assume we want to evaluate the health state of a person based on his height and weight.
• The input variables are the crisp numbers of the person’s height and weight.
• Fuzzification is a process by which the numbers (height and weight ) are changed into linguistic words.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 57

Fuzzification of Height
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 58
150cm 160cm 170cm 180cm
Very Short Short Medium Tall Very Tall
VS = Very Short S = Short M = Medium etc.
1.0

Fuzzification of Weight
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 59
Very Heavy Heavy Medium Slim Very Slim
70kg 90kg 110kg 130kg
1.0
VS = Very Slim S = Slim M = Medium etc.

Step 2: Fuzzy Rules Evaluation
• Rules reflect expert’s decisions
• Rules are tabulated as fuzzy words
• Rules can be grouped in subsets
• Rules can be redundant
• Rules can be adjusted to match desired results
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 60

Fuzzy Rules Function
• Rules are tabulated as fuzzy words (which describe consequences) • Healthy (H)
• Somewhat healthy (SH)
• Less Healthy (LH)
• Unhealthy (U)
• Rule function f
f = {U, LH, SH, H}
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 61

Fuzzified Decision
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 62
f
f= {U, LH, SH, H}

Weight
He
ight
Very
Slim Slim
Medium
Heavy Very
Heavy
Very
Short H SH LH U U
Short SH H SH LH U
Medium
LH H H LH U
Tall U SH H SH U
Very
Tall U LH H SH LH
Fuzzy Rules Table
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 63

Step 3: Calculate Membership
• For a given person, compute the membership of his weight and height
• Example: • Assume that a person’s height is 172cm
• Assume that the person’s weight is 66kg
• How about his health?
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 64

Membership of Height
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 65
Very Short Short Medium Tall Very Tall
150cm 160cm 170cm 180cm
1.0
0.7
0.3
𝜇ℎ𝑒𝑖𝑔ℎ𝑡 = {0 0 0.7 0.3 0}
𝜇ℎ𝑒𝑖𝑔ℎ𝑡 = {𝜇VS, 𝜇S, 𝜇M, 𝜇T, 𝜇VT}

Membership of Weight
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 66
Very Slim Slim Medium Heavy Very Heavy
70kg 90kg 110kg 130kg
1.0
0.8
0.2
𝜇𝑤𝑒𝑖𝑔ℎ𝑡 = {0.8 0.2 0 0 0}
𝜇𝑤𝑒𝑖𝑔ℎ𝑡 = {𝜇VS, 𝜇S, 𝜇M, 𝜇H, 𝜇VH}

Weight
Heigh
t
Very
Slim Slim Medium Heavy
Very
Heavy
Very
Short H SH LH U U
Short SH H SH LH U
Medium H LH U
Tall H SH U
Very
Tall U LH H SH LH
Step 4: Activate Fuzzy Rules
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 67

LH SH H LH U Very Tall
U SH H 0.3
U LH H 0.7
U LH SH H SH Short
U U LH SH H Very Short
Very Heavy
Heavy Medium 0.2 0.8
Heigh
t
Weight
SH U
H LH
Substitute Membership Values
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 68

Weight
Heigh
t
0.8 0.2 Medium
(0)
Heavy
(0)
V.Heavy
(0)
V.Short
(0) 0 0 0 0 0
Short
(0) 0 0 0 0 0
0.7 0.7 0.2 0 0 0
0.3 0.3 0.2 0 0 0
V.Tall
(0) 0 0 0 0 0
Perform Min Operation
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 69

Step 5: Compute Decision Function
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 70
f = { U , L H , S H , H } f = {0.3,0.7,0.2,0.2}
Weight
Heigh
t
0.8 0.2
V.Short(0) 0 0
Short(0) 0 0
0.7 0.7 0.2
0.3 0.3 0.2
V.Tall(0) 0 0
Weight
Heigh
t
0.8 0.2
V.Short(0) H SH
Short(0) SH H
0.7 LH H
0.3 U SH
V.Tall(0) U LH

Scaled Fuzzified Decision
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 71
f = { U , L H , S H , H }
f = { 0.3, 0.7, 0.2, 0.2}

Step 6: Compute Final Decision
• Use the fuzzified rules to compute the final decision.
• Two methods are often used:
- Maximum (Sugeno method)
- Centroid (Mamdani method)
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 72

Max Method
• Fuzzy set with the largest membership value is selected.
• Fuzzy decision:
f = { U, LH, SH, H }
f = {0.3, 0.7, 0.2, 0.2}
• Final Decision (FD) = Less Healthy
• If two decisions have the same membership max, use the average of the two.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 73

Centroid Method
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 75
𝑭𝑫 = 𝝁𝑫
𝝁=𝝁𝑼𝑫𝑼 + 𝝁𝑳𝑯𝑫𝑳𝑯 +⋯
𝝁𝑼 + 𝝁𝑳𝑯 +⋯
𝑭𝑫 =𝟎.𝟑×𝟎.𝟐+𝟎.𝟕×𝟎.𝟒+𝟎.𝟐×𝟎.𝟔+𝟎.𝟐×𝟎.𝟖
𝟎.𝟑+𝟎.𝟕+𝟎.𝟐+𝟎.𝟐=0.4429
Crisp Decision Index (D) = 0.4429

Fuzzified Decision
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 76
Crisp Decision Index (D) is the centroid D=0.4429

Fuzzy Decision Index
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 77
Fuzzy Decision Index (D) 75% in Less Healthy group 25% in Somewhat Healthy group

Summary
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 78

Benefits
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 80

Strength and Weakness
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 81

Reading materials
• [Book] Ross T J. Fuzzy logic with engineering applications (Chapter 6 Logic and Fuzzy Systems). John Wiley & Sons, 2009.
• [Zadeh, 1965] Zadeh, L. (1965). Fuzzy sets. Information and Control, 8(3):338 – 353.
• [Madau D., 1996] Madau D., D. F. (1996). Influence value defuzzification method. Fuzzy Systems, Proceedings of the Fifth IEEE International Conference, 3:1819 – 1824.
• [Leekwijck and Kerre, 1999] Leekwijck, W. V. and Kerre, E. E. (1999). Defuzzification: criteria and classification. Fuzzy Sets and Systems, 108(2):159 – 178.
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 82

Homework 1
Consider two fuzzy subsets of the set X,
X = {a, b, c, d, e }
referred to as A and B
A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}
and
B = {0.6/a, 0.9/b, 0.1/c, 0.3/d, 0.2/e}
Calculate the following : Support, Core, Cardinality, Complement, Union, Intersection, A ( =0.5), A ( =0.2), -cut (A0.2, A0.3, A0.8, A1)
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 83

Homework 2
For A = {0.2/a, 0.4/b, 1/c, 0.8/d, 0/e} B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e}
Draw the Fuzzy Graph of A and B Then, calculate the following: - Support, Core, Cardinality, and Complement for A and B independently - Union and Intersection of A and B - the new set C, if C = A2 - the new set D, if D = 0.5∙B - the new set E, for an alpha cut at A0.5
Fall 2017 Artificial Intelligence: Fuzzy Logic and Fuzzy Systems 84