Abstract

The beetle antennae search algorithm is an effective bio-inspired algorithm. However, the algorithm is easy to fall into local optimal solution when dealing with high-dimensional and multimodal problems. An improved beetle antennae search algorithm based on inertia weight and attenuation factor was proposed in order to solve the problems. The inertia weights of normal distribution, versoria distribution, and random distribution are introduced into the weight to improve the search strategy, which was introduced to control the proportion of global search and local search so that the algorithm will escape the local optimum. Meanwhile, the randomness is introduced in the process of beetle’s step-size update, which can better help beetle to escape from the local optimum. Experiments on some benchmarks show that the algorithm has obvious performance improvement in dealing with high-dimensional and multimodal problems.

1. Introduction

The optimization problem has always been one of the most widely concerned problem [1]. It can be divided into convex optimization [2] and nonconvex optimization [3]. For the traditional convex optimization problem, any local optimal solution is chosen as being the global optimal solution. However, nonconvex problems may have an infinite number of locally optimal solutions and it is not differentiable in the feasible region. Researchers have been searching for a better method to deal with them. The effective results have been obtained from the steepest descent method [4], conjugate gradient method [5], Newton method [6], quasi-Newton method [7], and trust region method [8] in convex optimization.

For nonconvex optimization problems, there are a lot of optimization algorithms that can solve it such as projected gradient descent [9], alternating minimization [10], expectation-maximization [11], and stochastic optimization [12]. However, these algorithms are all for a kind of structure. Convex relaxation [13] is also an effective method, which releases some constraints and transforms the nonconvex optimization problem into the convex optimization problem. In addition, the Monte Carlo method [14] is a classical method to solve nonconvex problems. However, when dealing with a slightly more complex problem, it will face a lot of computation load. In order to overcome the weakness of traditional optimization algorithms on nonconvex problems, bio-inspired algorithms [1517] had gradually appeared in our field of vision. Bio-inspired algorithms are becoming popular because of their flexibility, robustness, and ability to escape local optimum. At present, common bio-inspired algorithms include particle swarm optimization algorithm [18], bee colony optimization algorithm [19], ant colony optimization algorithm [20], genetic optimization algorithm [21], chicken optimization algorithm [22], firefly optimization algorithm [23], butterfly optimization algorithm [24], and gray wolf optimization algorithm [25]. These algorithms have achieved remarkable results in solving nonconvex problems of modern engineering applications [26]. These algorithms all belong to the swarm algorithm, and they are all in the swarm to complete the search task, which has a large amount of calculation and does not have a good real-time performance. However, the individual algorithm can make up for those shortcomings.

The beetle antennae search (BAS) algorithm [27] was proposed by Jiang in 2017, which is an individual algorithm. The algorithm is inspired by beetle searching for food. The proposed BAS algorithm can better solve the problem of the global optimal solution of nonconvex function under low dimensions and has a faster convergence. The BAS algorithm has fewer initial parameters and is less affected by parameter sensitivity. At the same time, the BAS algorithm is only a single beetle during iteration, which is more efficient than current newer algorithms in terms of time and space complexity, such as the Harris Eagle algorithm [28], colony predation algorithm [29], moth search algorithm [30], and slime mould algorithm [31]. The BAS algorithm has been widely used in robot path planning and obstacle avoidance, PID parameter setting, image enhancement, fault diagnosis, neural network, etc. However, the BAS algorithm may have slow convergence speed, low iteration accuracy, and even divergence when dealing with complex multimodal and high-dimensional situations.

In order to solve the problem that the algorithm is easy to fall into local optimum, Wang [32] proposes the beetle swarm antennae search (BSAS) algorithm, which combines swarm intelligence algorithm with a feedback-based step-size update strategy. But it ignored the influence of swarm on individuals and increased the calculation. The introduction of population quantitative characteristics does not guarantee computation. Therefore, it should be improved from the individual structure in order to reduce the computational burden. Ameer [33] proposed the BAS-ADAM to smooth the convergence behavior and avoid trapping in the local optimal solution for a highly nonconvex objective function by introducing the adaptive moment estimation from the structure of the BAS algorithm. It introduced the ADAM’s update rules into BAS to adjust the step size for each dimension separately instead of using the same step size. It has the characteristics of fast convergence, but the algorithm still falls into the local optimal solution, and its performance on nonconvex functions is mediocre. In order to solve the problem that the algorithm is easy to fall into local optimum on nonconvex functions, Xu [34] proposed the beetle antennae search algorithm based on lévy flights and adaptive strategy (LABAS). The algorithm turns the beetle into a population and updates the population with elite individuals’ information to improve the convergence rate and stability, but it can only be adapted to single-objective optimization problems. In order to further improve the objective optimization problems, Lin [35] introduced the inertia weight of linear decreasing into the process of beetle search to ensure that the early iteration speed was fast and the later iteration speed was slow in the process of beetle search. However, the change rate of linear decreasing weight is constant, which leads to the situation that the BAS algorithm will remain in the same number of iterations of global search and local development. This algorithm may not be able to obtain the optimal solution.

For this problem of linear decreasing inertia weight may not be able to obtain the optimal solution, this study introduced three kinds of weight of inconstant change rate, namely, inertia weight by random distribution, inertia weight by versoria distribution, and inertia weight by normal distribution into position update of BAS. The improvement in inertia weight can avoid the situation that beetle is stuck in global search and local development in the process of optimization and improves the problem that the BAS algorithm is easy to fall into local optimum in the case of high-dimensional and multimodal function. At the same time, the idea of randomness is introduced in the step-size updating process to further enhance adaptability for complex problems. The main contributions of this study are as follows: (1) the inertia weight by random distribution, inertia weight by versoria distribution, and inertia weight by normal distribution are proposed to improve the search performance of BAS. (2) The randomness is introduced to improve the BAS step attenuation process.

The structure of this study is as follows. The second section reviews the traditional BAS algorithm. The third section introduces the BAS algorithm based on improved inertia weight and attenuation factor. In the fourth section, the proposed algorithm is simulated and verified by standard test functions. In the fifth section, the proposed algorithm is summarized.

2. Brief Introduction of Beetle Antennae Search Algorithm

The BAS is an effective bio-inspired algorithm, which is inspired by the foraging behavior of beetle. The simplified model is shown in Figure 1.

The simplified model of beetle was divided into left and right antennae. The distance between the two antennae was . The distance between the two antennae and the beetle’s centroid is equal. The BAS algorithm is divided into three steps: searching, comparing, and updating behavior. The searching behavior is responsible for the collection of food smells, and the comparing behavior is responsible for the comparative analysis of the found smells and then selects the side with high smell concentration. Finally, the updating behavior updates the next step of the beetle according to the smell concentration. The specific BAS algorithm steps are as follows.

First, the initial value of beetle optimization was defined , where is the number of beetle optimization and . represents the total number of beetles searching for optimization. Based on the mechanism of the BAS algorithm, the unit random vector is established bywhere is the random vector and is the dimension of space. The unit random vector and initial position of beetle in equation (1) are used to establish left antennae coordinates and the right antennae coordinates of beetle. The expressions of the right antennae coordinate and the left antennae coordinate of beetle are expressed bywhere is the centroid in the iteration. is the distance in the iteration. The update rules are as follows.where is the attenuation factor of . The value is usually 0.95. According to the beetle detection mechanism, the following position update iterative model is established bywhere is the sign function. is the step length in search. The updating rule of beetle step is expressed bywhere is the attenuation factor of . represents the value of the fitness function of the right antennae. represents the value of the fitness function of the right antennae. represents the fitness function.

3. Improved Beetle Antennae Search Algorithm Based on Improved Inertia Weight and Attenuation Factor

This section will introduce the improved BAS algorithm, respectively, by whether the change rate of inertia weight regularly changes. The algorithm flowchart of NBAS, RBAS, and VBAS is shown in Figure 2.

3.1. The Improved Bas in Which the Change Rate of Inertia Weight Regularly Changes

This section introduces two different mechanisms according to the change rate of inertia weight. One is the BAS algorithm based on a normal distribution of inertia weight and random attenuation factor. The other is the BAS algorithm based on versoria distribution. The inertia weight of the former is normal distribution, and the inertia weight of the latter is versoria distribution.

3.1.1. Normal Distribution Inertia Weight and Random Attenuation Factor

This section proposes a normal beetle antennae search (NBAS) algorithm based on normal distribution inertia weight and random attenuation factor. The details are as follows.

The normal distribution is a kind of continuous random variable probability distribution and a universal distribution. The function formula of normal distribution is as follows.where is the variable. The central tendency position of normal distribution is described for the mean value of normal distribution. The variance of normal distribution describes the dispersion degree of normal distribution data distribution.

The normal distribution curve is a dynamic curve. It has the advantages of slow attenuation in the early stage, rapid attenuation in the middle stage, and gentle attenuation in the late stage. Due to the slow attenuation in the early stage, the inertia weight of the algorithm is slowly attenuated before reaching a certain number of iterations. It can keep good global search ability for the algorithm.

After the middle of the iteration, the inertia weight will rapidly attenuate and lock to the local optimal value. Meanwhile, in the late iteration, the algorithm will slowly attenuate and keep iterating to achieve the strongest local search ability. This search strategy can greatly improve the search performance of BAS.

The inertia weight of normal distribution attenuation is expressed as follows.where is the maximum number of iterations, is the current number of iterations, is the maximum inertia weight, and is the minimum inertia weight. According to the beetle detection mechanism, the inertia weight of normal distribution is introduced into BAS to establish a new position update iterative model.where the randomness is introduced into the step-size iteration formula is expressed bywhere is a random distribution from 0 to 1.

3.1.2. Versoria Distribution Inertia Weight and Random Attenuation Factor

In this section, a versoria beetle antennae search (VBAS) algorithm based on versoria distribution inertial weight and random attenuation factor is proposed.

The introduction of versoria distribution can make the weight change rate of the algorithm slow in the early stage of iteration, which is helpful to search for the global optimal solution. In the later stage, the weight change rate of the BAS algorithm is faster, which can improve the local search ability. It is beneficial to improve the speed of BAS and jump out of local optimal solution when dealing with high-dimensional cases. The graph of versoria function is shown in Figure 3.

In Figure 3, is the diameter of the circle , where is the radius. It can intersect the line with point and the circle with point by rotating the X-axis degrees counterclockwise about the origin . The paralleling lines of x and y crossing points and intersect at . Then, the track of point becomes a versoria line from gradually increasing to , where the rectangular coordinate equation of versoria line is as follows:where and are minimum and maximum of inertia weight. is the maximum expected number of iterations. If let , the expression can be simplified as

The function property of versoria distribution is introduced into the update of beetle position. According to the beetle detection mechanism, the inertial weight distribution of versoria was introduced to establish the following position update iterative model.

The iterative formula for introducing randomness step size is expressed bywhere is a random number between 0 and 1.

3.2. The Improved Bas in Which the Change Rate of Inertia Weight Unregularly Changes

In this section, a random beetle antennae search (RBAS) algorithm based on random distribution inertia weight and random attenuation factor is proposed.

Introducing random inertia weight can improve the global search performance of the algorithm. Beetle can not only get a large or small weight value at the beginning of operation, but also get a small or large weight value at the later stage of calculation, because of the randomness. When the beetle is near the optimal position, the inertia weight of random distribution can produce a relatively small value, which is beneficial to accelerate the convergence speed of the algorithm. If the random inertia weight takes a large value, the calculation of the adaptive function will get a large value, which is worse than the optimal value. At this time, when the large inertia weight will be eliminated, the algorithm will generate a new inertia weight value. Using the method of random distribution to generate the weight value can also ensure that the algorithm is not prone to the stagnation of adaptive function value in the late iteration. Meanwhile, the random attenuation factor is introduced to improve the global search ability of the algorithm. The formula of random inertia weight is as follows.where is the minimum of random inertia weight. is a maximum of random inertia weight. is the random distribution of a random number between 0 and 1, for the normal distribution of random numbers. is used to measure the deviation between the random variable weight and mathematical expectation, and the purpose is to control the weight value, which makes the choice of weights that is more advantageous to the direction of change. According to the normal condition, the experimental error obeys the normal distribution. Then, according to the beetle detection mechanism, the inertial random inertia weight is introduced to establish the following position update iterative model:

The iteration formula of the attenuation factor is expressed bywhere is a random number between 0 and 1.

3.3. Complexity Analysis of Algorithms

In this subsection, we present an analytical study on the computational complexity of the algorithm. According to the calculation method in [36], is the number of populations. When the dimension of the optimization problem is , the computational complexity of this algorithm is as follows.

The computational complexity of initial BAS is . In the iterative process, the coordinates of two antennae and the fitness function value were calculated, the location of beetle was updated, the fitness value was calculated, and the computational complexity is . The computational complexity of the weight update process is . The computational complexity of NBAS, VBAS, and RBAS is , which is higher than the standard BAS algorithm , and the computational complexity can be approximately . The computational complexities of the six algorithms are shown in Table 1.

4. Function Experiments

In order to prove the effectiveness of the algorithm, the proposed algorithm was compared with beetle antennae search algorithm with the linearly decreasing inertia weight (WSBAS), particle swarm optimization (PSO) algorithm, and BAS through standard test functions. The optimal convergence value, average convergence value, and standard deviation were analyzed. The optimization ability of functions in two-dimensional, fifty-dimensional, and one hundred-dimensional cases are compared. The simulation environment is Windows10 operating system. The programming language environment is MATLAB R2016b. The hardware environment is Intel Core i5-8250u Processor. The main frequency is 1.8 GHz, and the RAM is 4 GB.

The search scope and the optimal value of the standard test function search scope and the optimal value are shown in Table 2. The function expression is shown as follows.

The Ackley function is expressed aswhere the variable values are chosen as , , and .

The Griewank function is expressed as

The Rastrigin function is expressed as

The rotated hyperellipsoid function is expressed as

The Sphere function is expressed as

The sum squares function is expressed as

The Zakharov function is expressed as

The Bohachevsky function is expressed as

The Schaffer function is expressed as

The sum of different powers function is expressed as

In this study, the simulation results of the algorithm from three aspects of two dimensions, fifty dimensions, and one hundred dimensions are as follows. The values of parameters are as follows. The number of iterations is 100. The maximum inertia weight of the proposed algorithm is 0.9, and the minimum inertia weight is 0.4. Other values are chosen as the same as literature [35]. The number of particles is 100, and the learning factors are all 1.5. Each algorithm is independently run 10000 times.

4.1. Analysis of Two-Dimensional Simulation Results

The comparison of function optimization results in 2 dimensions is shown in Figures 413. The comparison of function optimization results in two dimensions is shown in Table 3. The simulation results show that the algorithms of NBAS, RBAS, and VBAS proposed in this study are superior to the algorithms of BAS, PSO, and WSBAS in terms of optimal convergence value, average convergence value, and standard deviation under 10000 times Monte Carlo experiments. The optimal convergence values satisfied RBAS < VBAS < WSB-AS < PSO < BAS or NBAS < VBAS < WSBAS < PSO < BAS, and the performance of algorithm RBAS and algorithm NBAS is similar. The average convergence values are similar to the optimal convergence value, which is satisfied by RBAS < V-BAS < WSBAS < PSO < BAS or NBAS < VBAS < WSBAS < PS-O < BAS. The performance of RBAS is better than NBAS. In terms of standard deviation, the algorithm proposed in this study is smaller, which shows that the improved BAS algorithm proposed is superior to the original BAS, WSBAS, and PSO algorithms in both iteration accuracy and overall stability when dealing with two-dimensional functions.

4.2. Analysis of Fifty-Dimensional Simulation Results

The comparison of function optimization results in 50 dimensions is shown in Figures 1423. The comparison of function optimization results in 50 dimensions is shown in Table 4. The simulation results show that the optimal convergence value, average convergence value, and standard deviation of the algorithms of NBAS, VBAS, and RBAS proposed in this study are RBAS. The results show that the proposed algorithm has better searching performance and stability in the case of fifty dimensions.

The simulation results show that the comparison of optimal convergence value, average convergence value, and standard deviation of NBAS, VBAS, and RBAS proposed in this study is RBAS < VBAS < WSBAS < PSO < BAS or NBA-S < VBAS < WSBAS < PSO < BAS, which indicates that the proposed algorithm has better optimization performance and algorithm stability in the case of fifty dimensions.

4.3. Analysis of One Hundred-Dimensional Simulation Results

The comparison of function optimization results in one hundred dimensions is shown in Figures 2433. The comparison of function optimization results in 100 dimensions is shown in Table 5. The simulation results show thatthe optimal convergence value, average convergence value, and standard deviation of NBAS, IBAS, and VBAS algorithms proposed in this study are still RBAS < VBAS < WSBAS < PS-O < BAS or NBAS < VBAS < WSBAS < PSO < BAS in the case of 100 dimensions. It is shown that the proposed algorithm can maintain good performance even in the case of high dimensions. It will not fall into the local optimum, and the iteration accuracy will be higher in the same number of iterations.

5. Conclusions

In this study, the BAS algorithm based on improved inertia weight and attenuation factor is proposed. The global search ability, convergence speed, and convergence precision of the algorithm are improved by introducing normal distribution attenuation inertia weight, random inertia weight, and versoria distribution and adding a random attenuation factor. Finally, the standard test functions are verified under two dimensions, fifty dimensions, and one hundred dimensions, respectively. Numerical simulation results show that compared with traditional BAS, WSBAS, and PSO, the proposed algorithms have significantly improved the optimal convergence value, average convergence value, and standard deviation.

The BAS algorithm has been proposed for a short time, and most of them may only be tested by benchmark functions, with many numerical optimizations and not really applied to practical engineering applications. Although many scholars have applied the BAS algorithm in many fields, the application in each field is not perfect, and there is still a large space for the application and research of the algorithm.

Abbreviations

BAS:Beetle antennae search
BSAS:Beetle swarm antennae search
BAS-ADAM:Beetle antennae search with adaptive moment estimation
LABAS:Beetle antennae search with lévy flights and adaptive
NBAS:Beetle antennae search based on normal distribution
VBAS:Beetle antennae search based on versoria distribution
RBAS:Beetle antennae search based on the random distribution
WSBAS:Beetle antennae search with the linearly decreasing
PSO:Particle swarm optimization.

Data Availability

The program of the simulation function comes from the Virtual Library of Simulation Experiments: Test Functions and Datasets (http://www.sfu.ca/∼ssurjano/optimization.html).

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

The work was supported by the Key Science and Technology Program of Henan Province (212102110221), the Project of Henan Research Institute of China Engineering Science Development Strategy (22104090002), and the Science and Technology Research Project of Henan Province (22A590003).