NFS Unit 3 Notes PDF
NFS Unit 3 Notes PDF
Input
Inference
Fuzzifier Defuzzifier Plant Output
Engine
Fuzzy
Knowledge base
Inputs and Outputs of FIS
4. Defuzzification
Example:
p fuzzy
y control
Crisp
Crisp Inference Defuzzilier Values
Values Fuzzifier
Engine
Membership Functions
Rule 1: If p
pressure is low and temperature
p is high
g then p
power is low
Rule 2: If pressure is average and temperature is warm
then power is moderate
Mamdani Fuzzyy Models
y Y
L M H VH
B1 B2 B3 B4
\ C2 C3 C4 L Z L M H
A1
M L M H VH
x A2 C5 C6 C7 C8 x
H M H VH VH
A3 C9 C10 C11 C12
z Playing time
Whyy Defuzzification Is Needed?
•S
So, we have
h tto use a defuzzifier
d f ifi tot convertt a
fuzzy set to a crisp value.
Defuzzification
• zBOA satisfies
| ∈ | ∈
| ∗
′ ∈
• In particular, if µA(z) has a single maximum at
z = z*, then the zMOM = z*.
• Moreover,
M if µA(z)
( ) reaches
h itits maximum
i whenever
h
then
zMOM = (zleft + zright)/2
Smallest of Maximum (zSOM ) and
Largest of Maximum (zLOM )
•B
Because off their
th i obvious
b i bi
bias, zSOM and
d zLOM are
not used as often as the other three
defuzzification methods.
methods
Defuzzification
Example
Example: Single-input Single-output
Mamdani Fuzzy Model
• An example
p of a single-input
g p single-output
g p
Mamdani fuzzy model with three rules can be
expressed as
▫ If X is small then Y is small.
▫ If X is medium then Y is medium.
▫ If X is large then Y is large
large.
• Figure (next slide) plots the membership
functions of input X and output Y Y.
• With max-min composition and centroid
defuzzification,, we can find the overall input-
p
output curve, as shown in the Figure.
Single-input single-output Mamdani
Fuzzy Model
Membership Grades
0.5 10
8
0
-10 -5 0 5 10
6
X
Y
es
ship Grade
4
small medium large
1
2
05
0.5 0
Members
-10 -5 0 5 10
X
0
0 2 4 6 8 10
Y
a) MFs of the input and output
b) Overall input-output curve
Example: Two-input Single-output
Mamdani Fuzzy Model
• An example of a two-input single-output
Mamdani fuzzy model with four rules can be
expressed as
▫ If X is small and Y is small then Z is negative large
large.
▫ If X is small and Y is large then Z is negative small.
▫ If X is large and Y is small then Z is positive small.
▫ If X is
i llarge and
d Y iis llarge th
then Z iis positive
iti llarge.
• Figure (next slide) plots the membership
functions of input X and Y and output Z.
• With max-min composition and centroid
defuzzification, we can find the overall input-
output
t t surface,
f as shown
h in
i the
th Figure.
Fi
Two-input Single-output Mamdani
Fuzzy Model
1 small large
0.5
0
-5 0 5
Grades
X
mbership G
1 smallll l
large 2
Z
0.5 -2
0
-5 0 5 5
Mem
Y 0
0
Theorem 4.1: If we use the product T‐norm, and the
summation S‐norm (which is not really an S‐norm), and
( h h ll )
centroid defuzzification, then the crisp output z is:
z
wa zi i i wi = firing strength (input MF value)
wa i i
ai = consequent MF area
zi = consequent MF centroid
ai and zi can be calculated ahead of time!
Example
We examine a simple two-input one-output problem that
includes three rules:
Rule: 1 IF x is A3 OR y is B1 THEN z is C1
Rule: 2 IF x is A2 AND y is B2 THEN z is C2
Rule: 3 IF x is A1 THEN z is C3
34
Step 2: Rule Evaluation
• The second step is to take the fuzzified inputs,
(x=A1) = 0.5,, (x=A2) = 0.2,, (y=B1) = 0.1 and (y=B2) = 0.7,,
and apply them to the antecedents of the fuzzy rules.
• If a given fuzzy rule has multiple antecedents, the fuzzy operator
((AND or OR)) is used to obtain a single g number that represents
p the
result of the antecedent evaluation.
j
RECALL: To evaluate the disjunction of the rule antecedents,, we use
the OR fuzzy operation. Typically, fuzzy expert systems make use of
the classical fuzzy operation union:
AB(x) = max [A(x), B(x)]
Similarly, in order to evaluate the conjunction of the rule antecedents,
we apply the AND fuzzy operation intersection:
AB(x) = min [A(x), B(x)]
Step 2: Rule Evaluation
1 1 1
A3 B1 C1 C2 C3
0.1 OR 0.1
0.0
(max)
0 x1 X 0 y1 Y 0 Z
Rule 1: IF x is A3 (0
(0.0)
0) OR y is B1 (0
(0.1)
1) THEN z is C1 (0
(0.1)
1)
1 1 1
0.7
C1 C2 C3
A2 0.2 B2 AND 0.2
(min)
0 x1 X 0 y1 Y 0 Z
Rule 2: IF x is A2 (0.2) AND y is B2 (0.7) THEN z is C2 (0.2)
1 1
A1 0.5 0.5 C1 C2 C3
0 x11 X 0 Z
Rule 3: IF x is A1 (0.5) THEN z is C3 (0.5)
Step 2: Rule Evaluation
• Now the result of the antecedent evaluation Degree of
can be applied to the membership function of Membership
1.0
10
the
th consequent. t
• The most common method is to cut the consequent C2
membership function at the level of the antecedent
truth. This method is called clipping (alpha-cut).
▫ Since the top of the membership function is sliced, 0.2
the clipped fuzzy set loses some information.
▫ However, clipping is still often preferred because it 0.0
Z
involves less complex and faster mathematics, and clipping
pp g
generates an aggregated d output surface
f that
h iis easier
i
to defuzzify. Degree of
Membership
• While clipping is a frequently used method, scaling 1.0
offers a better approach for preserving the original
shape of the fuzzy set. C2
▫ The original membership function of the rule
consequent is adjusted by multiplying all its
membership degrees by the truth value of the rule 0.2
antecedent.
▫ This method, which generally loses less information, 0.0
can be very useful in fuzzy expert systems. scaling Z
Step 3: Aggregation of the Rule
Outputs
• Aggregation is the process of unification of the outputs of all
rules.
• We take the membership functions of all rule consequents
previously clipped or scaled and combine them into a single
fuzzy set.
• The input of the aggregation process is the list of clipped or
scaled consequent membership functions, and the output is one
fuzzy set for each output variable.
1 1 1
C1 C2 C3
0.5 0.5
0.2 0.2
0.1 0.1
0 Z 0 Z 0 Z 0 Z
z is C 1 (0.1) z is C 2 (0.2) z is C 3 (0.5)
Step 4: Defuzzification
• The last step in the fuzzy inference process is defuzzification.
• Fuzziness helps us to evaluate the rules, but the final output of a
fuzzy system has to be a crisp number.
• The input for the defuzzification process is the aggregate output
fuzzy set and the output is a single number.
• There are several defuzzification methods, but probably the most
popular one is the centroid technique. It finds the point where a
vertical line would slice the aggregate set into two equal masses.
Mathematically this centre of gravity (COG) can be expressed as:
b
A x x dx
COG a
b
A x dx
a
Step 4: Defuzzification
• Centroid defuzzification method finds a point representing the centre
of gravity of the aggregated fuzzy set A, on the interval [a, b ].
• A reasonable estimate can be obtained by calculating it over a
sample of points.
Degree of
Membership
1.0
0.8
0.6
0.4
0.2
0.0
0 10 20 30 40 50 60 70 80 90 100
67.4 Z
• The most commonly used zero-order Sugeno fuzzy model applies fuzzy
rules in the following form:
IF x is A AND y is B THEN z is k
• where k is a constant.
• In this case,, the output
p of each fuzzyy rule is constant and all consequent
q
membership functions are represented by singleton spikes.
So …
• First-order Sugeno
g ( , y) is a
y model: f(x,
fuzzy
first-order polynomial
• zero-order Sugeno fuzzy model: f is a
constant
▫ a special case of the Mamdani fuzzy inference
system in which each rule's consequent is
system,
specified by a fuzzy singleton;
▫ or a special case of the Tsukamoto fuzzy model
(to be introduced next) in which each rule's
consequent is specified by an MF of a step
f
function
ti center
t att the
th constant
t t
Sugeno
g Fuzzy
y Models
z
Ai , Bk ( x, y ) f m ( i , k ) ( x, y )
Double summation
over all i (x MFs) and
over all i (x MFs) and
Ai , Bk ( x, y ) all k (y MFs)
w f ( x, y )
i i SSummation over all i
ti ll i
w i
(fuzzy rules)
4
Y
0.5
2
0 0
Me
-10 0 10 -10 0 10
X X
Example: Fuzzy and nonfuzzy rule
sets
• If we have smooth membership p functions
[figure (c)] instead, the overall input-output curve
[figure (d)] becomes a smoother one:
Y
0.5
2
Memb
0 0
-10 0 10 -10 0 10
X X
Example: Two-input single-output
Sugeno fuzzy model
• An example
p of a two-input
p single-output
g p Sugeno
g
fuzzy model with four rules:
▫ If X is small and Y is small then z = -x + y + 1.
▫ If X is small and Y is large then z = -y + 3.
▫ If X is large and Y is small then z = -x + 3.
▫ If X is large and Y is large then z = x + y + 2
2.
Example: Two-input single-output
Sugeno fuzzy model
Grades
Small Large
1
Membership
0.5
10
0
-5 0 5
M
5
X
Z
p Grades
Small Large 0
1
5
Membership
5
0.5 0
0
Y -5 -5
0 X
-5 0 5
M
Y
a) MFs of the inputs and output
b) Overall input-output curve
• Th
The surface
f i composed
is d off ffour planes,
l each
h off which
hi h iis
specified by the output equation of a fuzzy rule.
Another Example
1 1 1
A3 B1
0.1 OR 0.1
0.0
(max)
0 x1x1 X 0 y1y1 Y 0 k1k1 Z
Rule
Rule1:
1: IF x is A3 (0.0)
(0(0
(0.0)
0)0) OR
OR yy is
is B1
B1 (0.1)
(0 1) THENTHEN z is
z is
k1k1
(0.1)
(0(0.1)
(0
1)1)
1 1 1
0.7
A2 0.2 B2 AND 0.2
(min)
0 x1x1 X 0 y1
y1 Y 0 k2k2 Z
Rule
Rule 2:
2: IF
IF x is A2 (0.2)
(0.2) AND yyisisB2
B2(0.7)
(0.7) THENTHENz isz k2
is k2 (0.2)
(0.2)
1 1
A1 0.5 0.5
0 x1x1
11 X 0 k3
k3 Z
Rule 3: IF x is A1 (0.5)
Rule (0.5) THEN THENz isz k3
is k3 (0.5)
(0.5)
Another Example
▫ IT X is large then Y is C
3,
Example: Single-input Tsukamoto
fuzzy model
Example: Single-input Tsukamoto
fuzzy model
• The overall input-output
p p curve is equal
q to:
• Why
y to optimise?
p
▫ trial and error tuning is laborious
▫ it can be impossibly complicated if number of
input parameters are large (100’s or more)
▫ far too many parameters to tune: number of rules,
membership functions
functions, rule consequents
▫ arbitrariness of FIS is eliminated
▫ if not optimised,
p , the FIS performance
p is not
optimum
FIS Optimisation
• Optimisation methods:
▫ Adaptive Neuro-Fuzzy
Neuro Fuzzy systems
multilayer perceptron neural networks (ANFIS, FuNeI)
RBFN we will see these systems later on
▫ evolutionary techniques (genetic algorithms)
▫ clustering methods (cluster analysis, Hard C-means, Fuzzy C-
means)
▫ ...
FIS Optimisation
• Optimisation
p can be viewed as knowledge g
discovery
• Optimisation = Learning
• Resulting model describes input-output
relationships qualitatively and quantitatively.
• Easy
E validation
lid ti and d verification
ifi ti off FIS
Tuning
g fuzzyy systems
y
1. Review model input and output variables, and if
required redefine their ranges.
2. Review the fuzzy sets, and if required define
additional sets on the universe of discourse.
3. Provide sufficient overlap between neighbouring
sets. It is suggested that triangle-to-triangle and
trapezoid to triangle fuzzy sets should overlap
trapezoid-to-triangle
between 25% to 50% of their bases.
Tuning
g fuzzyy systems
y
p
input 2
Grid Partition
The curse of
dimensionality:
If we have n inputs and m
ut 1
p
input 2
Tree Partition
• Reduces the number of
rules
• Requires more MFs per
ut 1
inpu
i
inputt
• MFs do not have clear
linguistic meanings
Scatter partition
p
input 2
Scatter Partition
• In many systems,
extremes occur rarely
• Number of active rules
ut 1
inpu
d
depends
d on iinputt
values
Input Space Partitioning
g
• In g
general,, we design
g a fuzzy
y inference system
y
based on the past known behavior of a target
system.
• now consider how we might construct a fuzzy
inference system for a specific application
• fuzzy g features:
g has the following
y modeling
▫ Takes advantage of domain knowledge
Making it easy to incorporate human expertise about
th target
the t t system
t directly
di tl into
i t the
th modeling
d li process
▫ The use of numerical data also plays an
important role in fuzzy modeling
When the input-output data of a target system is
available, conventional system identification
t h i
techniques can b
be used
d ffor ffuzzy modeling
d li
Fuzzy
y Modeling
g
• fuzzy
y modelingg can be p g ,
pursued in two stages,
which are not totally disjoint:
1. the identification of the surface structure
2. the identification of deep structure
Fuzzy
y Modeling
g
• JJ-S
S R Jang and C T Sun,
C-T Sun Neuro Fuzzy
Neuro-Fuzzy
and Soft Computing, Prentice Hall, 1997
(Chapter 4)
4).