0% found this document useful (0 votes)
12 views39 pages

Week 11 Fuzzy Logic (Type-1 Fuzzy Logic)

Uploaded by

laplluve
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views39 pages

Week 11 Fuzzy Logic (Type-1 Fuzzy Logic)

Uploaded by

laplluve
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Week 11:

Fuzzy Logic (Type-


1 Fuzzy Logic)
Vs.
What is Fuzzy Logic? Boolean
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.
 The motor is running really hot.
 Tom is a very tall guy.
Formal Definition Fuzzy
Logic
 Fuzzy logic can be seen as an extension of
ordinary logic, where the main difference is that
we use fuzzy sets for the membership of a
variable
 We can have fuzzy propositional logic and fuzzy
predicate logic
 Fuzzy logic can have many advantages over
ordinary logic in areas like artificial intelligence
where a simple true/false statement is
Fuzzy logic is a set of mathematical principles for knowledge
insufficient.
representation based on degrees of membership.
Formal Definition Fuzzy
Logic
 Formal definition: A fuzzy set A in X is expressed
as a set of ordered pairs:

Fuzzy set Membership function Universe of


Discourse
Afuzzy set is totally characterized by a
membership function (MF).
Fuzzy
logic is a set of mathematical principles for
knowledge representation based on degrees of
membership (Membership value).
Where did Fuzzy Logic
originate?
 People generally do not
divide things into clean
categories, yet still
make solid, adaptive
decisions
 Dr. Zadeh felt that
having controllers to
accept 'noisy' data
might make them
easier to create, and
more effective
Example (Controlling a
fan)
Fuzzy System
IF temperature = hot
Conventional model
THEN RUN fan at full speed
If temperature > X,
RUN fan IF temperature = warm
Else, THEN RUN fan at moderate speed
STOP fan
IF temperature = comfortable
THEN MAINTAIN fan speed

IF temperature = cool
THEN SLOW fan

IF temperature = cold
THEN STOP fan
Fuzzy Logic
(Introduction)
 Philosophical approach
 Decisions based on “degree of truth”
 Is not a probability
 Crisp Facts – distinct boundaries
 Fuzzy Facts – imprecise boundaries
 Probability - incomplete facts
 Example – Scout reporting an enemy
 “Two tanks at grid NV 54“ (Crisp)
 “A few tanks at grid NV 54” (Fuzzy)
 “There might be 2 tanks at grid NV 54 (Probabilistic)
WHAT IS FUZZY LOGIC?

 Definition of fuzzy
 Fuzzy – “not clear, distinct, or precise; blurred”

 Definition of fuzzy logic


A form of knowledge representation suitable for
notions that cannot be defined precisely, but
which depend upon their contexts.
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.
Example
• 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….
 Human brains interpret imprecise and incomplete
sensory information provided by perceptive
organs
 Fuzzy set theory provides a systematic calculus
to deal with such information linguistically
 It performs numerical computation by using
linguistic labels stimulated by membership
functions
 It lacks the adaptability to deal with changing
external environments ==> incorporate NN
learning concepts in fuzzy inference systems: NF
modeling (neuro-fuzzy)
Fuzzy Sets Theory

Classical Set vs Fuzzy set


Let X be the universe of discourse and its elements be denoted as x.
In the classical set theory, crisp set A of X is defined as function fA(x)
called
the characteristic function of A
1, if x  A
f A ( x) : X  {0,1}, where f A ( x) 
0, if x  A
In the fuzzy theory, fuzzy set A of universe of discourse X is defined by
function  A (x) called the membership function of set A

 A ( x) : X  [0,1], where  A ( x) 1 if x is totally in A;


 A ( x) 0 if x is not in A;
0   A ( x)  1 if x is partly in A.
+ Example (Tall Men)
+ Terminologies

1. Fuzzy Set: Tall Men


2. Elements of Fuzzy Set:
Chris, Mark etc.
Degree of
Crisp Sets
3. Degree of membership
Membership
1.0

(Degree of truth): Degrees 0.8

0.6

of membership depend on 0.4

their height.
0.2

0.0
150 160 170 180 190 200 210
Height, cm
Degree of
Fuzzy Sets
Membership
1.0

0.8

0.6

0.4

0.2

0.0
150 160 170 180 190 200 210
Height, cm
+ Terminologies

4. Universe of Discourse: (Height


of man)
 The x-axis represents the
universe of discourse – the
range of all possible values
Degree of
Crisp Sets
Membership
1.0

applicable to a chosen variable. 0.8

0.6

 According to this representation, 0.4

0.2

the universe of men’s heights 0.0


150 160 170 180 190 200 210

consists of all tall men. Degree of


Membership
Fuzzy Sets
Height, cm

1.0

5. Membership Value: 0.8

0.6

 The y-axis represents the


0.4

0.2

membership value of the fuzzy 0.0


150 160 170 180 190 200 210
Height, cm
set.
 In our case, the fuzzy set of “tall
men” maps height values into
corresponding membership
values.
+
Crisp and Fuzzy Set – more than one fuzzy
set
Fuzzy sets: Degreeof CrispSets
Membership

tall, 1.0

0.8 Short Average Tall

0.6
short and 0.4

0.2
average 0.0
men. 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
+ Crisp and Fuzzy Set

 (x)
X FuzzySubsetA
1

0
Crisp SubsetA Fuzziness x

Typicalfunctions that can be used to represent a fuzzy set


are sigmoid, gaussian and pi.
However, these functions increase the time of
computation.
Therefore,in practice, most applications use linear fit
functions.
HISTORY OF FUZZY LOGIC

 Fuzzy Logic was developed by Lotfi Zadeh at UC Berkeley 1960s


and 70s
 Lotfi Asker Zadeh ( 1965 )
 First to publish ideas of fuzzy logic.

 Professor Toshire Terano ( 1972 )


 Organized the world's first working group on fuzzy
systems.

 F.L. Smidth & Co. ( 1980 )


 First to market fuzzy expert systems.
Similarities and Differences
Between Fuzzy logic & Boolean
logic
 Fuzzy logic is a super set of conventional (or
Boolean) logic and contains similarities and
differences with Boolean logic.

 Fuzzy logic is similar to Boolean logic, in


that Boolean logic results are returned by fuzzy
logic operations when all fuzzy memberships
are restricted to 0 and 1.

 Fuzzy logic differs from Boolean logic in


that it is permissive of natural language
queries and is more like human thinking; it is
based on degrees of truth.
Fuzzy Logic Boolean Logic

For example, if a person is .83 of tallness, they are “rather


tall”.
Fuzzy logic calculates the shades of gray between
black/white and true/false.
Sample Application Areas of
Fuzzy logic
 Fuzzy logic has been applied in many areas; it is
used in a variety of ways.
 Household appliances such as dishwashers and
washing machines use fuzzy logic to determine
the optimal amount of soap and the correct water
pressure for dishes and clothes.
 Fuzzy logic is even used in self-focusing cameras.
 Expert systems, such as decision-support and
meteorological (forecasting the weather)
systems, use fuzzy logic.
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.
+ Example: Air Conditioner

Air conditioner system controlled by a FLS.


The system adjusts the temperature of the
room according to the current temperature
of the room and the target value.
The fuzzy engine periodically compares the
room temperature and the target
temperature, and produces a command to
heat or cool the room.
Applied to Computer Games & Vehicular
Control
 Can have different characteristics of players
 Strength: strong, medium, weak
 Aggressiveness: meek, medium, nasty
 If meek and attacked, run away fast
 If medium and attacked, run away slowly
 If nasty and strong and attacked, attack back
 Control of a vehicle
 Should slow down when close to car in front
 Should speed up when far behind car in front
 Provides smoother transitions – not a sharp
boundary
Further Introductory facts (Contd.)

 Fuzzy logic may appear similar to probability and


statistics as well.
 Although, fuzzy logic is different than probability
even though the results appear similar.
 The probability statement, "There is a 70% chance
that Bill is tall" supposes that Bill is either tall or he
is not. There is a 70% chance that we know which
set Bill belongs.
 The fuzzy logic statement, " Bill's degree of
membership in the set of tall people is 0.80 "
supposes that Bill is rather tall.
 The fuzzy logic answer determines not only the set
which Bill belongs, but also to what degree he is a
member.
Further Introductory facts (Contd.)
 Fuzzy Logic deals with those imprecise conditions
about which a true/false value cannot be
determined.
 Much of this has to do with the vagueness and
ambiguity that can be found in everyday life.
 For example, the question: Is it HOT outside?
 These are often labelled as subjective responses,
where no one answer is exact.
 Subjective responses are relative to an individual's
experience and knowledge.
 Human beings are able to exert this higher level of
abstraction during the thought process.
Further Introductory facts (Contd.)

 For these reasons, Fuzzy Logic has been


compared to the human decision making
process.
 Conventional Logic (and computing systems for
that matter) are by nature related to the Boolean
Conditions (true/false).
 What Fuzzy Logic attempts to encompass is that
area where a partial truth can be established.
 In fuzzy set theory, although it is still possible
to have an exact yes/no answer as to set
membership, elements can now be partial
members in a set.
 Fuzzy logic is a superset of Boolean
(conventional) logic that handles the concept of
partial truth, which is truth values between
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 6” 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
Example Fuzzy Variable

Membership  Each function tells us


(Degree of Truth) how much we consider a
Meek character in the set if it
Nasty has a particular
1.0 Medium
aggressiveness value
 Or, how much truth to
attribute to the
statement: “The
character is nasty (or
meek, or neither)?”

-1 -0.5 0.0 0.5 1


Aggressiveness
Fuzzy Logic Processes

“Crisp” Input Fuzzification


“Fuzzy” Input

Fuzzy Logic
-or-
F.A.M. Note:
FAM=fuzzy Associative
Memory

“Fuzzy” Output
De-Fuzzification “Crisp” Output
Example

https://www.youtube.com/watch?
v=__0nZuG4sTw
Definitions
 Fuzzifcation: 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.
 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.
Example………….

 Input membership function


 E.g.

Cold Cool Normal Warm Hot


0-16 8-25 16-33 25-42 33-50

So, if crisp input = 20°C

We will get,

0.8 truth value of Cool, 0.15 truth value of Normal


Examples contd.
 In case of expert system: Fuzzy inference
system, resides in the knowledge base as fuzzy
rules relied upon while taken decisions. It is the
bedrock of fuzzy expert systems.
 In the case of fuzzy classification: A fuzzy
inference system (FIS) is a system that uses fuzzy
set theory to map inputs (features) to outputs
(classes in the case of fuzzy classification)
+

Begin
Fuzzy Logic System
Crisp input

 A FLS consists of three main parts:


Fuzzification
 Fuzzifier
 Inference engine,
Fuzzy input
 Defuzzifier.

Rule Evaluation
(Inference)

Fuzzy output

Defuzzification

Crisp output

End
Fuzzy Systems

Inference
Input Fuzzification Defuzzification Output
Engine

Fuzzy
Knowledge base
Sample Fuzzy Rules

 IF temperature IS very cold THEN stop fan


 IF temperature IS cold THEN turn down fan
 IF temperature IS normal THEN maintain fan
 IF temperature IS hot THEN speed up fan
Extra resources

 https://home.agh.edu.pl/~vlsi/AI/
fuzzy_t/example.html

You might also like