0% found this document useful (0 votes)
28 views

Unit 4

The document discusses key concepts in fuzzy sets and fuzzy logic. It covers fuzzy set operations like union, intersection, and complement. It also discusses membership functions, fuzzy logic systems including fuzzification, rules, inference engines and defuzzification. The document provides examples of fuzzy logic rules for washing machines. It also covers linguistic hedges, fuzzy propositions, and fuzzy inference rules.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Unit 4

The document discusses key concepts in fuzzy sets and fuzzy logic. It covers fuzzy set operations like union, intersection, and complement. It also discusses membership functions, fuzzy logic systems including fuzzification, rules, inference engines and defuzzification. The document provides examples of fuzzy logic rules for washing machines. It also covers linguistic hedges, fuzzy propositions, and fuzzy inference rules.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Unit 4

Fuzzy Sets and Fuzzy Logic


Dr. Meghana Harsh Ghogare
Fuzzy Sets and Fuzzy Logic
• Fuzzy Set Operations, Membership Functions, Fuzzy Logic, Hedges,
Fuzzy Proposition and Inference Rules, Fuzzy Systems.

Dr. Meghana Harsh Ghogare


Fuzzy logic Definition and Basics
• Introduced in 1965 by Lotfi Zadeh
• Fuzzy imitates the human way of decision making.
• real-world problems are based on degrees of truth rather than
usual true/false or 1/0 like Boolean logic.

Dr. Meghana Harsh Ghogare


Dr. Meghana Harsh Ghogare
Fuzzy Logic Control for Washing Machines
• Rule 1: if type-of-dirt is greasy and degree-of-dirt is large then wash time is very-long
• Rule 2: if type-of-dirt is greasy and degree-of-dirt is medium then wash time is long
• Rule 3: if type-of-dirt is greasy and degree-of-dirt is small then wash time is long
• Rule 4: if type-of-dirt is medium and degree-of-dirt is large then wash time is long
• Rule 5: if type-of-dirt is medium and degree-of-dirt is medium then wash time is medium
• Rule 6: if type-of-dirt is medium and degree-of-dirt is small wash time is medium
• Rule 7: if type-of-dirt is not-greasy and degree-of-dirt is large then wash time is medium
• Rule 8: if type-of-dirt is not-greasy and degree-of-dirt is medium then wash time is short
• Rule 9: if type-of-dirt is not-greasy and degree-of-Dirt is small then wash time is very-short

Dr. Meghana Harsh Ghogare


• Input is crisp in KG
• Weight Sensor inside the washing machine, which sensos the load in
the washing machine
• Texture sensor: Soft or Hard (strong cycle)
• I/P is crisp → Fuzzyfy→ rules are applied -→ Defuzzyfy
• Is output is run medium cycle, but machine does not understand
medium, therefore the o/p gets defuzzied to time eg: 45 mins.

Dr. Meghana Harsh Ghogare


Fuzzy Logic Control for Washing Machines

Dr. Meghana Harsh Ghogare


Dr. Meghana Harsh Ghogare
Fuzzy Set Operations
• 1. Union :
• µR∪S(a,b) = max {µR(a,b), µS(a,b)}
• The union operation can only be performed if the relational matrices
R and S are of the same order. Here, the degree of membership of
each element of R∪S is the maximum degree of membership of
its corresponding elements in R and S.

The First Fuzzy Set is : {'a': 0.2, 'b': 0.3, 'c': 0.6, 'd': 0.6, ‘e’: 0.2}
The Second Fuzzy Set is : {'a': 0.9, 'b': 0.9, 'c': 0.4, 'd': 0.5}
Fuzzy Set Union is : {'a': 0.9, 'b': 0.9, 'c': 0.6, 'd': 0.6, ’e’: 0.2}

Dr. Meghana Harsh Ghogare


• 2 Intersection:
• µR∩S(a,b) = min {µR(a,b), µS(a,b)}
• The intersection operation can also only be performed in the relational matrices R and S
are of the same order. Here, the degree of membership of each element of R∩S is the
minimum degree of membership of its corresponding elements in R and S. Thus, we
can say that R∩S is analogous to RxS.
The First Fuzzy Set is : {'a': 0.2, 'b': 0.3, 'c': 0.6, 'd': 0.6, ‘e’: 0.2}
The Second Fuzzy Set is : {'a': 0.9, 'b': 0.9, 'c': 0.4, 'd': 0.5}
Fuzzy Set Intersection is : {'a': 0.2, 'b': 0.3, 'c': 0.4, 'd': 0.5}
• 3. Complement :
degree_of_membership(Y)= 1 - degree_of_membership(A)
• The Fuzzy Set is : {'a': 0.2, 'b': 0.3, 'c': 0.6, 'd': 0.6}
• Fuzzy Set Complement is : {'a': 0.8, 'b': 0.7, 'c': 0.4, 'd': 0.4}
Dr. Meghana Harsh Ghogare
Membership Function
• Membership function (MF) - A function that specifies the degree to
which a given input belongs to a set.
• Degree of membership- The output of a membership function, this
value is always limited to between 0 and 1.

Dr. Meghana Harsh Ghogare


Dr. Meghana Harsh Ghogare
• Membership Functions for T (temperature) = too-cold, cold, warm,
hot, too-hot.

Dr. Meghana Harsh Ghogare


Membership Function
• There are different forms of membership functions such as:
Triangular. Trapezoidal. Piecewise linear. Gaussian. Singleton

Dr. Meghana Harsh Ghogare


Fuzzy Logic
A FLS consists of four main parts: o Fuzzifier (Fuzzification). o Rules. o
Inference engine. o Defuzzifier (Defuzzification).
Fuzzy logic algorithm
1) Initialization process:
1) Define the linguistic variables.
2) Construct the fuzzy logic membership functions
3) Construct the rule base(IF X AND Y, THEN Z )
2) Convert crisp input data to fuzzy values using the membership functions
(fuzzification).
• 3) Evaluate the rules in the rule base (inference).
• 4) Combine the results of each rule (inference).
• 5) Convert the output data to non-fuzzy values (defuzzification).
Dr. Meghana Harsh Ghogare
Dr. Meghana Harsh Ghogare
Hedges
• hedges are the operators which modify the shapes of fuzzy sets by
using adverbs such as more, high, less, and slightly
• AGE = {Child, Young, Old}

• For AGE = 11, we will get a membership value of 0.75 (roughly) in the
Child set, 0.2 (approx) in the Young set, and 0 in the Old set,

Dr. Meghana Harsh Ghogare


Dr. Meghana Harsh Ghogare
• Linguistic hedges :
• Linguistic hedges can be used to modify linguistic variables, which is an
important feature. Linguistic hedges are primarily employed to aid in the
more precise communication of the degree of correctness and truth in a
particular statement.
• For example: If a statement
• John is Young is associated with the value 0.6 then
• very young is automatically deduced as 0.6 * 0.6 = 0.36.
• not very young get the value ( 1 – 0.36 ), i.e., 0.64.
• In this example, the operator very(X) is defined as X*X;
• this results in great power for the expression of both rules and fuzzy facts.
• Linguistic modifiers such as very, more or less, fairly, and extremely rare are
some examples of hedges.
• They can modify fuzzy predicates and fuzzy truth values

Dr. Meghana Harsh Ghogare


• In general, for a given fuzzy proposition P, such that P : x is F
• And a linguistic hedge H, we can construct a modified proposition as HP : x is HF
• Here, HF denotes the fuzzy predicate obtained by applying hedge H to predicate F. The
predicate can be further modified by applying the hedge to a fuzzy truth value in the
given proposition. Any hedge H is interpreted as unary operator ‘h’ on the interval [0,1].
• For example hedge very is often interpreted as the unary operator :h(a) = a2 ; for a ∈
[0,1]
• Similarly, hedge fairly interpreted as the unary operator : h(a) = √a ; or a ∈ [0,1]
• A strong modifier strengthens a fuzzy predicate. A weak modifier weakens the
predicate and consequently increases the truth value of the associated proposition.
• Example: If Young (25) = 0.8, Then : very Young(25) = 0.8 ×0.8 = 0.64 and fairly
young(25) = √0.8 = 0.89
• The modifier h should satisfy the following conditions :
• - h is a continuous function
• - h(0) = 0; h(1) = 1
• - If h is strong, then 1/h is weak and vice versa
• - If h and g are two modifiers then compositions of these modifiers are also modifier
such as very little.
• If both modifiers are strong, then the composition is also strong and vice versa.
Dr. Meghana Harsh Ghogare
Fuzzy Proposition
• A fuzzy proposition, much like a classical proposition
• classical propositions can have a truth value of either 0 or 1,
• Fuzzy propositions, on the other hand, can have truth values in the
range [0, 1].
• For example, if we have a proposition P, defined as:
P - The weather is pleasant.
T(P) = 0, if absolutely unpleasant.
T(P) = 0.2, if mostly unpleasant.
T(P) = 0.4, if partially unpleasant.
T(P) = 0.6, if partially pleasant.
T(P) = 0.8, if mostly pleasant.
T(P) = 1, if absolutely pleasant.
Where T(P) represents the truth value of the proposition.

Dr. Meghana Harsh Ghogare


Listed below are a few operations that
can be performed on propositions:

Dr. Meghana Harsh Ghogare


• P - Max is fast.
T(P) = 0.8
Q - Daniel is fast.
T(Q) = 0.6
• Then, to find the truth value of the following statements, we
have to use the above operators:
1.'Max is not fast.'
T(¬P) = 1 − T(P) = 0.2
2.'Max is fast and so is Daniel.'
T(P ∧ Q) = min{T(P),T(Q)} = 0.6
3.'Either Max is fast or Daniel is.'
T(P ∨ Q) = max{T(P),T(Q)} = 0.8
4.'If Max is fast, then so is Daniel.'
T(P ⇒ Q) = max{1−T(P),T(Q)} = 0.6

Dr. Meghana Harsh Ghogare


Fuzzy Inference Rules
Fuzzy inference rules are the foundational building blocks of a fuzzy logic
system.
They express the relationship between fuzzy inputs (antecedents) and fuzzy
outputs (consequents) using linguistic terms.
allowing the system to reason and make decisions based on fuzzy logic
principles.
These rules capture human-like reasoning and are particularly useful for
handling imprecise, uncertain, or vague information
Fuzzy inference rules typically follow the "IF-THEN" format, where the "IF"
part represents the conditions and the "THEN" part represents the
consequences.

Dr. Meghana Harsh Ghogare


• The most common type of fuzzy inference rule is the Mamdani-type
fuzzy rule.
• Antecedent (IF-part): consists of one or more linguistic variables and
their associated fuzzy sets(different degrees of membership for that
parameter.)
• Operator: fuzzy operators include "AND" and "OR." The "AND"
operator.
• Consequent (THEN-part): one or more linguistic variables and their
associated fuzzy sets
• Rule 1: IF Temperature is Cold AND Humidity is High THEN Heater
Power is High

Dr. Meghana Harsh Ghogare


Fuzzy Systems.

Dr. Meghana Harsh Ghogare


Generalized Modus Tollens
• In fuzzy logic, the is an inference rule that allows us to draw
conclusions from the negation of a fuzzy implication.
• Example: Suppose we have two fuzzy propositions:
1.If it is sunny (S), then the temperature is high (H) with a degree of
truth of 0.8. Fuzzy implication: S → H (μ(S → H) = 0.8)
2.The temperature is not high (¬H) with a degree of truth of 0.6. Fuzzy
negation: ¬H (ν(¬H) = 0.6)
• "If it is not sunny (¬S)" is 0.2, suggesting a moderate degree of
confidence that it is not sunny when the temperature is not high.

Dr. Meghana Harsh Ghogare


Generalized Modus Ponens
• is an inference rule used to draw conclusions from multiple fuzzy implications and fuzzy antecedents.
• Example:
• If the temperature is high (H), then it is uncomfortable (U) with a degree of truth of 0.7.
• Fuzzy implication: H → U (μ(H → U) = 0.7)
• If the humidity is high (HM), then it is uncomfortable (U) with a degree of truth of 0.6.
• Fuzzy implication: HM → U (μ(HM → U) = 0.6)
• Now, suppose we have the following fuzzy propositions:
• The degree of truth of "The temperature is high (H)" is 0.8. ν(H) = 0.8
• The degree of truth of "The humidity is moderate (HM)" is 0.5. ν(HM) = 0.5
• Using Generalized Modus Ponens, we can infer the degree of truth of "It is uncomfortable (U)" as:
ν(U) = min(μ(H → U) * ν(H), μ(HM → U) * ν(HM))
= min(0.7 * 0.8, 0.6 * 0.5)
= min(0.56, 0.3)
= 0.3
• 0.3, indicates a moderate certainty that it is uncomfortable given the high temperature and moderate
humidity.

Dr. Meghana Harsh Ghogare


Thank You

MID SEM SYLLABUS IS OVER

Dr. Meghana Harsh Ghogare

You might also like