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.
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.
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 Section 2, 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
Suppose X is the state vector of artificial fish swarm. Let X = (x
1, x
2,…, x
), where x
1, x
2,…, x
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.
Suppose X
is the visual position at some moment; X
= (x
1
, x
2
,…, x
). X
next 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
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. Suppose X
is the current state of artificial fish and X
is a random state in its visual distance, and Y is the food concentration:If Y
< Y
, it goes forward a step in this direction:
3.2. Swarm Behavior
Suppose X
is the center position and the number of artificial fish is n
. If n
/n < δ and Y
> Y
, it goes forward a step to the companion center; otherwise perform prey behavior:
3.3. Follow Behavior
Suppose X
max is the optimal state from visual neighbors, and the number of partners of X
max is n
. If n
/n < δ and Y
> Y
, it goes forward a step to the companion X
; otherwise perform prey behavior:
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:
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 (Y
max
− Y
max
< eps),
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.
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 Step 2.
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 is X = (x
1, x
2,…, x
), where x
1, x
2,…, x
is status of the fishes. The basic form of the behavior selection algorithm based on log-linear model can be defined as
where h
(t), (m = 1,2,…, M) are feature functions and λ
(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 h
1(t) describes adaptive diversity of tth iteration:
where f
avg
means the average fitness value of tth iterative and f is the fitness value of the current fishes X
. Consider h
1(t)∈(0,1]. h
1(t) = 1 means the diversity is poor. h
1(t) ≪ 1 means the diversity is good.(2) Dimensional Distribution Function. We select dimensional distribution function as feature function:
where N means the number of particles and means the average value of the D dimension component of particles. When h
2(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 d
= ‖X
− X
‖, and i and j are the number of random fishes. Diversity function h
3(t) describes average distance of ith fishes X
: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 is w = [w
1, w
2,…, w
]; here w
(i = 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
where diversity function P
(t) describes adaptive diversity of tth iteration. α is a constant; we set α = 10 in the experiment.The image of function f(x) = 0.6∗e
(− + 0.3 is shown in Figure 2. It can be used to describe the change tendency of parameters ω
.
Figure 2
The image of function f(x) = 0.6∗e
(− + 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 isNew swarm behavior isNew follow behavior is
If (P
(t) > R
1), perform adaptive movement behavior; else perform traditional prey behavior, swarm behavior, and follow behavior, where R
1 is diversity threshold value, and we set R
1 = 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 Figure 3, where R
2 is diversity threshold value, and we set R
2 = 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 fish i, it can generate subswarm which is in line with the normal distribution. The generation of new fishes can be set as
where l is an integer constant. The population expansion behavior of artificial fish swarm is shown in Figure 4, where R
3 is diversity threshold value, and we set R
3 = 0.2 in the experiment.
Figure 4
The population expansion behavior of artificial fish swarm.
For the new artificial fishes, firstly find X
max with the largest objective function value, and if Y
< Y
max, then move one step to the center of subclass X
; otherwise move one step to the largest fish of subclass X
max.
4.4. The Behavior Selection Algorithm Based on Log-Linear Model
The improved algorithm is shown in Algorithm 1.
Algorithm 1
Improved AFSA based on log-linear model.
The overall structure of the improved algorithm is shown in Figure 5.
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 Table 1.
Table 1
Functions used to test the effects of improved algorithm.
Function
Function expression
Optimal value
Sphere function
f1x=∑t=1nxt2
0
Rastrigin function
f2x=∑t=1nxt2-10cos2πxt+10
0
Griewank function
f3(x)=14000∑t=1n(xt-100)2-∏t=1ncosxt-100t+1
0
Ackley function
f4(x)=20+e-20e-0.2∑t=1nxt2/n-e∑t=1ncos2πxt/n
0
Shaffer's function
f5x=0.5+sinx12+x222-0.51+0.001x12+x222
0
Sphere 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 Figure 6.
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 Figure 7.
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 Figure 8.
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 Figure 9.
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 Figure 10.
Figure 10
The image of Shaffer function.
The parameter setting of test algorithm is shown in Table 2.
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
60
For comparison, we use five strategies:AFSA: basic artificial fish swarm algorithm,AFSA + AMB: artificial fish swarm algorithm with adaptive movement behavior based on log-linear model,AFSA + PIB: artificial fish swarm algorithm with population inhibition behavior based on log-linear model,AFSA + PEB: artificial fish swarm algorithm with population expansion behavior based on log-linear model,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 Table 3 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.72
Table 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
8
We can see from Table 3, 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 Table 4, 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.22
For 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 Table 5, 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 Figures 11, 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.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.Adaptive movement behavior with reasonable setting according to diversity of fish swarm can improve the performance of basic artificial fish swarm algorithm.Population inhibition behavior is introduced which can greatly accelerate the convergence speed.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.