You are on page 1of 6

2W2 IEEE InIematioMl Symposium on Computer

Aided Control Sptem Oesm Pmceedmgs


September 18.20, PW*Glasgow, Scotland, U.K.

A,Library of Adaptive Neural Networks for Control Purposes

.,

I
.

Giampiero Campa, Mario Luca Fravolini, Marcello Napolitano


D e p k n t of Electronic find Information Engineering, Perugia University, 06100 Perugia, Italy
Department of Mechanical and Aerospace Eng. West Virginia University, Morgantown, WV 26506/6106

Abstract: In this paper, a library of Adaptive Neural


Networks to be used witbin the SimulinkB environment is
presented. The library has been developed by the authors with
the intent of giving to the S i m u l i user an easy access to a
variety of adaptive approximators. The Neural Networks
contained in the library are ready to be used and interchanged
witbin the users application. Differentlyfrom existing neural
network collections and toolboxes, in this library, a Neural
Network is strictly treated as a dynamic system with its
inputs, outputs and states, and the dynamics of the
approximation process is therefore considered as an essential
parl of this system. In the following, the library is
introduced and the featured network architectures are
analyzed in detail. Finally, as an example, a comparison is
performed between two of the presented networks.

For example, one of the ongoing projects employs Neural


Networks that approximate key relationships of the aircraft
dynamics in order to provide virmal sensors being able to
replace real sensors [2] in case of a sensor fault.

Fig. 1: B777 Model During Approach

1. Introduction

The Official way to deal with Neural Networks under the


Matlab@ environment is to use the Neural Network Toolbox
[I]. This toolbox is a very large (commercial) collection of
tools allowing the user to build and simulate her neural
network with great flexibility. Although recent developments
aimed to a greater integration with Simulink, the product has
still in Matlab rather that Simulink its natural environment,
therefore the resulting code for the neural network subsystem
is sometimes redundant, slow, and very hard to integrate with
Real Time Workshop@, the latter feature would be extremely
important for those who ultimately need their neural network
to work in a real-time environment. In addition to that,
emphasis is given to the approximation result rather than to
the approximation process, so that, using that toolbox, setting
up (in Simulink) a neural network for on-line learning is not
as natural as letting a pre-trained neural network work as a
simple static function appioximator.
The Adaptive Neural Network (ANN) Library, was developed
by the authors in the context of several funded research
projects going on at the West Virginia University that involve
the use of Neural Networks as a fundamental approximation
tool for control and identification purposes. Most of these
projects have as a research platform a WVU-built scaled
model airplane as the one in Fig. 1.

.-,

Therefore, in most of these projects, the neural network


software ultimately has to run in real time as a part of the
control system and everythmg has to fit in the flying
computer system of the airplane model. It is probably clear to
the reader that these facts are ultimately translated to very
severe requirements for what concerns the speed, the
efficiency and the overall performance and computational
requirements of the neural network code. Having in mind the
above requirements, most of the Neural Networks were
developed in C following the guidelines for the development
of optimized level-2 S-functions [3].
The S-Function paradigm yields a very useful way to interpret
a Neural Network as a dynamic system, in particular, the
dloutput function provides the input-output relationships
that define the static mapping capability of the network, while
the dlupdate function provides the update laws needed
during the adaptive approximation process in which all the
weights of the network are updated (those weights are
therefore seen as states of the Neural Network).
The ANN Library (Fig 2) is a collection of Simulink blocks
each implementing a particular Neural Network architecture.
Each block has the same interface as the others in order to
provide easy interchangeability within the users simulation.
This allows the user to compare different neural network
structures and select the one that best suits a given purpose.

PhD.
Associate Professor.

67803-7388-W02/$17.00 0 2002 IEEE

115

Specifically, as inputs to any block there are:

main Neural Networks architectures featured in the library

will be presented.
1.

The input vector to the NN (i.e. the current point in the


input space).
2. The e m r between the real output and the network
approximation.
3. A logic signal that enableddisables the learning.
As outputs from a block, there are:
1 The value of the approximated function for the current
point in the input space.
2. All the "states" of the network, namely the weights and
all the parameters that change during the learning
process.

Fig. 3: Inteffacefor rhe "Adaline" Nerwork

2. ADALINE

It can be used to approximate an "almost linear" function. The


ADALINE network approximates a vector signal Y E X"as a
linear combination of M inputs signals X E Xm,i.e.. Y= Wx
where W E R""" is a matrix of real numbers that are updated
online (states). The matrix W is updated by using a steepest
descent gradient in order to minimize the square error
between measurements and estimates. The resulting update
law is:

Mapti". Ne",.,
H.b*Lill.R.Y.IIIP"
2 3 1U.U.h RW,,R,2:R?2.t)
cilm).lo Cam..&
Y.dO L Y Y F....lini.YntYig,ni.
.*,.e"
llor2ml

-Fig. 2: The Adaprive Neural Nehvork Library

W ( k + l ) = W ( k ) - y e(k) x(k)

where y is. the learning rate, e(k)=y(k)-yJk) is the cmeut


estimation error. Different kinds of such modifications to the
basic steepest descent rule are available, e.g. sigma
modification, e-modification, dead zone and projection [41.
By employing one of the above-mentioned modifications, it is
possible to guarantee the ultimate boundedness of both
estimation error and network weights, in presence of noise
and uncertainty.

The~usercan easily access the block's parameters through its


.graphical interface (an example is given in Fig 3).
By means of such an interface the user can easily set the
network parameters that usually remain constant within a
specific simulation such as for example the number of inputs
to the network, the learning rate or the sample time. Each
block has its specific help window accessible through the
Help button in the block's interface. The help window
explains in more detail the network architecture making clear
to the user what are its inputs, states and outputs and what are
- the relationships between them. In the following sections, the

116

3. MLP-EBPA

5. EXTENDED-RBF

It is a three layer NN, ba& on sigmoidal neurons with the


following activation function:

A simple criterion to implement ERBF is to define an


activation radius d"" and to update the weights of the
gaussians that satisfy the relation:

f ( X , U , L , T ) =-

U-L

+L

1+e-%

In the MLP-EBP the hack-propagation algorithm is used not


only to update the weights of the input and output matrices
( W W , VW), but also to update the parameters U,LT, that
define the shape of each neuron. In [ 5 ] is showed that EBP
outperforms the standard Back-Propagation in terms of
leaming speed and approxunation accuracy; these
characteristics are particularly suitable for online learning
problem.

4. RBF

In the standard RBF Networks the estimations y , E W" are


expressed as a linear combination of M Gaussian Basis
functions $,(e) '

Especially for the fully tuned implementations, this approach

saves a noticeable amount of computations.


6. MRAN-RBF

In order to avoid the dimensionality problem generated by


standard RBF, Platt [6] proposed a sequential learning
technique for RBFNs, where the emphasis was to learn
quickly, generalize well and have a compact representation.
The resulting architecture was called the Resource Allocating
Network (RAN) and has proven to be suitable for online
modeling of non-stationary processes.
The RAN learning algorithm proceeds as follows [61:
At each sampling instant, if all of the following 3 criteria are
met one unit is added:
Current estimation error criteria, error must be bigger
than a threshold
e ( k )= y ( k ) - X k ) 2 4
Novelty criteria, the nearest center distance must be
bigger than a threshold

where X E W is the input vector, the parameters 4 and q are


respectively the center and width of the j-th basis function. In
the basic implementation the hidden layer neurons are a priori
statically allocated on a uniform grid that covers the whole
input space and only the weights w8, are updated. The socalled "Fully Tuned" implementations allow centers and
widths of each basis function to he updated along with the
weights. The learning algorithm is generally a (possibly
modified) steepest descent rule (as in the ADALINE).
Although easy to implement, this approach requires an
exponentially increasing number of basis functions versus the
dimension of the input space. For this reason standard RBF
can be applied only for small dimensionality problem.
Another problem is that an inaccurate choice of centers and
widths usually results in a poor performance especially in
highly nonlinear systems. A way to partially reduce the online
computational burden is to update just the weights in the
neighborhood of the most activated gaussian. This approach
has been called Extended-RBF.

Windowed mean error criteria, windowed mean error


must be bigger than a threshold

This new neuron is initialied with the following center,


variance and weight respectively:
' PM+l(k) = X ( k )

w,+,(k)=e(k)=y(k)-~(k)
where h i s a constant called "overlapping factor".
When one (or more) of the criteria is not satisfied, the vector
Rk) containing the tuning parameters of the RBF-NN is
updated using the following relationship:

117

2. Read an input-output pair [x(k),y(k)]

where e(k) is the prediction error and r] is the learning rate


and elk) is the vector of parameters to be updated. As for
fixed RBF architectures, following a Lyapunov analysis is it
possible to defme a dead zone term that assures the ultimate
boundedness of both estimation error e(k) and parameter
vector elk), also in presence of modeling error [7]. To avoid
an excessive increase of the Network size a pruning strategy
can also be applied. When this happens the network is called
Minimal RAN (MRAN) [PI.

3. Find the nearest unit s1 and the second-nearest unit s2 to


the pair [x(k),YWI.
4. Increment the age of all the edges associated with sl.

5. Evaluate the current estimation $ ( k ) .


6. Add the absolute estimation error to the error variable
associated to s, :Aerr(sl)= l y ( k ) - $(k)l.
7. Move s, and its topological neighbours s. toward x(k)
using the following error modulated Kohonen rule:

pSI
(k + 1) = ps1( k ) + g (=Fflerr(s,)).&, .(x-.uS,)

7. EMRAN-RBF
This Neural.Network is a powerful variation of the standard
MRAN [SI. The growing and pruning mechanisms remains
unchanged, while the parameters are updated following a
%&er takes it all strategy. In practice only the parameters
of the most activated neuron are updated, while all the other
are unchanged. This strategy (named Extended MRAN, or
EMRAN) implies a significant reduction of the number of
parameters to he updated online, and for this reason it is
particularly suitable for online applications. The performance
degradation with respect to the MRAN is minimal:
8. DCS

DCSs are significantly more complex than RANs and


standard fixed dimension RBFs [9]. In fact, in addiction to the

~~

basic interpolating structure for the output estimation of the


nonlinear function y(.), DCSs are characterized by an
additional lateral connection structure between the neural
units of the hidden layer. This structure is used to reflect the
topology of the input manifold. In order to perform perfect
topology learning, a competitive Hebbian learning is
commonly used. Differently from RANs, in standard DCSs
the centers are updated through competitive learning in a
Kohonen-like fashion in order to learn the spatial input
samples distribution. During the supervised learning the
estimation ermr ~ e ( k )is accumulated locally and used to
determine where to insert the next unit. This insertion
criterion is quite different from the RAN one. Originally
developed for off-line applications, the DCS algorithm was
recently extended to on-line supervised learning by using an
estimation error modulated Kohonen Rule for centers
adaptation [IO]. The sequential steps of the extended version
algorithm are reported below:

&(k +1) = &(k) + g (=Tlerr(s,)).&, ,(x-pJ Viae Ngh.


where g(.) is a positive monotonically decreasing function
with g(O)=l and g(l)=O respectively; and E. are adaptation
coefficients (el>> %).
8. If s1 and sI are connected by an edge, set the strength of
this edge to 1. If this edge does not exist, create it an set the
strength of this edge to 1

9. Decrease the strength of the other connections by a decay


constant a(<l).If the connection strength is smaller than a
threshold &h remove the connection.
10. If the number of read samples is a multiple of the
insertion parameter 1,and the number on neuron is less Nm,
then insen a new units as follows:
0

*
e

Determine the unit sq with the maximum accumulated


error.
Insert a new unit s, halfway between sq and its neighbour
sf with the largest ermr variable: p , = O.S(w, - w,) .
Interpolate the parameters ofthe new unit s,as follows:

u,=0.5(uq+off)
wr = 0 . 5 ( w q + w f )
err&) = O.S(err(sq)+err(sf ))

Insert edges connecting the new unit s, with s,and sfi and
remove the original edge between sq and sf
11. Perform an adaptation step of the networks parameters
6 = [w,,...,w N . u,,...,u,,] using the delta rule:

12. Decrease the error variables err(s,)


multiplying them with a decay constant a.

1. Start with two gaussian units (centers) a and bin random


positions h a n d b and random activations w. and w,. Define
the widths: oa=OF II h-LID.

118

and err(sf)

13. Decrease all error variables by multiplying for a decay


constant S.
14. Goto step 2.

A modification of the DCS algorithm was recently proposed


[ l l ] where the neighbourhd information is exploited to
generate a local hear model for the estimation function. The
reconstructing function is:

?={

w2a+(1-a)w,
WI

if IIx(~)-P.~II<IIP,~
-P,J
if IlJW- K z I 2 HKI- A 2 I

a = IIm-K,II~(IIX(k)-HIII+a~(k)-A*ll)
This structure is called' 'linear DCS" (LDCS), it is
particularly efficient from a computational point of view and,
therefore, rather attractive for real-time implementations.
9. EXAMPLE Mapping of the Look-Up Table of an

Aircraft Stability Derivative


As an example, a comparison has been performed between
the (E)MRAN and DCS Networks where the benchmark is
the 3-D look-up table of a selected aerodynamic derivative of
an aircraft. This problem is relevant within the task of
updating in real-time a stability look-up table, which allow to
quickly reconfigure the control laws following control surface
failures [lll. In this study the derivative C,(mach,alphu) of
the F-15 [I21 (shown in Fig. 4) was considered.

The following region of 9t2 was investigated


(macb,ulphu) A=[O,2]~[-20,60]. A trajectory of 25,000
training samples, that accurately span the domain A, was
generated to simulate the sequential on-line learning of the
NNs. The maximum number of basis function was fixed to 40
for the Gaussian NNs and to 80 for the LDCS. The
parameters d e f ~ the
g architectures and the corresponding
learning parameters are reported in Table 1. These parameters
were found by trial and error to obtain the best performance
by each of the 4 NNs; the insenion of a new neuron was set at
every M
O
Oteaching samples. Before the training, all the
data were normalized in the interval [-1,1]. The main
performance measure was the standard deviation of the error
(STD,). The values of the STDEEat the end of the training
phase ( S T D , , ) are reported in Table 1. The validation was
on a set of points taken on
performed by evaluating the SmEE
a grid [19x101 on the domain (with all the NNs learning rates
[ ~ , ~ , p , , , ] = O )The
.
resulting performance STZlw, is also
reported in Table 1. The best off-line mapping accuracy was
achieved by the MRAN; the performances of the LDCS
(+17.4%) and of the EMRAN (+17.0%) are approximately the
same, while the standard DCS (+72.7%) did not exhibit
desirable generalization capabilities. In terms of on-line
learning performance the values of the index I(&)was
evaluated during the training phase and shown in Fig. 5
(updated every S= 400 samples). Even in this case the RAN
networks outperformed the DCS throughout all the sequential
leaming phase. The increase of the learning cycles seems to
have a positive effect in the second part of the "ining for the
LDCS, while the M3S performance did not show any
improvement in this phase.
PWiORPB"c0

0.45

.____.--

. ...
.... .. ...... . .
.......
".....................*..,
...........

0.15

""

QO

011

*wn

.,

05

1.5

amla9

Fig. 4: The benchmarkfunction


Fig. 5: On-line learning pe@omnce.

119

I
2.5

x 1;

hpm:N.
Out: N7
Neurons: N.

DCS

DCS

MRAN

(Gaur*)
2
1
43

(Liocad
2

(Gauss.)

I
80
122

2w
[IO.-.II~-~ I I O . - . . I ~ - ~
I30 *le-3
130 31e-3
1 0.990.W5l i 0.99 .MO51
-.

0.1853
0,1858

0.1294
0.1259

A77 7.

A,,**

.....

EMRAN
(Gam.)

2
1
40
I 20

1
40
3
I I O , L I I ~ -r30.2.11~-3
~

-.
...

.-

r2.z.iiC-~
0.1122

0,1072

12,2 lie-I
0.1288
0.1255
*i7n*

* reSWcl tolheksl ( MRAN)


Table I : General Perfofmance comparison.

As a conclusion to the comparison, it is fair to state that the


additional complexity of the DCS-NNs did not lead to
performance improvement with respect to RAN-NNs.
Actually h m an on-line leaming p i n t of view the DCS
performance is somewhat lower than the MRAN and
EMRAN performance.
Note: Downloading ihe Library
The Simulink library here described is enclosed in the tile
ann.zip, which can be freely downloaded from The
Mathworks .file exchange web site:
http://www.mathworks.conhatlabcentmUfilge/

(under the Neural Network section) or, as an alternative,


from the Matlab Tools page of the fmt authors web site:
http://tools.mimotooIs.co~(under the section Ann).
10. Conclusions

In this paper, a Neural Networks Library to be used within the


Simulink environment has been proposed. Some reasons that
lead the authors toward the development of the library have
been outlined and the most important featured networks have
been explained, with special attention to the on-line
learning perspective. Finally as an example, a comparison
between two of these architectureswas performed.

References
Neural Network Toolbox Users Guide, October 1998,
The Matworks Inc.
G. Campa, M.L. Fravolini, M.R. Naplilano, B. Seanor,
Neural Networks-Based Sensor Validation for the Right
Control System of a E177 Research Model American
Control Conference 2002, May 8-10,2002, AK, USA.
Simulink, Writing S-Funcfions, January 1999, The
Mathworks Inc.
M. Polycarpou, On-Line Approximators for Nonlinear
System Identification: A Unified Approach Control and
Dynamic Systems Series, Volume 7, Neural Network
Systems Techniques and Applications (Ac. Press, Jan
1998).
M. R. Naplilano, Y. An, B. Seanor, A fault tolerant
flight control system for sensor and actuator failure using
neural networks, Aircraff Design, 2000, vol. 3, pp. 103128.
J. C. Plan, A Resource Allocation Network for Function
Interpolation, Neural Compufaiion 3(2), pp. 213-225,
1991.
L. Yan, N. Sundarajan, P. Saratchandran, Nonlinear
System Identification Using Lyapunov Based Fully
Tuned Dynamic RBF Networks , Neural Processing
k f f e r s2000, 12: 291-303.
Y. Lu, N. Snndararajan, P. Saratchandran, Analysis of
Minimal Radial Basis Function Network Algorithm for
Real-time identification of nonlinear dynamic systems,
IEE Proceedings on Control Theory and Applicaiion
2000; Vol. 4, no. 147, pp. 476.
B. Friske,. Growing cell structures: a self-organizing
network for unsupervised and supervised learning,
Neural Networks. vo1.7 DD. 1441-1460. 1995.
[lO]I. Ahms, J. Bruske, G.-Sommer, On-tine leaning with
dynamic cell structures, Proc. Int. Conf. Artificial
Neural Networks, v01.2 pp.141-146,1995.
[ 1I] C. Jorgensen, Direct Adaptive Aircraft Control Using
Dynamic Cell Structure Neural Networks, NASA TM
112198, May 1997.
[12]R.W. Brumbaugh, An Aircraft Model for the AIAA
Controls Design Challenge, NASA CR 186019, Dec.
1991

11. Acknowledgement

Panial support for the I, 2. and 3d author has been


provided through a grant Erom the Institute for Software
Research (ISR) within the F-15 IFCS program
(hnD://www.softwareresearch.or~.

120

You might also like