Soft Computing Course Overview
Soft Computing Course Overview
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]
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]
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
Debasis Samanta
IIT Kharagpur
dsamanta@[Link]
10.01.2023
Yes or No
Crisp answer
True or False
Milk Yes
Water
A liquid
Crisp
Coca
No
Spite
Is the liquid
colorless?
May be
May not be
Partially
etc
Score
99
Extremely honest
· Ankit
· Rajesh
Very honest 75
· Santosh
Fuzzy
· Kabita Honest at times 55
· Salmon
Extremely dishonest 35
Is the person
honest?
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
Universe of discourse X
H
M
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.
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
F P D C B A EX
1
0
35 50 60 70 80 90 100
F P D C B A EX
1
0
35 50 60 70 80 90 100
High Temperature
Low Pressure
Color of Apple
Sweetness of Orange
Weight of Mango
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 ?
Example:
A = City of comfort
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
A = “Happy family”
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+
Core: The core of a fuzzy set A is the set of all points x in X such that
µA (x) = 1
1.0
µ
0.5
1.0
Aα = {x | µA (x) ≥ α }
Aα ’ = {x | µA (x) > α }
1.0 1.0
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
Symmetry :
Example: India will win the T20 tournament with a chance 60% means
that out of 100 matches, India own 60 matches.
Forecasting : When you take the information from the past job and
apply it to new job.
Fuzzy Membership
Functions
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
µ
µ
x x x
x x
1.0
a b c
1.0
a b c d
c
0.1
0.1c 0.9c
b
Slope at x =
2a
b
Slope at y =
x b y
2 a
c-a c c+a
1
Example: µ(x)= 1+x 2 ;
a = b = 1 and c = 0;
1.0
-1 0 1
Changing a Changing b
Changing a
Changing a and b
1.0
Slope = a
0.5
Excellent = Marks ≤ 90
Very good = 75 ≤ Marks ≤ 90
Good = 60 ≤ Marks ≤ 75
Average = 50 ≤ Marks ≤ 60
Poor = 35 ≤ Marks ≤ 50
Bad= Marks ≤ 35
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.
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
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
Complement (AC ):
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
Difference (A − B = A ∩ B C ):
Equality (A = B):
µA (x) = µB (x)
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
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)
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)
µB µA
µ
b1 a1 a2 b4 a3 a4
x
µB µA
b1 a1 a2 b4 a3 a4
x
A B ( x)
A B ( x)
a2 b4
b1 a1 a2 a3 a4
x
x
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
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
i. A , B
ii. A ∪ B
iii. A ∩ B
iv. (A ∪ B)c [Hint: Use De’ Morgan law]
µA µB
1.0
0.5
µ
-15 -10 -5 0 5 10 15 20 25 30 35 40 45 50
Note: Note that ”Not cold climate” ̸= ”Hot climate” and vice-versa.
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
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
Debasis Samanta
IIT Kharagpur
dsamanta@[Link]
15.01.2023
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
Fuzzy Relations
Note :
(1) A × B ̸= B × A
(2) |A × B| = |A| × |B|
(3)A × B provides a mapping from a ∈ A to b ∈ B.
Intersection:
Complement:
R(x, y ) = 1 − R(x, y)
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
Max-Min Composition
Given the two relation matrices R and S, the max-min composition is
defined as T = R ◦ S ;
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
µR (a, b) = 1 − µR (a, b)
Composition
T =R◦S
µR◦S = maxy∈Y {min(µR (x, y ), µS (y , z))}
( x, y )
Important: Binary fuzzy relations are fuzzy sets with two dimensional
MFs and so on.
Hint:
You have given two relations R1 and R2 .
Then, the required can be derived using the union operation of R1
and R2
Fuzzy Propositions
The basic assumption upon which crisp logic is based - that every
proposition is either TRUE or FALSE.
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
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.
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
Fuzzy Implications
If x is A then y is B
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)}
A entails B
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
Min operator:
R
Rm = A × B = X ×Y µA (x) ∧ µB (y )|(x,y) or fmin (a, b) = a ∧ b
[Mamdani rule]
Propositional calculus :
R : A → B = Ā ∪ (A ∩ B)
Rmm = (A × B) ∪ (Ā × Y )
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
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
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
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
IF x is A THEN y is B ELSE y is C.
The relation R is equivalent to
R = (A × B) ∪ (Ā × C)
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
{
If x is A then y is B else y is C
{ {
Fuzzy Inferences
1 Modus Ponens : P, P =⇒ Q, ⇔Q
2 Modus Tollens : P =⇒ Q, ¬Q ⇔, ¬P
3 Chain rule : P =⇒ Q, Q =⇒ R ⇔, P =⇒ R
Given
1 C∨D
2 ∼ H =⇒ (A∧ ∼ B)
3 C ∨ D =⇒∼ H
4 (A∧ ∼ B) =⇒ (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).
′ ′
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 ))]
P : If x is A then y is B
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
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)}
P: If x is A Then y is B
′
Q: y is B
——————————————
′
x is A
Given that :
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.
R = (H × S) ∪ (H × Y )
Defuzzification Techniques
Debasis Samanta
IIT Kharagpur
dsamanta@[Link]
19.01.2023
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?
( x)
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]
Example:
Here, may be input THIGH is fuzzy, but action rotate should be based
on the crisp value of RFIRST .
Fuzzy
rule
Crisp base Defuzzifier Crisp
Fuzzifier
input output
Inference
mechanism
Defuzzification Techniques
3 Maxima methods
4 Centroid methods
Lambda-cut method
Then A0.6 = {(x1 , 1), (x2 , 0), (x3 , 0), (x4 , 0)} = {x1 }
and
A0.2 = {(x1 , 0), (x2 , 1), (x3 , 1), (x4 , 1)} = {x2 , x3 , x4 }
µ(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
(b) (P ∪ Q)0.6
(c) (P ∪ P)0.8
(d) (P ∩ Q)0.4
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λ
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 λ
Lambda-cut method converts a fuzzy set (or a fuzzy relation) into crisp
set (or relation).
The output of a fuzzy system can be a single fuzzy set or union of two
or more fuzzy sets.
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
1 R1 : If x is A1 then y is C1
2 R2 : If x is A2 then y is C2
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
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
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
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
Centroid methods
1 Center of gravity method (CoG)
2 Center of sum method (CoS)
3 Center of area method (CoA)
Defuzzification Technique
Maxima Methods
Centroid methods
1 Center of gravity method (CoG)
2 Center of sum method (CoS)
3 Center of area method (CoA)
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]
c
c
P
xi ∈M (xi )
x∗ = |M|
where, M = {xi |µ(xi ) = h(C)} where h(C) is the height of the fuzzy set
C
c
a+b
x∗ = 2
Note:
Thus, MoM is also synonymous to middle of maxima.
MoM is also general method of Height.
Defuzzification Technique
Centroid Methods
Centroid methods
1 Center of gravity method (CoG)
2 Center of sum method (CoS)
3 Center of area method (CoA)
3 Graphically,
Center of gravity
c
x*
x
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 .
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
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
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
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
Note:
2 In CoS, we use the center of area and hence, its name instead of
center of gravity as in CoG.
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
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
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'
Centroid methods
1 Center of gravity method (CoG)
2 Center of sum method (CoS)
3 Center of area method (CoA)
where, C1 , C2 , ...Cn are the output fuzzy sets and (xi ) is the value
where middle of the fuzzy set Ci is observed.
Graphically,
k1 C3
k2 C1
C2
k3
x1 x2 x3
Find the crisp value of the following using all defuzzified methods.
C2
1.0
C1
0.5
1 2 3 4 5 6
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
1.0
0.5
0.5
0.4
5 6 7 8 9 10
If a road with its degree of membership value is 0.4 then what will
be its width (in crisp) measure.
1.0 1.0
1.0 1.0
0.5 0.5
0.5 0.5
0.3
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
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]
Debasis Samanta
IIT Kharagpur
dsamanta@[Link]
23.01.2023
Fuzzy Controller
Defuzzification actions
module Input
Output
Fuzzification
module Conditions
Figure 1
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 23.01.2023 4 / 34
Fuzzy Systems : Fuzzy Logic Controller
[Link]
4 a defuzzification module.
1 Mamdani approach
O2
O3
D
O1 O4
R S
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
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
Note that this rule base defines 20 rules for all possible instances.
These rules are simple rules and take in the following forms.
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).
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
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
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.
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
In practice, all rules which are above certain threshold value of rule
strngth are selected for the output computation.
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.
A1 B1 C1
A2 B2 C 2 C
Combine output
s1* s2*
Note:
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
AA AR RT
-45 0 45 90
The fuzzy output needs to be defuzzified and its crisp value has to be
determined for the output to take decision.
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
Consider two inputs I1 and I2 . These two inputs have the following
linguistic states :
Note:
I I 2
1 L M H NR FR VF
1.0 1.0
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
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