Você está na página 1de 6

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ 7

&RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

Training ANFIS Structure with Modified PSO


Algorithm
V.Seydi Ghomsheh *, M. Aliyari Shoorehdeli **, M. Teshnehlab **
* Computer Department of Islamic Azad university , Kermanshah, Iran
And Computer Department of Science and research branch
Islamic Azad university of Tehran, Iran
vahidseydi@gmail.com
** K. N. Toosi university technology
Tehran, Iran

Abstract- This paper introduces a new approach This adaptive network has good ability and
for training the adaptive network based fuzzy performance in system identification, prediction
inference system (ANFIS). The previous works and control and has been applied in many
emphasized on gradient base method or least different systems. The ANFIS has the advantage
square (LS) based method. In this study we apply of good applicability as it can be interpreted as
one of the swarm intelligent branches, named
particle swarm optimization (PSO) with some
local linearization modeling and conventional
modification in it to the training of all parameters linear techniques for state estimation and control
of ANFIS structure. These modifications are are directly applicable.
inspired by natural evolutions. Finally the The ANFIS composes the ability of neural
method is applied to the identification of network and fuzzy system. The training and
nonlinear dynamical system and is compared updating of ANFIS parameters is one of the main
with basic PSO and showed quite satisfactory problems. The most of the training methods are
results. based on gradient and calculation of gradient in
each step is very difficult and chain rule must be
Keywords: Particle Swarm Optimization, TSK used also may causes local minimum. Here, we
System, Fuzzy Systems, ANFIS, Swarm Intelligent, try to propose a method which can update all
Identification, Neuro- Fuzzy. parameters easier and faster than the gradient
method. In the gradient method convergence of
I. INTRODUCTION parameters is very slow and depends on initial
value of parameters and finding the best learning
rate is very difficult. But, in this new method so
T he complexity and the dynamics of some
problems, such as prediction of chaotic
systems and adapting to complex plant, require
called PSO, we do not need the learning rate.
The rest of the paper is organized as follows: In
sophisticated methods and tools for building an Section II, we review ANFIS. In Section III we
intelligent system. Using fuzzy systems as discuss PSO method. An overview of the
approximators, identifier and predictor, is proposed method and applied this method to
reliable approach for this purpose [1, 2]. The nonlinear identification is presented in Section
combination of fuzzy logic with architectural IV. Finally, Section V presents our conclusions.
design of neural network led to creation of
neuro- fuzzy systems which benefit from feed
forward calculation of output and back- II. THE CONCEPT OF ANFIS
propagation learning capability of neural
networks, while keeping interpretability of a A. ANFIS Structure
fuzzy system [3]. The TSK [4, 5] is a fuzzy
system with crisp functions in consequent, which Here, type-3 ANFIS topology and learning
perceived proper for complex applications [6]. It method which use for this neuro- fuzzy network
has been proved that with convenient number of is presented. Both Neural Network and Fuzzy
rules, a TSK system could approximate every Logic [9] are model-free estimators and share the
plant [7]. The TSK systems are widely used in common ability to deal with the uncertainties
the form of a neuro- fuzzy system called ANFIS and noise. Both of them encode the information
[8]. Because of crisp consequent functions, in a parallel and distribute architecture in a
ANFIS uses a simple form of scaling implicitly. numerical framework. Hence , it is possible to
3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ 7
&RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

convert fuzzy logic architecture to a neural covered by MFs with overlapping that means
network and vice-versa. This makes it possible to several local regions can be activated
combine the advantages of neural network and simultaneously by a single input. As simple local
fuzzy logic. A network obtained this way could models are adopted in ANFIS model, the ANFIS
use excellent training algorithms that neural approximation ability will depend on the
networks have at their disposal to obtain the resolution of the input space partitioning, which
parameters that would not have been possible in is determined by the number of MFs in ANFIS
fuzzy logic architecture. Moreover, the network and the number of layers. Usually MFs are used
obtained this way would not remain a black box, as bell-shaped with maximum equal to 1 and
since this network would have fuzzy logic minimum equal to 0 such as:
capabilities to interpret in terms of linguistic
variables [10].
(4)
The ANFIS is composed of two approaches
neural network and fuzzy. If we compose these (5)
two intelligent approaches, it will be achieve
good reasoning in quality and quantity. In other
words we have fuzzy reasoning and network Where {ai , bi , ci } are the parameters of MFs
calculation. which are affected in shape of MFs.
ANFISs network organizes two parts like
fuzzy systems. The first part is the antecedent
part and the second part is the conclusion part,
which are connected to each other by rules in
network form. If ANFIS in network structure is
shown, that is demonstrated in five layers. It can
be described as a multi-layered neural network as
shown in Fig. (1). Where, the first layer executes
a fuzzification process, the second layer executes
the fuzzy AND of the antecedent part of the Figure (1): The equivalent ANFIS (type-3
fuzzy rules, the third layer normalizes the ANFIS)
membership functions (MFs), the fourth layer
executes the consequent part of the fuzzy rules, B. Learning Algorithms
and finally the last layer computes the output of
fuzzy system by summing up the outputs of layer The subsequent to the development of ANFIS
fourth. Here for ANFIS structure (fig. (1)) two approach, a number of methods have been
inputs and two labels for each input are proposed for learning rules and for obtaining an
considered. The feed forward equations of optimal set of rules. For example, Mascioli et al
ANFIS are as follows: [11] have proposed to merge Min-Max and
ANFIS model to obtain neuro-fuzzy network and
wi = Ai ( x) Bi ( y ), i = 1,2. (1) determine optimal set of fuzzy rules. Jang and
wi (2) Mizutani [12] have presented application of
wi = , i = 1,2. Lavenberg-Marquardt method, which is
w1 + w 2
essentially a nonlinear least-squares technique,
for learning in ANFIS network. In another paper,
f1 = p1 x + q1 y + r1 z
Jang [13] has presented a scheme for input
f 2 = p 2 x + q 2 y + r2 z (3) selection and [10] used Kohonens map to
w1 f 1 + w2 f 2 training.
f = = w1 f1 + w2 f 2 Jang [8] is introduced four methods to update
w1 + w2
the parameters of ANFIS structure, as listed
below according to their computation
In order to model complex nonlinear systems,
complexities:
the ANFIS model carries out input space
1. Gradient decent only: all parameters are
partitioning that splits the input space into many
updated by the gradient descent.
local regions from which simple local models
2. Gradient decent only and one pass of LSE: the
(linear functions or even adjustable coefficients)
LSE is applied only once at the very beginning
are employed. The ANFIS uses fuzzy MFs for
to get the initial values of the consequent
splitting each input dimension; the input space is
3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ 7
&RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

parameters and then the gradient decent takes


G
over to update all parameters. pbest i = F ( xi (t )) (6)
3. Gradient decent only and LSE: this is the G G
x pbest i = xi (t ) (7)
hybrid learning.
4. Sequential LSE: using extended Kalman filter
to update all parameters. 4. Compare the performance of each individual
These methods update antecedent parameters to global best particle: if F ( xGi (t )) < gbest then:
by using GD or Kalman filtering. These methods
G
have high complexity. In this paper we gbest = F ( xi (t )) (8)
introduced a method which has less complexity G G
x gbest = x i (t ) (9)
and fast convergence.

III. PARTICLE SWARM OPTIMIZATION 5. Change the velocity vector for each:
(PSO) ALGORITHMS G G G G G G
v i (t ) = v i (t 1) + 1 ( x pbest i xi (t )) + 2 ( x gbest xi (t ))
A. General PSO Algorithm. (10)
The particle swarm optimization (PSO)
algorithms are a population-based search Where 1 and 2 are random variables. The
algorithms based on the simulation of the social second term above is referred to as the cognitive
behavior of birds within a flock [14]. They all component, while the last term is the social
work in the same way, which is, updating the component.
population of individuals by applying some kind 6. Move each particle to a new position:
of operators according to the fitness information
obtained from the environment so that the G G G
xi (t ) = xi (t 1) + vi (t ) (11)
individuals of the population can be expected to
move toward better solution areas. In the PSO t = t +1
each individual flies in the search space with
velocity which is dynamically adjusted according 7. Go to step 2, and repeat until convergence.
to its own flying experience and its companion
flying experience, each individual is a point in The random variables 1 and 2 are defined
the D- dimensional search space[15]. as 1 = r1C1 and 2 = r2 C 2 , with r1 , r2 ~ U (0,1) ,
Generally, the PSO has three major and C1 and C 2 are positive acceleration constant.
algorithms. The first is the individual best. This
Kennedy has studied the effects of the random
version, each individual compares position to its
variables 1 and 2 on the particle's trajectories.
own best position, pbest , only. No information
He asserted that C1 + C 2 4 guarantees the
from other particles is used in these type
algorithms. stability of PSO [16].
The second version is the global best. The
social knowledge used to drive the movement of
particles includes the position of the best particle B. Modified PSO Algorithm
from the entire swarm. In addition, each particle In this approach we remove worst particle in
uses its history of experience in terms of its own population and replace it by new particle. This is
best solution thus far. In this type the algorithms important that how to determine worst particle
is presented as: and how to generate new particle for current
population.
1. Initialize the swarm, P (t ) , of particles such The particle is selected with worst local best
that the position xGi (t ) of each particle
value at generation. Then we randomly choose
two particles from the population and use
Pi P (t ) is random within the hyperspace, crossover operator to generate two new particles.
with t = 0 . Then select the best one from two newly
2. Evaluated the performance F of each generated particles and the selected particle and
particle, using its current position xGi (t ) . replace the worse particle with it.
In other hand we combine GA operator and
3. Compare the performance of each individual
PSO algorithm to modify it .This modification
to its best performance thus far: if
G make converges faster than basic algorithm.
F ( xi (t )) < pbest i then:
3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ 7
&RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

IV. LEARNING BY PSO k


sin( ) 0 < k < 250
25
In this section, the way PSO employed for
1.0 250 k < 500
updating the ANFIS parameters is explained. (14)

The ANFIS has two types of parameters which u ( k ) = 1.0 500 k < 750
need training, the antecedent part parameters and
0.3 sin( k ) + 0.1 sin( k )
the conclusion part parameters. The membership 25 25
functions are assumed Gaussian as in equation k
(5), and their parameters are {ai , bi , ci }, where a i + 0.6 sin( ). 750 k < 1000
10
is the variance of membership functions and c i
is the center of MFs. Also bi is a trainable Fig.2 (a) shows results using the ANFIS and
PSO for identification (solid line: actual system
parameter. The parameters of conclusion part are output, the dotted line: the ANFIS and PSO
trained and here are represented with {pi , qi , ri }. result). Fig.2 (b) Present the MSEs of modified
algorithm and Fig.2 (c) Present the MSEs of
A. How to Apply PSO for Training ANFIS basic algorithm.
parameters The parameters for training the ANFIS with this
There are 3 sets of trainable parameters in PSO algorithm listed in Table I.
antecedent part {ai , bi , ci } , each of these Example 2: Identification of nonlinear systems.
parameters has N genes. Where, N represents the We consider here the problem of identifying a
number of MFs. The conclusion parts parameters nonlinear system which was considered in [18].
( {pi , qi , ri }) also are trained during optimization A brief description is as follows. The system
model is
algorithm. Each chromosome in conclusion part
has ( I + 1) R genes that R is equal to
y (k +1) = f (y (k ), y (k 1)) +u (k ) (15)
Number of rules and I denotes dimension of data
inputs. For example each chromosome in
conclusion part in fig (1) has 6 genes. The fitness Where
is defined as mean square error (MSE).
Parameters are initialized randomly in first step x x ( x + 2.5 )
and then are being updated using PSO f (x 1, x 2 ) = 1 2 1 (16)
algorithms. In each iteration, one of the 1 + x 12 + x 22
parameters set are being updated. i.e. in first
iteration for example ai s are updated then in
second iteration bi are updated and then after Fig.3 (a) shows results using the ANFIS and
updating all parameters again the first parameter PSO for identification (solid line: actual system
update is considered and so on. output, the dotted line: the ANFIS and PSO
result). Fig.3 (b) Present the MSEs of this
B. Nonlinear Function Modeling algorithm and Fig.3 (c) Present the MSEs of
Example 1: Identification of a nonlinear dynamic basic algorithm.
system. In this example, the nonlinear plant with
multiple time-delays is described as [18] The parameters for training the ANFIS neural
network with this PSO algorithm listed in Table
y p ( k + 1) = f ( y p ( k ), y p ( k 1),
II.
(12)
y p ( k 2), u ( k ), u ( k 1))
TABLE I: PARAMETERS FOR EXAMPEL I

Where
NO of input 5
f (x 1, x 2 , x 3 , x 4 , x 5 ) = NO Of Data for train 1000
(13) NO MFs for each inputs 2
x 1 x 2 x 3 x 5 ( x 3 1) + x 4
15
1 + x 22 + x 32 NO of particle for each population

Here, the current output of the plant depends on Epoch for each population 100
three previous outputs and two previous inputs.
Testing input signal used is as the following:
3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ 7
&RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

(a) (a)

(b) (b)

MSE=7.0020.e-004 MSE=0.0905

(c)
(c)

MSE=0.197

Figure 2: Using PSO for training parameters in ANFIS Figure 3: Using PSO for training parameters in ANFIS
structure for example1. Simulation results for nonlinear structure for example2.. Simulation results for nonlinear
system identification. (a) (dashed line), and actual system system identification. (a) (dashed line), and actual system
output (solid line). (b) MSEs for modified algorithm.(c) output (solid line). (b) MSEs for modified algorithm.(c)
MSEs for basic algorithm MSEs for basic algorithm.
3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ 7
&RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

[8] Jyh-Shing Roger Jang, ANFIS: Adaptive-Network-


TABLE II: PARAMETERS FOR EXAMPE II Based Fuzzy Inference System, IEEE Trans. Sys.,Man and
Cybernetics., Vol. 23, No. 3, May/June 1993.
[9] 13. Yager, R. R. and Zadeh, L. A., Fuzzy Sets Neural
NO of input 3 Networks, and Soft Computing, Van Nostrand
NO Of Data for train 100 Reinhold,1994.
NO MFs for each inputs 2 [10] Manish Kumar, Devendra P. Garg Intelligent Learning
of Fuzzy Logic Controllers via Neural Network and Genetic
10 Algorithm, Proceedings of 2004 JUSFA 2004 Japan USA
NO of particle for each population
Symposium on Flexible Automation Denver, Colorado, July
Epoch for each population 100 19-21, 2004.
[11] Mascioli, F.M., Varazi, G.M. and Martinelli, G.,
Constructive Algorithm for Neuro-Fuzzy Networks,
Proceedings of the Sixth IEEE International Conference on
Fuzzy Systems, 1997, Vol. 1, July 1997, pp. 459 464.
V. CONCLUSIONS [12] Jang, J.-S. R., and Mizutani, E., Levenberg-Marquardt
Method for ANFIS Learning, Biennial Conference of the
North American Fuzzy Information Processing Society, June
In this paper, we proposed a novel method for 1996, pp. 87 91.
training the parameters of ANFIS structure. In [13] Jang, J.-S.R., Input Selection for ANFIS Learning,
our novel method we used PSO for updating the Proceedings of the Fifth IEEE International Conference on
parameters. The PSO which we used has some Fuzzy Systems, Vol. 2, Sep 1996, pp. 1493 1499.
[14] J. kennedy, RC. Ebenhart,, particle swarm
differences with the usual PSO. optimization, Proceedings of the IEEE International
The simulation results showed the new approach Conference on neural networks, Vol. 4, 1995, pp. 1942
has better results for complex nonlinear systems 1948.
than basic PSO. Since this algorithm is free of [15] Andries P.Engelbrecht, Computational Intelligence An
introduction, John Wiley & Sons Ltd 2002.
derivation which is very difficult to calculate for [16] J. kennedy , the behavior of particle swarm in VW, N
training of antecedent part parameters saravan, D Waagen (eds), proceeding of 7th international
complexity of this new approach is less than conference on evolutionary programming, 1998, pp581-589.
other training algorithms like GD and LS. In the [17] Y Shi, RC Ebenhart, Empirical study of Particle Swarm
Optimization, proceeding of the IEEE Congress on
other hand the number of computations required Evolutionary Computation, Vol3, 1999, pp 1945-1950.
by each algorithm has shown that PSO requires less [18] K. S. Narendra and K. Parthasarathy, Identification and
to achieve the same error goal as with the control of dynamical system using neural networks, IEEE
Backpropagation [19]. Also, the local minimum Trans. Neural Networks,vol. 1, pp. 427, Jan. 1990.
[19] Venu G. Gudise and Ganesh K. Venayagamoorthy ,
problem in GD algorithm for training in this Comparison of Particle Swarm Optimization and
novel approach is solved. The effectiveness of Backpropagation as Training Algorithms for Neural
the proposed PSO method was shown by Networks , Swarm Intelligence Symposium, 2003. SIS '03.
applying it to identification of nonlinear model. Proceedings of the 24-26 April 2003 IEEE.

REFERENCES

[1] Mannle M, Identify rule- base TSK fuzzy method, uni


of Karsruhe, 2000.
[2] Mannle M, Richard A, and Dorasm T. A, Rule- based
fuzzy model for nonlinear system identification, uni of
Karsruhe, 1996.
[3] Jang J. R, Sun C, and Mizutani, Neuro- Fuzzy and soft
computing, prentice hall, 1997.
[4] Sugeno M, and Kang G. T, Structure identification of
fuzzy model, fuzzy sets and systems, pp. 15- 33, 1998.
[5] Takagi T, Sugeno M, Fuzzy identification of systems
and its application to modeling and control, IEEE
Transaction on systems, Man & Cybernetics, pp: 116- 1321,
1985.
[6] Alcala R, Casillas J, Cordon O and Herrera F, Learning
TSK rule- based system from approximate ones by mean of
MOGUL methodology Granda uni of spain, Oct 2000.
[7] Mannle M, FTSM: Fast Takagi- Sugeno fuzzy
modeling, uni of Karsruhe, 1999.

Você também pode gostar