FUZZY SYSTEMS
Fuzzy Sets Operations
Intersection (A B)
In classical set theory the intersection of two sets contains
those elements that are common to both
The value of the elements in the intersection:
µA B(x) = min [µA(x), µB(x)]
e.g. Tall = (0/5, 0.1/5.25, 0.5/5.5, 0.8/5.75, 1/6)
Short = (1/5, 0.8/5.25, 0.5/5.5, 0.1/5.75, 0/6)
Tall Short = (0/5, 0.1/5.25, 0.5/5.5, 0.1/5.75, 0/6)
= Medium
1
FUZZY SYSTEMS
Fuzzy Sets Operations
Union (A B)
In classical set theory the union of two sets contains those
elements that are in any one of the two sets
The value of the elements in the union:
µA B(x) = max [µA(x), µB(x)]
e.g. Tall = (0/5, 0.1/5.25, 0.5/5.5, 0.8/5.75, 1/6)
Short = (1/5, 0.8/5.25, 0.5/5.5, 0.1/5.75)
Tall Short = (1/5, 0.8/5.25, 0.5/5.5, 0.8/5.75, 1/6)
= not Medium
2
FUZZY SYSTEMS
Fuzzy Sets Operations
Complement (A)
The value of complement of A is:
µ A(x) = 1 - µA(x)
e.g. Tall = (0/5, 0.1/5.25, 0.5/5.5, 0.8/5.75, 1/6)
Tall = (1/5, 0.9/5.25, 0.5/5.5, 0.2/5.75, 0/6)
3
FUZZINESS IS NOT PROBABILITY
• Probability is used, for example, in weather forecasting
• Probability is a number between 0 and 1 that is the
certainty that an event will occur
• Fuzziness is more than probability; probability is a
subset of fuzziness
• Probability is only valid for future/unknown events
• Fuzzy set membership continues after the event
FUZZY SYSTEMS
Fuzzy Relations
The fuzzy set operators allow rudimentary reasoning about
facts
For example, consider the three fuzzy sets tall, good_athlete
and good-basketballplayer. Now assume
If we know that a good basketball player is tall and is a
good athlete, then which one of Peter or Carl will be the
better basketball player?
5
FUZZY SYSTEMS
Fuzzy Relations
Through application of the intersection operator, we get
Using the standard set operators, it is possible to
determine that Peter will be better at the sport than Carl
The example above is a very simplistic situation. For
most real-world problems, the sought outcome is a
function of a number of complex events, or scenarios
6
FUZZY SYSTEMS
Fuzzy Relations
For example, actions made by a controller are determined
by a set of if-then rules. The if-then rules describe situations
that can occur, with a corresponding action that the
controller should execute
It is, however, possible that more than one situation, as
described by if-then rules, are simultaneously active, with
different actions. The problem is to determine the best
action to take
A mechanism is therefore needed to infer an action from a
set of activated situations
7
FUZZY SYSTEMS
Fuzzy rule based reasoning system
8
FUZZY SYSTEMS
Fuzzy rule based reasoning system
For fuzzy systems in general, the dynamic behavior of that
system is characterized by a set of linguistic fuzzy rules
These rules are based on the knowledge and experience of a
human expert within that domain. Fuzzy rules are of the
general form
if antecedent(s) then consequent(s)
The antecedents of a rule form a combination of fuzzy sets
through application of the logic operators (i.e. complement,
intersection, union)
The consequent part of a rule is usually a single fuzzy set,
with a corresponding membership function 9
FUZZY SYSTEMS
Fuzzification
The antecedents of the fuzzy rules form the fuzzy “input
space,” while the consequents form the fuzzy “output
space”
The input space is defined by the combination of input
fuzzy sets, while the output space is defined by the
combination of output sets
The fuzzification process is concerned with finding a fuzzy
representation of non-fuzzy input values. In which, input
values from the universe of discourse are assigned
membership values to fuzzy sets
10
FUZZY SYSTEMS
Fuzzification
For example the fuzzy sets A and B, and assume the
corresponding membership functions have been defined
already
Let X denote the universe of discourse for both fuzzy sets.
The fuzzification process receives the elements a, b € X, and
produces the membership degrees µA(a), µA(b) and µB(a),
µB(b)
11
FUZZY SYSTEMS
Inferencing
The task of the inferencing process is to map the fuzzified
inputs to the rule base, and to produce a fuzzified output
For the consequents in the rule output space, a degree of
membership to the output sets are determined based on the
degrees of membership in the input sets and the relationships
between the input sets
The output fuzzy sets in the consequent are then combined to
form one overall membership function for the output of the
rule
12
FUZZY SYSTEMS
Fuzzy Relations
Classical relation between two universes
U = {1, 2} and V = {a, b, c} is defined as:
a b c
R=UxV= 1 1 1 1
2 1 1 1
13
FUZZY SYSTEMS
Fuzzy Relations
Fuzzy relation between two universes U and V is defined as:
µR (u, v) = µAxB (u, v) = min [µA (u), µB (v)]
i.e. we take the minimum of the memberships of the two
elements which are to be related
14
FUZZY SYSTEMS
Fuzzy Relations
Example:
Determine fuzzy relation between A1 and A2
A1 = 0.2/x1 + 0.9/x2
A2 = 0.3/y1 + 0.5/y2 + 1/y3
15
FUZZY SYSTEMS
Fuzzy Relations
A2
R = R(A1, A2)
a23
(1.0)
= 0.2 0.2 0.2
0.3 0.5 0.9 0.2
a22 0.9
(0.5)
0.2 0.5
a21
(0.3)
0.2 0.3
a11 a12 A1
(0.2) (0.9)
16
FUZZY SYSTEMS
Fuzzy Relations
Example: The fuzzy relation R is
R = A1 x A2 = 0.2 x 0.3 0.5 1
0.9
= min(0.2, 0.3) min(0.2, 0.5) min(0.2, 1)
min(0.9, 0.3) min(0.9, 0.5) min(0.9, 1)
= 0.2 0.2 0.2
0.3 0.5 0.9
17
FUZZY SYSTEMS
Fuzzy Rules
Relates two or more fuzzy propositions
If X is A then Y is B
e.g. if height is tall then weight is heavy
X and Y are fuzzy variables
A and B are fuzzy sets
18
FUZZY SYSTEMS
Fuzzy Associative Matrix
So for the fuzzy rule:
If X is A then Y is B
We can define a matrix M(nxp) which relates A to B
M=AxB
It maps fuzzy set A to fuzzy set B and is used in the fuzzy
inference process
19
FUZZY SYSTEMS
Fuzzy Associative Matrix
Concept behind M
a1 b1 a1 b2 …
a2 b1 …
.
.
.
If a1 is true then b1 is true; and so on
20
FUZZY SYSTEMS
• Inference process in fuzzy expert systems has four steps
• FUZZIFICATION
• INFERENCE
• COMPOSITION
• DEFUZZIFICATION
21
FUZZY SYSTEMS
• Fuzzification :
In the fuzzification subprocess, the membership functions defined
on the input variables are applied to their actual values, to
determine the degree of truth for each rule premise
• Inference :
The truth value for the premise of each rule is computed, and
applied to the conclusion part of each rule. This results in one
fuzzy subset to be assigned to each output variable for each rule
22
FUZZY SYSTEMS
• Composition :
All of the fuzzy subsets assigned to each output variable are
combined together to form a single fuzzy subset for each output
variable.
• Defuzzification :
Sometimes it is useful to just examine the fuzzy subsets that are
the result of the composition process, but more often, this fuzzy
value needs to be converted to a single number - a crisp value.
This is what the defuzzification subprocess does
23
FUZZY SYSTEMS
24
FUZZY SYSTEMS
Fuzzy Inference: Composition Operator,
Max-min Inference
25
FUZZY SYSTEMS
Composition of Fuzzy Relations
Let there be three universes U, V and W
Let R be the relation that relates elements from U to V
e.g. R= 0.6 0.8
0.7 0.9
And let S be the relation between V and W
e.g. S= 0.3 0.1
0.2 0.8
26
FUZZY SYSTEMS
Composition of Fuzzy Relations
With the help of an operation called “composition” we can
find the relation T that maps elements of U to W
By max-min rule T = R S = maxvV { min(R(u, v), S(v, w)) }
0.6 0.8 0.3 0.1 = 0.3 0.8
0.7 0.9 0.2 0.8 0.3 0.8
Where
element (1,1) is obtained by max{min(0.6, 0.3), min(0.8, 0.2)}
= 0.3
Note that S R = 0.3 0.3 R S
0.7 0.8
27
FUZZY SYSTEMS
Example:
If Temperature is normal then Speed is medium
Let A = [0/100, 0.5/125, 1/150, 0.5/175, 0/200]
B = [0/10, 0.6/20, 1/30, 0.6/40, 0/50]
M = 0 0 0 0 0
0 0.5 0.5 0.5 0
0 0.6 1 0.6 0
0 0.5 0.5 0.5 0
0 0 0 0 0
28
FUZZY SYSTEMS
Max-Min Inference
Let Temperature = 125 o F = Acurrent
Then it may be thought of as a new fuzzy set defined over the
universe of discourse of variable Temperature
Acurrent = [0/100, 0.5/125, 0/150, 0/175, 0/200]
We can find the relationship (i.e. mapping or FAM) between
Acurrent and A as
A’ = Acurrent x A = 0 x [0 0.5 1 0.5 0]
0.5
0 = [0 0.5 0.5 0.5 0]
0 (if we eliminate all 0 rows)
0 29
FUZZY SYSTEMS
Max-Min Inference
Now the composition of A’ and M will produce a new
relationship, which we call B’
A’ M = B’
0 0 0 0 0
0 0.5 0.5 0.5 0
[0 0.5 0.5 0.5 0] 0 0.6 1.0 0.6 0 = [0 0.5 0.5 0.5 0]
0 0.5 0.5 0.5 0
0 0 0 0 0
30
FUZZY SYSTEMS
Multi-Premises Rules
If A B then C CA’
CB’
CA’ = A’ MAC
CB’ = B’ MBC
C’ = CA’ CB’ = min(CA’ , CB’)
CB’
CA’
31
FUZZY SYSTEMS
Multi-Premises Rules
If A B then C
C’ = CA’ CB’
= max(CA’ , CB’)
CB’ CB’
CA’ CA’
32
FUZZY SYSTEMS
Multiple Fuzzy Rules
In a regular rule-based system, if two rules are
simultaneously satisfied, a conflict resolution policy decides
the precedence
The system proceeds sequentially, with one rule firing at a
time
In fuzzy rule based systems, all rules are executed during
each pass through the system
33
FUZZY SYSTEMS
Fuzzy Inference: Combining Multiple Rules
34
EXAMPLE – DINNER
Dinner for two: this is a 2 input, 1 output, 3 rule
system
Rule 1 If service is poor or
food is rancid, then
Input 1 tip is cheap
Service (0-10)
Rule 2 If service is good, Output
then tip is average
Tip (5-25%)
Input 2
Food (0-10) Rule 3 If service is excellent or
food is delicious, then
tip is generous
The inputs are crisp (non- All rules are evaluated The results of the rules The result is a crisp (non-
fuzzy) numbers limited to in parallel using fuzzy are combined and fuzzy) number
a specific range reasoning distilled (de-fuzzyfied)
35
FUZZY SYSTEMS
Multiple Fuzzy Rules
36
FUZZY SYSTEMS
Fuzzy Inference: Defuzzification
37
FUZZY SYSTEMS
Defuzzification
In most applications we need to obtain a crisp value after
inferring a fuzzy set B’
The most popular defuzzification technique used is the
fuzzy centroid method
38
FUZZY SYSTEMS
Defuzzification
p
Fuzzy Centroid Method y
j 1
j A( y j )
yi p
j 1
A (yj)
Let B’ = [0/10, 0.3/20, 0.5/30, 0.3/40, 0/50]
then y = 10*0 + 20*0.3 + 30*0.5 + 40*0.3 + 50*0
0 + 0.3 + 0.5 + 0.3 + 0
= 6 + 15 + 12 = 33/1.1 = 30
1.1
39