11
1.0 0.0 U µ COG MOM MOA COM y U U 0 n

A trainable transparent universal approximator for defuzzification in Mamdani-type neuro-fuzzy controllers

Embed Size (px)

Citation preview

A Trainable Transparent Universal Approximator for Defuzzi�cation in Mamdani

Type Neuro-Fuzzy Controllers

Saman K. Halgamuge

Abstract|A novel technique of designing application spe-ci�c defuzzi�cation strategies with neural learning is pre-

sented. The proposed neural architecture considered as auniversal defuzzi�cation approximator is validated by show-

ing the convergence when approximating several existingdefuzzi�cation strategies. The method is successfully testedwith fuzzy controlled reverse driving of a model truck. The

transparent structure of the universal defuzzi�cation ap-proximator allows to analyse the generated customised de-

fuzzi�cation method using the existing theories of defuzzi�-cation.

The integration of universal defuzzi�cation approximatorinstead of traditional methods in Mamdani type fuzzy con-

trollers can also be considered as an addition of trainablenon linear noise to the output of the fuzzy rule inferencebefore calculating the defuzzi�ed crisp output. Therefore,

non linear noise trained speci�cally for a given applicationshows a grade of con�dence on the rule base, providing an

additional opportunity to measure the quality of the fuzzyrule base. The possibility of modelling Mamdani type fuzzycontrollers as a feed forward neural network with the abil-

ity of gradient descent training of the universal defuzzi�-cation approximator and antecedent membership functions

ful�ll the requirement known from Multi-layer Preceptronsin �nding solutions to non linear separable problems.

Keywords|Fuzzy control, Fuzzy neural networks, Mecha-tronics, Defuzzi�cation

I. Introduction

Since the initial theoretical work of Zadeh [1] and earlypractical applications of fuzzy control [2], numerous de-fuzzi�cation strategies have been proposed by several au-thors [3], [4]. The result of fuzzy rule inference and com-position known as the fuzzy output is transformed back toa crisp output by defuzzi�cation [5]. Although most of themethods are proposed in connection with Mamdani typefuzzy systems [2], defuzzi�cation is an essential step in allfuzzy system models such as Takagi-Sugeno-Kang (TSK)[6], [7], FuNe I [8], Tsukamoto [9] with the exception ofclassi�er type [10] fuzzy systems, in which the fuzzy out-put is taken as the class membership.

Assuming normalised membership values �i, and denot-ing U as the �nite set of possible normalised output valuesof a Mamdani type fuzzy controller, U = fU0:::Ui:::Ung,where 8i; 0 � �i � 1 represent the discrete set of corre-sponding membership values.

The resulting output Uout obtained by applying sev-eral existing defuzzi�cation schemes to an example can beshown in Fig. 1.

The author is a�liated with the Mechatronics Research Group, De-partment of Mechanical and Manufacturing Engineering, The Univer-sity of Melbourne, Parkville, Vic 3052, Australia. He is also a memberof the Cooperative Research Centre for Sensor Signal and Informa-tion Processing, Data and Information Fusion Programme, Adelaide,Australia.

1.0

0.0

U

µ

COGMOM MOACOM

y

U U0 n

Fig. 1. Standard defuzzi�cation strategies

� Centre Of Gravity (COG), the centre of gravity of thearea

UCOGout =

nPi=0

�i Ui

nPi=0

�i

(1)

� Midpoint Of Area (MOA), the middle of the area:

UMOAout = Uh; wherenXi=h

�i =

hXi=0

�i (2)

� Mean Of Maxima (MOM), the centre of gravity of thearea under the maxima of fuzzy output.

UMOMout =

Pi2M Ui

jM j(3)

where M = f i j �i = max(�1 : : : �n) g

� Centre of Mean (COM), the middle of the area under themaxima of fuzzy output:

UCOMout = Uh where

hXi=minjfj2Mg

�i =

nXi=h

�i; and

M = f i j �i = max(�1; : : : ; �n) g (4)

From the neural network perspective defuzzi�cation isa multidimensional function approximation problem thatcan be solved. But the neural networks trained to solve aremostly of black box type. If representative data sets exist,such neural networks can be trained to approximate any of

1.0

0.0

AL

µ

Pl Pu

AR

UnU0

Fig. 2. MOA defuzzi�cation

above mentioned explicitly known standard defuzzi�cationmethods [11]. For example a transparent non trainableneural structure is used to implement the method COG in[12] in constructing a prototype neuro-fuzzy system.

Another approach is to use a conventional type neuralnetwork to map fuzzy output into crisp output withoutconsidering the formal methods of defuzzi�cation [8], [13].Those neural networks are universal defuzzi�cation approx-imators with the strong drawback of black box nature.

The main contribution of this paper is the introduction ofa universal defuzzi�cation approximator that is parameter-isable and transparent, with the capability of approximat-ing the defuzzi�cation to an application speci�c solution orto select the best one from the known methods.

Problems caused in applying existing defuzzi�cationschemes are outlined in Section II. Section III presents thenew customisable universal defuzzi�cation approximatorgiving more emphasis to its implementation as a transpar-ent neural network. The validation of the proposed methodby training it to approximate di�erent existing defuzzi�-cation methods and the application to a control exampleare described in sections IV and V. The integration of theproposed method to the fuzzy-neural controller FuNe II isoutlined in Section VI. Section VII summarises the paper.

II. Application of Existing Defuzzification

Strategies

The defuzzi�cation methods MOA and COM are eas-ily implementable in software as well as in hardware [14]using two pointers Pl and Pu covering the output rangestarting from the lower and the upper limit, respectively,and moving stepwise towards the middle calculating theleft area (AL) and the right area (AR) as depicted in Fig. 2for MOA. However the possible error (half of the discretestep selected) should be taken into account. For a moreaccurate solution in an analog hardware or software imple-mentation with continuous crisp output range, two di�er-ent cases need to be considered for non zero fuzzy outputbetween the pointers in the �nal step:

1. both pointers correspond to the same membership value�1 (Fig. 3 left)2. pointers correspond to two di�erent membership values�1 and �2 (Fig. 3 right)

L R L RAAAµ

1 1µ µ µ

1 2

T

A

T

t t

Fig. 3. Calculation of MOA

Following equations can be obtained considering Fig. 3and both cases for MOA and only the �rst case for COM:

UCOMout = Pl +

AR � AL

2�Max

+t

2(5)

UMOAout

���1 =�2

= Pl +AR � AL

2�1+

t

2(6)

UMOAout

���1 <�2

= Pl �r

2+

r(r

2)2 � s (7)

UMOAout

���1 >�2

= Pl �r

2�

r(r

2)2 � s (8)

where t is the step size, T is the correction to be addedto Pl and r, s are:

r =2�1 t

�2 � �1

s =(AL � AR) t � (�1 + �2) �

t2

2

�2 � �1

For the case where the fuzzy output is zero (or �i 62 Mfor COM) between the pointers, either of the pointers couldbe selected as the output.The widely used COG method is not appropriate in some

con icting situations. An example is shown in Fig. 1. Inthis case rules are active to the left and the right from thecentre. One can imagine this case as moving a vehicle to-wards possible paths in the left and the right with an obsta-cle in the middle. COG and MOM defuzzi�cation methodsdeliver the most inappropriate solutions somewhere in themiddle, whereasMOA and COM deliver though not similarbut acceptable solutions. In case of having two equal pos-sibilities to the left and to the right, i.e. both membershipfunctions are equal, then either the right corner of the \left"membership block or the left corner of the \right" member-ship block has to be taken as the defuzzi�ed value accordingto COM and MOA. Even MOA delivers an inappropriatecrisp output, along with COG and MOM, if the obstacle isreplaced by a less favourable swampy path causing a infer-ence strength of \y" at the output, where 0 � y � 1 in Fig.1. The winner in this example is COM still delivering anacceptable solution, but undesirable as a universal methoddue to its high small signal ampli�cation similar to that ofMOM as described in [15]. Even though the vehicle canmove straight forward in the swampy path the desirableway would be to the left or to the right. These situationscan be avoided by restricting the membership value withinthe curve at least equal to the swamp constant.

Apart from the basic defuzzi�cation strategies mentionedabove, a number of extended methods have been proposedby several authors. Most of them do not provide algorithmsfor application speci�c parameter training, but posses ad-vantages in hardware implementation [16] and show im-proved static and dynamic properties [17], [15].The parameterisable extended methods proposed Ex-

tended Centre of Area (XCOA )[15] and Basic Defuzzi-�cation Distributions (BADD) [18] use the non negativeparameter �, \con�dence measure" [19]:

hXi=0

��i =

nXi=h

��i (9)

where UXCOAout = Uh.

UBADDout =

Pni=1 ��i � UiPni=1 ��i

(10)

A fuzzy set to the power of � is a \concentration" if � >1, and a \dilation" if � < 1 [20]. The COG method isextended in BADD and theMOA in XCOA, both replacing�i by ��i in equations 1 and 2 respectively. It is obviousthat:

UBADDout

��normal con�dence�=1

= UCOGout (11)

UBADDout

��high con�dence

�!1= UMOM

out (12)

UXCOAout

��normal con�dence�=1

= UMOAout (13)

UXCOAout

��high con�dence

�!1= UCOM

out (14)

It must be noted that in case of reaching no con�dence:

UBADDout

���!0

= UXCOAout

���!0

= Uuout (15)

where Uuout is the defuzzi�ed output by any of the meth-ods described above, when the universe of discourse isequally possible (8i; �i = constant).The application of di�erent defuzzi�cation methods may

lead to completely di�erent crisp outputs depending on theshape of the fuzzy outputs (e.g. Fig. 1). In some situationsnone of the mentioned defuzzi�cation methods delivers sat-isfactory results. Even the existing extended strategies arenot successful in solving the problem with swampy pathwith the exemption of COM which has several other unde-sirable properties.Therefore, tuning to an application or customisation of

the defuzzi�cation strategy is an interesting alternative tothe conventional trial and error methods used.

III. A Customisable Universal Defuzzification

Approximator

The proposed method Customisable Basic Defuzzi�cation-Distributions (CBADD) is a useful extension of the wellknown BADD strategy, that can be validated as a univer-sal defuzzi�cation approximator by neural network train-ing. We de�ne the set variable con�dence measure �I :�I = f�1:::�i:::�ng, where �i is a real value. The con-�dence on the fuzzy output values can be divided into dif-ferent regions as shown in Fig. 4. CBADD strategy can be

α

< 0

< 1

i

α

> 1

= 0α i

α

i

i = 1

i

α i0 <

i

αµ0

0 1

1 no confidence

negative confidence

µi

low confidence

normal confidence

high confidence

Fig. 4. Di�erent regions in the con�dence chart

described as:

UCBADDout =

Pni=1 ��ii � UiPni=1 ��ii

(16)

In contrast to the con�dence measure � used in XCOAand BADD, variable con�dence measure �i can be nega-tive. Whenever �i is negative, �

�ii � 1. It can be found an

alternative non negative ��i , in an e�ort by scaling to bringback the maximum of ��ii below a certain level (in the nor-

malised case below 1) so that function ���

i

i provides thesame defuzzi�ed output as ��ii . Scaling the fuzzy outputmeans a complete change in the rule inference. Therefore,a trained CBADD neural network containing �i weights inthe negative con�dence region indicates the inconsistencyof the existing rule base, hence a warning to the user tocheck the rule base.The inclusion of constant � in BADD and the set �I in

CBADD can also be considered as an addition of nonlinearnoise to the fuzzy output curve before defuzzi�cation. Theextension in CBADD is more exible and eases the neuralnetwork based training.

A. Implementation as a Transparent Neural Network

CBADD uses a special transparent neural network withn + 1 number of inputs (netwidth), each of them feedinga �i, the ith discrete value of the fuzzy output, where0 � i � n,in order to approximate the crisp output forUout . It consists of four consecutive layers of neurons, eachlayer consisting of di�erent types of neurons concerning thecalculation of net input and activation function (Fig. 5).The �rst three layers have summing net inputs and onlythe output neuron has multiplying inputs. The �rst layerconsists of neurons having logarithmic activation functions

U

U

Σ I

Σ L

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

Σ Ln Σ E

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

0.25 0.5 0.75 1.0

αI

µ0.0

0.0

Fig. 5. CBADD transparent Neural Network

and the connections to the following layer are weighted bythe components of variable con�dence �i. They are theonly trainable weights in the CBADD network. Each neu-ron in the second layer has an exponential activation func-tion which partly eliminates the logarithm of the �rst layerand delivers ��i . Within the �rst two layers there are nocross-connections but only connections among the neuronsof the same net index. In the third neuron layer all outputsare fed into two neurons that build a weighted sum. Theincoming connections to the upper neuron with linear acti-vation is weighted by Ui, the discrete values of the possiblerange of outputs (In Fig. 5 Ui is 0:0; 0:1; 0:2; :::0:9; 1:0 fori = 1; 2::11). The lower neuron has unity incoming weightsand an inverting activation function. In the last layer theresulting sum of the upper neuron is multiplied with theinverted sum calculated in the lower neuron by using a �-Neuron. The network can be resolved mathematically tomatch the CBADD equation due to its transparent struc-ture.The activation functions of neurons employed in

CBADD-network (linear (L), inverse (I), exponential (E),and logarithmic (Ln)) must satisfy a few rules [21] espe-cially in the ranges of usage to assure convergence.

fjL(netpj) = netpj (17)

fjI (netpj) =1

netpj(18)

fjE (netpj) = e�� netpj (19)

fjLn(netpj) = �ln(netpj) (20)

The linear activation function is only used as a \dummy"and it does not play a role in calculating �p�i, the weightchange for �i. The inverse activation function is usedwith the fact that net input to the neuron is always nonzero. The exponential activation function is inappropri-ate for gradient descent learning whenever net input isvery high negative. Since this is not the case in theCBADD-network, the exponential activation function canbe used. To assure that net input to the neurons withlogarithmic activation functions is always non zero, a min-

ji(n,n-1)

δ(n +1)

W(n+1,n)kj

pk

W

ki j

nn-1 n+1

Σ Π

Σ Π

Σ Π

δpj(n)

Fig. 6. Gradient descent learning

imum limit � for the fuzzy output (�) is de�ned such that;(� = ALMOST ZERO = 10�6).

netpj = �1 netpj = 0 netpj = +1

fjL �1 0 +1

f0

jLc c c

fjI 0 �1=1 0

f0

jI0 1 0

fjE +1 1 0

f0

jE�1 1 0

netpj = 0 netpj = 1 netpj = +1

fjLn +1 0 �1

f0

jLn�1 �1 0

B. Alternative Neuron Models in CBADD Network

In building the CBADD-Network, di�erent types of neu-rons were used. Apart from the standard type neuronswith linear (L) or sigmoid functions as activation functions(f) and summation (�) to calculate the weighted net input(net), neurons with multiplying net inputs (�), and thosehaving logarithmic (Ln), exponential (E) or inverse (I) ac-tivation functions are used.Fig. 6 shows three consecutive neuron layers, n � 1, n

and n + 1, having neuron indices i, j and k respectively.The connection weight of the jth neuron in the nth layer

and the ith neuron in the layer n�1 is denoted as w(n;n�1)ji .

Let us consider n + 1 as the output layer and others ashidden layers. Using the least mean square method (LMS)and the gradient descent algorithm [21], the total error (E)at the output can be calculated as:

E =Xp

Ep (21)

Ep =1

2

Xk

(tp � o(n+1)pk )2 (22)

where Ep is the error occurred for a single pattern, tp

is the desired output and o(n+1)pk is the current output of

neuron k.

Assuming that j can be a neuron in any of the layers,

the weight change �pw(n;n�1)ji by de�nition [21] is:

�pw(n;n�1)ji / �

@Ep

@w(n;n�1)ji

(23)

Considering �, the learning rate, as the constant of pro-portionality, we can write:

�pw(n;n�1)ji = � � �

@Ep

@net(n)pj| {z }

�(n)pj

�@net

(n)pj

@w(n;n�1)ji| {z }�(n)pj

: (24)

The function used for calculation of net inputs of the jthneuron (� or �) in uences the calculation of the partial

derivative �(n)pj�

for neurons with summing net inputs, sothat

net(n)pj =

Xi

w(n;n�1)ji o

(n�1)pi

�(n)pj�

= o(n�1)pi ; (25)

and �(n)pj�

for neurons with multiplying net inputs, i.e.

net(n)pj =

Yi

w(n;n�1)ji o

(n�1)pi

�(n)pj�

=

Yi

o(n�1)pi

!�

0B@Qi

w(n;n�1)ji

w(n;n�1)ji

1CA : (26)

Calculation of �n+1pk for an output neuron is independent ofthe calculation of net input, from (22) we conclude that

�@Ep

@o(n+1)pk

= (tp � o(n+1)pk ) hence

�n+1pk = (tp � o(n+1)pk ) � f

0

k(net(n+1pk ): (27)

Calculating the partial derivative for hidden neurons �(n)pj

depends on �(n+1)pk , f

0

j(net(n)pj ), and the net input calculation

method of the following neurons with index k:

�@Ep

@o(n)pj

= �Xk

�(n+1)pk �

@net(n+1)pk

@o(n)pj| {z }

�(n+1;n)

pkj

: (28)

Assuming neurons in the layer n + 1 use summing netinputs, we obtain

net(n+1)pk =

Xj

w(n+1;n)kj � o

(n)pj

�(n+1;n)pkj�

= w(n+1;n)kj

�(n)pj�

=Xk

h�(n+1)pk � �

(n+1;n)pkj�

i� f

0

j(net(n)pj );(29)

and assuming neurons in the layer n + 1 use multiplyingnet inputs, we can write

net(n+1)pk =

Yj

w(n+1;n)kj � o

(n)pj

�(n+1;n)pkj�

=Yj

w(n+1;n)kj �

Qj

o(n)pj

o(n)pj

�(n)pj�

=Xk

h�(n+1)pk � �

(n+1;n)pkj�

i� f

0

j(net(n)pj ): (30)

IV. Convergence of the CBADD Network

The convergence of the CBADD network is assured bythe ful�lment of the requirements discussed in Section III-A and the derivations for the alternative neuron modelsfound in CBADD networks as described in Section III-B.Denoting the layers in Fig. 5 from 1 (left most layer) to 4(right most layer), starting the index for the neurons fromthe top neuron (neuron 1), applying (27) for the outputneuron of the CBADD network,

�4p1 = (tp � o(4)p1 ) (31)

and simplifying (30) we can obtain

�(3)p1 =

��(4)p1 � o

(3)p2

�(32)

�(3)p2 =

��(4)p1 � o

(3)p1

��

�1

(net(3)p2 )

2: (33)

It can be derived from (29) that

�(2)pi = ��� �

(3)p1 �w

(3;2)1i � e�� net

(2)

pi ��� �3p2 �w(3;2)2i � e�� net

(2):

pj

(34)Applying (25) and (34) in (24) we obtain

�p�i = �� � � � o(1)pi � e�� net

(2)pi (�

(3)p1 � Ui + �

(3)p2 ) (35)

The validation of the CBADD Network is done by train-ing the network with pattern sets generated with the de-fuzzi�cation strategies COG and MOM [22]. Similar toequations (11) and (12) it is obvious that UCBADD

out can bereduced to UCOG

out by setting all the elements in set �I to 1,and it can be reduced to UMOM

out by setting those elementsvirtually to 1. We approximate these mathematically ex-act solutions with neural network training and consider itas a validation for the convergence of the system.

A. Validation with Known Defuzzi�cation Methods

Several sample pattern sets are used with n = 32 in-puts in the range from ALMOST ZERO to 1:0 and one outputrange from 0:0 to maxu = 31:0. We use 2000 di�erent pat-terns that are applied over 1000 sweeps, that is 1000 times.Furthermore we use single mode backpropagation and up-date the weights after each single pattern. Each patternrepresents one epoch.

Un

1.0

0.0

0.0

µ

(a) Pattern set 1

Un

1.0

0.0

0.0

45 45

45 45µ

µ

µ

µ

µ

µ1

2

3

4

5

edge 2edge 1

(b) Pattern set 2

Fig. 7. Sample pattern sets for CBADD training

The system has been tested with di�erent pattern sets,each defuzzi�ed with the strategy of interest. This paperreports the simulation results only for two of them: patternsets 1 and 2, which are similar to real fuzzy output variables(Fig. 7). The general strategy was to train the network withdata sets having 32 inputs and an output representing thediscrete values of fuzzy output values and the crisp outputcalculated according to one of the standard defuzzi�cationalgorithms. The trained CBADD network should show incase of convergence good results on an entirely di�erenttest data set, and the con�dence values �i evolved must beidentical with the expected values.

The randomly generated patterns in set 1 are evenly dis-tributed and, therefore have their UCOG

out and UMOAout values

often close to the middle of the output range. The pat-tern set 2 has fuzzy output curves composed of 5 randomheights that are bounded in the vertical direction by thelimits of the fuzzy output range and in the horizontal di-rection by two randomly selected edge values between 0:0and Un. The resulting pattern sets can be of a rectangularshape as well as of a triangular or multi-trapezoidal shape.Therefore UCOG

out and UMOAout values are almost randomly

distributed.

Exploiting the advantages of the transparency of theCBADD-network, con�dence charts obtained using trained�i weights can be analysed. The con�dence charts of di�er-ent existing defuzzi�cation methods for pattern set 2 shownin Fig. 8 are similar to those of pattern set 1.

A.1 Validation with COG

The training of patterns defuzzi�ed with COG strategyconverges successfully, leading to weights �I in the rangeof 1:0 � 0:01 for pattern set 1 and set 2 (Fig. 8(a)). Pat-tern set 1 shows a slightly slower convergence than pat-tern set 2. After 1000 sweeps the RMS-error for sets 1and 2 are 0:004% and 0:0002%, respectively. The mathe-matically correct solution for �I is 1:0. Therefore, we seethat CBADD approximates the set �I for the COG in thetraining phase. When trained over a longer period of time(10000 sweeps) the tendency for the weights is towards anasymptote at 1 and an RMS-error of 0.

A.2 Validation with MOM

When the CBADD-network is trained with pattern setsdefuzzi�ed by the MOM strategy, the �-weights are dis-tributed in the range of 33:0� 2:0 for pattern set 1 and inthe range of 21:5 � 0:2 for pattern set 2 (Fig. 8(b)). TheRMS-error for training the �rst set is 1:46%, and that forthe second is 0:49%. In this case the mathematically cor-rect solution for �I is +1, a value that cannot be reachedin a computer simulation. We therefore conclude thatCBADD can su�ciently approximate MOM, since con�-dence values are well above 20.

As shown by the simulation results, CBADD can suc-cessfully represent the defuzzi�cation strategies COG andMOM and the implementation has herewith shown to becorrect. The trained CBADD approximations for MOMand COG are successfully tested with di�erent data sets.

V. Application of CBADD Network

Due to the exibility of the CBADD concept, any of theexisting defuzzi�cation method can be approximated, i.e.,a discrete set of �I can be found either mathematicallyas shown in Section IV-A or by training the CBADD net-work with numerical data. Furthermore data sets obtainedfrom an model truck application are also used for creatingcustomised defuzzi�cation methods.

A. Approximation of Other Standard Defuzzi�cation Meth-ods

The resulting weights or con�dence values for the MOAand COM defuzzi�cation strategies cannot be mathemati-cally obtained as for COG and MOM. Therefore, trainingof the CBADD-network with sample data for both MOAand COM can be considered as application examples. Theimportance in showing this using simulations is related tothe universal approximation capability of the network. Inthis paper the simulation results given are limited only fortwo methods.

A.1 Approximation of MOA

For MOA method the variable con�dence measure �Ireaches values varying from 0:0 at both ends of the outputrange to 2:5 in the middle. The RMS-errors for patternset 1 and for pattern set 2 (Fig. 8(c)) are 2:24% and 2:20%

0.0

0.2

0.4

0.6

0.8

1.0

0.0 0.2 0.4 0.6 0.8 1.0

mu

^alp

ha

mu

µα

µ(a) COG strategy

0.0

0.2

0.4

0.6

0.8

1.0

0.0 0.2 0.4 0.6 0.8 1.0

mu

^alp

ha

mu

µα

µ(b) MOM strategy

0.0

0.2

0.4

0.6

0.8

1.0

0.0 0.2 0.4 0.6 0.8 1.0

mu

^alp

ha

mu

αµ

µ(c) MOA strategy

0.0

0.2

0.4

0.6

0.8

1.0

0.0 0.2 0.4 0.6 0.8 1.0

mu

^alp

ha

mu

µα

µ(d) COM strategy

Fig. 8. Con�dence chart for pattern set 2

respectively. The trained CBADD-net successfully approx-imates MOA.

A.2 Approximation of COM

The training of Centre Of Maxima (COM) defuzzi�edpatterns leads to weights for �I between 23:0 and 41:0 forpattern set 1 and to weights between 19:0 to 29:0 for pat-tern set 2 (Fig. 8(d)). The RMS-error for the �rst set is9:96%, and for the second set is 3:53%. The weights for�I are somewhat similar to those of MOM, which is nota surprise as a single block of maximum height will havethe same crisp output with both strategies. But the testsconducted show that COM test have the least error withthe COM trained network and not with the MOM trainednetwork. Therefore the resulting weights represent the newdefuzzi�cation strategy COM.

B. Fuzzy Controlled Model Truck and Trailer

Driving a vehicle with a trailer in the reverse directionis a di�cult task for a beginner. Even experienced drivershave to undertake a \trial and error" approach, i.e. if thetrailer comes to a position where the angle between thelongitudinal axes of the vehicle and the trailer can not beincreased even by maximum angle of the steering wheel inreverse driving, then the driver has to change the gear anddrive forward in order to avoid further bending (criticalangle). Since this is a nonlinear problem, a support systemis designed employing a Mamdani type fuzzy controller ina model truck and trailer (Fig. 9) in an e�cient manner,to overcome this situation [23].

Inputs to the fuzzy controller are the driver commandto the wheels of the truck at the front and the currentrare wheel position of the trailer. The output is the fuzzycontrolled command to the front wheels of the truck. Thetruck is slowly but, correctly driven without fuzzy sup-port by an experienced human and crisp input/output dataare recorded. Applying the same crisp input data to thefuzzy controller the fuzzy output can be recorded. The ap-plication data for training CBADD-network contains therecorded fuzzy output and the crisp output.

The training of application data obtained from a fuzzycontrolled model truck for three drives: \reverse turn toleft bend ( )", \straight line reversing (fs)" and \reverseturn to right bend (fr)" show a new distribution of weights(Fig. 10). However, con�dence charts of the �rst two datasets ( and fr) are similar to that of COM. It is on-line fuzzycontrolled in order to enhance the reverse dynamics, so thateven an unexperienced driver would encounter hardly anyproblems in fast reverse driving the truck with a trailer.

Either all three data sets can be applied to a singleCBADD-network creating a single defuzzi�cation approxi-mation or two di�erent defuzzi�cation schemes (one for and fr, another for fs) can be trained. Since the modeltruck contains a hierarchical fuzzy controller with two subknowledge bases for two situations, it is better to employtwo di�erent methods. The defuzzi�cation method for leftor right bend can be COM. But for the straight line reverse

Fig. 9. Truck and trailer

driving it is better to use the newly created defuzzi�cationwith CBADD-network.

Other method of tuning CBADD in this application isthe use of crisp input/output data to train a neuro-fuzzycontroller that includes the CBADD network as shown inFig. 12. Optimal results for the fuzzy system can be ob-tained this way due to the inclusion of membership func-tions and the rules to an integrated training network withdefuzzi�cation.

VI. Integration into Neuro-Fuzzy Controller

Most of the neuro-fuzzy systems proposed for genera-tion of fuzzy rules from numerical data does not includetraditional defuzzi�cation techniques since they generateclassi�er type fuzzy systems [24], [25], [26], [27], [10], [28].The FuNe I fuzzy system generator proposed in [8] was suc-cessful in employing several real world applications [25]. Itpossesses the ability of fuzzy rule generation from sampledata without compulsory expert opinion, and the capabil-ity of integrating existing incomplete knowledge, and pa-rameter tuning. Unlike neuro-fuzzy classi�er generators,it uses a black box type defuzzi�cation typical for FuNe Itype fuzzy systems.

Mamdani type fuzzy controller with CBADD defuzzi�-cation method is called FuNe II fuzzy system [29]. FuNeII fuzzy system generator is an extension of FuNe I fuzzysystem generator for application to control problems withrepresentative training data for e�cient tuning. The train-ing procedure includes the tuning of CBADD network to-gether with antecedent membership functions. The fuzzyrules are either extracted (for an example with FuNe I)or human formulated. The simultaneous customisation ofdefuzzi�cation and the tuning of antecedent membershipfunctions ful�ll the requirement for a 2-layer perceptronof neural network theory, i.e. the existence of at least twofeed-forward neuron layers with trainable weights, acquir-ing the ability of �nding solutions to non-linear separableproblems.

FuNe II neuro-fuzzy network contains bell shaped an-tecedent membership functions and trapezoidal (or tri-angular) consequent membership functions. The conse-quent membership functions are initialised with the weightsshown in Fig. 11. The weighting method between two neu-ron layers, either product or soft min [30] depends on theinference method applied. The net input functions of theneurons in both layers must be the same and must rep-resent the composition method. Assuming each weight ismultiplied by the incoming signal, and considering > asthe soft max [8]net input function, the fuzzy output curveshown is the result of Product Inference and Max Com-position. Min Inference can be implemented by using softmin [30] instead of multiplication in weighting.

Together with the weights in antecedent membershipfunctions, created as scaled, shifted and re ected sigmoidfunctions [8], weights in consequent membership functions(that can also be trained for tuning the membership func-tions), and trainable variable con�dence measure �i tuningthe CBADD-network the fuzzy classi�er generator FuNe Iis successfully extended to operate as a FuNe II fuzzy con-troller as shown in Fig. 12.

Only the dark arrows in fuzzi�cation, composition anddefuzzi�cation blocks in Figure represent variable weights,and other connection have �xed unity weights. The darkcircles represent neurons with sigmoid activation functions,if they are solid circle and neurons with logarithmic acti-vation functions (Ln) if they are dashed circles, or neuronswith exponential activation functions (E) if the dark cir-cles are dotted, and the other neurons have linear activa-tion functions. The elliptic neuron in the defuzzi�cationhas the inverse function as the activation and the outputneuron has multiplication as the net input calculation. Thewhite circles with \ ([) have Soft Min (Soft Max) net inputcalculation and other neurons have summing inputs.

The FuNe II neuro-fuzzy controller is used in training theantecedent membership functions together with CBADDnetwork expanding the application results shown in Section

V-B for the reverse driving of the truck with the trailer.

VII. Discussion

Existing defuzzi�cation methods are outlined and anal-ysed together with several application dependent situa-tions. Therefore, a customisable defuzzi�cation methodcan be useful in many applications. A parameterisable uni-versal defuzzi�cation must have the capability of approxi-mating all the standard defuzzi�cation methods. Conven-tional neural networks are universal defuzzi�cation approx-imators. But they are not transparent and therefore nothelpful in comparing with standard defuzzi�cation meth-ods. The CBADD-network is presented as a universaltransparent trainable approximator for defuzzi�cation infuzzy Control. In comparison to other parameterisable de-fuzzi�cation methods such as BADD where only a limitednumber of standard defuzzi�cation methods can be approx-imated, it is shown that CBADD-network can be trainedto approximate all the well known defuzzi�cation methods.The method is validated and applied to a real fuzzy controlproblem creating a customised defuzzi�cation.Knowing fuzzy rules, the CBADD-network can be

used to generate an application dependent defuzzi�cationmethod. Either the generated method can be used or themost desirable existing defuzzi�cation method can be sug-gested using con�dence chart analysis. However, the majormotivation behind the development of CBADD-network isthe extension of FuNe I fuzzy system generator to a FuNe IIfuzzy controller generator, training the con�dence values ofapplication speci�c defuzzi�cation, the fuzzy rules and theantecedent membership functions. After training a FuNeII network, an evaluation of fuzzy rules can also be donewith respect to a traditional Mamdani type fuzzy controllerwith COG defuzzi�cation. If a trained variable con�dencevalue is negative, the fuzzy rules containing the consequentmembership function corresponding to that value has tobe checked for the correctness. The integration of CBADDnetwork instead of COG defuzzi�cation can also be consid-ered as an addition of trainable noise to the fuzzy outputbefore calculating the crisp output. Essentially the trainedvalues of the set variable con�dence measure �I serves asa quality measure Q for the existing rule base.

Q =

nXi=1

�i if 8i; �i � 0

< 0 otherwise (36)

The accepted range of the quality measure for the rulebase would be Q > 0. If Q � 0 the rule base need to beredesigned.The trained FuNe II Neuro-Fuzzy controller can either

be left as it is, ignoring even the lack of con�dence shownon several fuzzy rules, since it is a functioning neural net-work ignoring the erroneous rule base and approximating asolution to the application considered, or the network canbe retrained after the fuzzy rules are modi�ed, providinga functioning solution together with a more reliable andcorrect fuzzy rule base.

VIII. Acknowledgement

The author wish to thank Dr. Thomas Runkler,Dr. Werner Poechmueller and Prof. Manfred Glesner fortheir support, Dipl.-Ing. Tilman Wagner for the implemen-tation of the algorithm in software, and Dipl.-Ing. MarkusSeidel, Dipl.-Ing. Ralf Kothe for the collection of appli-cation data at early stages of this research at TechnischeUniversit"at Darmstadt in Germany, and the reviewers foruseful comments.

References

[1] L. Zadeh, \Fuzzy Sets," in Information and Control 8, 1965.[2] E. H. Mamdani and S. Assilian, \An experiment in linguistic

synthesis with a fuzzy logic controller," IJMMS 7, 1975.[3] C. C. Lee, \Fuzzy Logic in Control Systems: Fuzzy Logic Con-

troller | Part II," IEEE Transactions on Systems, Man andCybernetics, vol. 20, no. 2, March/April 1990.

[4] M. Mizumoto, \Improvement Methods of Fuzzy Controls," in3rd IFSA Congress, 1989, pp. 60{62.

[5] D. Driankov, H. Hellendoorn, and M. Reinfrank, An Introduc-tion to Fuzzy Control, Springer-Verlag, USA, 1993.

[6] M. Sugeno and G. T. Kang, \Structure identi�cation of fuzzymodel," International Journal for Fuzzy Sets and Systems, vol.28, pp. 15{33, 1988, North Holland.

[7] T. Takagi and M. Sugeno, \Fuzzy Identi�cation of Systems andIts Application to Modeling and Control," IEEE Transactionson Systems, Man and Cybernetics, vol. 15, no. 1, 1985.

[8] S. K. Halgamuge and M. Glesner, \Neural Networks in Design-ing Fuzzy Systems for Real World Applications," InternationalJournal for Fuzzy Sets and Systems, vol. 65, no. 1, pp. 1{12,1994, North Holland.

[9] Y. Tsukamoto, \An approach to fuzzy reasoning method," inAdvances in Fuzzy Set Theory and Applications, M. M. Gupta,R. K. Ragade, and R. Yager, Eds. North-Holland, Amsterdam,1979.

[10] S. K. Halgamuge, W. P�ochm�uller, and M. Glesner, \An Alter-native Approach for Generation of Membership Functions andFuzzy Rules Based on Radial and Cubic Basis Function Net-works," International Journal of Approximate Reasoning, vol.12, no. 3/4, pp. 279 { 298, April/May 1995, Elsevier.

[11] Q. Song and G. Bortolan, \Some properties of defuzzi�cationneural networks," International Journal for Fuzzy Sets and Sys-tems, vol. 61, pp. 83{89, 1994, North Holland.

[12] A. Kawamura, N. Watanabe, H. Okada, and K. Asakawa, \APrototype of Neuro-Fuzzy Cooperation System," in IEEE Inter-national Conference on Fuzzy Systems, San Diego, USA, 1992,pp. 1275{1282.

[13] S. K. Halgamuge, T. A. Runkler, and M. Glesner, \On theNeural Defuzzi�cation Methods," in International Conferenceon Fuzzy Systems'96, New Orleans, September 1996.

[14] T. Hollstein, S. K. Halgamuge, and M. Glesner, \ComputerAided Fuzzy System Design based on generic VHDL Speci�ca-tions," IEEE Transactions on Fuzzy Systems, November, 1996.

[15] T. A. Runkler and M. Glesner, \Defuzzi�cation with improvedstatic and dynamic behavior: Extended center of area," in Eu-ropean Congress on Fuzzy and Intelligent Technologies, Aachen,Sept. 1993, pp. 845{851.

[16] T. A. Runkler and M. Glesner, \DECADE | Fast centroidapproximation defuzzi�cation for real time fuzzy control appli-cations," in ACM Symposium on Applied Computing (SAC'94),Phoenix, New York, Mar. 1994, pp. 161{165, ACM Press.

[17] T. A. Runkler and M. Glesner, \A Set of Axioms for Defuzzi�ca-tion Strategies | Towards a Theory of Rational Defuzzi�cationOperators," in Second IEEE International Conference on FuzzySystems, San Francisco, March/April 1993.

[18] D. P. Filev and R. R. Yager, \A Generalized Defuzzi�cationMethod via Bad Distributions," International Journal of Intel-ligent Systems, vol. 6, 1991.

[19] R. R. Yager, \Fuzzy Sets and Approximate Reasoning in Deci-sion and Control," in IEEE International Conference on FuzzySystems, 1992, pp. 418{428.

[20] L. Zadeh, \Outline of a new approach to the analysis of complexsystems and decision processes," IEEE Trans. Systems, Man,and Cybernetics, SMC-3, 1973.

[21] D. E. Rumelhart and J. L. McClelland, Parallel Distributed Pro-cessing: Explorations in the Microstructure of Cognition, MITPress, USA, 1986.

[22] S. K. Halgamuge, T. Wagner, and M. Glesner, \Validation andApplication of an Adaptive Transparent Defuzzi�cation Strategyfor Fuzzy Control," in IEEE International Conference on FuzzySystems' 94, Orlando, USA, June 1994.

[23] S. K. Halgamuge, T. A. Runkler, and M. Glesner, \A Hier-archical Hybrid Fuzzy Controller for Realtime Reverse DrivingSupport of Vehicles with Long Trailers," in IEEE InternationalConference on Fuzzy Systems' 94, Orlando, USA, June 1994.

[24] S. K. Halgamuge, \Self Evolving Neural Networks for Rule BasedData Processing," IEEE Transactions on Signal Processing,November, 1997.

[25] S. K. Halgamuge, Advanced Methods for Fusion of Fuzzy Sys-tems and Neural Networks in Intelligent Data Processing, In-stitute of Engineers Germany Press (VDI Verlag), D�usseldorf,1996.

[26] D. Nauck and R. Kruse, \NEFCLASS - A Neuro-Fuzzy Ap-proach for the Classi�cation of Data," in ACM Symposium onApplied Computing (SAC'95), Nashville, USA, February 1995,ISBN: 089791-658-1.

[27] N. Tschichold-G�urman, \Generation and Improvement of FuzzyClassi�ers with Incremental Learning using Fuzzy RuleNet," inACM Symposium on Applied Computing (SAC'95), Nashville,USA, February 1995, ISBN: 089791-658-1.

[28] S. K. Halgamuge and M. Glesner, \Fuzzy Neural Networks:Between Functional Equivalence and Applicability," IEE Inter-national Journal on Neural Systems, vol. 6, no. 2, pp. 185{196,June, 1995, World Scienti�c Publishing.

[29] S. K. Halgamuge and M. Glesner, \The Fuzzy Neural ControllerFuNe II with a New Adaptive Defuzzi�cation Strategy Basedon CBAD Distributions," in European Congress on Fuzzy andIntelligent Technologies'93, Aachen, Germany, September 1993,pp. 852{855, Verlag der Augustinus-Buchhandlung, ISBN 3-86073-176-9.

[30] H. R. Berenji and P. Khedkar, \Learning and Tuning FuzzyLogic Controllers Through Reinforcements," IEEE Transactionson Neural Networks, vol. 3, no. 5, pp. 724{740, 1992.

0.0

0.2

0.4

0.6

0.8

1.0

0.0 0.2 0.4 0.6 0.8 1.0

mu

^alp

ha

mu µ

µα

(a) :fuzzy truck left

0.0

0.2

0.4

0.6

0.8

1.0

0.0 0.2 0.4 0.6 0.8 1.0

mu^a

lpha

mu

µα

µ(b) fr:fuzzy truck right

0.0

0.2

0.4

0.6

0.8

1.0

0.0 0.2 0.4 0.6 0.8 1.0

mu

^alp

ha

mu

µα

µ(c) fs:fuzzy truck straight

α i

i

(d) Trained weights �i

Fig. 10. Trained weights �i for three reverse driving paths

U

L

L

L

L

L

L

L

L

L

L

L

L

L

L

µ

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

0.25 0.5 0.75 1.0

0.0

0.0

0.33

0.66

0.33

0.66

1.0

1.0

1.0

0.5

1.0

1.0

1.0

0.5

1.0

1.0

1.0

L

M

H

Fig. 11. Consequent membership functions

RuleInference

Id

1

11

1 1 1

11

1 1 1-1 -1 -1

ConsequentMembershipFunctions

DefuzzificationCBADD

Composition

Fuzzification

µ d(I )

E

1Lnα i

U IΠ

i 1

Fig. 12. Mamdani Neuro-Fuzzy Controller with CBADD network