Fuzzy Logic
Fuzzy Logic
1 11/25/2024
What is Fuzzy Logic?
Fuzzy logic is not logic that is fuzzy, but logic that
is used to describe fuzziness.
Fuzzy logic is the theory of fuzzy sets, sets that
calibrate vagueness.
Fuzzy logic is based on the idea that all things
admit of degrees.
⚫ Temperature, height, speed, distance, beauty – all come on a sliding scale.
IF temperature = cool
THEN SLOW fan
IF temperature = cold
THEN STOP fan
Definition of fuzzy
Fuzzy – “not clear, distinct, or precise; blurred”
7 11/25/2024
Fuzzy Sets Theory
What is fuzzy thinking
⚫ Experts rely on common sense when they solve the
problems
⚫ How can we represent expert knowledge that uses vague
and ambiguous terms in a computer
⚫ Fuzzy logic is not logic that is fuzzy but logic that is used to
describe the fuzziness. Fuzzy logic is the theory of fuzzy
sets, set that calibrate the vagueness.
⚫ Fuzzy logic is based on the idea that all things admit of
degrees. Temperature, height, speed, distance, beauty – all
come on a sliding scale.
⚫ Jim is tall guy
⚫ It is really very hot today 11/25/2024
8
Example…….
Consider a set of young people using fuzzy sets.
In general, young people range from the age of 0 to 20.
But, if we use this strict interval to define young people, then a
person on his 20th birthday is still young (still a member of the set).
But on the day after his 20th birthday, this person is now old (not a
member of the young set).
How can one remedy this?
By RELAXING the boundary between the strict separation of young
and old.
This separation can easily be relaxed by considering the boundary
between young and old as "fuzzy".
The figure below graphically illustrates a fuzzy set of young and old
people.
9 11/25/2024
Example….contd.
•Notice in the figure that people whose ages are >= zero and <= 20 are
complete members of the young set (that is, they have a membership
value of one).
•Also note that people whose ages are > 20 and < 30 are partial members
of the young set.
•For example, a person who is 25 would be young to the degree of 0.5.
•Finally people whose ages are >= 30 are non-members of the young set.
Fuzzy set theory contd….
11 11/25/2024
Fuzzy Sets Theory
1, if x A
f A ( x) : X → {0,1}, where f A ( x) =
0, if x A
13 11/25/2024
+ Terminologies 14
◼Fuzzy relation
◼Relationships can also be expressed on a scale of 0 to 1
e.g. degree of resemblance between two people
◼Fuzzy variable
◼Variable with (labels of) fuzzy sets as its values.
Degreeof CrispSets
Membership
1.0
0.8 Short Average Tall
0.6
0.4
0.2
0.0
150 160 170 180 190 200 210
Height, cm
Degreeof Fuzzy Sets
Membership
1.0
0.8
0.6 Short Average Tall
0.4
0.2
0.0
150 160 170 180 190 200 210
(x )
X Fuzzy SubsetA
1
0
Crisp SubsetA Fuzziness x
◼ Typical
functions that can be used to represent a fuzzy set are sigmoid,
gaussian and pi.
0.6
0.4
0.2
0.0
150 160 170 180 190 200 210
Height, cm
Degree of
Membership Fuzzy Sets
1.0
0.8
0.6
0.4
0.2
0.0
150 160 170 180 190 200 210
November 25, 2024
Height, cm
+ 20
Terminologies
◼ Linguistic variable:
Chris is tall
0.2
0.0
◼ Membership Value:
150 160 170 180 190 200 210
Height, cm
Degree of
Membership Fuzzy Sets
0.8
0.0
height values into corresponding 150 160 170 180 190 200 210
Height, cm
membership values.
23 11/25/2024
Fuzzy Logic Boolean Logic
24 11/25/2024
Further Introductory facts (Contd.)
25 11/25/2024
Sample Application Areas of Fuzzy logic
26 11/25/2024
TEMPERATURE CONTROLLER (An Example)
The problem
Change the speed of a heater fan, based on the room
temperature and humidity.
A temperature control system has four settings
Cold, Cool, Warm, and Hot
Humidity can be defined by:
Low, Medium, and High
Using this we can define the fuzzy set.
27 11/25/2024
+ Example: Air Conditioner 28
29 11/25/2024
Further Introductory facts(Contd.)
30 11/25/2024
Further Introductory facts (Contd.)
31 11/25/2024
Fuzzy Sets
32 11/25/2024
Fuzzy Sets
Provides a way to write symbolic rules with terms like
“medium” but evaluate them in a quantified way
Classical set theory: An object is either in or not in the set
⚫ Can’t talk about non-sharp distinctions
Fuzzy sets have a smooth boundary
⚫ Not completely in or out – somebody 180 cm is 80% in the
tall set tall
Fuzzy set theory
⚫ An object is in a set by matter of degree
⚫ 1.0 => in the set
⚫ 0.0 => not in the set
⚫ 0.0 < object < 1.0 => partially in the set
33 11/25/2024
Example Fuzzy Variable
11/25/2024 34
Operations on Fuzzy Sets
Negation
Intersection
Union
Summary equations:
NOT x = (1 - truth(x))
x AND y = minimum(truth(x), truth(y))
x OR y = maximum(truth(x), truth(y))
35 11/25/2024
+ Operations (summary) 36
37 11/25/2024
Fuzzy Set Operations: Complement
Membership FS
1.0
The degree to which you
believe something is not
in the set is 1.0 minus the
degree to which you
¬FS
believe it is in the set
0.0
Units
11/25/2024 38
Fuzzy Set Ops: Intersection (AND)
In the figures in the next slide, the red and green lines are
fuzzy sets.
To find the intersection of these sets take the minimum of
the two membership values at each point on the x-axis.
For example, in the figure the red fuzzy set has a
membership of ZERO when x = 4 and the green fuzzy set has
a membership of ONE when x = 4.
The intersection would have a membership value of ZERO
when x = 4 because the minimum of zero and one is zero.
39 11/25/2024
40 11/25/2024
Fuzzy Set Ops: Intersection (AND)
11/25/2024 41
Fuzzy Set Ops: Union (OR)
42 11/25/2024
43 11/25/2024
Fuzzy Set Ops: Union (OR)
11/25/2024 44
Fuzzy Set Ops: Union (OR)
Membership
About 6’ Tall
1.0
Take the max of your beliefs in
each individual statement
About 6’ high Also works if statements are
or tall about different variables
0.0
Height
11/25/2024 45
+ Operations (summary) 46
Intersection
Negation
Union
47 11/25/2024
Fuzzy Logic Processes
“Crisp” Input Fuzzification
“Fuzzy” Input
Fuzzy Logic
(Inference (FIS) )
“Fuzzy” Output
De-Fuzzification “Crisp” Output
11/25/2024
48
Definitions:
Fuzzification: is the process of changing a real scalar
value into a fuzzy value.
This is achieved with the different types of fuzzifiers
(membership functions).
Inference: A fuzzy inference system (FIS) is a system that
uses fuzzy set theory to map inputs to outputs. In case of
expert system, it resides in the knowledge base as fuzzy
rules relied upon while taken decisions.
Defuzzification: The input for the defuzzification process is
the aggregate output fuzzy set and the output is a single
number. i.e. it convert the out fuzzy terms into crisp
number again.
49 11/25/2024
Example
We will get,
50 11/25/2024
Fuzzy inference system (FIS)
51 11/25/2024
+ 52
◼Defuzzifier.
Rule Evaluation
(Inference)
Fuzzy output
Defuzzification
Crisp output
End
Crisp
Fuzzification
Input
◼ Steps:
◼Membership functions:
◼ Membership functions are used in the fuzzification and defuzzification steps
of a FLS, to map the non-fuzzy input values to fuzzy linguistic terms and
vice versa.
◼ Linguistic Variables:
◼ Linguistic variables are the input or output variables.
◼A fuzzy inference system (FIS) is a system that uses fuzzy set theory
to map inputs to outputs.
◼ Incase of expert system, it resides in the knowledge base as fuzzy
rules relied upon while taken decisions.
◼ Fuzzy Rules:
◼ In a FLS, a rule base is constructed to control the output variable.
◼A fuzzy rule is a simple IF-THEN rule with a condition and a
conclusion.
◼ Sample fuzzy rules for the air conditioner system and the matrix
representation of the fuzzy rules for the said FLS.
◼ The evaluations of the fuzzy rules and the combination of the results
of the individual rules are performed using fuzzy set operations.
◼ The operations on fuzzy sets are different than the operations on non-
fuzzy sets.
◼ Let µA and µB are the membership functions for fuzzy sets A and B.
◼ Commonly used operations are NOT, AND, OR
◼ Afterevaluating each rule, these results should be combined to obtain
the final result.
◼ After
the inference step, the overall result is a fuzzy value. This result should
be defuzzified to obtain a final crisp output.
Inference
Input Fuzzification Defuzzification Output
Engine
Fuzzy
Knowledge base
65 11/25/2024
Basic Configuration of a Fuzzy Logic System
Knowledge
Base/Rule
base
Fuzzification Defuzzification
Inferencing
Fuzzy input Fuzzy out set
set
Output
Input
66 11/25/2024
Sample Fuzzy Rules
67 11/25/2024
Rules are usually expressed in the form:
Takagi-Sugeno Model
R1: If x is A1 and y is B1 then z =f1(x,y)
R1: If x is A2 and y is B2 then z =f2(x,y)
69 11/25/2024
The membership functions of two fuzzy sets A and B is shown
in figure below. Draw graphically the fuzzy sets for the
following.
(a) Intersection of A and B
(b) Union of A and B
(c) Compliment of A and B
10 20 30 40 50 60 70 80 90
70 11/25/2024
Further Readings/References
1) http://users.abo.fi/rfuller/fuzs.html
2) http://www.fuzzytech.com/
3) http://www.cs.cmu.edu/Groups/AI/html/faqs/ai/fuzzy/part1/faq-doc-2.html
4) Neural Networks, a comprehensive foundation, Simon Haykin, 2nd ed.
Prentice Hall
5) Introduction to the theory of neural computation, Hertz, Krog and Palmer,
Addision Wesley
6) Introduction to Artificial Neural Systems, J. M. Zurada, West Publishing
Company
7) Fuzzy Models and Algorithms for Pattern Recognition and Image
Processing, Bezdek, Keller, Krishnapuram, Pal, Kluwer Academic
Publishers
8) Fuzzy Sets and Fuzzy Systems, Klir and Yuan
9) Pattern Classification, Duda, Hart and Stork
11/25/2024 71
References
http://users.abo.fi/rfuller/fuzs.html
http://www.fuzzytech.com/
http://www.cs.cmu.edu/Groups/AI/html
/faqs/ai/fuzzy/part1/faq-doc-2.html
72 11/25/2024