# Log-Linear Model Based Behavior Selection Method for Artificial Fish Swarm Algorithm

Authors: Zhehuang Huang; Yidong Chen
Journal: Computational Intelligence and Neuroscience
 (2015)

---

## Abstract

Artificial fish swarm algorithm (AFSA) is a population based optimization technique inspired by social behavior of fishes. In past several years, AFSA has been successfully applied in many research and application areas. The behavior of fishes has a crucial impact on the performance of AFSA, such as global exploration ability and convergence speed. How to construct and select behaviors of fishes are an important task. To solve these problems, an improved artificial fish swarm algorithm based on log-linear model is proposed and implemented in this paper. There are three main works. Firstly, we proposed a new behavior selection algorithm based on log-linear model which can enhance decision making ability of behavior selection. Secondly, adaptive movement behavior based on adaptive weight is presented, which can dynamically adjust according to the diversity of fishes. Finally, some new behaviors are defined and introduced into artificial fish swarm algorithm at the first time to improve global optimization capability. The experiments on high dimensional function optimization showed that the improved algorithm has more powerful global exploration ability and reasonable convergence speed compared with the standard artificial fish swarm algorithm.


---

## Body

## 1. Introduction

Artificial fish swarm algorithm [1, 2] is a new evolutionary algorithm proposed in 2002 to imitate the fish behaviors such as praying, swarming, and following. For many optimization problems, artificial fish swarm algorithm can produce high-quality solution within a reasonable computation time and relatively stable convergence characteristics.Compared with traditional evolutionary algorithm, artificial fish swarm algorithm has some attractive characteristics such as simple in principle, good robustness, and tolerance of parameter setting [3]. In recent years, a series of papers have focused on the application of AFSA, such as resource leveling [4], robot task allocation [5, 6], neural network [7], image segmentation [8], fault diagnosis in mine hoist [9], image reconstruction [10], data clustering [11–13], PID controller parameters [14], and other areas [15–21].However, AFSA algorithm also showed some unsatisfactory aspects in practical applications, such as premature convergence and poor ability in global optimization. At the same time, the experiences of group members are not used for the next moves. To solve the problem, some improved algorithms [22–25] have been proposed. Although the methods mentioned above can improve the performance to some extent, they still cannot get satisfactory results for some applications.At the selection of behaviors, we signed by the log-linear model of thinking. In statistics, linear model is used in different ways according to the context. Log-linear model [26] is a mathematical model that takes the form of a function whose logarithm is a polynomial function of the parameters of the model.In this paper, we proposed a behavior selection algorithm based on log-linear model. The advantages of log-linear model are the ability to easily blend multiple features. Using the log-linear model can enhance decision making ability of behavior selection.This paper is organized as follows. In Section2, related work is presented. The background of artificial fish swarm algorithm is introduced in Section 3. The improved algorithm based on log-linear model and some new behaviors of fishes are presented in Section 4. In Section 5, some experimental tests, results, and conclusions are given. Section 6 concludes the paper.


## 2. Related Work

In recent years, researchers have made some attempts to improve the performance of artificial fish swarm algorithm. In [22], chaos optimization is first employed to initialize the position of individual artificial fish and applied to obtain the neighborhood of the global optimum solution. Gao et al. reported an improved artificial fish swarm algorithm with crossover operator based on parents’ characteristics [23]. In [24], the concept of ecological niche is also being introduced to overcome the shortcoming of traditional artificial fish swarm algorithm to obtain optimal solution. Rocha et al. reported an augmented Lagrangian methodology with a stochastic population based algorithm, which solves a sequence of simple bound global optimization subproblems using a fish swarm intelligent algorithm [25].Some researchers have tried to improve the performance of AFSA by combining different algorithm with AFSA. An improved AFSO (IAFSO) [27] is proposed to train forward neural network using a hybrid of artificial fish swarm algorithm and particle swarm optimization. In [28], some new ideas are proposed which focus on a set of movements of fishes. Wang and Ma reported a hybrid artificial fish swarm algorithm, which is combined with CF and artificial fish swarm algorithm to solve the Bin packing problem [29]. In [30], quantum rotation gate is used to update the position of artificial fish swarm which employs the quantum nongate to speed up the convergence. The experimental results show that the performance of AFSA is significantly improved. A hybrid algorithm based on particle swarm optimization and artificial fish swarm algorithm [31] is reported which owns a good globally convergent performance with a faster convergent rate. In [32], a simulated annealing artificial fish swarm algorithm is proposed which can obtain better optimization precision and convergence speed.Log-linear model is a mathematical model which is widely used in part-of-speech tagging, statistical machine translation, and other fields. Och and Ney introduced the log-linear model for statistical machine translation (SMT), in which translation is considered as optimization problem. Its efficiency is comparable to the global method [33]. In [34], the multinomial diversity model (MDM) based on generalized linear models is proposed which can be used for model selection and graphical and numerical interpretation.In this paper, we proposed an improved algorithm based on log-linear model which can transform the traditional single probability model to adaptive model.


## 3. Introduction to AFSA

SupposeX is the state vector of artificial fish swarm. Let X=(x1,x2,…,xn), where x1,x2,…,xn is status of fishes. The action of artificial fish occurs only in the radius of a circle with vision. The artificial fish realizes external perception by its vision shown in Figure 1.Figure 1
Vision concept of the artificial fish.SupposeXv is the visual position at some moment; Xv=(x1v,x2v,…,xnv). Xnext is the new position. Let Step be the moving step length, Visual represents the visual distance, and δ is the crowd factor (0<δ<1). Then the movement process is represented as
(1)Xv=Xi+Visual×rand(),i∈(0,n].Xnext=X+Xv-XXv-X×Step×rand(),
where rand() produces random numbers between 0 and 1.The basic behaviors of artificial fish are defined as follows.


### 3.1. Prey Behavior

Prey behavior is a basic biological behavior to find food. SupposeXi is the current state of artificial fish and Xj is a random state in its visual distance, and Y is the food concentration:
(2)Xj=Xi+Visual×rand().IfYi<Yj, it goes forward a step in this direction:
(3)Xit+1=Xit+Xj-XitXj-Xit×Step×rand().


### 3.2. Swarm Behavior

SupposeXc is the center position and the number of artificial fish is nf. If nf/n<δ and Yc>Yi, it goes forward a step to the companion center; otherwise perform prey behavior:
(4)Xit+1=Xit+Xc-XitXc-Xit×Step×rand.


### 3.3. Follow Behavior

SupposeXmax⁡ is the optimal state from visual neighbors, and the number of partners of Xmax⁡ is nf. If nf/n<δ and Yj>Yi, it goes forward a step to the companion Xj; otherwise perform prey behavior:
(5)Xit+1=Xit+Xmax⁡-XitXmax⁡-Xit×Step×rand().


### 3.4. Move Behavior

Move behavior is a basic behavior to seek food or companions in larger ranges. They can choose a state in the vision and then move towards this state:(6)Xit+1=Xit+Visual×rand().


### 3.5. Leap Behavior

If the fitness function is almost the same or the difference is smaller than a proportion during the given (m-n) iterations, leap behavior can move to new state to avoid the local extreme values.If (Ymax⁡m-Ymax⁡n<eps),
(7)Xit+1=Xit+β×Visual×rand(),
where eps is a smaller constant and β is a parameter that can make some fishes have other actions.The artificial fish swarm algorithm mainly includes the following steps.Step 1.
Initialize the parameters of artificial fish, such as Step, Visual, the number of exploratory, and maximum number of iterations.Step 2.
Select the optimal value, and recorded in the bulletin.Step 3.
Perform prey behavior, swarm behavior, follow behavior, move behavior, and leap behavior.Step 4.
If individual optimum is better than bulletin board, update the optimal value in bulletin board.Step 5.
If the termination condition is satisfied, output the result; otherwise return to Step2.


## 3.1. Prey Behavior

Prey behavior is a basic biological behavior to find food. SupposeXi is the current state of artificial fish and Xj is a random state in its visual distance, and Y is the food concentration:
(2)Xj=Xi+Visual×rand().IfYi<Yj, it goes forward a step in this direction:
(3)Xit+1=Xit+Xj-XitXj-Xit×Step×rand().


## 3.2. Swarm Behavior

SupposeXc is the center position and the number of artificial fish is nf. If nf/n<δ and Yc>Yi, it goes forward a step to the companion center; otherwise perform prey behavior:
(4)Xit+1=Xit+Xc-XitXc-Xit×Step×rand.


## 3.3. Follow Behavior

SupposeXmax⁡ is the optimal state from visual neighbors, and the number of partners of Xmax⁡ is nf. If nf/n<δ and Yj>Yi, it goes forward a step to the companion Xj; otherwise perform prey behavior:
(5)Xit+1=Xit+Xmax⁡-XitXmax⁡-Xit×Step×rand().


## 3.4. Move Behavior

Move behavior is a basic behavior to seek food or companions in larger ranges. They can choose a state in the vision and then move towards this state:(6)Xit+1=Xit+Visual×rand().


## 3.5. Leap Behavior

If the fitness function is almost the same or the difference is smaller than a proportion during the given (m-n) iterations, leap behavior can move to new state to avoid the local extreme values.If (Ymax⁡m-Ymax⁡n<eps),
(7)Xit+1=Xit+β×Visual×rand(),
where eps is a smaller constant and β is a parameter that can make some fishes have other actions.The artificial fish swarm algorithm mainly includes the following steps.Step 1.
Initialize the parameters of artificial fish, such as Step, Visual, the number of exploratory, and maximum number of iterations.Step 2.
Select the optimal value, and recorded in the bulletin.Step 3.
Perform prey behavior, swarm behavior, follow behavior, move behavior, and leap behavior.Step 4.
If individual optimum is better than bulletin board, update the optimal value in bulletin board.Step 5.
If the termination condition is satisfied, output the result; otherwise return to Step2.


## 4. The Improved Fish Swarm Algorithm Based on Log-Linear Model (LAFSA)

In this section, we proposed a behavior selection algorithm based on log-linear model. Firstly, log-linear model is used to implement a multiprobability adaptive model. A variety of knowledge sources are added to the model in the form of a feature function to enhance decision making ability. Secondly, some new behaviors are proposed to improve the performance of fish swarm algorithm.


### 4.1. Log-Linear Model

Suppose that the state vector of fishes isX=(x1,x2,…,xn), where x1,x2,…,xn is status of the fishes. The basic form of the behavior selection algorithm based on log-linear model can be defined as
(8)Prt=∑mexp⁡⁡βmhmt∑t∑mexp⁡⁡βmhmt,
where hm(t), (m=1,2,…,M) are feature functions and λm(m=1,2,…,M) are the weight of feature function.


### 4.2. The Selection of Feature Function

The selections of feature functions have a crucial impact on the optimization performance; how to construct feature functions is an important task. In this paper, we choose diversity function, dimensional distribution function, and average distance metrics function as feature function in the experiment.(1) Diversity Function. Diversity function is used to describe the degree of dispersion of the fishes. Diversity function h1(t) describes adaptive diversity of tth iteration:
(9)h1(t)=∑i=1Nf(xi)-favgtN*max⁡1≤j≤N⁡f(xj)-favgt,
where favgt means the average fitness value of tth iterative and f is the fitness value of the current fishes Xi. Consider h1(t)∈(0,1]. h1(t)=1 means the diversity is poor. h1(t)≪1 means the diversity is good.(2) Dimensional Distribution Function. We select dimensional distribution function as feature function:
(10)h2t=∑i=1N∑dDxid-x-d2N×max⁡1≤j≤N⁡∑dDxjd-x-d2,
where N means the number of particles and x-d means the average value of the D dimension component of particles. When h2(t) is less than a threshold, we must employ some strategies to improve the diversity of population.(3) Average Distance Metrics Function. We select average distance metrics function as feature function. Suppose that the distance between the fishes is di,j=Xi-Xj, and i and j are the number of random fishes. Diversity function h3(t) describes average distance of ith fishes Xi:
(11)h3(t)=∑j=1Ndi,jN×max⁡1≤i,j≤N⁡(di,j),i=1,2,…,N.Additionally, we can choose other functions such as contraction expansion measure as feature function.


### 4.3. New Behaviors

#### 4.3.1. Adaptive Movement Behavior

Suppose that inertia weight vector isw=w1,w2,…,wn; here wii=1,2,…,n is inertia weight of the ith dimension, and its value dynamically adjusts according to diversity of fishes. When the diversity of fishes is good, the inertia weight can be set smaller. When the diversity of fishes is good, the inertia weight can be set larger. The inertia weight of ith dimension can be set as
(12)ωi=0.6*e(-α*(1-Pr(t)))+0.3,i=1,2,…,n,
where diversity function Pr(t) describes adaptive diversity of tth iteration. α is a constant; we set α=10 in the experiment.The image of functionf(x)=0.6*e(-α*(1-x))+0.3 is shown in Figure 2. It can be used to describe the change tendency of parameters ωi.Figure 2
The image of functionf(x)=0.6*e(-α*(1-x))+0.3.So the traditional prey behavior, swarm behavior, and follow behavior can be redefined as adaptive movement behavior based on inertia weight. The adaptive movement behavior includes three behaviors: new prey behavior, new swarm behavior, and new follow behavior, which is shown as (13) to (15).New prey behavior is(13)Xit+1=wiXit+(1-wi)Xj-XitXj-Xit×Step×rand().New swarm behavior is(14)Xit+1=wiXit+(1-wi)Xc-XitXc-Xit×Step×rand().New follow behavior is(15)Xit+1=wiXit+(1-wi)Xmax⁡-XitXmax⁡-Xit×Step×rand().
If (Pr(t)>R1), perform adaptive movement behavior; else perform traditional prey behavior, swarm behavior, and follow behavior, where R1 is diversity threshold value, and we set R1=0.6 in the experiment.


#### 4.3.2. Population Inhibition Behavior

In artificial fish swarm algorithm, the convergence speed of later stages is too slow; a lot of fishes perform invalid search which wastes much time. So we introduce population inhibition behavior to accelerate the convergence speed.After a period of evolution, the big fishes will eat small fishes, and the occupied space of small fishes will be cleared.The population inhibition behavior of artificial fish swarm is shown in Figure3, where R2 is diversity threshold value, and we set R2=0.85 in the experiment.Figure 3
The population inhibition behavior of artificial fish swarm.


#### 4.3.3. Population Expansion Behavior

Population inhibition behavior can improve the convergence speed, but it may lead to poor global exploration ability. So we introduce population expansion behavior to maintain a certain population size.For fishi, it can generate subswarm which is in line with the normal distribution. The generation of new fishes can be set as
(16)Xinew=Xi+random-l*Step,l*Step,
where l is an integer constant. The population expansion behavior of artificial fish swarm is shown in Figure 4, where R3 is diversity threshold value, and we set R3=0.2 in the experiment.Figure 4
The population expansion behavior of artificial fish swarm.For the new artificial fishes, firstly findXmax⁡ with the largest objective function value, and if Yi<Ymax⁡, then move one step to the center of subclass Xc; otherwise move one step to the largest fish of subclass Xmax⁡.


### 4.4. The Behavior Selection Algorithm Based on Log-Linear Model

The improved algorithm is shown in Algorithm1.Algorithm 1:Improved AFSA based on log-linear model.
(1) Initialize variables;
(2) Construct the log-linear model by (8).
(3) Each fishes update their location.
(a) IfPr(t)>R1, perform adaptive movement behavior by (13) to (15);
else perform traditional prey behavior, swarm behavior and follow behavior.
(b) IfPr(t)>R2, perform population inhibition behavior;
(c) IfPr(t)<R3, then perform population expansion behavior by (16).
(4) The threshold gradually reduced which can lead to the dispersion of fishes;
(5) Update the optimal value;
(6) If the termination condition is satisfied, output the optimal value; otherwise return to Step  2.The overall structure of the improved algorithm is shown in Figure5.Figure 5
Log-linear model based artificial fish swarm algorithm.


## 4.1. Log-Linear Model

Suppose that the state vector of fishes isX=(x1,x2,…,xn), where x1,x2,…,xn is status of the fishes. The basic form of the behavior selection algorithm based on log-linear model can be defined as
(8)Prt=∑mexp⁡⁡βmhmt∑t∑mexp⁡⁡βmhmt,
where hm(t), (m=1,2,…,M) are feature functions and λm(m=1,2,…,M) are the weight of feature function.


## 4.2. The Selection of Feature Function

The selections of feature functions have a crucial impact on the optimization performance; how to construct feature functions is an important task. In this paper, we choose diversity function, dimensional distribution function, and average distance metrics function as feature function in the experiment.(1) Diversity Function. Diversity function is used to describe the degree of dispersion of the fishes. Diversity function h1(t) describes adaptive diversity of tth iteration:
(9)h1(t)=∑i=1Nf(xi)-favgtN*max⁡1≤j≤N⁡f(xj)-favgt,
where favgt means the average fitness value of tth iterative and f is the fitness value of the current fishes Xi. Consider h1(t)∈(0,1]. h1(t)=1 means the diversity is poor. h1(t)≪1 means the diversity is good.(2) Dimensional Distribution Function. We select dimensional distribution function as feature function:
(10)h2t=∑i=1N∑dDxid-x-d2N×max⁡1≤j≤N⁡∑dDxjd-x-d2,
where N means the number of particles and x-d means the average value of the D dimension component of particles. When h2(t) is less than a threshold, we must employ some strategies to improve the diversity of population.(3) Average Distance Metrics Function. We select average distance metrics function as feature function. Suppose that the distance between the fishes is di,j=Xi-Xj, and i and j are the number of random fishes. Diversity function h3(t) describes average distance of ith fishes Xi:
(11)h3(t)=∑j=1Ndi,jN×max⁡1≤i,j≤N⁡(di,j),i=1,2,…,N.Additionally, we can choose other functions such as contraction expansion measure as feature function.


## 4.3. New Behaviors

### 4.3.1. Adaptive Movement Behavior

Suppose that inertia weight vector isw=w1,w2,…,wn; here wii=1,2,…,n is inertia weight of the ith dimension, and its value dynamically adjusts according to diversity of fishes. When the diversity of fishes is good, the inertia weight can be set smaller. When the diversity of fishes is good, the inertia weight can be set larger. The inertia weight of ith dimension can be set as
(12)ωi=0.6*e(-α*(1-Pr(t)))+0.3,i=1,2,…,n,
where diversity function Pr(t) describes adaptive diversity of tth iteration. α is a constant; we set α=10 in the experiment.The image of functionf(x)=0.6*e(-α*(1-x))+0.3 is shown in Figure 2. It can be used to describe the change tendency of parameters ωi.Figure 2
The image of functionf(x)=0.6*e(-α*(1-x))+0.3.So the traditional prey behavior, swarm behavior, and follow behavior can be redefined as adaptive movement behavior based on inertia weight. The adaptive movement behavior includes three behaviors: new prey behavior, new swarm behavior, and new follow behavior, which is shown as (13) to (15).New prey behavior is(13)Xit+1=wiXit+(1-wi)Xj-XitXj-Xit×Step×rand().New swarm behavior is(14)Xit+1=wiXit+(1-wi)Xc-XitXc-Xit×Step×rand().New follow behavior is(15)Xit+1=wiXit+(1-wi)Xmax⁡-XitXmax⁡-Xit×Step×rand().
If (Pr(t)>R1), perform adaptive movement behavior; else perform traditional prey behavior, swarm behavior, and follow behavior, where R1 is diversity threshold value, and we set R1=0.6 in the experiment.


### 4.3.2. Population Inhibition Behavior

In artificial fish swarm algorithm, the convergence speed of later stages is too slow; a lot of fishes perform invalid search which wastes much time. So we introduce population inhibition behavior to accelerate the convergence speed.After a period of evolution, the big fishes will eat small fishes, and the occupied space of small fishes will be cleared.The population inhibition behavior of artificial fish swarm is shown in Figure3, where R2 is diversity threshold value, and we set R2=0.85 in the experiment.Figure 3
The population inhibition behavior of artificial fish swarm.


### 4.3.3. Population Expansion Behavior

Population inhibition behavior can improve the convergence speed, but it may lead to poor global exploration ability. So we introduce population expansion behavior to maintain a certain population size.For fishi, it can generate subswarm which is in line with the normal distribution. The generation of new fishes can be set as
(16)Xinew=Xi+random-l*Step,l*Step,
where l is an integer constant. The population expansion behavior of artificial fish swarm is shown in Figure 4, where R3 is diversity threshold value, and we set R3=0.2 in the experiment.Figure 4
The population expansion behavior of artificial fish swarm.For the new artificial fishes, firstly findXmax⁡ with the largest objective function value, and if Yi<Ymax⁡, then move one step to the center of subclass Xc; otherwise move one step to the largest fish of subclass Xmax⁡.


## 4.3.1. Adaptive Movement Behavior

Suppose that inertia weight vector isw=w1,w2,…,wn; here wii=1,2,…,n is inertia weight of the ith dimension, and its value dynamically adjusts according to diversity of fishes. When the diversity of fishes is good, the inertia weight can be set smaller. When the diversity of fishes is good, the inertia weight can be set larger. The inertia weight of ith dimension can be set as
(12)ωi=0.6*e(-α*(1-Pr(t)))+0.3,i=1,2,…,n,
where diversity function Pr(t) describes adaptive diversity of tth iteration. α is a constant; we set α=10 in the experiment.The image of functionf(x)=0.6*e(-α*(1-x))+0.3 is shown in Figure 2. It can be used to describe the change tendency of parameters ωi.Figure 2
The image of functionf(x)=0.6*e(-α*(1-x))+0.3.So the traditional prey behavior, swarm behavior, and follow behavior can be redefined as adaptive movement behavior based on inertia weight. The adaptive movement behavior includes three behaviors: new prey behavior, new swarm behavior, and new follow behavior, which is shown as (13) to (15).New prey behavior is(13)Xit+1=wiXit+(1-wi)Xj-XitXj-Xit×Step×rand().New swarm behavior is(14)Xit+1=wiXit+(1-wi)Xc-XitXc-Xit×Step×rand().New follow behavior is(15)Xit+1=wiXit+(1-wi)Xmax⁡-XitXmax⁡-Xit×Step×rand().
If (Pr(t)>R1), perform adaptive movement behavior; else perform traditional prey behavior, swarm behavior, and follow behavior, where R1 is diversity threshold value, and we set R1=0.6 in the experiment.


## 4.3.2. Population Inhibition Behavior

In artificial fish swarm algorithm, the convergence speed of later stages is too slow; a lot of fishes perform invalid search which wastes much time. So we introduce population inhibition behavior to accelerate the convergence speed.After a period of evolution, the big fishes will eat small fishes, and the occupied space of small fishes will be cleared.The population inhibition behavior of artificial fish swarm is shown in Figure3, where R2 is diversity threshold value, and we set R2=0.85 in the experiment.Figure 3
The population inhibition behavior of artificial fish swarm.


## 4.3.3. Population Expansion Behavior

Population inhibition behavior can improve the convergence speed, but it may lead to poor global exploration ability. So we introduce population expansion behavior to maintain a certain population size.For fishi, it can generate subswarm which is in line with the normal distribution. The generation of new fishes can be set as
(16)Xinew=Xi+random-l*Step,l*Step,
where l is an integer constant. The population expansion behavior of artificial fish swarm is shown in Figure 4, where R3 is diversity threshold value, and we set R3=0.2 in the experiment.Figure 4
The population expansion behavior of artificial fish swarm.For the new artificial fishes, firstly findXmax⁡ with the largest objective function value, and if Yi<Ymax⁡, then move one step to the center of subclass Xc; otherwise move one step to the largest fish of subclass Xmax⁡.


## 4.4. The Behavior Selection Algorithm Based on Log-Linear Model

The improved algorithm is shown in Algorithm1.Algorithm 1:Improved AFSA based on log-linear model.
(1) Initialize variables;
(2) Construct the log-linear model by (8).
(3) Each fishes update their location.
(a) IfPr(t)>R1, perform adaptive movement behavior by (13) to (15);
else perform traditional prey behavior, swarm behavior and follow behavior.
(b) IfPr(t)>R2, perform population inhibition behavior;
(c) IfPr(t)<R3, then perform population expansion behavior by (16).
(4) The threshold gradually reduced which can lead to the dispersion of fishes;
(5) Update the optimal value;
(6) If the termination condition is satisfied, output the optimal value; otherwise return to Step  2.The overall structure of the improved algorithm is shown in Figure5.Figure 5
Log-linear model based artificial fish swarm algorithm.


## 5. Experiment

A set of unconstrained benchmark functions was used to investigate the effect of the improved algorithm which is shown in Table1.Table 1
Functions used to test the effects of improved algorithm.
Function
Function expression
Optimal  value
Sphere  function
f
1
x
=
∑
t
=
1
n
x
t
2
0
Rastrigin function
f
2
x
=
∑
t
=
1
n
x
t
2
-
10
cos
⁡
2
π
x
t
+
10
0
Griewank function
f
3
(
x
)
=
1
4000
∑
t
=
1
n
(
x
t
-
100
)
2
-
∏
t
=
1
n
cos
⁡
x
t
-
100
t
+
1
0
Ackley  function
f
4
(
x
)
=
20
+
e
-
20
e
-
0.2
∑
t
=
1
n
x
t
2
/
n
-
e
∑
t
=
1
n
cos
⁡
2
π
x
t
/
n
0
Shaffer’s function
f
5
x
=
0.5
+
sin
⁡
⁡
x
1
2
+
x
2
2
2
-
0.5
1
+
0.001
x
1
2
+
x
2
2
2
0Sphere function is a single-peak function, we can find the optimal value to be 0 through the analysis for function expression, and the function image is shown in Figure6.Figure 6
The image of Sphere function.Rastrigin function is a multipeak function, we can find the optimal value to be 0 through the analysis for function expression, and the function image is shown in Figure7.Figure 7
The image of Rastrigin function.Griewank function is a multipeak function, we can find the optimal value to be 0 through the analysis for function expression, and the function image is shown in Figure8.Figure 8
The image of Griewank function.Ackley function is a multipeak function, we can find the optimal value to be 0 through the analysis for function expression, and the function image is shown in Figure9.Figure 9
The image of Ackley function.Shaffer function is a multipeak function, we can find the optimal value to be 0 through the analysis for function expression, and the function image is shown in Figure10.Figure 10
The image of Shaffer function.The parameter setting of test algorithm is shown in Table2.Table 2
The parameter setting of test algorithm.
Algorithm
Fish number
Visual
Delta
Step
Number of iterations
AFSA
100
2.85
9
1
60
LAFSA
100
2.85
9
1
60For comparison, we use five strategies:(1)
AFSA: basic artificial fish swarm algorithm,(2)
AFSA + AMB: artificial fish swarm algorithm with adaptive movement behavior based on log-linear model,(3)
AFSA + PIB: artificial fish swarm algorithm with population inhibition behavior based on log-linear model,(4)
AFSA + PEB: artificial fish swarm algorithm with population expansion behavior based on log-linear model,(5)
LAFSA: improved artificial fish swarm algorithm with hybrid behavior (adaptive movement behavior, population inhibition behavior, and population expansion behavior) based on log-linear model.We used mean (average optimal value), times (execution time), SD (standard deviation), and iterations (average convergence iterations number) as evaluation indicators.The comparison of different methods is shown in Table3 to Table 5. Each point is made from average values of over 30 repetitions. The dimension of Sphere function, Rastrigin function, Griewank function, and Ackley function is taken as 10 dimensions. Shaffer function is taken as 2 dimensions.Table 3
The performances of AFSA and AFSA + AMB.
Algorithm
AFSA
AFSA + AMB
Mean
Time (s)
Mean
Time (s)
Sphere
0.017
3.02
0.016
3.13
Rastrigin
42.7
3.52
34.6
3.43
Griewank
24.56
2.21
24.56
2.56
Ackley
0.25
3.93
0.14
3.18
Shaffer
0.0097
1.79
0.0097
1.72We can see from Table3, for Sphere function, Rastrigin function, and Ackey function, that we can improve the optimal value compared with the standard AFSA. For Griewank function and Shaffer function, the optimal value of the two algorithms is the same.So the adaptive inertia weight can effectively reflect the diversity of fish swarm. Adaptive movement behavior with reasonable setting according to diversity of fish swarm can improve the performance.From Table4, we can find out that the convergence time of AFSA + PIB is greatly reduced as expected for all the five functions. The number of fishes is gradually reduced which can avoid useless search, so the time can be reduced. But we can see that optimal value is slightly inferior to the standard algorithm.Table 4
The testing performance comparison among of AFSA, AFSA + PIB, and AFSA + PEB.
Algorithm
AFSA
AFSA + PIB
AFSA + PEB
Mean
Time (s)
Mean
Time (s)
Mean
Time (s)
Sphere
0.017
3.02
0.036
1.49
0.013
4.59
Rastrigin
42.7
3.52
45.3
1.55
22.3
4.58
Griewank
24.56
2.21
26.25
1.33
18.63
3.51
Ackley
0.25
3.93
0.33
1.96
0.16
5.19
Shaffer
0.0097
1.79
0.051
1.38
0
3.22Table 5
The performances of AFSA and LAFSA.
Algorithm
AFSA
LAFSA
Mean
SD
Time (s)
Iterations
Mean
SD
Time (s)
Iterations
Sphere
0.017
0.0048
3.02
21
0.014
0.0023
1.88
15
Rastrigin
42.7
7.54
3.52
55
29.6
5.31
2.23
28
Griewank
24.56
4.91
2.21
57
24.45
3.04
1.35
32
Ackley
0.25
0.072
3.93
45
0.18
0.054
2.456
31
Shaffer
0.0097
0.00013
1.79
8
0.0097
0.00011
1.51
8For all the five functions, the accuracy obtained in AFSA + PEB is significantly improved because the introduction of population expansion behavior can improve global optimization capability. But at the same time, the execution time inevitably increases compared with the standard AFSA algorithm.So different behavior has both advantages and disadvantages, from an overall point of view, and we must select different behaviors according to different condition.From Table5, for Sphere function, Rastrigin function, Griewank function, and Ackley function, LAFSA algorithm can effectively improve the accuracy such that the optimal value obtained is much closer to the theoretical one and the accuracy is improved compared with the standard AFSA algorithm. On the convergence speed and algorithm execution time, there is a significant improvement as expected for all the five functions.So the new behaviors of fish presented in this paper are essential for better performance. At the same time, the behavior selection based on log-linear model can enhance decision making ability of behavior selection.The comparison of the two methods with convergent curves is shown in Figures11, 12, 13, 14, and 15. Comparing with AFSA, the LAFSA algorithm has both global search ability and fast convergence speed.Figure 11
Sphere function.Figure 12
Rastrigin function.Figure 13
Griewank function.Figure 14
Ackley function.Figure 15
Shaffer function.


## 6. Conclusions

In this paper, we present an improved artificial fish swarm algorithm based on log-linear model. This is the first effort to introduce log-linear model and some new behavior to artificial fish swarm algorithm. Experiments show that the improved algorithm has more powerful global exploration ability with reasonable convergence speed.We got the following conclusions.(1)
Using the log-linear model, the traditional single probability model can be transformed into multiprobability adaptive model, which can efficiently use the advantages of a variety of probabilistic models and enhance decision making ability of behavior selection.(2)
Adaptive movement behavior with reasonable setting according to diversity of fish swarm can improve the performance of basic artificial fish swarm algorithm.(3)
Population inhibition behavior is introduced which can greatly accelerate the convergence speed.(4)
Population expansion behavior can improve global optimization capability and avoid premature convergence.From the experiment, we can find out that the behavior of fishes is essential for better performance. We will introduce some new behaviors in future work and apply this idea to other optimization tasks.



---

*Source: 685404-2015-01-26.xml*