Professional Documents
Culture Documents
Fuzzy Logic-HIAST-5th-Year
Fuzzy Logic-HIAST-5th-Year
and Technology
1
Contents of Lecture
Course organisation + References
Definition and History of fuzzy logic
Definition of fuzzy sets
Membership functions
Operations of fuzzy sets
Linguistic variables
Fuzzy rules (Reasoning)
De-fuzzification
2
Course organisation + References
Final exam 3 points + Mini Project 2 points +
Practical sessions 2 points
Documents are Allowed
References
- Book: “An Introduction to Fuzzy Logic and
Fuzzy Sets”
James J. Buckley, Esfandiar Eslami / Springer 2002
4
Definition and History of Fuzzy Logic
The opposite word (antonym) of fuzzy is crisp.
Fuzzy means un-clear or ambiguous, blurred and
Crisp means clear, clean, and sharp.
5
Definition and History of Fuzzy Logic
We’re assuming we know what words like “tall”, “very
tall”, “close”, “very close”, “far”, “very far”… While we
might be able to give a clear definition of “long” it won’t
ever match the real world.
6
Definition and History of Fuzzy Logic
Traditional logic: true vs. false
Language isn’t usually precise…
How hot is “hot”? 30 degrees? 40 degrees?
Fuzzy Sets let us say something is 90% “one thing”
and 10% “another”, without being illogical.
7
Definition and History of Fuzzy Logic
Fuzzy logic approximates human reasoning
It does a good job of balancing the tradeoff between
precision and significance.
8
Definition and History of Fuzzy Logic
Fuzzy logic Properties:
Flexible
Understandable
Highly suitable method for uncertain or approximate
reasoning
views inference as a process of propagating elastic
constraints
Mostly robust as no precise inputs required
9
Definition and History of Fuzzy Logic
Fuzzy logic Properties:
Close to the human approach of reasoning (un-clear
or ambiguous, blurred ).
using linguistic variables (words) more than
precise numbers
10
Definition and History of Fuzzy Logic
Example 1:
Example 2:
11
Definition and History of Fuzzy Logic
1923: “Bertie” Russell releases a paper on
Vagueness. How do we define objects that are partly
in two normally mutually exclusive sets?
• 1937: Black defines Vague sets.
• 1965: Zadeh coins the daft name “Fuzzy” for a logic
based on Vague set membership, instantly putting
humourless scientist’s backs up.
• 1972: 1st practical demonstration Mamdani’s steam
engine.
• 1981: 1st commercial applications using fuzzy logic to
control systems.
• 1994: Japan exported $35 billion worth of fuzzy
products
12
Contents of Lecture
Course organisation + References
Definition and History of fuzzy logic
Definition of fuzzy sets
Membership functions
Operations of fuzzy sets
Linguistic variables
Fuzzy rules (Reasoning)
De-fuzzification
13
Definition of fuzzy sets
Classical set theory:
• a refresher on the classical sets
• 5, 10, 7, 6, 9 is a set of integers.
• 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
is the set of integers between 0 and 10.
• ‘a‘ , ‘b'; ‘c', 'a' is a set of characters.
• "Site", "of", is a set of words.
Concept of belonging:
• the fact that an element is part of a set or not.
• Membership 7 ∈ {6; 7; 9} and non-membership 5 ∉
{2, 6, 7 9}.
14
Definition of fuzzy sets
• We give things a degree of membership between 0
and 1 in several sets (subsets).
• We then label these sets using human terms.
15
Definition of fuzzy sets
• Fuzzy logic is based on the theory of fuzzy sets
(generalization of the classical set theory )
16
Definition of fuzzy sets
17
Definition of fuzzy sets
X: universe (Set) of discourse (classical set in classical
logic). Fuzzy Set A is defined by
A={μ(x) | x ⋀ x in X}
where μ(x) is a membership function.
Let X be a set and A a fuzzy subset of X.
A(x) is called the membership degree of x in A.
19
Contents of Lecture
Course organisation + References
Definition and History of fuzzy logic
Definition of fuzzy sets
Membership functions
Operations of fuzzy sets
Linguistic variables
Fuzzy rules (Reasoning)
De-fuzzification
20
Membership functions
Membership function of a fuzzy set A:
μA: X [0,1]
If the universe of discourse X={x1,x2,...,xN}, A is
described as follows:
A = μA(x1)/x1 + μA(x2)/x2+...+ μA(xN)/xN
21
Membership functions
22
Membership functions
• The height of A h(A) is the upper bound of the domain
of its membership function.
h(A) = sup{μA(x) | x ∈ X }. (Superior )
• Normalized Set: A is normalized if and only if h(A) = 1.
In practice, it is extremely rare to work on non-
normalized fuzzy sets.
• The support of A is the set supp(A):
supp(A) = {x ∈ X | μA(x) > 0}.
• kernel of A is the set of elements of X belonging
entirely to A. kernel(A) = {x ∈ X | μA(x) = 1}.
• An α-cut of A is the classical subset of elements with a
membership degree greater than or equal to α:
α-cut(A) = {x ∈ X | μA(x)≥ α}.
23
Membership functions
24
Membership functions
• Types of membership functions:
25
Membership functions
1- Triangular membership function
26
Membership functions
2- Trapezoidal membership function
27
Membership functions
Two special cases of Trapezoidal membership:
function
28
Membership functions
Two special cases of Trapezoidal membership
function
29
Membership functions
3- Gaussian membership function
30
Membership functions
4- Sigmoidal membership function
31
Membership functions
A linguistic variable 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,
less,
slightly,
indeed,
Extremly
32
Membership functions
Example of Hedges:
33
Membership functions
Hedges and Mathematical Expressions:
A little [μA(x) ]1.3
Very [μA(x) ]2
Extremely [μA(x) ]3
34
Contents of Lecture
Course organisation + References
Definition and History of fuzzy logic
Definition of fuzzy sets
Membership functions
Operations of fuzzy sets
Linguistic variables
Fuzzy rules (Reasoning)
De-fuzzification
35
Operations of fuzzy sets
36
Operations of fuzzy sets
Examples:
37
Operations of fuzzy sets
More Examples:
The universe of discourse:
38
Contents of Lecture
Course organisation + References
Definition and History of fuzzy logic
Definition of fuzzy sets
Membership functions
Operations of fuzzy sets
Linguistic variables
Fuzzy rules (Reasoning)
De-fuzzification
39
Linguistic variables
• Idea: to define fuzzy systems in natural language.
Let V be a variable (quality of service, tip amount),
X the range of values of the variable,
TV a finite or infinite set of fuzzy sets (Linguistic values,
Linguistic sets, Linguistic labels).
A linguistic variable corresponds to the triplet (V, X, TV ).
40
Linguistic variables
41
Linguistic variables
42
Linguistic variables
43
Contents of Lecture
Course organisation + References
Definition and History of fuzzy logic
Definition of fuzzy sets
Membership functions
Operations of fuzzy sets
Linguistic variables
Fuzzy rules (Reasoning)
De-fuzzification
44
Fuzzy Rules (Reasoning)
In classical logic:
If p then q : p true then q true
In fuzzy logic:
Fuzzy reasoning (approximate reasoning) is based on fuzzy rules.
Fuzzy rules are expressed in natural language using linguistic
variables.
Premise / Antecedent Consequent
If x ∈ A and y ∈ B then z ∈ C, with A, B and C fuzzy sets.
If (the quality of the food is delicious)
then (tip is high)
45
Fuzzy Rules (Reasoning)
• Example: If (the quality of the food is delicious)
then (tip is high)
The variable 'tip' belongs to the fuzzy set 'high' to a degree that
depends on the degree of validity of the premise (i.e. the
membership degree of the variable 'food quality' to the fuzzy set
'delicious '.)
46
Fuzzy Rules (Reasoning)
Number of Attributes: N
Number of Rules: K
The Kth fuzzy Rule:
47
Fuzzy Rules (Reasoning)
2- Fuzzy rules applied to
Fuzzy defuzzfication.: get new sets of members.
48
Fuzzy Rules (Reasoning)
• Fuzzy implication (inference): the
fuzzy system
designer must choose among the wide choice of
fuzzy implications
• Most commonly used are:
Mamdani: min (fa(x); fb(x))
Sugeno : f(x,y)
49
Fuzzy Rules (Reasoning)
• Example: Mamdani Fuzzy implication (min (fa(x); fb(x)) ) :
fuzzy rule: 'If (the food quality is delicious), then (tip is high)‘
50
Fuzzy Rules (Reasoning)
• Example: Mamdani Fuzzy implication (min (fa(x); fb(x)) ) :
• All the rules of a fuzzy system is called the decision matrix.
If the service is bad or the food is awful then the tip is low
51
Fuzzy Rules (Reasoning)
• Example: Mamdani Fuzzy implication (min (fa(x); fb(x)) ) :
• If (the service is excellent or the food is delicious)
then the tip is high
52
Fuzzy Rules (Reasoning)
• Example: Mamdani Fuzzy implication (min (fa(x); fb(x)) ) :
If the service is bad or the food is awful then the tip is low
If the service is good then the tip is average
If the service is excellent or the food is delicious then the tip is high
commutative
Aggregation
Commutative
53
Fuzzy Rules (Reasoning)
• Example: Sugeno Fuzzy implication
IF x is A And y is B THEN z is f(x,y)
x, y are linguistic variables,
A, B are fuzzy sets, on universe of discourse X, Y
F(x,y) is a mathematical function
54
Fuzzy Rules (Reasoning)
• Example: Sugeno Fuzzy implication
55
Fuzzy Rules (Reasoning)
• Example: Sugeno Fuzzy implication
56
Fuzzy Rules (Reasoning)
• Example: Sugeno Fuzzy implication
57
Fuzzy Rules (Reasoning)
• Example: Sugeno Fuzzy implication
58
Fuzzy Rules (Reasoning)
• More Examples: Sugeno Fuzzy implication
59
Fuzzy Rules (Reasoning)
• Example: Sugeno Fuzzy implication
60
Fuzzy Rules (Reasoning)
• Example: Sugeno Fuzzy implication
61
Contents of Lecture
Course organisation + References
Definition and History of fuzzy logic
Definition of fuzzy sets
Membership functions
Operations of fuzzy sets
Linguistic variables
Fuzzy rules (Reasoning)
De-fuzzification
62
Fuzzy Rules
2- Fuzzy rules applied to
Fuzzy defuzzfication.: get new sets of members.
63
Defuzzification
Fuzzy defuzzification.:
The final process of a fuzzy system to set the output (the
final decision).
Fuzzy to Crisp conversion.
There are many methods of defuzzfication :
Mean Of Maxima (MeOM) Maxima
First Of Maxima
Last Of Maxima
Methods
Center Of Gravity (COG) - Centroid Of Area
Weighted Average method
Alpha-cut (lambda-cut) method
64
Defuzzification
Fuzzy defuzzification (Mean Of Maxima MeOM):
MeOM defuzzification's output is the average of the abscissas of the
maxima of the fuzzy set resulting from the aggregation of the implication
results.
65
Defuzzification
Fuzzy defuzzification (Mean Of Maxima MeOM):
Example
66
Defuzzification
Fuzzy defuzzification (First Of Maxima):
67
Defuzzification
Fuzzy defuzzification (Last Of Maxima):
68
Defuzzification
Fuzzy defuzzification (Center Of Gravity COG - centroid):
COG defuzzification's output corresponding to the abscissa of the
center of gravity of the surface of the membership function
characterizing the fuzzy set resulting from the aggregation of the
implication results..
69
Defuzzification
Fuzzy defuzzification (Center Of Gravity COG - centroid):
The area and the center of gravity or centroid of each sub-area is
calculated and then the summation of all these sub-areas is taken to
find the defuzzified value for a discrete fuzzy set.
70
Defuzzification
Fuzzy defuzzification (Center Of Gravity COG - centroid):
The area and the center of gravity or centroid of each sub-area is
calculated and then the summation of all these sub-areas is taken to
find the defuzzified value for a discrete fuzzy set.
71
Defuzzification
Fuzzy defuzzfication (Center Of Gravity COG - centroid):
72
Defuzzification
Fuzzy defuzzfication (Center Of Gravity COG - centroid):
73
Defuzzification
Fuzzy defuzzfication (Center Of Gravity COG - centroid):
74
Defuzzification
Fuzzy defuzzfication (Center Of Gravity COG - centroid):
75
Defuzzification
Fuzzy defuzzfication (Center Of Gravity COG - centroid):
76
Defuzzification
Fuzzy defuzzfication (Weighted Average Method):
produces results very close to the COA method.
less computationally intensive
Each membership function is weighted by its maximum
membership value.
77
Defuzzification
Fuzzy defuzzfication (Weighted Average Method):
.
78
Defuzzification
• Example: Sugeno Fuzzy implication with Weighted Average Method
79
Defuzzification
• Example: Sugeno Fuzzy implication with Weighted Average Method
80
Defuzzification
• Example: Sugeno Fuzzy implication with Weighted Average Method
81
Defuzzification
Fuzzy defuzzfication (alpha-cut method):
82
Defuzzification
Fuzzy defuzzfication (alpha-cut method):
α-cut properties:
83