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 loglinear model is proposed and implemented in this paper. There are three main works. Firstly, we proposed a new behavior selection algorithm based on loglinear 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.
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 highquality 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 loglinear model of thinking. In statistics, linear model is used in different ways according to the context. Loglinear 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 loglinear model. The advantages of loglinear model are the ability to easily blend multiple features. Using the loglinear 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 loglinear 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.
Loglinear model is a mathematical model which is widely used in partofspeech tagging, statistical machine translation, and other fields. Och and Ney introduced the loglinear 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 loglinear model which can transform the traditional single probability model to adaptive model.
3. Introduction to AFSA
Suppose is the state vector of artificial fish swarm. Let , where 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.
Suppose is the visual position at some moment; . is the new position. Let Step be the moving step length, Visual represents the visual distance, and is the crowd factor (). Then the movement process is represented as where 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 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:
3.2. 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:
3.3. Follow Behavior
Suppose is the optimal state from visual neighbors, and the number of partners of is . If and , it goes forward a step to the companion ; 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 () iterations, leap behavior can move to new state to avoid the local extreme values.
If (), 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.
4. The Improved Fish Swarm Algorithm Based on LogLinear Model (LAFSA)
In this section, we proposed a behavior selection algorithm based on loglinear model. Firstly, loglinear 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. LogLinear Model
Suppose that the state vector of fishes is , where is status of the fishes. The basic form of the behavior selection algorithm based on loglinear model can be defined as where , are feature functions and 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 describes adaptive diversity of th iteration: where means the average fitness value of th iterative and is the fitness value of the current fishes . Consider . means the diversity is poor. 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 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 describes average distance of th fishes :
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 ; here 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 where diversity function describes adaptive diversity of th iteration. is a constant; we set in the experiment.
The image of function 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 (), perform adaptive movement behavior; else perform traditional prey behavior, swarm behavior, and follow behavior, where is diversity threshold value, and we set 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 is diversity threshold value, and we set in the experiment.
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 , 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 is diversity threshold value, and we set in the experiment.
For the new artificial fishes, firstly find with the largest objective function value, and if , then move one step to the center of subclass ; otherwise move one step to the largest fish of subclass .
4.4. The Behavior Selection Algorithm Based on LogLinear Model
The improved algorithm is shown in Algorithm 1.

The overall structure of the improved algorithm is shown in Figure 5.
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 singlepeak 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.
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 loglinear model,(3)AFSA + PIB: artificial fish swarm algorithm with population inhibition behavior based on loglinear model,(4)AFSA + PEB: artificial fish swarm algorithm with population expansion behavior based on loglinear model,(5)LAFSA: improved artificial fish swarm algorithm with hybrid behavior (adaptive movement behavior, population inhibition behavior, and population expansion behavior) based on loglinear 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.
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 loglinear 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.
6. Conclusions
In this paper, we present an improved artificial fish swarm algorithm based on loglinear model. This is the first effort to introduce loglinear 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 loglinear 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.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
This work was supported by the National Natural Science Foundation of China (Grant no. 61005052), the Fundamental Research Funds for the Central Universities (Grant no. 2010121068), the Natural Science Foundation of Fujian Province of China (Grant no. 2011J01369), and the Science and Technology Project of Quanzhou (Grant no. 2012Z91).