Log-Linear Model Based Behavior Selection Method for 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.


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 highquality solution within a reasonable computation time and relatively stable convergence characteristics.
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][23][24][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 loglinear 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 2 Computational Intelligence and Neuroscience are presented in Section 4. In Section 5, some experimental tests, results, and conclusions are given. Section 6 concludes the paper.

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.

Suppose
is the state vector of artificial fish swarm. Let = ( 1 , 2 , . . . , ), where 1 , 2 , . . . , 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.
Step X n1 X n2 X X X next Suppose V is the visual position at some moment; V = ( V 1 , V 2 , . . . , V ). 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.

Prey Behavior.
Prey behavior is a basic biological behavior to find food. Suppose is the current state of artificial fish and is a random state in its visual distance, and is the food concentration: If < , it goes forward a step in this direction:

Swarm Behavior.
Suppose is the center position and the number of artificial fish is . If / < and > , it goes forward a step to the companion center; otherwise perform prey behavior:

Follow Behavior.
Suppose max is the optimal state from visual neighbors, and the number of partners of max is . If Computational Intelligence and Neuroscience 3 / < and > , it goes forward a step to the companion ; otherwise perform prey behavior:

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:

Leap
Behavior. If the fitness function is almost the same or the difference is smaller than a proportion during the given ( − ) iterations, leap behavior can move to new state to avoid the local extreme values.
where 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 Step 2.

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.

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 ℎ 1 ( ) describes adaptive diversity of th iteration: where avg means the average fitness value of th iterative and is the fitness value of the current fishes . Consider ℎ 1 ( ) ∈ (0, 1]. ℎ 1 ( ) = 1 means the diversity is poor. ℎ 1 ( ) ≪ 1 means the diversity is good.
(2) Dimensional Distribution Function. We select dimensional distribution function as feature function: where means the number of particles and means the average value of the dimension component of particles. When ℎ 2 ( ) 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 , = ‖ − ‖, and and are the number of random fishes. Diversity function ℎ 3 ( ) describes average distance of th fishes : Additionally, we can choose other functions such as contraction expansion measure as feature function. is inertia weight of the th 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 th dimension can be set as = 0.6 * (− * (1− ( ))) + 0.3, = 1, 2, . . . , ,

New
where diversity function ( ) describes adaptive diversity of th iteration. is a constant; we set = 10 in the experiment. The image of function ( ) = 0.6 * (− * (1− )) + 0.3 is shown in Figure 2. It can be used to describe the change tendency of parameters .
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 New swarm behavior is New follow behavior is If ( ( ) > 1 ), perform adaptive movement behavior; else perform traditional prey behavior, swarm behavior, and follow behavior, where 1 is diversity threshold value, and we set 1 = 0.6 in the experiment.

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 2 is diversity threshold value, and we set 2 = 0.85 in the experiment.

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 , it can generate subswarm which is in line with the normal distribution. The generation of new fishes can be set as where is an integer constant. The population expansion behavior of artificial fish swarm is shown in Figure 4, where 3 is diversity threshold value, and we set 3 = 0.2 in the experiment.
For the new artificial fishes, firstly find max with the largest objective function value, and if < max , then move one step to the center of subclass ; otherwise move one step to the largest fish of subclass max .

The Behavior Selection Algorithm Based on Log-Linear
Model. The improved algorithm is shown in Algorithm 1.
The overall structure of the improved algorithm is shown in Figure 5.

Experiment
A set of unconstrained benchmark functions was used to investigate the effect of the improved algorithm which is shown in Table 1.
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.
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.
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.
(a) If ( ) > 1 , perform adaptive movement behavior by (13) to (15); else perform traditional prey behavior, swarm behavior and follow behavior. (b) If ( ) > 2 , perform population inhibition behavior; (c) If ( ) < 3 , 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.
Algorithm 1: Improved AFSA based on log-linear model.   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.
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.
The parameter setting of test algorithm is shown in Table 2.
For 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,

Variable initialization
Adaptive move behavior  (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 Table 3 to Table 5  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.
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   The number of iterations

Optimal value
Iterative process of the fish swarm algorithm AFSA LAFSA Figure 13: Griewank function.

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 Computational Intelligence and Neuroscience some new behaviors in future work and apply this idea to other optimization tasks.