Fuzzy Logic
Fuzzy Logic
INTRODUCTION TO
CLASSICAL SETS AND
FUZZY SETS
1
FUZZY LOGIC
Fuzzy logic is the logic underlying approximate, rather than
exact, modes of reasoning.
2
FUZZY LOGIC
3
TYPES AND MODELING
OF UNCERTAINTY
4
FUZZY vs PROBABILITY
Fuzzy ≠ Probability
5
FUZZY vs PROBABILITY
6
NEED OF FUZZY
LOGIC
Based on intuition and judgment.
{True, False}
{1, 0}
8
CRISP SETS
9
OPERATIONS ON CRISP
SETS
UNION:
INTERSECTION:
COMPLEMENT:
DIFFERENCE:
10
PROPERTIES OF CRISP
The various properties ofSETS
crisp sets are as follows:
11
PROPERTIES OF CRISP
SETS
12
FUZZY SETS
13
FUZZY SETS
14
FUZZY SETS
15
OPERATIONS ON FUZZY
SETS
16
PROPERTIES OF FUZZY
SETS
17
PROPERTIES OF FUZZY
SETS
18
PROPERTIES OF FUZZY
SETS
19
RELATIONS
Relations represent mappings between sets
and connectives in logic.
20
CRISP CARTESIAN
PRODUCT
21
CRISP RELATIONS
22
CRISP RELATIONS
23
CRISP BINARY
RELATIONS
Examples of binary relations
24
OPERATIONS ON CRISP
RELATIONS
25
PROPERTIES OF CRISP
RELATIONS
The properties of crisp sets (given below)
hold good for crisp relations as well.
Commutativity,
Associativity,
Distributivity,
Involution,
Idempotency,
DeMorgan’s Law,
Excluded Middle Laws.
26
COMPOSITION ON CRISP
RELATIONS
27
FUZZY CARTESIAN
PRODUCT
Let R be a fuzzy subset of M and S be a fuzzy subset of N.
Then the Cartesian product R × S is a fuzzy subset of N ×
M such that
Example:
Let R be a fuzzy subset of {a, b, c} such that R = a/1 + b/0.8
+ c/0.2 and S be a fuzzy subset of {1, 2, 3} such that S =
1/1 + 3/0.8 + 2/0.5. Then R x S is given by
28
FUZZY RELATION
29
FUZZY RELATION
30
OPERATIONS ON FUZZY
RELATION
The basic operation on fuzzy sets also apply on fuzzy
relations.
31
OPERATIONS ON FUZZY
RELATION
32
PROPERTIES OF FUZZY
RELATIONS
The properties of fuzzy sets (given below)
hold good for fuzzy relations as well.
Commutativity,
Associativity,
Distributivity,
Involution,
Idempotency,
DeMorgan’s Law,
Excluded Middle Laws.
33
COMPOSITION OF FUZZY
RELATIONS
34
COMPOSITION OF FUZZY
RELATIONS
35
COMPOSITION OF FUZZY
RELATIONS
36
COMPOSITION OF FUZZY
RELATIONS
37
CLASSICAL EQUIVALENCE
RELATION
38
CLASSICAL TOLERANCE
RELATION
39
FUZZY EQUIVALENCE
RELATION
40
FUZZY TOLERANCE
RELATION
A binary fuzzy relation that possesses the properties of
reflexivity and symmetry is called fuzzy tolerance
relation or resemblance relation.
41
CRISP MEMBERSHIP
FUCNTIONS
Crisp membership functions (µ ) are either one or zero.
42
REPRESENTING A
DOMAIN IN FUZZY
LOGIC
43
FUZZY MEMBERSHIP
FUCNTIONS
44
FUZZY MEMBERSHIP
FUCNTIONS
The set B of numbers approaching 2 can be represented by
the membership function
45
FUZZINESS vs
PROBABILITY
46
LINGUISTIC VARIABLE
47
LINGUISTIC VARIABLE
Let x be a linguistic variable with the label “speed”.
Terms of x, which are fuzzy sets, could be “positive low”,
“negative high” from the term set T:
48
MEMBERSHIP FUCNTIONS
49
MEMBERSHIP FUCNTIONS
50
FEATURES OF
MEMBERSHIP FUNCTIONS
CORE:
SUPPORT:
BOUNDARY:
51
FUZZIFICATION
52
FUZZIFICATION
Use crisp inputs from the user.
53
EXAMPLE -
FUZZIFICATION
54
FUZZIFICATION OF
HEIGHT
55
FUZZIFICATION OF
WEIGHT
56
METHODS OF
MEMBERSHIP VALUE
ASSIGNMENT
The various methods of assigning membership values are:
Intuition,
Inference,
Rank ordering,
Neural networks,
Genetic algorithm,
Inductive reasoning.
57
DEFUZZIFICATION
Defuzzification is a mapping process from a space of
fuzzy control actions defined over an output universe of
discourse into a space of crisp (nonfuzzy) control
actions.
58
LAMBDA CUT FOR FUZZY
SETS
59
LAMBDA CUT FOR FUZZY
RELATIONS
60
METHODS OF
DEFUZZIFICATION
Defuzzification is the process of conversion of a fuzzy quantity
into a precise quantity. Defuzzification methods include:
Max-membership principle,
Centroid method,
Mean-max membership,
Center of sums,
62
MAX MEMBERSHIP
Fuzzy set with the METHOD
largest membership value is selected.
Fuzzy decision: Fn = {P, F. G, VG, E}
Fn = {0.6, 0.4, 0.2, 0.2, 0}
Final decision (FD) = Poor Student
If two decisions have same membership max, use the
average of the two.
63
CENTROID METHOD
This method is also known as center-of-mass, center-of-
area, or center-of-gravity method. It is the most commonly
used defuzzification method. The defuzzified output x* is
defined as
64
WEIGHTED AVERAGE
METHOD
65
MEAN MAX MEMBERSHIP
METHOD
66
CENTER OF SUMS
This method employs the algebraic sum of the individual
fuzzy subsets instead of their unions. The calculations here
are very fast but the main drawback is that the intersecting
areas are added twice. The defuzzified value x* is given by
67
CENTER OF LARGEST AREA
This method can be adopted when the output consists of at least two
convex fuzzy subsets which are not overlapping. The output in this
case is biased towards a side of one membership function. When
output fuzzy set has at least two convex regions then the center-of-
gravity of the convex fuzzy subregion having the largest area is used to
obtain the defuzzified value x*. This value is given by
where is the convex subregion that has the largest area making
up
68
FIRST OF MAXIMA (LAST OF
MAXIMA)
The steps used for obtaining crisp values are as follows:
69
SUMMARY
Defuzzification process is essential because some
engineering applications need exact values for
performing the operation.
70
FUZZY ARITHMETIC
Distributions do not have to be precise.
71
FUZZY NUMBERS AND
THEIR ARITHMETIC
Fuzzy numbers
• Fuzzy sets of the real line,
• Unimodal,
• Reach possibility level one.
Fuzzy arithmetic
• Interval arithmetic at each possibility level.
72
FEATURES OF FUZZY
ARITHMETIC
Fully developed arithmetic and logic
• Addition, subtraction, multiplication, division, min,
max;
• Log, exp, sqrt, abs, powers, and, or, not;
• Backcalculation, updating, mixtures, etc.
73
TYPES OF NUMBERS
Scalars are well-known or mathematically
defined integers and real numbers.
74
FUZZY NUMBERS
Fuzzy set that is unimodal and reaches 1.
1
no no YES
0.5
75
LEVEL-WISE INTERVAL
ARITHMETIC
76
FUZZY INTERVALS BY TRAPEZOIDAL
SHAPES
77
FUZZY ADDITION
1
A B A+B
0.5
0
0 2 4 6 8
78
FUZZY ARITHMETIC
Interval Arithmetic
[a, b] + [d, e] = [a+d, b+e]
[a, b] - [d, e] = [a-e, b-d]
[a, b] x [d, e] = [min(a.d, a.e, b.d, b.e), max(a.d, a.e, b.d, b.e)]
[a, b]/[d, e] = [min(a/d, a/e, b/d, b/e), max(a/d, a/e, b/d, b/e)]
79
FUZZY ARITHMETIC
80
FUZZY ARITHMETIC
81
EXTENSION PRINCIPLE
82
VARIOUS FUZZY
MEASURES
Belief and Plausibility Measure.
Probability Measure.
83
POSSIBILITY MEASURE
No single definition.
84
FUZZY SET AS POSSIBILITY
MEASURE
85
GETTING FUZZY INPUTS
Subjective assignments:
• Make them up from highest, lowest and
best-guess estimates.
Objective consensus:
• Stack up consistent interval estimates or
bridge inconsistent ones.
Measurement error:
• Infer from measurement protocols.
86
SUBJECTIVE
ASSIGNMENTS
Triangular fuzzy numbers, e.g. [1,2,3].
1 1
Possibility
0.5 0.5
0 0
0 1 2 3 4 0 1 2 3 4 5
87
OBJECTIVE CONSENSUS
[1000, 3000]
1
[2000, 2400]
[500, 2500]
[800, 4000]
[1900, 2300] Possibility
0.5
0
0 2000 4000
88
MEASUREMENT ERROR
1
Possibility
46.8 ± 0.3
[46.5, 46.8, 47.1]
0
46.5 46.7 46.9 47.1
Possibility
[12.32]
[12.315, 12.32, 12.325]
0
12.31 12.32 12.33
89
SHAPE OF X AFFECTING
aX+b
90
ROBUSTNESS OF THE
ANSWER
Different choices for the fuzzy number X all
yield very similar distributions for aX + b
91
PROBABILITY MEASURE
92
POSSIBILITY MEASURE
93
ADVANTAGES OF FUZZY
ARITHMETIC
Requires little data.
Applicable to all kinds of uncertainty.
Fully comprehensive.
Fast and easy to compute.
Doesn’t require information about correlations.
Conservative, but not hyper-conservative
In between worst case and probability.
Backcalculations easy to solve.
94
LIMITATIONS OF FUZZY
ARITHMETIC
Controversial.
Are alpha levels comparable for different
variables?
Not optimal when there're a lot of data.
Can’t use knowledge of correlations to tighten
answers.
Not conservative against all possible
dependencies.
Repeated variables make calculations
cumbersome.
95
SOFTWARES FOR FUZZY
ARITHMETIC
FuziCalc
• (Windows 3.1) FuziWare, 800-472-6183
Cosmet (Phaser)
• (DOS, soon for Windows) [email protected]
Risk Calc
• (Windows) 800-735-4350; www.ramas.com
96
SCREEN SHOT OF FUZZY
CALCULATOR - FzCalc
97
SUMMARY
98
FUZZY RULES AND
REASONING
The degree of an element in a fuzzy
set corresponds to the truth value of a
proposition in fuzzy logic systems.
99
LINGUISTIC VARIABLES
A linguistic variable is a fuzzy variable.
100
LINGUISTIC HEDGES
(LINGUISTIC
QUANTIFIERS)
Hedges modify the shape of a fuzzy set.
101
TRUTH TABLES
Truth tables define logic functions of two
propositions. Let X and Y be two propositions,
either of which can be true or false.
2.Disjunction (∨): X OR Y.
102
FUZZY RULES
If x is A
THEN y is B
103
FUZZY RULES
The decision-making process is based on rules with
sentence conjunctives AND, OR and ALSO.
Example:
If (Distance x to second car is SMALL) OR
(Distance y to obstacle is CLOSE) AND (speed v is
HIGH) THEN (perform LARGE correction to steering
angle θ ) ALSO (make MEDIUM reduction in speed v).
104
FUZZY RULE FORMATION
IF height is tall
THEN weight is heavy.
105
FORMATION OF FUZZY
RULES
Three general forms are adopted for forming
fuzzy rules. They are:
Assignment statements,
Conditional statements,
Unconditional statements.
106
FORMATION OF FUZZY
RULES
Assignment Statements Unconditional Statements
Conditional Statements
107
DECOMPOSITION OF
FUZZY RULES
A compound rule is a collection of several simple
rules combined together.
UNLESS).
108
DECOMPOSITION OF
FUZZY RULES
Multiple Conjunctive
Multiple disjunctive
Antecedants
antecedent
109
AGGREGATION OF FUZZY
RULES
Aggregation of rules is the process of
obtaining the overall consequents from the
individual consequents provided by each rule.
110
AGGREGATION OF FUZZY
RULES
Conjunctive system of rules
111
FUZZY RULE - EXAMPLE
112
FUZZY RULE - EXAMPLE
Problem: Given
(a) membership functions for short,
medium-height, tall, light, medium-weight
and heavy;
(b) The three fuzzy rules;
(c) the fact that John’s height is 6’1”
estimate John’s weight.
113
FUZZY RULE - EXAMPLE
Solution:
(1) From John’s height we know that
John is short (degree 0.3)
John is of medium height (degree 0.6).
John is tall (degree 0.2).
(2) Each rule produces a fuzzy set as output by
truncating the consequent membership function
at the value of the antecedent membership.
114
FUZZY RULE - EXAMPLE
115
FUZZY RULE - EXAMPLE
116
FUZZY RULE - EXAMPLE
117
FUZZY RULE - EXAMPLE
The cumulative fuzzy output is obtained by OR-
ing the output from each rule.
Cumulative fuzzy output (weight at 6’1”).
118
FUZZY RULE - EXAMPLE
1. De-fuzzify to obtain a numerical
estimate of the output.
120
REASONING WITH FUZZY
RULES
In classical systems, rules with true
antecedents fire.
121
REASONING WITH FUZZY
RULES
122
SINGLE RULE WITH
SINGLE ANTECEDANT
123
SINGLE RULE WITH
MULTIPLE ANTECEDANTS
124
MULTIPLE ANTECEDANTS
IF x is A AND y is B THEN z is C
IF x is A OR y is B THEN z is C
125
MULTIPLE RULE WITH
MULTIPLE ANTECEDANTS
126
MULTIPLE CONSEQUENTS
IF x is A THEN y is B AND z is C
127
FUZZY INFERENCE
SYSTEMS (FIS)
Fuzzy rule based systems, fuzzy models, and
fuzzy expert systems are also known as fuzzy
inference systems.
128
FUZZY INFERENCE
SYSTEMS
The input to FIS may be fuzzy or crisp, but the
output from FIS is always a fuzzy set.
130
TYPES OF FIS
Mamdani FIS(1975)
Sugeno FIS(1985)
131
MAMDANI FUZZY
INFERENCE SYSTEMS
(FIS)
Fuzzify input variables:
Determine membership values.
Evaluate rules:
Based on membership values of (composite)
antecedents.
132
SUGENO FUZZY
INFERENCE SYSTEMS
(FIS)
The main steps of the fuzzy inference process namely,
1.fuzzifying the inputs and
2.applying the fuzzy operator
are exactly the same as in MAMDANI FIS.
133
SUGENO FIS
134
FUZZY EXPERT SYSTEMS
An expert system contains three major blocks:
135
BLOCK DIAGRAM OF
FUZZY EXPERT SYSTEMS
137
FUZZY DECISION MAKING
Decision making is a very important social,
economical and scientific endeavor.