Artifical Intelligence Notes Part 6
Artifical Intelligence Notes Part 6
ARTIFICAL INTELLIGENCE
PART 6
Fuzzy Systems
• Fuzzy Systems can handle simultaneously the numerical data and linguistic knowledge.
• Fuzzy Systems provide opportunities for modeling of conditions which are inherently imprecisely
defined.
• Many real world problems have been modeled, simulated, and replicated with the help of fuzzy
systems.
• The applications of Fuzzy Systems are many like : Information retrieval systems, Navigation system,
• Expert Systems design have become easy because their domains are inherently fuzzy and can now be
handled better; examples : Decision-support systems, Financial planners, Diagnostic system, and
Meteorological system.
Introduction
Any system that uses Fuzzy mathematics may be viewed as Fuzzy system.
The Fuzzy Set Theory - membership function, operations, properties and the relations have been
described in previous lectures. These are the prerequisites for understanding Fuzzy Systems. The
applications of Fuzzy set theory is Fuzzy logic which is covered in this section.
Here the emphasis is on the design of fuzzy system and fuzzy controller in a closed–loop. The specific
topics of interest are :
− Fuzzification of input information,
− Fuzzy Inferencing using Fuzzy sets ,
− De-Fuzzification of results from the Reasoning process, and − Fuzzy controller
in a closed–loop.
Fuzzy Inferencing, is the core constituent of a fuzzy system. A block schematic of Fuzzy System is
shown in the next slide. Fuzzy Inferencing combines the facts obtained from the Fuzzification
with the fuzzy rule base and conducts the Fuzzy Reasoning Process.
• Fuzzy System
Fuzzy
Rule Base
Input output
variables variables
X1 Fuzzy Y1
X2 Y2
Fuzzification Inferencing Defuzzification
Xn Ym
Membeship Function
− Input Vector : X = [x1 , x2, . . . xn ] T are crisp values, which are transformed into fuzzy sets in
the fuzzification block.
− Output Vector : Y = [y1 , y2, . . . ym ] T comes out from the defuzzification block, which
transforms an output fuzzy set back to a crisp value.
− Fuzzification : a process of transforming crisp values into grades of membership for linguistic
terms, "far", "near", "small" of fuzzy sets.
− Fuzzy Rule base : a collection of propositions containing linguistic variables; the rules are
expressed in the form:
If (x is A ) AND (y is B ) . . . . . . THEN (z is C) where x, y and z represent
variables (e.g. distance, size) and A, B and Z are linguistic variables (e.g. `far',
`near', `small').
− Membership function : provides a measure of the degree of similarity of elements in the
universe of discourse U to fuzzy set.
− Fuzzy Inferencing : combines the facts obtained from the Fuzzification with the rule base and
conducts the Fuzzy reasoning process.
− Defuzzyfication: Translate results back to the real world values.
Fuzzy Logic
A simple form of logic, called a two-valued logic is the study of "truth tables" and logic circuits.
Here the possible values are true as 1, and false as 0.
This simple two-valued logic is generalized and called fuzzy logic which treats "truth" as a continuous
quantity ranging from 0 to 1.
Definition : Fuzzy logic (FL) is derived from fuzzy set theory dealing with reasoning that is
approximate rather than precisely deduced from classical two-valued logic.
Logic is used to represent simple facts. Logic defines the ways of putting symbols together to
form sentences that represent facts. Sentences are either true or false but not both are called
propositions.
Examples :
A proposition is a statement - which in English is a declarative sentence and Logic defines the ways of
putting symbols together to form sentences that represent facts. Every proposition is either
true or false.
Propositional logic is also called boolean algebra.
Examples: (a) The sky is blue., (b) Snow is cold. , (c) 12 * 12=144 Propositional
Statement : A simple statement is one that does not contain any other statement as a part. A compound
statement is one that has two or more simple statements as parts called components.
Operator or connective : Joins simple statements into compounds, and joins compounds into larger
compounds.
■ Tr uth Value
T T F F T T T T T
T F F T F T F F T
F T T F F T T F F
■
F F T T F F T T T
Tautology
Note :
1. The entries of two columns p→q and ¬ [p ∧ (¬q)] are identical, proves the
tautology. Similarly, the entries of two columns p→q and (¬p) ∨ q are identical, proves
the other tautology.
2. The importance of these tautologies is that they express the membership function
for p→q in terms of membership functions of either propositions p and ¬q or ¬p and q.
■ Equivale nces
Some mathematical equivalence between Logic and Set theory and the correspondence
between Logic and Boolean algebra (0, 1) are given below.
T 1
F 0
∧ x ∩ , ∩
∨ + ∪ , U
¬ ′ ie complement (―)
↔ =
p, q, r a, b, c
■
Note :
1. Entries in last two columns of this table-2 agrees with the entries in table-1 for p→q ,
the proof of tautologies, read T as 1 and F as 0.
2. The implication membership functions of Eq.1 and Eq.2 are not the only ones that
give agreement with p→q. The others are :
µp→q (x , y) = 1 - µ p (x) (1 - µ q (y)) Eq (3)
In traditional propositional logic there are two important inference rules, Modus Ponens and
Modus Tollens.
Modus Ponens
Premise 1 : " x is A "
Premise 2 : " if x is A then y is B " ; Consequence : " y is B " Modus Ponens is
associated with the implication " A implies B " [A→B]
In terms of propositions p and q, the Modus Ponens is expressed as
(p ∧ (p → q)) → q
Modus Tollens
Premise 1 : " y is not B "
Premise 2 : " if x is A then y is B " ; Consequence : " x is not A "
In terms of propositions p and q, the Modus Tollens is expressed as
(¬ q ∧ (p → q)) → ¬ p
Fuzzy Logic
Like the extension of crisp set theory to fuzzy set theory, the extension of
crisp logic is made by replacing the bivalent membership functions of the crisp logic with the fuzzy
membership functions.
In crisp logic, the truth value acquired by the proposition are 2-valued, namely true as 1 and
false as 0.
In fuzzy logic, the truth values are multi-valued, as absolute true, partially true, absolute false
etc represented numerically as real value between 0 to 1.
Note : The fuzzy variables in fuzzy sets, fuzzy propositions, fuzzy relations etc are represented
~
usually using symbol ~ as but for the purpose of P easy to write it is always represented
as P .
•
Recaps
01 Membership function µ A (x) describes the membership of the elements x of the base set X in the fuzzy set A .
and B with the membership functions µ A (x) and µ B (x) based on min/max operations is µ A ∩ B =
min [ µ A (x) , µ B (x) ] , x ∈ X (Eq. 01)
: X x Y → [0 , 1]. µ R(x,y) = min[µ A (x), µ B (y)] (Eq. 06) or µ R(x,y) = µ A (x) µ B (y) (Eq. 07)
•
Fuzzy Propositional
•
Fuzzy C onnectives
Here P , Q are fuzzy proposition and T(P) , T(Q) are their truth values.
− the P and Q are related by the ⇒ operator are known as antecedents and consequent
respectively.
− as crisp logic, here in fuzzy logic also the operator ⇒ represents IF-THEN statement like,
IF x is A THEN y is B, is equivalent to R = (A x B)
U (¬ A x Y)
the membership function of R is given by µR (x , y) = max [min
(µA (x) , µB (y)) , 1 − µA (x)] − For the compound implication statement
like
IF x is A THEN y is B, ELSE y is C is equivalent to
R = (A x B) U (¬ A x C) the membership function
of R is given by
µR (x , y) = max [min (µA (x) , µB (y)) , min (1 − µA (x), µC (y))]
Example 1 : (Ref : Previous slide)
Let X = {a, b, c, d} ,
A = {(a, 0) (b, 0.8) (c, 0.6) (d, 1)}
B = {(1, 0.2) (2, 1) (3, 0.8) (4, 0)}
C = {(1, 0) (2, 0.4) (3, 1) (4, 0.8)}
Y = { 1, 2, 3, 4} the universe of discourse could be viewed as
{ (1, 1) (2, 1) (3, 1) (4, 1) }
i.e., a fuzzy set all of whose elements x have µ(x) = 1
B1 2 3 4 y 1 2 3 4
A A
a 0 0 0 0 a 1 1 1 1
b 0.2 0.2 0.2 0.2
A x B = b 0.2 0.8 0.8 0 ¬A x Y = c 0.2 0.6 0.6 0 d 0.2 1 0.8 0
c 0.4 0.4 0.4 0.4
d 0 0 0 0
Fuzzy Union is defined as (A ∪ B)(x) = max [A(x), B(x)] for all x
∈ X Therefore R = (A x B) U (¬ A x Y) gives
yx 1 2 3 4
a 1 1 1 1
Given X = {a, b, c, d} ,
A = {(a, 0) (b, 0.8) (c, 0.6) (d, 1)}
B = {(1, 0.2) (2, 1) (3, 0.8) (4, 0)}
C = {(1, 0) (2, 0.4) (3, 1) (4, 0.8)}
Fuzzy Intersection A x B is defined as : Fuzzy Intersection ¬A x Y is defined as : for all x in the set X,
for all x in the set X
(A ∩ B)(x) = min [A(x), B(x)], (¬A ∩ C)(x) = min [A(x), C(x)],
B1 2 3 4 yA1 2 3 4
A
a 0 0 0 0 a 0 0.4 1 0.8
A x B = b 0.2 0.8 0.8 0 ¬A x C = c 0.2 0.6 0.6 0 d 0.2 1 0.8 0 b 0.2 0.2 0.2 0.2
c 0.4 0.4 0.4 0.4
d 0 0 0 0
Fuzzy Union is defined as (A ∪ B)(x) = max [A(x), B(x)] for all x ∈ X Therefore
R = (A x B) U (¬ A x C) gives
yx 1 2 3 4
a 1 1 1 1
• Fuzzy Quantifiers
The fuzzification is a process of transforming crisp values into grades of membership for linguistic terms
of fuzzy sets.
The purpose is to allow a fuzzy condition in a rule to be interpreted.
.4
.2
Given car speed value X0=70km/h : grade
0
20 40 60 80 100 120 140 µA(x0) = 0.75 belongs to fuzzy low, and grade
Speed X0 =7 0km/h
µB(x0) = 0.25 belongs to fuzzy medium
Characterizing two grades, low and medium
speed fuzzy set
Medium
µ V Low Low High V High
1
.8
Given car speed value X0=40km/h : grade
.6
µA(x0) = 0.6 belongs to fuzzy low, and grade
.4
µB(x0) = 0.4 belongs to fuzzy medium.
.2
0
10 20 30 40 50 60 70 80 90 00
Speed X0 =4 0km/h
Fuzzy Inference
Note : Every fuzzy linguistic statements above the line is analytically known and what is below
the line is analytically unknown.
To compute the membership function ¬B , the max-min composition of fuzzy set ¬A with
R(x , y) which is the known implication relation (IF-THEN) is used. i.e. ¬B = ¬A ο R(x, y)
Note : Every fuzzy linguistic statements above the line is analytically known and what is below
the line is analytically unknown.
Example :
Apply the fuzzy Modus Ponens rules to deduce Rotation is quite slow?
Given :
(i) If the temperature is high then then the rotation is slow.
(ii) The temperature is very high.
Let H (High) , VH (Very High) , S (Slow) and QS (Quite Slow) indicate the associated fuzzy sets.
Let the set for temperatures be X = {30, 40, 50, 60, 70, 80, 90, 100} , and
Let the set of rotations per minute be Y = {10, 20, 30, 40, 50, 60} and
H = {(70, 1) (80, 1) (90, 0.3)}
VH = {(90, 0.9) (100, 1)}
QS = {10, 1) (20, 08) }
S = {(30, 0.8) (40, 1) (50, 0.6)
10 20 30 40
30 1 1 1
1
10 20 30 40 50 60 40 1 1 1
1
30 0 0 0 0 50 1 1 1
0 0 1
40 0 0 0 0 60 1 1 1
0 0 1
50 0 0 0 0
R(x,Y) = 70 0 0 0.8
0 0 60 0 0 1
0 0 0 80 0 0 0.8 1
0 90 0.7 0.7 0.7 0.7
H x S = 70 0 0 0.8 1 0.6 0 100 1 1 1 1
80 0 0 0.8 1 0.6 0
90 0 0 0.3 0.3 0.3 0
100 0 0 0 0 0 0
10 20 30 40 50 60
100 1 1 1 1 1 1
30 1 1 1 1 1
1
40 1 1 1 1 1 50 60
1
1 1
50 1 1 1 1 1
1 1
1
1 1
60 1 1 1 1 1
1 1 1
HxY= 0.6 0
70 0 0 0 0 0 0
80 0 0 0 0 0 0.6 0
0 0.7 0.7
90 0.7 0.7 0.7 0.7 0.7 0.7 1 1
QS = VH ο R (x, y)
To deduce Rotation is quite slow, we make use of the composition rule
= [1 1 1 1 1 1 ]
10 20 30 40 50 60
30 1 1 1 1 1 1
40 1 1 1 1 1 1
50 1 1 1 1 1 1
60 1 1 1 1 1 1
= [0 0 0 0 0 0 0.9 1] x 70 0 0 0 0 0 0
80 0 0 0 0 0 0
90 0.7 0.7 0.7 0.7 0.7 0.7
100 1 1 1 1 1 1
The fuzzy linguistic descriptions are formal representation of systems made through fuzzy IF-THEN rule.
They encode knowledge about a system in statements of the form :
where linguistic variables xi, yj take the values of fuzzy sets Ai and Bj respectively.
Example :
IF there is "heavy" rain and "strong" winds THEN there must
"severe" flood warnings.
Here, heavy , strong , and severe are fuzzy sets qualifying the variables rain, wind, and flood warnings
respectively.
A collection of rules referring to a particular system is known as a fuzzy rule base. If the
conclusion C to be drawn from a rule base R is the conjunction of all the individual consequents C
i of each rule , then
C = C1 ∩ C2 ∩ . . . ∩ Cn where
Defuzzification
In many situations, for a system whose output is fuzzy, it is easier to take a crisp decision if the output is
represented as a single quantity. This conversion of a single crisp value is called Defuzzification.
− Center of sums,
− Mean of maxima.
Centroid method
It is also known as the "center of gravity" of area method.
It obtains the centre of area (x*) occupied by the fuzzy set .
For discrete membership function, it is given by
Σ
xi µ (xi)
i=1 x* =
where n
Σ
µ (xi)
i=1