You are on page 1of 12

J. 1, .

CHAPTER

2'2
. . ;
, .. r,.
FUZZY LOGIC SYSTEMS, . J f r ; ~tl, F • ,,. ;

1, I

Cl]1f1t upon ang efmg tfi.scoveries.tfirou,gli tlie process efrational tliin,{i1!!J..,. , .u,, ·: J rJ,,. d

/,ad ·~ - \'
.
(1879-1955), GermarJ:..born'
. - · Amert
theoretical
. Einstein
\ . ·~
phy~icist
. .. ., ).: l ••;. ; '- J

Z2.1 IN TRODUCTION I

Alarge amount of data can constitute a proportionately -large amount of information. But thi~ comes with a
bel ofuncertainty. As we come to know more, we also know how much we do not know and our awareness
oftbeconcept of complexity seems to increase. We tend to forego some precise data and, f11lo~ uncertainty to
creep into our perception. This is when we start describing things in a slightly vague and fuzzy manner. For
~ ce after seeing a long list of names, you tell your friend that his name was cited .somev,,here near the
nnddle of the list. The word near seems to be comprehended effortlessly by the ·human brain but what of
computing systems? What does near mean in this context? Two names below the middle or five above or... ?
hlhere a way we can make these number crunching systems understand this concept?
~~sider the case of the statement - "Drive slowly". Does it mean you should drive at 10, 20 or, 20.5 km/
1
~ ~e answer could be any value or a very different one depending on the context. If it is ascertained in
it e that any speed less than or equal to 20 km/hour means slow speed and anything above is fast, then
'Orld.:ean tbat.20.1 km/hour (or 20.01 km/hour for that matter) is fast~ This is an exaggeration in the real
1rfili~.~yst~Ql
foUnderof~ r:
~al!ow~f~~gic deals with h?~ we can capture ~is essence of c_omprehension_and embed it
gradual trans1t1on from slow to high speeds. This comprehension, as per r.!otfi Z,adeti, the '
e zzy·logic concept, confers a higher machine intelligence quotient to computer systems. r:
22 2
, CRJsp SETS
llic. convenuonaI
· m . , . , '·• ' ' , - ·
C!isp :VaJues thereb achin: uses crisp sets to take care of concepts like fast and slow speeds. It relates speed to
Yfomung members that either belong to a ·group or d6 not belong· to it. For example
Slow = {0,5,10,15,20,25,30,35,40}
Artificial Jntelllgence
446
th value of speed is equal to either of those ·rn .
We could mean acrisp set that says that wh~n e be odified to a dosed interval [O 40 cnuonCd ·
set then the speed is categorized as stow. nus mar cros':es over to 40.1 it will be categoriz ] to inc1u: the
118
complete range of values. However, when ~e spec

the brakes when the speed isfasr(current speed does not


. ualize that a physical syste
maybe/asr). Likewise 39.99 wilt be slow. It is thus easy t~~1:g to [O 40]) and release
O
' • •
nor s/ the
ch has too-.; (Or
en Otherwise al>ply
w: w
continuousl: k . rki ·r the speed oscillates in the interval [39, ~1], a situation that could ,w°'11d
- - Y eep JC ng 1 . • have to 1hmk of some alt · cvcnh,.,
cause harm and subsequent damage. In such situauons, we emauvc to a c .'"<Illy
definition cif speed. · nsp Set

22.3 ·FuttvsETS
Fuzzy sets introduce a certain amount of vagueness to reduce complexity of comprehension. This
- · h" f a t M b hi set con·
of-elements •hat 'sigm·fy the degree or o-mde of members •P to a uzzy spec . em ers p values sists
' . ' u.r ' . ' e,- b Of . f
closed intervals and denote the sense of belonging of a mem er a cnsp set to a uzzy set. To tnak
usuauy
USC
clear consider a crisp set A comprising of elements that signify the ages of a set of people ,in years~ the llOint
A = {2,4,10,15,21 ,30,35,40,45,60,70}
We could classify age in •t erms of-what are known af fuzzy linguistic variables - infant, child, adole
adult, young and oui. A person whose age is 15 is no doubt young but how would you categorize SCtnt.
who is ~0. 1.f ~e la~er i~ to be ,considered young what about the person who is 40? Is he old? Ho:
for
'::1
translate all these into numbers
are . ?
efficiently making the computer understand what our feelings abo e
m•
Inspect the Table 22.1 giving ages and their membership to a particular set.

Table 22.1 Anes and their memberships


Age Infant Child Adole~cent' Young Adult Old
I --.'fi., ..
2 1 ,. 0 1 \[-.'t ~o ,r,~., 0
4 0.1 0.5 1 0 ,1 0
Jf ! -.- .;; 'fl
10 0 l 1 1 0. -~ 0
' j
15 0 ' 0.8'
0 .•
1
,. () ,~. 1
o'
21 "'"0 ·•{l!l 1 ,l )D.8 0.1
'30 0.,1 0.6 .,_ l ' 1 0.3
. o· •i
, I J
0
35 -0 0.5 ' 1 ', 0.35
40 •~tJ:0 · -0 0.4 ,,, ,1 ,;.l 0.4-
45 • 1~ p 0.2 '), ! ·3'.i!,• ' 0.6 ,
I. b. ,.: i 60 ~- o, .o 0 ··,. 1 0.8
,-r 70 r f 0 0 0 - ,, \
1
• • ,, , •' , ' . , , .1 /1 and
the table ipdicate mei:nbership~ ~9 the fuzzy sets -: infant, chifrJ., adolesce,it, young,_""':ifYfl
The valµ~s
15
old. Thus ~ phild of age 4 qelo9gs only 50% to the fuzzy set child while when he js 10 y~arsbe 10 I.
member. Note that .membership is diff~rent from .p robabiiities. Membership$ do _n o~ QecessarilY _aM up
The entries in the table have been m.ade after a manual evaluation of the different ages.

22.4 SOME FUZZV TERMINOLOGY


• I • • • • • , ' ( •• tU-
Now tbat r,~.u have a pouon of fuzzmess Y'/,f; could µefine sorrie teTil)s based .on a Umvers~ 5\!-
Fuzzy Logic Systems 447

I { otscourse (U):
, 1 gii~rsefio ed as the range of all possible values that comprise the input to the fuzzy system.
· de n
t l)iS I' ,
I I ..tfJ set . members to have diftierent grades of membership (based on a membership
. function)
.
. tY' (hat ernPowers its
I 1
1 •Ulyse• tefV al (0 ' t J is a fuzzy set.
. afl I0
. hiP function
1
ienir,ers1,ership function µA which fonns the basis of a fuzzy set is given by

-~
jbe rr,etll µA: U [0,1]
the closed interval is one that holds real numbers.
rt of a fuZZJ set (S1) .
SIIPP°rt sofa fuzzy se~f, in a u~iversal ~risp set U is that ·set which contains all elem~nts of the set U that
SIPP°
1be .zero membership value m'f For mstartce, the support of the fuzzy Set adult 1s
111,oe a 000
Sadult = {21,30,35,40,45,60,70}

o,pldlon of afuzzy set


Afu7ZY set/in a universal crisp set U, is written as
f = µ 1 ls1 + µ2 ls2 + µ3 ls3 + · · · + µn lsn
f/he!C µ;is the membership ands; is the corresponding term in the support set off i.e. SJ- .
This is however only a representation and has no algebraic implication (the slash and+ signs do not have
any meaning).
Accordingly,
Old= 0 .1121 :t o.3/30 + o.35/35 + 0.4/40 + o.6/45 + o.S/60 + 1no

Fuzzy Set Operations


• Union: The membership function oT the union of two fuzzy sets A and B is defined as the maximum of
the two individual membership functions. It is equiv~ent to the Boolean OR operation.
µAu B =.max(µA, µB)
• Intersectimr:1lre membership function of the intersectio_n o( two ~uzzy sets A and B is defined as the
minimum of the two individual'membership functions and fs equivalent to the Boolean AND operation.
µAn B :,mih(µA, µB)
• Complement: The membership·function of tlie complement of a fuzzy set A is' defined as tlie negation
of the specified member~hip function: µ,r .·This is equivalent to the Boolean N01' operation
µ,r =µAU B= (1-µA)
It may be further noted here tliat the laws of Associativity; €ommutativity , Distributivity and De
Morgan's laws hold in fuzzy set,theory too.

22·5 FUZiY I.0GIC CONTROL


The theo~ of a fuz;zy \ogi~ basep· syste~ could remai~_~zzy
Flll.z •·· till o~e discovers ho~ to \lp~ly it t~ a problem.
rnac~og,c has been used m a broad spectrum of apphc~µons rangmg from domestic appliances like washing
Flll.z es _and cameras, to more sophisticated ones that include turbiny control, tracking, data classifiers, etc.
tee~ logic by itself does not exhibit intelligence. Invariably systems that use fuzzy logic are augmented with
que_s that facilitate learning and adaptation to the environment in question. ·
448 Artfjic/al Intelligence

.-ve discuss a traditional problem of controlli ng the speed


u, . •
. of. a motor based
. on two par«-
. - 11eters le
and humidity. Such a model fits snug into room coolers that ~se a o! water and a fan to·increaseITlPera~
to bring down temperature. Coolers like these are widely used m tropical hi~ tempera~re and dry en . hult\i~
Th~ same could be extended for a wide range of applications. The foll~wmg d~scnption _explains~
logic works and how we model a system to use the concept. The logic explamed herein is Said "'~
Mamdani style of fuzzy inference processing. · to.Use 1lt

22.5.t Fuzzy Room Cooler,


We ~surne the conventional room cooler implement~ using a fan encased in a box with wool ha
continuously moistened by a trickle of water. A motorized pump controls the rate of flow of water Y_ that 11
moistening. 1\vo sensors mounted inside the cooler or in the room at strategic locations measure th~ f i t
speed ~d the temperature within the room. The fan speed could be eithe~ by a knob by the u~
be des_1gned to change based on an appropriate parameter s~nsed (humtdi~, for mstance). The basic aim
to achieve a smooth control and also save on water, a precious resource. Figure 22.1 shows a typical ~ --
, setup.

~ 1----- 1 Water Reservoir

Motor Pump

Fuzzy Controller

Temperature and Fan


Speed Sensor

Fig. 22.1 A Sectional Vi~w of a Fuzzy Room Cooler

For simplicity we assume that to maintain the temperature of the room, only the rate of flow of water~
to be con!TOlled ba_se<;l on the speed of the fan and the temperature. With this infrastructure we move to_deSI~
the fuzzy en~e to control ~s system.
Fuzzy regions
.
Two parameters (viz. temperature and pressure) decide the water flow rate. We define f~zzy \n.1per
t•b
temperature a~Cold, Cool, Moderate, Warm and Hot while those for fan speed (measured m rotall
minute) as-Slack, Low , Medium, Brisk, Fast. · . . furt/
Thus temperature in the room could be defined as Cold or Cool or by: any of the corresf<>ndi]lg
linguistic variables. Likewise, the fan speed too could be defined by any of the latter variables. ()lllda!SO
The output of the system, which is the flow-rate of the water controlled by the motorized pumP, ~Ne'sor'
be defined-accordingly by yet another set of fuzzy terms-Strong-Negative (SN), Negative (N), /.JJW
(IN) , Medium (M), Low-Positive (LP) , Positive (P) and High-Positive (HP).
• I
Fuzzy Logic Systems 449

rofiles
f'J,IY p data availa~le ~e ~ow define_ profiles ~or each ~f these parameters (viz. temperature, fan moto~ s~d
by assigning memberships to their respective values. The graphs shown 1in Fig. 22.2 depict this
1~tlt real rate)
_,J ~o~p for the inp~~ temperature ,and fan speed while Figi 22.3 reveals this for the output flow rate.
0
~1aUo that the regions for each of the sets for both the input parlin'leters, temperature and fan motor
O as a)so the outP-.ut hav~ a common 1.~tersect1on
bserve . ,
area. For example, we ,may say that when the temperat~re
~ • grees its membership to the fuzzy set moderate is I (100%). But as we drift away to 30 degrees, its
is 25 de h"P ;0 this set decreases while the same to the set warm starts to increase. Thus when the temperature
inelllt,e~s it is neither f~ ly moder~ttJ_ nor_warm. These erofiles have to be carefully designed after studying
and desired_behaviour of the system. _, r , , ,
1
!be .' 1.2 ~ - ~ - - - - - - - - - - ,
1.2 COid Cool Moderate Warm Hot 'l ' Medium ' Brisk Fast

i
1.

i
Z 1 '" I!!
0.8 0.8,
Q.6 ;:E 0.6

i
c
0
04 'j , 3l ,0.4

tu -~• OQ
0 I _ _,.j........."TTT"l.,.,...,rl-n-n"l"T,..,+,-r'rrn"l"T"TTT1',-h-,rrn-.....l "i 9 0 ..).......,.J..,.....,..,...l,~.+r-r..+nTTT1,,-rr,+,..,n'n-rrrrrh+r-n-rrrT1
O1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 1 4 7 10 13 16 19 22 25 28 31 34,37 40 43 46 49
Temperature ' I Motor,Speep RPM
(a) Temperature , •'f ,. (bJ Fr,m Moton Speed
1
Fig.:22.2, , I,/

1.2 ~ - - - - - - - - - - - - ~
a. SN N LN M LP P HP
1
1lE 0.8
Q)
::E 0.6
0
a> 0.4
!!!
g> 0.2
a
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
Flow Rate (ml/sec)
Fig. 22.3 Wat;er Flow Rate
FIIZzyRu/~
The fuzzy rules fonn th~ triggers of the fuzzy en9ine. After a study of Jbe system we could write linguistic
rules (so akin to natural language) such as - ,,,
RI : lftemperaturejs HOT and fan motor speed is SLACK then flow-rate is HIGH-POSmVE.
R2: If temperature is HOT and fan motor speed is LOW then flow-rate is .HIGH-POSITIVE
R3: If temperature is HOT and fan motor speed is MEDIUM then the flow-rate .is POSmVE.
R4: If temperature is HOT and fan motor speed is BRISK then the flow-rate is'.HIGH-POSITIVE.

!
R5: lftempera!J.lre is WARM and fan motor speed is MEDIUM then the-flow-rate is LOW-POSITIVE,
6
: If temperature is WARM and fan motor speed is BRISK then the flow-rate is POSITIVE.
/ If temperature is COOL and fan motor speed is LOW then flow-rate is NEGATIVE.' .,
S: If temperature is MODERATE and fan motor speed is LOW then flow-rate is MEDIUM.
lbe reac1e 18.
r urged to write the remaining set of rules based on the requirement of the system.
450 Artificial lntelli9ence

Fuzziflcation
The fuzzifier forms the heart of the fuzzy engine. Whenever the sensors report the values of tempe
fan speed, they are mapped based on their memberships to the respective fuzzy regions they be! rature ilnd
instance if at some instance of time t the temperature is 42 degrees and fan speed is 31 rpm, the coing to. For
membership values and the associated fuzzy regions are mentioned below esponding
F11zzy Regions Memberships
Parameter
warm, hot 0.1 42, 0.2
Temperature ·. 0.25,0.286
Fan speed medium, brisk

From the table, since both temperature and fan speed belo_ng to two regions, it is clear that the rules R3 4
R5 and R6 are applicable. The rules indicate a conflict. While two of them state that the flow-rate shouit ,
POSmVE, the other two state that it should be LOW-POSmVE and HI?H-POSITI_VE respectively. Thou be
we have resolved the issue of what could be the flow rates, the actual cnsp value still eludes us. gh

Defuzzifler
This is where we have to demystify these fuzzy terms for the flow rate controller system. In other words the
fuzzy outputs LOW-POSITIVE, POSITIVE and HIGH-POSmvE are to be converted to a single crisp
which can then be delivered to the final actuator of the pump. This process is called defuzzification. Se
methods_ are~ to achieve defuzzification, the most common ones being the Centre o~ Gravity method an~ the
e:
;al
Composite Maxuna method. In both these methods we need to compute the composite region formed by th
portions A, B, C and D (_See Fig. 22.4) on the output profile. F~g~ 22.4 sho~s how this i~ calculated. In case 0;
parameters whose prenuses are connected by an AND, the nurumum of therr memberships is first found. This

)
_e. 1.2 ~ - - - - - - - - - -- -~

j 1
r-o.8
0.6

I !
l
0.4
0.2
0 + -r-r.---r-r-~.,.......---.-,--,-~-1-h~--i
1 4 7 10131619222528313437 40 434648
Temperature 42°c
0.2
.e-
j 1.2
j 1
0.8
Rule R3

0
min (0.2, 0.25)
0.6
Eo.4
0.2
0
1.6
0 0.2 0.4 0.6 0.8
Flow Rate (ml/sec)

0.25
1 4 7 10 13 16 19 22 25 28 31343740 43 46 49
Motor Speed (RPM) 31 rpm

Fig. 22.4 Defuzzification (contd.)


Fuzzy Logic Systems 451

Ij:::1:
0.1

0
14 7
1013181922252831343740434849
Temperature

42 C

min (0,2, 0.286)


I'I :
, '15 0,8
0.6
Rule R4

HP

0.4
0.2 0.2

p
i 0.6
0 --1--~----.----r--,--,--.....,.-+--t-----t
0 0.2 0.4
Flow Rate (ml/sec)
0.6 0.6

I o4
l Ol..1--.-r-r-r-,-T""""T--r--r"""'llr"""T--r.-'r-r--i
0
0.286
,,
14710131619222528 1343740434649
Motor Speed (RPM) 31 rpm

0 1 1 ~ - - - - - - -- - - - - - - ,

i
E 0.8
1

• 06
0

1°·· 0.142
g01
Q.
:i; Rule R5
1 4 7 10 1316 19 22 25 26 31 34 37 40 43 46 49
j 1.2 . - - - - - - - - - - - - - - - ~
Temperature 42•c
:i 1
0.8
0
[ 0.6
J,
0,4
0.142 0.2
1.~
0 ;--,--,---,---+-+--r1--,--~-----i

1
iO.S
0.8
,, !I
0
I
0.2 0.4
Flow Rate (ml/sec)
0.6 0.8
J' I
1.2
A
1.4 1.6

!O·• ' '


! 0.2
0.25
1,.,,,4 7 10 131618 22 25 26 3134 37 40 43 46 48 ,,
otor SP88<1 (RPM) 31 rpm .

Fig. 22.4 Defuzziflcatlon (contd.)


452 Artificial Intelligence

0.142

1 4 7 1013161922252831343740434649 jo. Rule R6


1.2 . . . . . - - - - - - - - - - - - -
Temperature 42°C
:i't5 1
0.8
min (0'. 142, 0.286) 0.6
§ 0.4
0.2
0.142
0-1--,----.---,--,-----:"1-;--+---
o i 0.2 0.4 0.6 0.8 1.6
. Flow Rate (ml/sec)

0.286
1 4 7 10131619222528 1343740434649
Motor Speed (RPM) 31 rpm

1.2
a. LP P
:i:
· e?
Q)
.c 0.8
E
Q)
::E 0.6
0
0.4
eCl
G>

Q)
_. c 0.2 --t---- Centroid
0
0 0.2 0.4 0.6
Flow Rate ml/sec
A
Bi~ within c 'a's 1
P1s
a subset of the region C

Fig. 22.4' Defuzzifi~ation

value is used to cut ~ough the profile of the output fuzzy set (d~ne by drawing a horizontal line). This resul~
.. ' "''
a region (area) on the output surface. For cases where an OR relates the premises the maximum mern_
t,ersbip!S
taken to work out the output surface. All output surfaces are found to obtain the composite output region. )
Depending on the application, either the Centre of Grayi~y or the Composite Maxima of this region (are~
is fou_nd and tr~ated as th~ crisp outJ?ut. The f~rmer method works best for control applications such as~:~
descnbed herem. The cnsp output 1s the desired flow rate (X-coordinate of the Centroid) and the mot
pump is adjusted accordingly based on this value.
Fuzzy Lo9ic Systems 453

thus seen that the steps involved in realizing a fuzzy logic based system include -
'ehave .
\\ lating Fuzzy regions,
fortllU '
(i) Rules and
6i) fu~dding a Defuzzlfication procedure. ·
6ii) f,fll!ogic has als~ ~n wide!y applied to non-control applications as well. Take the case of decid!n~
fuaY t,ook on Artificial Intelligence belongs to the domain of Computer Science, Psychology or CIVIi
~·tiether g In such situations a crisp numerical output o'btained by this defuzzification process used earlier
~ioeennn~ meaning. The composite maxima is generally used for such problems and the truth d7pends on
111<1Y carrY not the composite maxima has crossed a predetermined thr~shold. The defuzzification process

•tiether orrnaY be tuned to smt· the satis


· fiiab"l" ·
1 1ty of the application at hand.
bOwever
sUGENO STYLE OF FUZZY IN FEREN CE PROCESSIN G
zz.6
ntioned earlier the fuzzy inference processing used in the application described is referred to as the
AS medani inference method. The Takagi-Sugeno-Kang, method of fuzzy inference, more commonly referred
Marn the sugeno method of fuzzy inference processing is similar to Mamdani but for the way in which the
1085
ut is computed. The process of fuzzifying the inputs !fnd applying the fuzzy rules remain the same as in
:tpMarndani style, but contrary to this, the Sugeno output membership functions are either a constant or
Unea£ in nature. A typical .rule in the Sugeno style is portrayed below.
If temperature is HOT then flow-rate is (aT2 + bT + c)
Alternatively the style also supports rules of the type -
If temperature is HOT and fan motor speed is SLACK then flow-rate is 100.
Amore complex model may have a rule like -
If temperature is HOT and fan motor speed is SLACK then flow-ratefis (aT + bS + c)
Tand S are the values reported by the temperature and speed sensors respectively. (Note that when the
coostants a and bare zero, the flow-rate equals the constant c wQich makes this rule similarto the previous one.)
This value of flow rate (flow-rate) may be weighted using the firing strength (memberships) of the inputs
10 ~ve the actual flow rate as given below:
N
L,wJ;
Actual flow rate F = i=1

L,w;
i=l
whereNis the number of rules triggered and the weight w; = min(µ};j = 1 to M the number of sensor inputs.
The computation of a Sugano based is depicted in Fig. 22.5.

~-----------+-l f= (aT + bS + c)

Membership

Membership f---~---,J

I
Fig. 22.S Sugano fezzy injerence processi,ng model
454 Artificial lntel/i9ence

22.7 FUZZV HEDGES


What if we need to further exemplify a fuzzy set. For instance the fuzzy set slow could be further-au
by a word very to make very slow. Words like these (very, d~finit~ly, ,:ather,:etc.) are te~ed as Fuzz/~nlcd
and 8;l"C used to modi!)' the shape of a fuzzy set. The. mod1~catio~ 1s achieved by altenng the rnernbeCdg~s
function. Table 22.2 lists some hedges an9 their eqmvalent m~arungs: 1:1tes~ hedges ,can help define!'Ship
contours of control allowing use(s to tune the system to meet the desired performance specificati' new
,
fu zzy rules could be' specified using these hedges to augment control. . .. ons Th
Aq instance could be - · e
If the temperature is positively high and fan speed is rather l~w then flow-rate is ve,:y high.
The tenns positively, rather and very constitute the hedges that shape the behavior of the respective fuzz
, · · Ysets.
Table 22.2 Some Fuzzy Hedl}es and their m_eanln9s
./
Hedge Significance Fuzzy region
Above, Constrains a Below Tall
More than fuzzy region
{Below,
less than)
- .Tall
-Below Tall

2 .2 3 -3 4 4 5 5 6 0
Height in Metres '
Definitely, Intensifies Fuzzy Heights ''
positively, .the contrast .---Tall
surely, very of the region
Somewhat, Dilutes the -VeryTall ,
a bit, rather, region
quite • • ·• Somewhat
Tall -
2 2.5 3 3.5 4 4 .5 -Extremely
Heigh_t in Metres
Tall

./ . q
22.8 a CUT"THRESHOLD li't

The minimum truth membership level for a fuzzy set forms the a cut threshold
for that fuzzy set. Membership values below this threshold are treated as
Hot
equivalent to zero. Naturally this threshold affects the suppo~t'~f the fuzzy set.
Thus as this threshold value increases, the support of the fµzzy, &et decreases.
Figure 22.6 shows one such a cut (µHot = 0.27) for the fuzzy set Hot. a cuts, ·
implemented either as strictly "less than," a certain membership value or relaxed 0.27 ---------
as "less than or equal to" mode, aid in filtering out 'noise by prescribing a 140
minimum truth level requirement. Such cuts have to be implemented with care Temperature
and should not be ·raised beyond the overlapping areas of the fuzzy sets lest Fig. 22,6 aCut/or theFUzzY
some points in the universe of discourse (U) become excluded from all the . Set Hot
fuzzy sets. ·
Fuzzy Logic Systems 455

uRO FUZZV SYSTEMS


ii,9 NE , mind that fuzzy logic systems do not possess any inherent method of learning. It is the
Illus! i,ear : e that makes the fuzzy system work to satisfaction. In more complex domains even an
~ 's!(llowle~ able to provide error-free data or knowledge. This is where a neuro fuzzy system could be
rr,aY not e the system and reject unnecessary or redundant fuzzy rules. Just as a multi-layer neural
ised 101eafll to
ell".".. tun
uro-fuzZY .
system also has layers that embed the fuzzy system. Figure 22. 7 shows how part of
~ rf., ane stem can be modeled as a neuro fuzzy one. As can be seen the temperature and the speed of
roo!ll coal: s\itial inputs whose memberships are found from the respective triangular regions. These
: fall fo~ e~ inputs to a second layer that comprise the rules. Note that the connections are made as per
~t,ersh•P~ugh RS. Toe right hand sides of the rules specify the fuzzy outputs that correspond to the next
ill roles Ill , ns at this level are also made in conformance with the rules. Finally the outputs of the
~yet• Connecuo . er are defuzzified by a de fuzz1'f ymg
. function
. to give
. a cnsp
. output.
ultiillate 1ay
µ~
Cool µeooi R1 WR1

e
Tempe Output

Fan mot
speed

Brisk µ

'G v
Fig. 22.7 Neuro Fuzzy Room Cooler

As can be seen from the figure the arcs connecting the neurons pertaining to the rule's left hand side, to
those of its right hand side (neurons of the penultimate layer) are weighted. These weights may be initialized
just as in neural networks, to values between [O, 1]. These weights are the ones that change during the training
phase of the neural network. Training is conducted by presenting both the input and the desired target output.
The system's output is computed and the error between this and the desired output is propagated backwards
(using the back propagation algorithm). This modifies the activation functions of the neurons. Over several
epochs, the weights are altered to reveal the best values. In the process it may also happen that a particular arc
may have a weight equal to Owhich essentially means the rule (neuron) from which it emanated need not be
pan of the fuzzy system. The learning mechanism thus aids in filtering unnecessary or redundant rules that
may have been included by the expert unknowingly.
22 ·10 POIN TS TO N OTE
~se of fuzzy logic may seem a bit unconventional. Especially since everything seems in place (a priori)
thus; sys~m seems to be doing something computationally to achieve the desired effect. Such systems are
realize~: suited for areas where a mathematical model is not available or the problem is difficult to model or
urthennore these systems have to be tuned and re-tuned by changing the input and output profiles,
456 Artificial Intelligence

rules and the de~zzification procedures. This may require sev~ral iter~ti~ns; at times in:olving the develo .
of the real workmg prototype in the loop. Also note that while the mput control variables are cont· Plllent
. . tnuou .
nature, the system can take into account high ambient noise. lmagme a case when the temperature O . 8 1n
frequ~tly between two values belonging to two adjacent fuzzy re~ions. Si~ce the ce~troid would sh~~tes
rnargmally, the change in the flow rate would remain smooth unhke that m conventional discrete s nly
wherem · osci·11 atmns
· could lead to instability. YSlems ·

EXERCISES
1. No_w that a fuzzy cooler is in place, design a simple_fuzzy washing machine that can decide the SJ>eecl
of _its motor based on the dirt level, type and the weight of the cloth.
2. Visit the library of your institution, this time,.for a different purpose. Inspec~ what of books are
placed in each rack. Write a fuzzy logic program that can suggest the rack mto which a new arrival
(pook) can go. .
3. Based on the fuzzy cooler, model ·the exposure time of a typical camera. Assume the camera has
sensors to detect ambient light, controls for flash and picture type (landscape, close, etc.) settings. Also
assume that exposure times are based on values reported by these sensors.
4. Check the fuzzy model for parking a truck described in the site:
http://www.iit.nrc.ca/IR_public/fuzzy/FuzzyTruck.html
Observe thatthe rules have been portrayed as a matrix commonly referred to as a Fuzzy Associative
Memory (FAM). Try placing the truck at different orientations at the comers and trace its path. In ~ase it
is unsuccessful try changing the rules within this m~trix and inspect the ways in which the truck paiks,

You might also like