0% found this document useful (0 votes)
28 views229 pages

Soft Computing Course Overview

The document outlines a course plan on Soft Computing, covering topics such as Evolutionary Computing, Fuzzy Logic, and Artificial Neural Networks. It distinguishes between hard and soft computing, highlighting their characteristics and applications. Additionally, it introduces fuzzy logic, its history, and concepts such as fuzzy sets and membership functions.

Uploaded by

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

Soft Computing Course Overview

The document outlines a course plan on Soft Computing, covering topics such as Evolutionary Computing, Fuzzy Logic, and Artificial Neural Networks. It distinguishes between hard and soft computing, highlighting their characteristics and applications. Additionally, it introduces fuzzy logic, its history, and concepts such as fuzzy sets and membership functions.

Uploaded by

Harsh pathak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Course Plan [Link].

in
1. Introduction to Soft Computing
2. Evolutionary Computing
I Genetic Algorithms (GAs)
I Simulated Annealing (SA)
I Ant Colony Optimization (ACO)
I Particle Swam Optimization (PSO)
3. Fuzzy Logic
I Fuzzy Set, Fuzz Logic, Fuzzy Algebra
I Fuzzy Reasoning and Fuzzy Classification
4. Artificial Neural Networks (ANNs)
I Different ANNs
I Learning with ANNs
5. Advanced Topics
I Mixed(Hybrid) Soft Computing
I FL-GA, FL-ANN, GA-ANN, FL-GA-ANN
I Hidden Markov Modeling (HMM)
I Support Vector Machine (SVM)
Today’s Topics [Link]

Introduction to Soft Computing

I Concept of computing
I Important characteristics of ”Computing”
I ”Soft” computing vs. ”Hard” computing
I Few examples of Soft computing applications
I Characteristics of Soft computing
I Hybrid computing
Concept of Computing
[Link]

Figure: Basic of computing

y = f (x), f is a mapping function


f is also called a formal method or an algorithm to solve a problem.
Important Characteristics
[Link]

1. Should provide precise solution.


2. Control action should be unambiguous and accurate.
3. Suitable for problem, which is easy to model mathematically.
Hard Computing [Link]
In 1996, LA Zade (LAZ) introduced the term hard computing.
According to LAZ: We term a computing as ”Hard” computing, if
I Precise result is guaranteed
I Control action is unambiguous
I Control action is formally defined (i.e. with
mathematical model

Example:
I Solving numerical problems (e.g. Roots of polynomials,
Integration etc.)
I Searching and sorting techniques
I Solving ”Computational Geometry” problems (e.g. Shortest
tour in Graph theory, Finding closest pair of points, etc.)
Problems in [Link]
other areas of applications

I Medical diagnosis
I Person identification / Computer vision
I Hand written character recognition
I Pattern recognition and Machine Intelligence (MI)
I Weather forecasting
I VLSI design
I Network optimization
Characteristics of [Link]
Soft Computing

I It does not require any mathematical modeling of problem


solving
I It may not yield the precise solution
I Algorithms are adaptive (i.e. it can adjust to the change of
dynamic environment)
I Use some biological inspired methodologies such as genetics,
evolution, Ant’s behaviors, particles swarming, human nervous
systems etc.
Hybrid [Link]
It is a combination of the conventional hard computing and
emerging soft computing

Figure: Concept of Hybrid Computing


Problems to ponder
[Link]

I Hard computing (HC) vs. Soft computing (SC)


I Limitation(s) in HC and SC
I Examples of (only) Hard computing and (only) Soft
computing
I Examples of Hybrid computing
[Link]

Fuzzy Logic : Introduction

Debasis Samanta

IIT Kharagpur
dsamanta@[Link]

10.01.2023

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 1 / 69


What is Fuzzy logic?
[Link]

Fuzzy logic is a mathematical language to express something.


This means it has grammar, syntax, semantic like a language for
communication.

There are some other mathematical languages also known


• Relational algebra (operations on sets)
• Boolean algebra (operations on Boolean variables)
• Predicate logic (operations on well formed formulae (wff), also
called predicate propositions)

Fuzzy logic deals with Fuzzy set.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 2 / 69


A brief history of Fuzzy Logic
[Link]
First time introduced by Lotfi Abdelli Zadeh (1965), University of
California, Berkley, USA (1965).

He is fondly nick-named as LAZ

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 3 / 69


A brief history of Fuzzy logic
[Link]

1 Dictionary meaning of fuzzy is not clear, noisy etc.


Example: Is the picture on this slide is fuzzy?
2 Antonym of fuzzy is crisp
Example: Are the chips crisp?

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 4 / 69


Example : Fuzzy logic vs. Crisp logic
[Link]

Yes or No
Crisp answer
True or False

Milk Yes

Water
A liquid
Crisp

Coca
No
Spite

Is the liquid
colorless?

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 5 / 69


Example : Fuzzy logic vs. Crisp logic
[Link]

May be

May not be

Fuzzy answer Absolutely

Partially

etc

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 6 / 69


Example : Fuzzy logic vs. Crisp logic
[Link]

Score

99
Extremely honest
· Ankit

· Rajesh
Very honest 75
· Santosh
Fuzzy
· Kabita Honest at times 55

· Salmon
Extremely dishonest 35
Is the person
honest?

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 7 / 69


World is fuzzy!
[Link]

Our world is better


described with
fuzzily!

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 8 / 69


Concept of fuzzy system
[Link]

Fuzzy element(s)

Fuzzy set(s)
I
N
P Fuzzy rule(s)
U
T
Fuzzy implication(s)
(Inferences)
O
U
T
Fuzzy system P
U
T

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 9 / 69


Concept of fuzzy set
[Link]
To understand the concept of fuzzy set it is better, if we first clear our
idea of crisp set.
X = The entire population of India.
H = All Hindu population = { h1 , h2 , h3 , ... , hL }
M = All Muslim population = { m1 , m2 , m3 , ... , mN }

Universe of discourse X

H
M

Here, All are the sets of finite numbers of individuals.


Such a set is called crisp set.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 10 / 69


Example of fuzzy set
[Link]

Let us discuss about fuzzy set.


X = All students in IT60108.
S = All Good students.
S = { (s, g) | s ∈ X } and g(s) is a measurement of goodness of the
student s.
Example:
S = { (Rajat, 0.8), (Kabita, 0.7), (Salman, 0.1), (Ankit, 0.9) } etc.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 11 / 69


Fuzzy set vs. Crisp set
[Link]

Crisp Set Fuzzy Set


1. S = { s | s ∈ X } 1. F = (s, µ) | s ∈ X and
µ(s) is the degree of s.
2. It is a collection of el- 2. It is collection of or-
ements. dered pairs.
3. Inclusion of an el- 3. Inclusion of an el-
ement s ∈ X into S is ement s ∈ X into F is
crisp, that is, has strict fuzzy, that is, if present,
boundary yes or no. then with a degree of
membership.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 12 / 69


Fuzzy set vs. Crisp set
[Link]
Note: A crisp set is a fuzzy set, but, a fuzzy set is not necessarily a
crisp set.

Example:
H = { (h1 , 1), (h2 , 1), ... , (hL , 1) }
Person = { (p1 , 1), (p2 , 0), ... , (pN , 1) }
In case of a crisp set, the elements are with extreme values of degree
of membership namely either 1 or 0.

How to decide the degree of memberships of elements in a fuzzy set?

City Bangalore Bombay Hyderabad Kharagpur Madras Delhi


DoM 0.95 0.90 0.80 0.01 0.65 0.75

How the cities of comfort can be judged?

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 13 / 69


Example: Course evaluation in a crisp way
[Link]

1 EX = Marks ≥ 90
2 A = 80 ≤ Marks < 90
3 B = 70 ≤ Marks < 80
4 C = 60 ≤ Marks < 70
5 D = 50 ≤ Marks < 60
6 P = 35 ≤ Marks < 50
7 F = Marks < 35

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 14 / 69


Example: Course evaluation in a crisp way
[Link]

F P D C B A EX
1

0
35 50 60 70 80 90 100

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 15 / 69


Example: Course evaluation in a fuzzy way
[Link]

F P D C B A EX
1

0
35 50 60 70 80 90 100

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 16 / 69


Few examples of fuzzy set
[Link]

High Temperature

Low Pressure

Color of Apple

Sweetness of Orange

Weight of Mango

Note: Degree of membership values lie in the range [0...1].

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 17 / 69


Some basic terminologies and notations
[Link]

Definition 1: Membership function (and Fuzzy set)

If X is a universe of discourse and x ∈ X, then a fuzzy set A in X is


defined as a set of ordered pairs, that is
A = {(x, µA (x))|x ∈ X } where µA (x) is called the membership function
for the fuzzy set A.

Note:
µA (x) map each element of X onto a membership grade (or
membership value) between 0 and 1 (both inclusive).

Question:
How (and who) decides µA (x) for a Fuzzy set A in X ?

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 18 / 69


Some basic terminologies and notations
[Link]

Example:

X = All cities in India

A = City of comfort

A={(New Delhi, 0.7), (Bangalore, 0.9), (Chennai, 0.8), (Hyderabad,


0.6), (Kolkata, 0.3), (Kharagpur, 0)}

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 19 / 69


Membership function with discrete membership
[Link]
values

The membership values may be of discrete values.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 20 / 69


Membership function with discrete membership
[Link]
values

Either elements or their membership values (or both) also may be of


discrete values.

A ={(0,0.1),(1,0.30),(2,0.78)……(10,0.1)}

1.0
0.8
0.6 Note : X = discrete value
µ

0.4

0.2
How you measure happiness ??
0 2 4 6 8 10

Number of children (X)

A = “Happy family”

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 21 / 69


Membership function with continuous
[Link]
membership values

1.0
 B ( x)  1
4
0.8  x  50 
1  
0.6  10 

0.4

0.2

0 50 100
B

Age (X)
Note : x = real value
B = “Middle aged” = R+

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 22 / 69


Fuzzy terminologies: Support
[Link]

Support: The support of a fuzzy set A is the set of all points x ∈ X


such that µA (x) > 0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 23 / 69


Fuzzy terminologies: Core
[Link]

Core: The core of a fuzzy set A is the set of all points x in X such that
µA (x) = 1

core (A) = {x | µA(x) = 1}

1.0
µ

0.5

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 24 / 69


Fuzzy terminologies: Normality
[Link]

Normality : A fuzzy set A is a normal if its core is non-empty. In other


words, we can always find a point x ∈ X such that µA (x) = 1.

1.0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 25 / 69


Fuzzy terminologies: Crossover points
[Link]

Crossover point : A crossover point of a fuzzy set A is a point x ∈ X


at which µA (x) = 0.5. That is
Crossover (A) = {x|µA (x) = 0.5}.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 26 / 69


Fuzzy terminologies: Fuzzy Singleton
[Link]

Fuzzy Singleton : A fuzzy set whose support is a single point in X


with µA (x) = 1 is called a fuzzy singleton. That is
|A| = |{ x | µA (x) = 1}| = 1. Following fuzzy set is not a fuzzy singleton.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 27 / 69


Fuzzy terminologies: α-cut and strong α-cut
[Link]

α-cut and strong α-cut :

The α-cut of a fuzzy set A is a crisp set defined by

Aα = {x | µA (x) ≥ α }

Strong α-cut is defined similarly :

Aα ’ = {x | µA (x) > α }

Note : Support(A) = A0 ’ and Core(A) = A1 .

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 28 / 69


Fuzzy terminologies: Convexity
[Link]
Convexity : A fuzzy set A is convex if and only if for any x1 and x2 ∈ X
and any λ ∈ [0, 1]
µA (λx1 + (1 -λ)x2 ) ≥ min(µA (x1 ), µA (x2 ))
Note :
• A is convex if all its α- level sets are convex.
• Convexity (Aα ) =⇒ Aα is composed of a single line segment only.

Membership function is Non-convex


convex Membership function

1.0 1.0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 29 / 69


Fuzzy terminologies: Bandwidth
[Link]

Bandwidth :

For a normal and convex fuzzy set, the bandwidth (or width) is defined
as the distance the two unique crossover points:
Bandwidth(A) = | x1 - x2 |
where µA (x1 ) = µA (x2 ) = 0.5

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 30 / 69


Fuzzy terminologies: Symmetry
[Link]

Symmetry :

A fuzzy set A is symmetric if its membership function around a certain


point x = c, namely µA (x + c) = µA (x - c) for all x ∈ X.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 31 / 69


Fuzzy terminologies: Open and Closed
[Link]
A fuzzy set A is
Open left
If limx→−∞ µA (x) = 1 and limx→+∞ µA (x) = 0
Open right:
If limx→−∞ µA (x) = 0 and limx→+∞ µA (x) = 1
Closed
If : limx→−∞ µA (x) = limx→+∞ µA (x) = 0

Open left Open right


Closed

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 32 / 69


Fuzzy vs. Probability
[Link]

Fuzzy : When we say about certainty of a thing

Example: A patient come to the doctor and he has to diagnose so that


medicine can be prescribed.
Doctor prescribed a medicine with certainty 60% that the patient is
suffering from flue. So, the disease will be cured with certainty of 60%
and uncertainty 40%. Here, in stead of flue, other diseases with some
other certainties may be.

Probability: When we say about the chance of an event to occur

Example: India will win the T20 tournament with a chance 60% means
that out of 100 matches, India own 60 matches.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 33 / 69


Prediction vs. Forecasting
[Link]

The Fuzzy vs. Probability is analogical to Prediction vs. Forecasting

Prediction : When you start guessing about things.

Forecasting : When you take the information from the past job and
apply it to new job.

The main difference:


Prediction is based on the best guess from experiences.
Forecasting is based on data you have actually recorded and packed
from previous job.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 34 / 69


[Link]

Fuzzy Membership
Functions

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 35 / 69


Fuzzy membership functions
[Link]
A fuzzy set is completely characterized by its membership function
(sometimes abbreviated as MF and denoted as µ ). So, it would be
important to learn how a membership function can be expressed
(mathematically or otherwise).
Note: A membership function can be on
(a) a discrete universe of discourse and
(b) a continuous universe of discourse.
Example:

1.0 1.0
0.8 0.8
µA

µB
0.6 0.6
0.4 0.4

0.2 0.2

0 2 4 6 8 10 0 10 20 30 40 50 60

Number of children (X) Age (X)

A = Fuzzy set of “Happy family” B = “Young age”

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 36 / 69


Fuzzy membership functions
[Link]
So, membership function on a discrete universe of course is trivial.
However, a membership function on a continuous universe of
discourse needs a special attention.
Following figures shows a typical examples of membership functions.

µ
µ

x x x

< triangular > < trapezoidal > < curve >


µ

x x

< non-uniform > < non-uniform >

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 37 / 69


Fuzzy MFs : Formulation and parameterization
[Link]
In the following, we try to parameterize the different MFs on a
continuous universe of discourse.
Triangular MFs : A triangular MF is specified by three parameters
{a, b, c} and can be formulated as follows.



0 if x ≤ a
 x−a if a ≤ x ≤ b

b−a
triangle(x; a, b, c) = c−x (1)


 c−b if b ≤ x ≤ c

0 if c ≤ x

1.0

a b c

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 38 / 69


Fuzzy MFs: Trapezoidal
[Link]
A trapezoidal MF is specified by four parameters {a, b, c, d} and can
be defined as follows:


 0 if x ≤ a

x−a
 b−a if a ≤ x ≤ b



trapeziod(x; a, b, c, d) = 1 if b ≤ x ≤ c (2)
 d−x
if c ≤ x ≤ d




 d−c
0 if d ≤ x

1.0

a b c d

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 39 / 69


Fuzzy MFs: Gaussian
[Link]

A Gaussian MF is specified by two parameters {c, σ} and can be


defined as below:
1 x−c
gaussian(x;c,σ) =e− 2 ( σ )2 .

c
0.1
0.1c 0.9c

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 40 / 69


Fuzzy MFs: Generalized bell
[Link]

It is also called Cauchy MF. A generalized bell MF is specified by three


parameters {a, b, c} and is defined as:
1
bell(x; a, b, c)= 1+| x−c |2b a

b
Slope at x =
2a
b
Slope at y = 
x b y
2 a

c-a c c+a

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 41 / 69


Example: Generalized bell MFs
[Link]

1
Example: µ(x)= 1+x 2 ;
a = b = 1 and c = 0;

1.0

-1 0 1

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 42 / 69


Generalized bell MFs: Different shapes
[Link]

Changing a Changing b

Changing a
Changing a and b

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 43 / 69


Fuzzy MFs: Sigmoidal MFs
[Link]

Parameters: {a, c} ; where c = crossover point and a = slope at c;


1
Sigmoid(x;a,c)= a ]
−[ x−c
1+e

1.0

Slope = a
0.5

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 44 / 69


Fuzzy MFs : Example
[Link]

Example : Consider the following grading system for a course.

Excellent = Marks ≤ 90
Very good = 75 ≤ Marks ≤ 90
Good = 60 ≤ Marks ≤ 75
Average = 50 ≤ Marks ≤ 60
Poor = 35 ≤ Marks ≤ 50
Bad= Marks ≤ 35

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 45 / 69


Grading System
[Link]
A fuzzy implementation will look like the following.

Bad poor Average Good Very Good Excellent

1
.8
.6
.4
.2
0
10 20 30 40 50 60 70 80 90
marks

You can decide a standard fuzzy MF for each of the fuzzy garde.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 46 / 69


[Link]

Operations on Fuzzy Sets

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 47 / 69


Basic fuzzy set operations: Union
[Link]
Union (A ∪ B):

µA∪B (x) = max{µA (x), µB (x)}

Example:
A = {(x1 , 0.5), (x2 , 0.1), (x3 , 0.4)} and
B = {(x1 , 0.2), (x2 , 0.3), (x3 , 0.5)};
C = A ∪ B = {(x1 , 0.5), (x2 , 0.3), (x3 , 0.5)}
µA µA
µB µB
µ
µAUB

a p x b q c a p x b q c

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 48 / 69


Basic fuzzy set operations: Intersection
[Link]
Intersection (A ∩ B):

µA∩B (x) = min{µA (x), µB (x)}

Example:
A = {(x1 , 0.5), (x2 , 0.1), (x3 , 0.4)} and
B = {(x1 , 0.2), (x2 , 0.3), (x3 , 0.5)};
C = A ∩ B = {(x1 , 0.2), (x2 , 0.1), (x3 , 0.4)}
µA
µB

µAᴖB
µ

a p x b q c a p x b q c

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 49 / 69


Basic fuzzy set operations: Complement
[Link]

Complement (AC ):

µAAC (x) = 1-µA (x)

Example:
A = {(x1 , 0.5), (x2 , 0.1), (x3 , 0.4)}
C = AC = {(x1 , 0.5), (x2 , 0.9), (x3 , 0.6)}
µA µA
1.0 µA’

p x q p x q

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 50 / 69


Basic fuzzy set operations: Products
[Link]

Algebric product or Vector product (A•B):

µA•B (x) = µA (x) • µB (x)

Scalar product (α × A):

µαA (x) = α · µA (x)

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 51 / 69


Basic fuzzy set operations: Sum and Difference
[Link]
Sum (A + B):

µA+B (x) = µA (x) + µB (x) − µA (x) · µB (x)

Difference (A − B = A ∩ B C ):

µA−B (x) = µA∩B C (x)

Disjunctive sum: A ⊕ B = (AC ∩ B) ∪ (A ∩ B C ))

Bounded Sum: | A(x) ⊕ B(x) |

µ|A(x)⊕B(x)| = min{1, µA (x) + µB (x)}

Bounded Difference: | A(x) ⊖ B(x) |

µ|A(x)⊖B(x)| = max{0, µA (x) + µB (x) − 1}

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 52 / 69


Basic fuzzy set operations: Equality and Power
[Link]

Equality (A = B):

µA (x) = µB (x)

Power of a fuzzy set Aα :

µAα (x) = {µA (x)}α

If α < 1, then it is called dilation


If α > 1, then it is called concentration

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 53 / 69


Basic fuzzy set operations: Cartesian product
[Link]

Caretsian Product (A × B):

µA×B (x, y ) = min{µA (x), µB (y)

Example 3:
A(x) = {(x1 , 0.2), (x2 , 0.3), (x3 , 0.5), (x4 , 0.6)}
B(y) = {(y1 , 0.8), (y2 , 0.6), (y3 , 0.3)}
y1 y2 y3
 
x1 0.2 0.2 0.2
x2  0.3 0.3 0.3 
A × B = min{µA (x), µB (y)} = 
 0.5

x3 0.5 0.3 
x4 0.6 0.6 0.3

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 54 / 69


Properties of fuzzy sets
[Link]

Commutativity :

A∪B = B∪A
A∩B = B∩A

Associativity :

A ∪ (B ∪ C) = (A ∪ B) ∪ C
A ∩ (B ∩ C) = (A ∩ B) ∩ C

Distributivity :

A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 55 / 69


Properties of fuzzy sets
[Link]
Idempotence :
A∪A=A
A∩A=∅
A∪∅=A
A∩∅=∅
Transitivity :
If A ⊆ B, B ⊆ C then A ⊆ C
Involution :
(Ac )c = A
De Morgan’s law :
(A ∩ B)c = Ac ∪ B c
(A ∪ B)c = Ac ∩ B c

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 56 / 69


[Link]

Few Illustrations on Fuzzy


Sets

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 57 / 69


Example 1: Fuzzy Set Operations
[Link]

Let A and B are two fuzzy sets defined over a universe of discourse X
with membership functions µA (x) and µB (x), respectively. Two MFs
µA (x) and µB (x) are shown graphically.
µA(x)

a1 a2 a3 a4 µB(x) b1 a1=b2 a2=b3 a4


x x

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 58 / 69


Example 1: Plotting two sets on the same graph
[Link]

Let’s plot the two membership functions on the same graph

µB µA
µ

b1 a1 a2 b4 a3 a4
x

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 59 / 69


Example 1: Union and Intersection
[Link]
The plots of union A ∪ B and intersection A ∩ B are shown in the
following.

µB µA

b1 a1 a2 b4 a3 a4
x
 A B ( x)

 A B ( x)
a2 b4
b1 a1 a2 a3 a4
x
x

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 60 / 69


Example 1: Intersection
[Link]

The plots of union µĀ (x) of the fuzzy set A is shown in the following.
 A ( x)

 A ( x)
a b a b
x x

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 61 / 69


Fuzzy set operations: Practice
[Link]

Consider the following two fuzzy sets A and B defined over a universe
of discourse [0,5] of real numbers with their membership functions

x
µA (x) = 1+x and µB (x) = 2−x

Determine the membership functions of the following and draw them


graphically.

i. A , B
ii. A ∪ B
iii. A ∩ B
iv. (A ∪ B)c [Hint: Use De’ Morgan law]

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 62 / 69


Example 2: A real-life example
[Link]
Two fuzzy sets A and B with membership functions µA (x) and µB (x),
respectively defined as below.
A = Cold climate with µA (x) as the MF.
B = Hot climate with µB (x) as the M.F.

µA µB
1.0

0.5
µ

-15 -10 -5 0 5 10 15 20 25 30 35 40 45 50

Here, X being the universe of discourse representing entire range of


temperatures.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 63 / 69


Example 2: A real-life example
[Link]

What are the fuzzy sets representing the following?


1 Not cold climate
2 Not hold climate
3 Extreme climate
4 Pleasant climate

Note: Note that ”Not cold climate” ̸= ”Hot climate” and vice-versa.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 64 / 69


Example 2 : A real-life example
[Link]
Answer would be the following.
1 Not cold climate
A with 1 − µA (x) as the MF.
2 Not hot climate
B with 1 − µB (x) as the MF.
3 Extreme climate
A ∪ B with µA∪B (x) = max(µA (x), µB (x)) as the MF.
4 Pleasant climate
A ∩ B with µA∩B (x) = min(µA (x), µB (x)) as the MF.
The plot of the MFs of A ∪ B and A ∩ B are shown in the following.
Extreme climate Pleasant climate
1.0
µA µB
1.0
 A B

 A B
0.
5
µ

- -
15 10 -5 0 5 10 15 20 25 30 35 40 45 50
x 5 15 25 5 25
x x

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 65 / 69


[Link]

Few More on Membership


Functions

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 66 / 69


Generation of MFs
[Link]
Given a membership function of a fuzzy set representing a linguistic
hedge, we can derive many more MFs representing several other
linguistic hedges using the concept of Concentration and Dilation.
Concentration:
Ak = [µA (x)]k ; k > 1
Dilation:
Ak = [µA (x)]k ; k < 1
Example : Age = { Young, Middle-aged, Old }
Thus, corresponding to Young, we have : Not young, Very young, Not
very young and so on.
Similarly, with Old we can have : old, very old, very very old, extremely
old etc.
Thus, Extremely old = (((old)2 )2 )2 and so on
Or, More or less old = A0.5 = (old)0.5
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 67 / 69
Linguistic variables and values
[Link]
Young Middle-Aged Old

Very Old


Very young

0 30 60 100

X = Age

1
µyoung (x) = bell(x, 20, 2, 0) = x 4
1+( 20 )
1
µold (x) = bell(x, 30, 3, 100) =
1+( x−100
30
)6

µmiddle−aged = bell(x, 30, 60, 50)


Not young = µyoung (x) = 1 − µyoung (x)
Young but not too young = µyoung (x) ∩ µyoung (x)

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 10.01.2023 68 / 69


[Link]

Fuzzy Relations, Rules and Inferences

Debasis Samanta

IIT Kharagpur
dsamanta@[Link]

15.01.2023

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 1 / 65


Concept of fuzzy system
[Link]

Fuzzy element(s)

Fuzzy set(s)
I
N
P Fuzzy rule(s)
U
T
Fuzzy implication(s)
(Inferences)
O
U
T
Fuzzy system P
U
T

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 2 / 65


[Link]

Fuzzy Relations

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 3 / 65


Crisp relations
[Link]

To understand the fuzzy relations, it is better to discuss first crisp


relation.
Suppose, A and B are two (crisp) sets. Then Cartesian product
denoted as A × B is a collection of order pairs, such that
A × B = {(a, b)|a ∈ A and b ∈ B}

Note :
(1) A × B ̸= B × A
(2) |A × B| = |A| × |B|
(3)A × B provides a mapping from a ∈ A to b ∈ B.

The mapping so mentioned is called a relation.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 4 / 65


Crisp relations
[Link]
Example 1:
Consider the two crisp sets A and B as given below. A ={ 1, 2, 3, 4}
B = {3, 5, 7 }.
Then, A × B = {(1, 3), (1, 5), (1, 7), (2, 3), (2, 5), (2, 7), (3, 3), (3, 5),
(3, 7), (4, 3), (4, 5), (4, 7)}
Let us define a relation R as R = {(a, b)|b = a + 1, (a, b) ∈ A × B}
Then, R = {(2, 3), (4, 5)} in this case.
We can represent the relation R in a matrix form as follows.
3 5 7
 
1 0 0 0
2  1 0 0 
R= 
 0

3 0 0 
4 0 1 0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 5 / 65


Operations on crisp relations
[Link]
Suppose, R(x, y) and S(x, y ) are the two relations define over two
crisp sets x ∈ A and y ∈ B
Union:

R(x, y) ∪ S(x, y ) = max(R(x, y), S(x, y ));

Intersection:

R(x, y) ∩ S(x, y ) = min(R(x, y), S(x, y ));

Complement:

R(x, y ) = 1 − R(x, y)

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 6 / 65


Example: Operations on crisp relations
[Link]

Example:
Suppose, R(x, y) and S(x, y ) are the two relations define over two
crisp sets x ∈ A and y ∈ B
   
0 1 0 0 1 0 0 0
0 0 1 0 0 1 0 0
R= 0 0 0 1 and S = 0 0 1 0 ;
  

0 0 0 0 0 0 0 1
Find the following:
1 R∪S
2 R∩S
3 R

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 7 / 65


Composition of two crisp relations
[Link]

Given R is a relation on X ,Y and S is another relation on Y ,Z .


Then R ◦ S is called a composition of relation on X and Z which is
defined as follows.

R ◦ S = {(x, z)|(x, y) ∈ R and (y , z) ∈ S and ∀y ∈ Y }

Max-Min Composition
Given the two relation matrices R and S, the max-min composition is
defined as T = R ◦ S ;

T (x, z) = max{min{R(x, y), S(y, z) and ∀y ∈ Y }}

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 8 / 65


Composition: Composition
[Link]
Example:
Given
X = {1, 3, 5}; Y = {1, 3, 5}; R = {(x, y)|y = x + 2}; S = {(x, y)|x < y }
Here, R and S is on X × Y .
Thus, we have
R = {(1, 3), (3, 5)}
S = {(1, 3), (1, 5), (3, 5)}
1 3 5 1 3 5
   
1 0 1 0 1 0 1 1
R= 3  0 0 1  and S= 3  0 0 1 
5 0 0 0 5 0 0 0
1 3 5
 
1 0 0 1
Using max-min composition R ◦ S= 3  0 0 0 
5 0 0 0
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 9 / 65
Fuzzy relations
[Link]
Fuzzy relation is a fuzzy set defined on the Cartesian product of
crisp set X1 , X2 , ..., Xn
Here, n-tuples (x1 , x2 , ..., xn ) may have varying degree of
memberships within the relationship.
The membership values indicate the strength of the relation
between the tuples.
Example:
X = { typhoid, viral, cold } and Y = { running nose, high temp,
shivering }
The fuzzy relation R is defined as

runningnose hightemperature shivering


 
typhoid 0.1 0.9 0.8
viral  0.2 0.9 0.7 
cold 0.9 0.4 0.6
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 10 / 65
Fuzzy Cartesian product
[Link]

Suppose
A is a fuzzy set on the universe of discourse X with µA (x)|x ∈ X
B is a fuzzy set on the universe of discourse Y with µB (y)|y ∈ Y
Then R = A × B ⊂ X × Y ; where R has its membership function given
by µR (x, y ) = µA×B (x, y) = min{µA (x), µB (y )}
Example :
A = {(a1 , 0.2), (a2 , 0.7), (a3 , 0.4)}and B = {(b1 , 0.5), (b2 , 0.6)}
b1 b2
 
a1 0.2 0.2
R =A×B = a2  0.5 0.6 
a3 0.4 0.4

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 11 / 65


Operations on Fuzzy relations
[Link]
Let R and S be two fuzzy relations on A × B.
Union:

µR∪S (a, b) = max{µR (a, b), µS (a, b)}


Intersection:

µR∩S (a, b) = min{µR (a, b), µS (a, b)}


Complement:

µR (a, b) = 1 − µR (a, b)
Composition

T =R◦S
µR◦S = maxy∈Y {min(µR (x, y ), µS (y , z))}

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 12 / 65


Operations on Fuzzy relations: Examples
[Link]
Example:
X = (x1 , x2 , x3 ); Y = (y1 , y2 ); Z = (z1 , z2 , z3 );
y1 y2
 
x1 0.5 0.1
R= x2  0.2 0.9 
x3 0.8 0.6
z1 z2 z3
 
y1 0.6 0.4 0.7
S=
y2 0.5 0.8 0.9
z1 z2 z3
 
0.5 0.4 0.5
x1
R◦S = x2  0.5 0.8 0.9 
x3 0.6 0.6 0.7
µR◦S (x1 , y1 ) = max{min(x1 , y1 ), min(y1 , z1 ), min(x1 , y2 ), min(y2 , z1 )}
= max{min(0.5, 0.6), min(0.1, 0.5)} = max{0.5, 0.1} = 0.5 and so on.
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 13 / 65
Fuzzy relation : An example
[Link]
Consider the following two sets P and D, which represent a set of
paddy plants and a set of plant diseases. More precisely
P = {P1 , P2 , P3 , P4 } a set of four varieties of paddy plants
D = {D1 , D2 , D3 , D4 } of the four various diseases affecting the plants
In addition to these, also consider another set S = {S1 , S2 , S3 , S4 } be
the common symptoms of the diseases.
Let, R be a relation on P × D, representing which plant is susceptible
to which diseases, then R can be stated as
D1 D2 D3 D4
 
P1 0.6 0.6 0.9 0.8
P2  0.1 0.2 0.9 0.8 
R= 
 0.9

P3 0.3 0.4 0.8 
P4 0.9 0.8 0.4 0.2

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 14 / 65


Fuzzy relation : An example
[Link]
Also, consider T be the another relation on D × S, which is given by
S1 S2 S3 S4
 
D1 0.1 0.2 0.7 0.9
D2  1.0 1.0 0.4 0.6 
S= 
 0.0

D3 0.0 0.5 0.9 
D4 0.9 1.0 0.8 0.2
Obtain the association of plants with the different symptoms of the
disease using max-min composition.
Hint: Find R ◦ T , and verify that
S1 S2 S3 S4
 
P1 0.8 0.8 0.8 0.9
P2  0.8 0.8 0.8 0.9 
R◦S = 
 0.8

P3 0.8 0.8 0.9 
P4 0.8 0.8 0.7 0.9

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 15 / 65


Fuzzy relation : Another example
[Link]
Let, R = x is relevant to y
and S = y is relevant to z
be two fuzzy relations defined on X × Y and Y × Z , respectively,
where X = {1, 2, 3} ,Y = {α, β, γ, δ} and Z = {a, b}.
Assume that R and S can be expressed with the following relation
matrices :
α β γ δ
 
1 0.1 0.3 0.5 0.7
R= 2  0.4 0.2 0.8 0.9  and
3 0.6 0.8 0.3 0.2
a b
 
α 0.9 0.1
β  0.2 0.3 
S= 
 0.5

γ 0.6 
δ 0.7 0.2
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 16 / 65
Fuzzy relation : Another example
[Link]
Now, we want to find R ◦ S, which can be interpreted as a derived
fuzzy relation x is relevant to z.
Suppose, we are only interested in the degree of relevance between
2 ∈ X and a ∈ Z . Then, using max-min composition,
µR◦S (2, a) = max{(0.4 ∧ 0.9), (0.2 ∧ 0.2), (0.8 ∧ 0.5), (0.9 ∧ 0.7)}
= max{0.4, 0.2, 0.5, 0.7} = 0.7
R s

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 17 / 65


2D Membership functions : Binary fuzzy relations
[Link]
(Binary) fuzzy relations are fuzzy sets A × B which map each element
in A × B to a membership grade between 0 and 1 (both inclusive).
Note that a membership function of a binary fuzzy relation can be
depicted with a 3D plot.

 ( x, y )

Important: Binary fuzzy relations are fuzzy sets with two dimensional
MFs and so on.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 18 / 65


2D membership function : An example
[Link]

Let, X = R + = y (the positive real line)


and R = X × Y = ”y is much greater than x”
The membership function of µR (x, y ) is defined as
 (y−x)
if y > x
µR (x, y ) = 4
0 if y ≤ x
Suppose, X = {3, 4, 5} and Y = {3, 4, 5, 6, 7}, then
3 4 5 6 7
 
3 0 0.25 0.5 0.75 1.0
R= 4  0 0 0.25 0.5 0.75 
5 0 0 0 0.25 0.5

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 19 / 65


Problems to ponder:
[Link]

How you can derive the following?


If x is A or y is B then z is C;
Given that
1 R1 : If x is A then z is c [R1 ∈ A × C]
2 R2 : If y is B then z is C [R2 ∈ B × C]

Hint:
You have given two relations R1 and R2 .
Then, the required can be derived using the union operation of R1
and R2

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 20 / 65


[Link]

Fuzzy Propositions

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 21 / 65


Two-valued logic vs. Multi-valued logic
[Link]

The basic assumption upon which crisp logic is based - that every
proposition is either TRUE or FALSE.

The classical two-valued logic can be extended to multi-valued


logic.

As an example, three valued logic to denote true(1), false(0) and


indeterminacy ( 21 ).

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 22 / 65


Two-valued logic vs. Multi-valued logic
[Link]
Different operations with three-valued logic can be extended as shown
in the following truth table:

a b ∧ ∨ ¬a =⇒ =
0 0 0 0 1 1 1
1 1 1
0 2 0 2 1 1 2
0 1 0 1 1 1 0
1 1 1 1 1
2 0 0 2 2 2 2
1 1 1 1 1 1
2 2 2 2 2 2 1
1 1 1 1
2 1 2 1 2 1 2
1 0 0 1 1 0 0
1 1 1 1
1 2 2 1 1 2 2
1 1 1 1 1 1 1

Fuzzy connectives used in the above table are:


AND (∧), OR (∨), NOT (¬), IMPLICATION (=⇒) and EQUAL (=).

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 23 / 65


Three-valued logic
[Link]

Fuzzy connectives defined for such a three-valued logic better can be


stated as follows:
Symbol Connective Usage Definition
¬ NOT ¬P 1 − T (P)
∨ OR P ∨Q max{T(P), T(Q) }
∧ AND P ∧Q min{ T(P),T(Q) }
=⇒ IMPLICATION (P =⇒ Q) or max{(1 - T(P)),
(¬P ∨ Q) T(Q) }
= EQUALITY (P = Q) or 1 − |T (P) − T (Q)|
[(P =⇒ Q) ∧
(Q =⇒ P)]

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 24 / 65


Fuzzy proposition
[Link]

Example 1:
P : Ram is honest
1 T(P) = 0.0 : Absolutely false
2 T(P) = 0.2 : Partially false
3 T(P) = 0.4 : May be false or not false
4 T(P) = 0.6 : May be true or not true
5 T(P) = 0.8 : Partially true
6 T(P) = 1.0 : Absolutely true.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 25 / 65


Example 2 :Fuzzy proposition
[Link]

P : Mary is efficient ; T(P) = 0.8;


Q : Ram is efficient ; T(Q) = 0.6
1 Mary is not efficient.
T (¬P) = 1 − T (P) = 0.2
2 Mary is efficient and so is Ram.
T (P ∧ Q) = min{T (P), T (Q)} = 0.6
3 Either Mary or Ram is efficient
T (P ∨ Q) = maxT (P), T (Q) = 0.8
4 If Mary is efficient then so is Ram
T (P =⇒ Q) = max{1 − T (P), T (Q)} = 0.6

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 26 / 65


Fuzzy proposition vs. Crisp proposition
[Link]

The fundamental difference between crisp (classical) proposition


and fuzzy propositions is in the range of their truth values.

While each classical proposition is required to be either true or


false, the truth or falsity of fuzzy proposition is a matter of degree.

The degree of truth of each fuzzy proposition is expressed by a


value in the interval [0,1] both inclusive.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 27 / 65


Canonical representation of Fuzzy proposition
[Link]
Suppose, X is a universe of discourse of five persons.
Intelligent of x ∈ X is a fuzzy set as defined below.

Intelligent: {(x1 , 0.3), (x2 , 0.4), (x3 , 0.1), (x4 , 0.6), (x5 , 0.9)}
We define a fuzzy proposition as follows:

P : x is intelligent
The canonical form of fuzzy proposition of this type, P is
expressed by the sentence P : v is F .
Predicate in terms of fuzzy set.
P : v is F ; where v is an element that takes values v from some
universal set V and F is a fuzzy set on V that represents a fuzzy
predicate.
In other words, given, a particular element v , this element belongs
to F with membership grade µF (v ).
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 28 / 65
Graphical interpretation of fuzzy proposition
[Link]

 F (v )

P: v is F
T(P)
T(P) = µF(v) for a v ε V

v V

For a given value v of variable V in proposition P, T(P) denotes the


degree of truth of proposition P.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 29 / 65


[Link]

Fuzzy Implications

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 30 / 65


Fuzzy rule
[Link]

A fuzzy implication (also known as fuzzy If-Then rule, fuzzy rule,


or fuzzy conditional statement) assumes the form :

If x is A then y is B

where, A and B are two linguistic variables defined by fuzzy sets A


and B on the universe of discourses X and Y , respectively.

Often, x is A is called the antecedent or premise, while y is B is


called the consequence or conclusion.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 31 / 65


Fuzzy implication : Example 1
[Link]

If pressure is High then temperature is Low

If mango is Yellow then mango is Sweet else mango is Sour

If road is Good then driving is Smooth else traffic is High

The fuzzy implication is denoted as R : A → B

In essence, it represents a binary fuzzy relation R on the


(Cartesian) product of A × B

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 32 / 65


Fuzzy implication : Example 2
[Link]

Suppose, P and T are two universes of discourses representing


pressure and temperature, respectively as follows.

P = { 1,2,3,4} and T ={ 10, 15, 20, 25, 30, 35, 40, 45, 50 }

Let the linguistic variable High temperature and Low pressure are
given as

THIGH =
{(20, 0.2), (25, 0.4), (30, 0.6), (35, 0.6), (40, 0.7), (45, 0.8), (50, 0.8)}

PLOW = (1, 0.8), (2, 0.8), (3, 0.6), (4, 0.4)

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 33 / 65


Fuzzy implications : Example 2
[Link]

Then the fuzzy implication If temperature is High then pressure


is Low can be defined as
R : THIGH → PLOW
1 2 3 4
 
20 0.2 0.2 0.2 0.2
25 
 0.4 0.4 0.4 0.4 

30 
 0.6 0.6 0.6 0.4 

where, R = 35 
 0.6 0.6 0.6 0.4 

40 
 0.7 0.7 0.6 0.4 

45  0.8 0.8 0.6 0.4 
50 0.8 0.8 0.6 0.4

Note : If temperature is 40 then what about low pressure?

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 34 / 65


Interpretation of fuzzy rules
[Link]

In general, there are two ways to interpret the fuzzy rule A → B as


A coupled with B

A entails B

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 35 / 65


Interpretation as A coupled with B
[Link]
R
R :A→B =A×B = X ×Y µA (x) ∗ µB (y)|(x,y) ; where ∗ is called a
T-norm operator.

T-norm operator
The most frequently used T-norm operators are:
Minimum : Tmin (a, b) = min(a, b) = a ∧ b
Algebric product : Tap (a, b) = ab
Bounded product : Tbp (a, b) = 0 ∨ (a + b − 1)

a if b=1
Drastic product : Tdp = b if a=1
0 if a, b < 1

Here, a = µA (x) and b = µB (y ). T∗ is called the function of T-norm operator.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 36 / 65


Interpretation as A coupled with B
[Link]

Based on the T-norm operator as defined above, we can automatically


define the fuzzy rule R : A → B as a fuzzy set with two-dimentional MF:
µR (x, y ) = f (µA (x), µB (y)) = f (a, b) with a=µA (x) , b=µB (y), and f is
the fuzzy implication function.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 37 / 65


Interpretation as A coupled with B
[Link]

In the following, few implications of R : A → B

Min operator:
R
Rm = A × B = X ×Y µA (x) ∧ µB (y )|(x,y) or fmin (a, b) = a ∧ b
[Mamdani rule]

Algebric product operator


R
Rap = A × B = X ×Y µA (x).µB (y)|(x,y ) or fap (a, b) = ab
[Larsen rule]

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 38 / 65


Product Operators
[Link]

Bounded product operator


R
RRbp = A × B = X ×Y µA (x) ⊙ µB (y)|(x,y ) =
X ×Y 0 ∨ (µA (x) + µB (y ) − 1)|(x,y)
or fbp = 0 ∨ (a + b − 1)

Drastic product R operator


Rdp = A × B = X ×Y µA (x)ˆ•µB (y)|(x,y)

a if b=1
or fdp (a, b) = b if a=1
0 if otherwise

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 39 / 65


Interpretation of A entails B
[Link]

There are three main ways to interpret such implication:


Material implication :
R : A → B = Ā ∪ B

Propositional calculus :
R : A → B = Ā ∪ (A ∩ B)

Extended propositional calculus :


R : A → B = (Ā ∩ B̄) ∪ B

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 40 / 65


Interpretation of A entails B
[Link]

With the above mentioned implications, there are a number of fuzzy


implication functions that are popularly followed in fuzzy rule-based
system.

Zadeh’s arithmetic rule :


R
Rza = Ā ∪ B = X ×Y 1 ∧ (1 − µA (x) + µB (y ))|(x,y)
or
fza (a, b) = 1 ∧ (1 − a + b)

Zadeh’s max-min rule :


R
Rmm = Ā ∪ (A ∩ B) = X ×Y (1 − µA (x)) ∨ (µA (x) ∧ µB (y ))|(x,y)
or
fmm (a, b) = (1 − a) ∨(a ∧ b)

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 41 / 65


Interpretation of A entails B
[Link]

Boolean fuzzy rule


R
Rbf = Ā ∪ B = X ×Y (1 − µA (x)) ∨ µB (x)|(x,y)
or
fbf (a, b) = (1 − a) ∨ b;

Goguen’s fuzzy rule:



R 1 if a≤b
Rgf = X ×Y µA (x) ∗ µB (y )|(x,y ) where a ∗ b = b
a if a>b

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 42 / 65


Example 3: Zadeh’s Max-Min rule
[Link]

If x is A then y is B with the implication of Zadeh’s max-min rule can


be written equivalently as :

Rmm = (A × B) ∪ (Ā × Y )

Here, Y is the universe of discourse with membership values for all


y ∈ Y is 1, that is , µY (y) = 1∀y ∈ Y .
Suppose X = {a, b, c, d} and Y = {1, 2, 3, 4}
and A = {(a, 0.0), (b, 0.8), (c, 0.6), (d, 1.0)}
B = {(1, 0.2), (2, 1.0), (3, 0.8), (4, 0.0)} are two fuzzy sets.

We are to determine Rmm = (A × B) ∪ (Ā × Y )

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 43 / 65


Example 3: Zadeh’s min-max rule:
[Link]

The computation of Rmm = (A × B) ∪ (Ā × Y ) is as follows:


1 2 3 4
 
a 0 0 0 0
b  0.2 0.8 0.8 0 
A×B =  0.2 0.6 0.6 0  and
 
c
d 0.2 1.0 0.8 0

1 2 3 4
 
a 1 1 1 1
b  0.2 0.2 0.2 0.2 
Ā × Y =  
 0.4 0.4 0.4 0.4 
c
d 0 0 0 0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 44 / 65


Example 3: Zadeh’s min-max rule:
[Link]

Therefore,
1 2 3 4
 
a 1 1 1 1
b  0.2 0.8 0.8 0.2 
Rmm = (A × B) ∪ (Ā × Y ) =  
 0.4 0.6 0.6 0.4 
c
d 0.2 1.0 0.8 0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 45 / 65


Example 3 :
[Link]

X = {a, b, c, d}
Y = {1, 2, 3, 4}
Let, A = {(a, 0.0), (b, 0.8), (c, 0.6), (d, 1.0)}
B = {(1, 0.2), (2, 1.0), (3, 0.8), (4, 0.0)}
Determine the implication relation :
If x is A then y is B
1 2 3 4
 
a 0 0 0 0
b  0.2 0.8 0.8 0 
Here, A × B =  
 0.2 0.6 0.6 0 
c
d 0.2 1.0 0.8 0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 46 / 65


Example 3 :
[Link]

1 2 3 4
 
a 1 1 1 1
b  0.2 0.2 0.2 0.2 
and Ā × Y =  
 0.4 0.4 0.4 0.4 
c
d 0 0 0 0
1 2 3 4
 
a 1 1 1 1
b  0.2 0.8 0.8 0.2 
Rmm = (A × B) ∪ (Ā × Y ) =  
 0.4 0.6 0.6 0.4 
c
d 0.2 1.0 0.8 0
This R represents If x is A then y is B

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 47 / 65


Example 3 :
[Link]

IF x is A THEN y is B ELSE y is C.
The relation R is equivalent to

R = (A × B) ∪ (Ā × C)

The membership function of R is given by


µR (x, y ) =max[min{µA (x), µB (y )}, min{µĀ (x), µC (y )]

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 48 / 65


Example 4:
[Link]
X = {a, b, c, d}
Y = {1, 2, 3, 4}
A = {(a, 0.0), (b, 0.8), (c, 0.6), (d, 1.0)}
B = {(1, 0.2), (2, 1.0), (3, 0.8), (4, 0.0)}
C = {(1, 0), (2, 0.4), (3, 1.0), (4, 0.8)}
Determine the implication relation :
If x is A then y is B else y is C
1 2 3 4
 
a 0 0 0 0
b  0.2 0.8 0.8 0 
Here, A × B =  
 0.2 0.6 0.6 0 
c
d 0.2 1.0 0.8 0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 49 / 65


Example 4:
[Link]

1 2 3 4
 
a 0 0.4 1.0 0.8
b  0 0.2 0.2 0.2 
and Ā × C =  
 0 0.4 0.4 0.4 
c
d 0 0 0 0
1 2 3 4
 
a 0 0.4 1.0 0.8
b  0.2 0.8 0.8 0.2 
R= 
 0.2

c 0.6 0.6 0.4 
d 0.2 1.0 0.8 0

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 50 / 65


Interpretation of fuzzy implication
[Link]
If x is A then y is B

{
If x is A then y is B else y is C

{ {

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 51 / 65


[Link]

Fuzzy Inferences

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 52 / 65


Fuzzy inferences
[Link]

Let’s start with propositional logic. We know the following in


propositional logic.

1 Modus Ponens : P, P =⇒ Q, ⇔Q

2 Modus Tollens : P =⇒ Q, ¬Q ⇔, ¬P

3 Chain rule : P =⇒ Q, Q =⇒ R ⇔, P =⇒ R

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 53 / 65


An example from propositional logic
[Link]

Given

1 C∨D

2 ∼ H =⇒ (A∧ ∼ B)

3 C ∨ D =⇒∼ H

4 (A∧ ∼ B) =⇒ (R ∨ S)

From the above can we infer R ∨ S?

Similar concept is also followed in fuzzy logic to infer a fuzzy rule from
a set of given fuzzy rules (also called fuzzy rule base).

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 54 / 65


Inferring procedures in Fuzzy logic
[Link]
Two important inferring procedures are used in fuzzy systems :

Generalized Modus Ponens (GMP)


If x is A Then y is B

x is A
————————————

y is B

Generalized Modus Tollens (GMT)


If x is A Then y is B

y is B
————————————

x is A

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 55 / 65


Fuzzy inferring procedures
[Link]

′ ′
Here, A, B, A and B are fuzzy sets.
′ ′
To compute the membership function A and B the max-min
′ ′
composition of fuzzy sets B and A ,respectively with R(x, y)
(which is the known implication relation) is to be used.

Thus,
′ ′
B = A ◦ R(x, y) µB (y) = max[min(µA′ (x), µR (x, y ))]
′ ′
A = B ◦ R(x, y) µA (x) = max[min(µB ′ (y), µR (x, y ))]

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 56 / 65


Generalized Modus Ponens
[Link]
Generalized Modus Ponens (GMP)

P : If x is A then y is B

Let us consider two sets of variables x and y be


X = {x1 , x2 , x3 } and Y = {y1 , y2 }, respectively.

Also, let us consider the following.


A = {(x1 , 0.5), (x2 , 1), (x3 , 0.6)}
B = {(y1 , 1), (y2 , 0.4)}

Then, given a fact expressed by the proposition x is A ,

where A = {(x1 , 0.6), (x2 , 0.9), (x3 , 0.7)}

derive a conclusion in the form y is B (using generalized modus
ponens (GMP)).
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 57 / 65
Example: Generalized Modus Ponens
[Link]

If x is A Then y is B

x is A
————————————–

y is B
′ ′
We are to find B = A ◦ R(x, y ) where R(x, y) = max{A × B, A × Y }
y1 y2 y1 y2
   
x1 0.5 0.4 x1 0.5 0.5
A×B = x2  1 0.4  and A × Y = x2  0 0 
x3 0.6 0.4 x3 0.4 0.4

Note: For A × B, µA×B (x, y ) = min(µA x, µB (y))

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 58 / 65


Example: Generalized Modus Ponens
[Link]

1 y
2 y
 
x1 0.5 0.5
R(x, y ) = (A × B) ∪ (A × y) = x2  1 0.4 
x3 0.6 0.4

Now, A = {(x1 , 0.6), (x2 , 0.9), (x3 , 0.7)}
′ ′
Therefore, B = A◦ R(x, y)=
  0.5 0.5  
0.6 0.9 0.7 ◦ 1 0.4 = 0.9 0.5

0.6 0.4
′ ′
Thus we derive that y is B where B = {(y1 , 0.9), (y2 , 0.5)}

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 59 / 65


Example: Generalized Modus Tollens
[Link]

Generalized Modus Tollens (GMT)

P: If x is A Then y is B

Q: y is B
——————————————

x is A

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 60 / 65


Example: Generalized Modus Tollens
[Link]

Let sets of variables x and y be X = {x1 , x2 , x3 } and y = {y1 , y2 },


respectively.

Assume that a proposition If x is A Then y is B given where


A = {(x1 , 0.5), (x2 , 1.0), (x3 , 0.6)} and B = {(y1 , 0.6), (y2 , 0.4)}

Assume now that a fact expressed by a proposition y is B is given



where B = {(y1 , 0.9), (y2 , 0.7)}.

From the above, we are to conclude that x is A . That is, we are to

determine A

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 61 / 65


Example: Generalized Modus Tollens
[Link]

We first calculate R(x, y) = (A × B) ∪ (A × y )


1 y 2 y
 
x1 0.5 0.5
R(x, y) = x2  1 0.4 
x3 0.6 0.4
′ ′
Next, we calculate A = B ◦ R(x, y )
y1 y2
 
x1 0.5 0.5
′    
A = 0.9 0.7 ◦ x2  1 0.4  = 0.5 0.9 0.6
x3 0.6 0.4

Hence, we calculate that x is A where

A = [(x1 , 0.5), (x2 , 0.9), (x3 , 0.6)]

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 62 / 65


Practice
[Link]

Apply the fuzzy GMP rule to deduce Rotation is quite slow

Given that :

If temperature is High then rotation is Slow.

temperature is Very High

Let,

X = {30, 40, 50, 60, 70, 80, 90, 100} be the set of temperatures.

Y = {10, 20, 30, 40, 50, 60} be the set of rotations per minute.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 63 / 65


Practice
[Link]
The fuzzy set High(H), Very High (VH), Slow(S) and Quite Slow (QS)
are given below.

H = {(70, 1), (80, 1), (90, 0.3)}

VH = {(90, 0.9), (100, 1)}

S = {(30, 0.8), (40, 1.0), (50, 0.6)}

QS = {(10, 1), (20, 0.8)}

1 If temperature is High then the rotation is Slow.

R = (H × S) ∪ (H × Y )

2 temperature is Very High

Thus, to deduce ”rotation is Quite Slow”, we make use the composition


rule QS = VH ◦ R(x, y )
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 15.01.2023 64 / 65
[Link]

Defuzzification Techniques

Debasis Samanta

IIT Kharagpur
dsamanta@[Link]

19.01.2023

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 1 / 55


What is defuzzification?
[Link]

Defuzzification means the fuzzy to crisp conversion.

Example 1:
Suppose, THIGH denotes a fuzzy set representing temperature is
High.
THIGH is given as follows.
THIGH = (15,0.1), (20, 0.4), (25,0.45), (30,0.55), (35,0.65),
(40,0.7), (45,0.85),(50,0.9)

What is the crisp value that implies for the high temperature?

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 2 / 55


Example 2: Fuzzy to crisp
[Link]

As an another example, let us consider a fuzzy set whose membership


finction is shown in the following figure.

 ( x)

What is the crisp value of the fuzzy set in this case?

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 3 / 55


Example 3: Fuzzy to crisp
[Link]
Now, consider the following two rules in the fuzzy rule base.

R1: If x is A then y is C
R2: If x is B then y is D
A pictorial representation of the above rule base is shown in the
following figures.

C
1.0 1.0
A B

 x’
 D

x y

What is the crisp value that can be inferred from the above rules given

an input say x ?
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 4 / 55
Why defuzzification?
[Link]

The fuzzy results generated can not be used in an application, where


decision has to be taken only on crisp values.

Example:

If THIGH then rotate RFIRST .

Here, may be input THIGH is fuzzy, but action rotate should be based
on the crisp value of RFIRST .

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 5 / 55


Generic structure of a Fuzzy system
[Link]

Following figures shows a general fraework of a fuzzy system.

Fuzzy
rule
Crisp base Defuzzifier Crisp
Fuzzifier
input output

Inference
mechanism

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 6 / 55


[Link]

Defuzzification Techniques

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 7 / 55


Defuzzification methods
[Link]

A number of defuzzification methods are known. Such as


1 Lambda-cut method

2 Weighted average method

3 Maxima methods

4 Centroid methods

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 8 / 55


[Link]

Lambda-cut method

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 9 / 55


Lambda-cut method
[Link]

Lmabda-cut method is applicable to derive crisp value of a fuzzy set or


relation. Thus

Lambda-cut method for fuzzy set

Lambda-cut method for fuzzy relation

In many literature, Lambda-cut method is also alternatively termed as


Alph-cut method.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 10 / 55


Lamda-cut method for fuzzy set
[Link]

1 In this method a fuzzy set A is transformed into a crisp set Aλ for a


given value of λ (0 ≤ λ ≤ 1)

2 In other-words, Aλ = {x|µA (x) ≥ λ}

3 That is, the value of Lambda-cut set Aλ is x, when the


membership value corresponding to x is greater than or equal to
the specified λ.

4 This Lambda-cut set Aλ is also called alpha-cut set.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 11 / 55


Lambda-cut for a fuzzy set : Example
[Link]

A1 = {(x1 , 0.9), (x2 , 0.5), (x3 , 0.2), (x4 , 0.3)}

Then A0.6 = {(x1 , 1), (x2 , 0), (x3 , 0), (x4 , 0)} = {x1 }

and

A2 = {(x1 , 0.1), (x2 , 0.5), (x3 , 0.8), (x4 , 0.7)}

A0.2 = {(x1 , 0), (x2 , 1), (x3 , 1), (x4 , 1)} = {x2 , x3 , x4 }

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 12 / 55


Lambda-cut sets : Example
[Link]
Two fuzzy sets P and Q are defined on x as follows.

µ(x) x1 x2 x3 x4 x5
P 0.1 0.2 0.7 0.5 0.4
Q 0.9 0.6 0.3 0.2 0.8

Find the following :

(a) P0.2 , Q0.3

(b) (P ∪ Q)0.6

(c) (P ∪ P)0.8

(d) (P ∩ Q)0.4

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 13 / 55


Lambda-cut for a fuzzy relation
[Link]
The Lambda-cut method for a fuzzy set can also be extended to fuzzy
relation also.
Example: For a fuzzy relation R
 
1 0.2 0.3
R = 0.5 0.9 0.6
0.4 0.8 0.7
We are to find λ-cut relations for the following values of
λ = 0,0.2, 0.9, 0.5
  
1 1 1 1 1 1
R0 = 1 1 1 and R0.2 = 1 1 1 and
1 1 1 1 1 1
   
1 0 0 1 0 0
R0.9 = 0 1 0 and R0.5 = 1 1 1
0 0 0 0 1 1

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 14 / 55


Some properties of λ-cut sets
[Link]

If A and B are two fuzzy sets, defined with the same universe of
discourse, then

1 (A ∪ B)λ = Aλ ∪ Bλ

2 (A ∩ B)λ = Aλ ∩ Bλ

3 (A)λ ̸= Aλ except for value of λ = 0.5

4 For any λ ≤ α, where α varies between 0 and 1, it is true that


Aα ⊆ Aλ , where the value of A0 will be the universe of discourse.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 15 / 55


Some properties of λ-cut relations
[Link]

If R and S are two fuzzy relations, defined with the same fuzzy sets
over the same universe of discourses, then

5 (R ∪ S)λ = Rλ ∪ Sλ

6 (R ∩ S)λ = Rλ ∩ Sλ

7 (R)λ ̸= R λ

8 For λ ≤ α, where α between 0 and 1 , then Rα ⊆ Rλ

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 16 / 55


Summary: Lambda-cut methods
[Link]

Lambda-cut method converts a fuzzy set (or a fuzzy relation) into crisp
set (or relation).

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 17 / 55


[Link]

Output of a Fuzzy System

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 18 / 55


Output of a fuzzy System
[Link]

The output of a fuzzy system can be a single fuzzy set or union of two
or more fuzzy sets.

To understand the second concept, let us consider a fuzzy system with


n-rules.

R1 : If x is A1 then y is B1
R2 : If x is A2 then y is B2
........................................
........................................
Rn : If x is An then y is Bn

In this case, the output y for a given input x = x1 is possibly B =


B1 ∪ B2 ∪ .....Bn

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 19 / 55


Output fuzzy set : Illustration
[Link]
Suppose, two rules R1 and R2 are given as follows:

1 R1 : If x is A1 then y is C1

2 R2 : If x is A2 then y is C2

Here, the output fuzzy set C = C1 ∪ C2 .


For instance, let us consider the following:

C2
1.0 1.0
A C1


B

0 1 2 3 4 5 6 0 1 2 3 4 5 6 7 8

x y
x1 x2 x3

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 20 / 55


Output fuzzy set : Illustration
[Link]

The fuzzy output for x = x1 is shown below.

1.0 1.0
A C
B 

0 1 2 3 4 5 6 0 1 2 3 4 5 6 7 8

x1 y
x
Fuzzy output for x = x1

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 21 / 55


Output fuzzy set : Illustration
[Link]

The fuzzy output for x = x2 is shown below.

1.0 1.0
A

B  C

0 1 2 3 4 5 6 0 1 2 3 4 5 6 7 8
x = x2 y
x
Fuzzy output for x = x2

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 22 / 55


Output fuzzy set : Illustration
[Link]

The fuzzy output for x = x3 is shown below.

1.0 1.0
A
B  C

0 1 2 3 4 5 6 0 1 2 3 4 5 6 7 8

x = x3 y
x
Fuzzy output for x = x3

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 23 / 55


Defuzzification Methods
[Link]
Following defuzzification methods are known to calculate crisp output
in the situations as discussed in the last few slides
Maxima Methods
1 Height method
2 First of maxima (FoM)
3 Last of maxima (LoM)
4 Mean of maxima(MoM)

Centroid methods
1 Center of gravity method (CoG)
2 Center of sum method (CoS)
3 Center of area method (CoA)

Weighted average method

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 24 / 55


[Link]

Defuzzification Technique
Maxima Methods

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 25 / 55


Maxima methods
[Link]
Following defuzzification methods are known to calculate crisp output.
Maxima Methods
1 Height method
2 First of maxima (FoM)
3 Last of maxima (LoM)
4 Mean of maxima(MoM)

Centroid methods
1 Center of gravity method (CoG)
2 Center of sum method (CoS)
3 Center of area method (CoA)

Weighted average method

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 26 / 55


Maxima method : Height method
[Link]
This method is based on Max-membership principle, and defined as
follows.

µC (x ∗ ) ≥ µC (x) for all x ∈ X

c

Note:
1. Here, x ∗ is the height of the output fuzzy set C.
2. This method is applicable when height is unique.
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 27 / 55
Maxima method : FoM
[Link]

FoM: First of Maxima : x ∗ = min{x|C(x) = maxw C{w}}

c

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 28 / 55


Maxima method : LoM
[Link]

LoM : Last of Maxima : x ∗ = max{x|C(x) = maxw C{w}}

c

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 29 / 55


Maxima method : MoM
[Link]

P
xi ∈M (xi )
x∗ = |M|

where, M = {xi |µ(xi ) = h(C)} where h(C) is the height of the fuzzy set
C

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 30 / 55


MoM : Example 1
[Link]

Suppose, a fuzzy set Young is defined as follows:

Young = {(15,0.5), (20,0.8), (25,0.8), (30,0.5), (35,0.3) }

Then the crisp value of Young using MoM method is


20+25
x∗ = 2 = 22.5

Thus, a person of 22.5 years old is treated as young!

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 31 / 55


MoM : Example 2
[Link]
What is the crisp value of the fuzzy set using MoM in the following
case?

c

a+b
x∗ = 2

Note:
Thus, MoM is also synonymous to middle of maxima.
MoM is also general method of Height.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 32 / 55


[Link]

Defuzzification Technique
Centroid Methods

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 33 / 55


Cenroid methods
[Link]
Following defuzzification methods are known to calculate crisp output.
Maxima Methods
1 Height method
2 First of maxima (FoM)
3 Last of maxima (LoM)
4 Mean of maxima(MoM)

Centroid methods
1 Center of gravity method (CoG)
2 Center of sum method (CoS)
3 Center of area method (CoA)

Weighted average method

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 34 / 55


Centroid method : CoG
[Link]
1 The basic principle in CoG method is to find the point x ∗ where a
vertical line would slice the aggregate into two equal masses.
2 Mathematically, the CoG can be expressed as follows :
R
x∗ = Rx.µC (x)dx
µC (x)dx

3 Graphically,

Center of gravity

c

x*
x

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 35 / 55


Centroid method : CoG
[Link]

Note:
1 x ∗ is the x-coordinate of center of gravity.
R
2 µC (x)dx denotes the area of the region bounded by the curve
µC .

3 If µC is defined with a discrete membership function, then CoG


can be stated as :
Pn
i=1 xi .µC (xi )
x∗ = P n ;
i=1 µC (xi )

4 Here, xi is a sample element and n represents the number of


samples in fuzzy set C.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 36 / 55


CoG : A geometrical method of calculation
[Link]
Steps:
1 Divide the entire region into a number of small regular regions
(e.g. triangles, trapizoid etc.)

A4
A3
A2
A1 A5
A6

x1 x2 x3 x4 x5 x6
x

2 Let Ai and xi denotes the area and c.g. of the i-th portion.
3 Then x ∗ according to CoG is
Pn
i=1 xi .(Ai )
x∗ = P n
i=1 Ai
where n is the number of smaller geometrical components.
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 37 / 55
CoG: An example of integral method of calculation
[Link]
c2
1.0 1.0
c1
0.7 0.7
c
c1 0.5
2

0.5

0 1 2 3 4 5 0 1 2 3 4 5 6
x x
C  C1  C2
d e
1.0
b c
0.7
c
0.5
A1 A2 A3 A4 A5

f
a
0 1 2 2.7 3 4 5 6

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 38 / 55


CoG: An example of integral method of calculation
[Link]


 0.35x 0≤x <2
0.7 2 ≤ x < 2.7





µc (x) = x −2 2.7 ≤ x < 3
1 3≤x <4





(−0.5x + 3) 4≤x ≤6

0.7
For A1 : y − 0 = 2 (x − 0), or y = 0.35x

For A2 : y = 0.7
1−0
For A3 : y − 0 = 3−2 (x − 2), or y = x − 2

For, A4 : y = 1
0−1
For, A5 : y − 1 = 6−4 (x − 4), or y = −0.5x + 3

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 39 / 55


CoG: An example of integral method of calculation
[Link]
R
Thus, x ∗ = Rx.µc (x)dx = N
µc (x)dx D

R2 R 2.7 R3 R4
N = 0 0.35x 2 dx + 2 0.7x 2 dx + 2.7 (x 2 − 2x)dx + 3 xdx +
R6 2
4 (−0.5x + 3x)dx

= 10.98
R2 R 2.7 R3 R4 R6
D= 0 0.35xdx + 2 0.7xdx + 2.7 (x − 2)dx + 3 dx + 4 (−0.5x + 3)dx

= 3.445

10.98
Thus, x ∗ = 3.445 = 3.187

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 40 / 55


Centroid method : CoS
[Link]
If the output fuzzy set C = C1 ∪ C2 ∪ ....Cn , then the crisp value
according to CoS is defined as

Pn
i=1 xi .Aci
x∗ = P n
i=1 Aci

Here, Aci denotes the area of the region bounded by the fuzzy set Ci
and xi is the geometric center of the area Aci .

Graphically,

c2
c3
c1
A2 A3
A1
5

x1 x2 x3

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 41 / 55


Centroid method : CoS
[Link]

Note:

1 In CoG method, the overlapping area is counted once, whereas, in


CoS , the overlapping is counted twice or so.

2 In CoS, we use the center of area and hence, its name instead of
center of gravity as in CoG.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 42 / 55


CoS: Example
[Link]

Consider the three output fuzzy sets as shown in the following plots:

c 1.0
c
1

0.5
2

0.5
c
3 0.5
0.3
0.25 0.25 0.25

0 1 2 3 4 5 6 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8
x x x

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 43 / 55


CoS: Example
[Link]
c 1.0
c
1

0.5
2

0.5
c
3 0.5
0.3
0.25 0.25 0.25

0 1 2 3 4 5 6 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8
x x x

In this case, we have


1
Ac1 = 2 × 0.3 × (3 + 5), x1 = 2.5
1
Ac2 = 2 × 0.5 × (4 + 2), x2 = 5
1
Ac3 = 2 × 1 × (3 + 1), x3 = 6.5
1
×0.3×(3+5)×2.5+ 21 ×0.5×(4+2)×5+ 21 ×1×(3+1)×6.5
Thus, x ∗ = 2
1
×0.3×(3+5+ 21 ×0.5×(4+2)+ 12 ×1×(3+1)
= 5.00
2

Note:
The crisp value of C = C1 ∪ C2 ∪ C3 using CoG method can be found
to be calculated as x ∗ = 4.9
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 44 / 55
Centroid method: Certer of largest area
[Link]
If the fuzzy set has two subregions, then the center of gravity of the
subregion with the largest area can be used to calculate the
defuzzified value.
R ′
Mathematically, x ∗ = Rµcm (x).x dx ;
µcm (x)dx

Here, Cm is the region with largest area, x is the center of gravity of
Cm .
Graphically,

C1 C3
C2

Cm  C3 x'

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 45 / 55


[Link]

Weighted Average Method

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 46 / 55


Cenroid methods
[Link]
Following defuzzification methods are known to calculate crisp output.
Maxima Methods
1 Height method
2 First of maxima (FoM)
3 Last of maxima (LoM)
4 Mean of maxima(MoM)

Centroid methods
1 Center of gravity method (CoG)
2 Center of sum method (CoS)
3 Center of area method (CoA)

Weighted average method

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 47 / 55


Weighted average method
[Link]

1 This method is also alternatively called ”Sugeno defuzzification”


method.
2 The method can be used only for symmetrical output membership
functions.
3 The crisp value accroding to this method is
Pn
µCi (xi ).(xi )
x∗ = i=1
P n
µCi (xi )
i=1

where, C1 , C2 , ...Cn are the output fuzzy sets and (xi ) is the value
where middle of the fuzzy set Ci is observed.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 48 / 55


Weighted average method
[Link]

Graphically,

k1 C3
k2 C1
C2
k3

x1 x2 x3

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 49 / 55


Exercise 1
[Link]

Find the crisp value of the following using all defuzzified methods.

C2
1.0

C1
0.5

1 2 3 4 5 6

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 50 / 55


Exercise 1
[Link]

Find the crisp value of the following using all defuzzified methods.

C2
1.0

C3
0.75

C1
0.5

1 2 3 4 5 6 7 8 9 10

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 51 / 55


Exercise 3
[Link]

The membership function defining a student as Average, Good,


and Excellent denoted by respective membership functions are as
shown below.
Avg Good Excellent

1.0

0.5

6.0 6.5 7 7.5 8.0 8.5 9.0 10.0

Find the crisp value of ”Good Student”

Hint: Use CoG method to the portion ”Good” to calculate it.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 52 / 55


Exercise 4
[Link]
narrow  wide
1.0

0.5

0.4

5 6 7 8 9 10

The width of a road as narrow and wide is defined by two fuzzy


sets, whose membership functions are plotted as shown above.

If a road with its degree of membership value is 0.4 then what will
be its width (in crisp) measure.

Hint: Use CoG method for the shadded region.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 53 / 55


Exercise 5
[Link]
The faulty measure of a circuit is defined fuzzily by three fuzzy
sets namely Faulty(F), Fault tolerant (FT) and Robust(R) defined
by three membership functions with number of faults occur as
universe of discourses and is shown below.
 ( x)  ( x)  ( x)

1.0 1.0
1.0 1.0

0.75 0.75 0.75

0.5 0.5
0.5 0.5
0.3

0.25 0.25 0.25

0 1 2 3 4 5 6 7 8 9 10 x 0 1 2 3 4 5 6 7 8 9 10 x 0 1 2 3 4 5 6 7 8 9 10
x

Robust Fault tolerant Faulty

Reliability is measured as R ∗ = F ∪ FT ∪ R.
With a certain observation in testing
(x, 0.3) ∈ R, (x, 0.5) ∈ FT , (x, 0.8) ∈ F .
Calculate the reliability measure in crisp value.
Calculate with 1) CoS 2) CoG .
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 19.01.2023 54 / 55
[Link]

Fuzzy Logic Controller

Debasis Samanta

IIT Kharagpur
dsamanta@[Link]

23.01.2023

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 1 / 34


[Link]

Applications of Fuzzy Logic

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 2 / 34


Fuzzy Systems : Fuzzy Logic Controller
[Link]
Concept of fuzzy theory can be applied in many applications, such
as fuzzy reasoning, fuzzy clustering, fuzzy programming etc.

Out of all these applications, fuzzy reasoning, also called ”fuzzy


logic controller (FLC)” is an important application.

Fuzzy logic controllers are special expert systems. In general, a


FLC employs a knowledge base expressed in terms of a fuzzy
inference rules and a fuzzy inference engine to solve a problem.

We use FLC where an exact mathematical formulation of the


problem is not possible or very difficult.

These difficulties are due to non-linearities, time-varying nature of


the process, large unpredictable environment disturbances etc.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 3 / 34


Fuzzy Systems : Fuzzy Logic Controller
[Link]
A general scheme of a fuzzy controller is shown in the following figure.

Fuzzy Controller
Defuzzification actions
module Input

Fuzzy rule Fuzzy inference Process to be


base engine controlled

Output
Fuzzification
module Conditions

Figure 1
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 4 / 34
Fuzzy Systems : Fuzzy Logic Controller
[Link]

A general fuzzy controller consists of four modules:


1 a fuzzy rule base,

2 a fuzzy inference engine,

3 a fuzzification module, and

4 a defuzzification module.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 5 / 34


Fuzzy Systems : Fuzzy Logic Controller
[Link]
As shown in Figure 1, a fuzzy controller operates by repeating a cycle
of the following four steps :
1 Measurements (inputs) are taken of all variables that represent
relevant condition of controller process.
2 These measurements are converted into appropriate fuzzy sets to
express measurements uncertainties. This step is called
fuzzification.
3 The fuzzified measurements are then used by the inference
engine to evaluate the control rules stroed in the fuzzy rule base.
The result of this evaluation is a fuzzy set (or several fuzzy sets)
defined on the universe of possible actions.
4 This output fuzzy set is then converted into a single (crisp) value
(or a vector of values). This is the final step called defuzzification.
The defuzzified values represent actions to be taken by the fuzzy
contoller.
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 6 / 34
Fuzzy Systems : Fuzzy Logic Controller
[Link]

There are two approaches of FLC known.

1 Mamdani approach

2 Takagi and sugeno’s approach


Mamdani approach follows linguistic fuzzy modeling and
characterized by its high interpretability and low accuracy.
On the other hand, Takagi and Sugeno’s approach follows precise
fuzzy modeling and obtains high accuracy but at the cost of low
interpretabily.
We illustrate the above two approaches with two examples.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 7 / 34


Mamdani approach : Mobile Robot
[Link]

Consider the control of navigation of a mobile robot in the


presence of a number of moving objects.

To make the problem simple, consider only four moving objects,


each of equal size and moving with the same speed.

A typical scenario is shown in Figure 2.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 8 / 34


Mamdani approach : Mobile Robot
[Link]

O2

O3

D

O1 O4

R S

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 9 / 34


Mamdani approach : Mobile Robot
[Link]

We consider two parameters : D, the distance from the robot to an


object and θ the angle of motion of an object with respect to the
robot.
The value of these parameters with respect to the most critical
object will decide an output called deviation (δ).

We assume the range of values of D is [0.1, .... 2.2] in meter and θ


is [-90, ... , 0, ... 90] in degree.

After identifying the relevant input and output variables of the


controller and their range of values, the Mamdani approach is to
select some meaningful states called ”linguistic states” for each
variable and express them by appropriate fuzzy sets.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 10 / 34


Linguistic States
[Link]
For the current example, we consider the following linguistic states for
the three parameters.
Distance is represented using four linguistic states:
1 VN : Very Near
2 NR : Near
3 VF : Very Far
4 FR : Far
Angle (for both angular direction (θ) and deviation (δ)) are represented
using five linguistic states:
1 LT : Left
2 AL : Ahead Left
3 AA: Ahead
4 AR : Ahead Right
5 RT : Right
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 11 / 34
Linguistic States
[Link]
Three different fuzzy sets for the three different parameters are given
below (Figure 3).

D 1.0
VN NR FR VF 1.0

0.0
1.04
0.1 0.8 1.5 2.2

Distance D in mt

 LT AL AA AR RT

1.0 LT AL AA AR RT
1.0

0.0 0.0
-90 -45 0 45 90 -90 90
-45 0 45

Angle ɵ in degree Deviation  in degree

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 12 / 34


Fuzzy rule base
[Link]

Once the fuzzy sets of all parameters are worked out, our next step in
FLC design is to decide fuzzy rule base of the FLC.
The rule base for the FLC of mobile robot is shown in the form of a
table below.

LT AL AA AR RT
 
VN AA AR AL AL AA
NR  AA AA RT AA AA 
 
FR  AA AA AR AA AA 
VF AA AA AA AA AA

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 13 / 34


Fuzzy rule base for the mobile robot
[Link]

Note that this rule base defines 20 rules for all possible instances.
These rules are simple rules and take in the following forms.

Rule 1: If (distance is VN ) and (angle is LT) Then (deviation is AA)


..
.
..
.
Rule 13: If (distance is FR ) and (angle is AA) Then (deviation is
AR)
..
.
..
.
Rule 20: Rule 1: If (distance is VF ) and (angle is RT) Then
(deviation is AA)

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 14 / 34


Fuzzification of inputs
[Link]

The next step is the fuzzification of inputs. Let us consider, at any


instante, the object O3 is critical to the Mobile Robot and distance
D = 1.04 m and angle θ = 30o (see Figure 2).

For this input, we are to decide the deviation δ of the robot as


output.

From the given fuzzy sets and input parameters’ values, we say
that the distance D = 1.04m may be called as either NR (near) or
FR (far).

Similarly, the input angle θ = 30o can be declared as either AA


(ahead) or AR(ahead right).

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 15 / 34


Fuzzification of inputs
[Link]
Hence, we are to determine the membership values corresponding to
these values, which is as follows.
x = 1.04m
µNR (x) = 0.6571
µFR (x) = 0.3429
y = 30o
µAA (y) = 0.3333
µAR (y ) = 0.6667

NR FR AA AR

1.0 1.0

0.0 0.0
0.1 0.8 1.5 2.2 0 45
-45 y
x
1.04 30

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 16 / 34


Fuzzification of inputs
[Link]
x δ1
Hint : Use the principle of similarity. y = δ2

NR FR AA AR

1.0 1.0

0.0 0.0
0.1 0.8 1.5 2.2 0 45
-45 y
x
1.04 30

x 1.5−1.04
Thus, 1 = 1.5−0.8 , that is, x = 0.6571

y
x
1
2

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 17 / 34


Rule strength computation
[Link]

There are many rules in the rule base and all rules may not be
applicable.
For the given x = 1.04 and θ = 30o , only following four rules out of 20
rules are firable.

R1: If (distance is NR) and (angle is AA) Then (deviation is RT)

R2: If (distance is NR) and (angle is AR) Then (deviation is AA)

R3: If (distance is FR) and (angle is AA) Then (deviation is AR)

R4: If (distance is FR) and (angle is AR) Then (deviation is AA)

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 18 / 34


Rule strength computation
[Link]

The strength (also called α values) of the firable rules are calculated as
follows.
α(R1) = min(µNR (x), µAA (y)) = min(0.6571, 0.3333) = 0.3333

α(R2) = min(µNR (x), µAR (y)) = min(0.6571, 0.6667) = 0.6571

α(R3) = min(µFR (x), µAA (y )) = min(0.3429, 0.3333) = 0.3333

α(R4) = min(µFR (x), µAR (y)) = min(0.3429, 0.6667) = 0.3429

In practice, all rules which are above certain threshold value of rule
strngth are selected for the output computation.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 19 / 34


Fuzzy output
[Link]

The next step is to determine the fuzzified outputs corresponding to


each fired rules.
The working principle of doing this is first discussed and then we
illustrate with the running example.
Suppose, only two fuzzy rules, R1 and R2, for which we are to decide
fuzzy output.
R1: IF (s1 is A1 ) AND (s2 is B1 ) THEN (f is C1 )

R2: IF (s1 is A2 ) AND (s2 is B2 ) THEN (f is C2 )

Suppose, s1∗ and s2∗ are the inputs for fuzzy variables s1 and s2 . µA1 ,
µA2 , µB1 , µB2 , µC1 and µC2 are the membership values for different
fuzzy sets.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 20 / 34


Fuzzy output
[Link]

The fuzzy output computation is graphically shown in the following


figure.

 A1 B1 C1

A2 B2 C 2 C
Combine output

s1* s2*

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 21 / 34


Fuzzy output
[Link]

Note:

We take min of membership function values for each rule.

Output membership function is obtained by aggregating the


membership function of result of each rule.

Fuzzy output is nothing but fuzzy OR of all output of rules.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 22 / 34


Illustration : Mobile Robot
[Link]
For four rules, we find the following results.
NR AA RT

1.0

R1 :

0.3333
0.0
0.8 1.5 0 45 45 90
NR AR AA
1.0

R2 :

0.6571
0.0
0.8 1.5 0 45 -45 0 45

AA AR
1.0

R3 :

0.3333
0.0
0 45 90
0.8 1.5 0 45

1.0 AR AA

R4 :

0.3333
0.0
-45 0 45
0.8 1.5 0 45

D=1.04 Ɵ = 30

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 23 / 34


Illustration : Mobile Robot
[Link]

AA AR RT

0.6571 0.34 0.3333

-45 0 45 90

Aggregation of all results

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 24 / 34


Defuzzification
[Link]

The fuzzy output needs to be defuzzified and its crisp value has to be
determined for the output to take decision.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 25 / 34


Illustration : Mobile Robot
[Link]
From the combined fuzzified output for all four fired rules, we get the
crisp value using Center of Sum method as follows.

12.5×71+25×45+25.56×0+25.56×0
v= 12.5+39.79+25+25.56 = 19.59

39.7/0
AA AR RT
1.0

0.5 A3

0.6571 0.34 A2
A4 0.3333
A1

-45 0 45 90

25.56 / 0 25/45 12.5 / 71

Conclusion : Therefore, the robot should deviate by 19.58089 degree


towards the right with respect to the line joining to the move of direction
to avoid collision with the obstacle O3 .

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 26 / 34


[Link]

Takagi and Sugeno’s


Approach

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 27 / 34


Takagi and Sugeno’s Approach
[Link]
In this approach, a rule is composed of fuzzy antecedent and
functional consequent parts.
Thus, any i-th rule, in this approach is represented by
If (x1 is Ai1 ) and (x2 is Ai2 ) ...... and (xn is Ain )
Then, y i = a0i + a1i x1 + a2i x2 + ... + ani xn
where, a0 , a1 , a2 , ... an are the co-efficients.
The weight of i-th rule can be determined for a set of inputs x1 , x2 ,
.... xn as follows.
w i = µiA1 (x1 ) × µiA2 (x2 ) × ..... × µiAn (xn )
where A1 , A2 , .... , An indicates membership function distributions
of the linguistic hedges used to represent the input variables and
µ denotes membership function value.
The combined
Pk i i action then can be obtained as
i w y
y = Pk i ; where k denotes the total number of rules.
i w
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 28 / 34
Illustration:
[Link]

Consider two inputs I1 and I2 . These two inputs have the following
linguistic states :

I1 : L(low), M(Medium), H(High)

I2 : NR(Near), FR (Far), VF(Very Far)

Note:

The rule base of such as system is decided by a maximum of


3 × 3 = 9 feasible rules.

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 29 / 34


Illustration:
[Link]

The output of any i-th rule can be expressed by the following.

y i = f (I1 , I2 ) = aji I1 + bki I2 ; where, j,k = 1,2,3.

Suppose : a1i = 1, a2i = 2, a3i = 3 if I1 = L, M and H, respectively.

b1i = 1, b2i = 2, b3i = 3 if I2 = NR, FR, and VF , respectively.

We have to calculate the output of FLC for I1 = 6.0 and I2 = 2.2

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 30 / 34


Illustration:
[Link]

Given the distribution functions for I1 and I2 as below.

I I 2
1 L M H NR FR VF
1.0 1.0

0.0 5.0 10.0 15.0 0.0 1.0 2.0 3.0


I1 I2

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 31 / 34


Solution
[Link]

a) The input I1 = 6.0 can be called either L or M. Similarly, the input


I2 = 2.2 can be declared either FR or VF.

b) Using the principal of similarity of triangle, we have the following.


µL (I1 ) = 0.8
µM (I1 ) = 0.2
µFR (I2 ) = 0.8
µVF (I2 ) = 0.2

c) For the input set, following four rules can be fired out of all 9 rules.
R1: I1 is L and I2 is FR
R2: I1 is L and I2 is VF
R3: I1 is M and I2 is FR
R4: I1 is M and I2 is VF

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 32 / 34


Solution
[Link]

d) Now, the weights for each of the above rules can be determined as
follows.
R1: w 1 = µL × µFR = 0.8 × 0.8 = 0.6
R2: w 2 = µL × µVF = 0.8 × 0.2 = 0.16
R3: w 3 = µM × µFR = 0.2 × 0.8 = 0.16
R4: w 4 = µM × µVF = 0.2 × 0.2 = 0.6
e) The functional consequent values for each rules can be calculated
as below.
y 1 = I1 + 2I2 = 6.0 + 2 × 2.2 = 10.4
y 2 = I1 + 3I2 = 6.0 + 3 × 2.2 = 12.6
y 3 = 2I1 + 2I2 = 2 × 6.0 + 2 × 2.2 = 16.4
y 4 = 2I1 + 3I2 = 2 × 6.0 + 3 × 2.2 = 18.6

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 33 / 34


Solution
[Link]

f) Therefore, the output y of the controller can be determined as


follows.
1 1 2 y 2 +w 3 y 3 +w 4 y 4
y = w y w+w
1 +w 2 +w 3 +w 4 = 12.04

Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 34 / 34

You might also like