A hybrid equilibrium optimizer algorithm for multi-level image segmentation

: Threshlod image segmentation is a classic method of color image segmentation. In this paper, we propose a hybrid equilibrium optimizer algorithm for multi-level image segmentation. When multi-level threshold method calculates the neighborhood mean and median of color image, it takes huge challenge to find the optimal threshold. We use the proposed method to optimize the multi-level threshold method and get the optimal threshold from the color image. In order to test the performance of the proposed method, we select the CEC2015 dataset as the benchmark function. The result shows that the proposed method improves the optimization ability of the original algorithm. And then, the classic images and wood fiber images are taken as experimental objects to analyze the segmentation result. The experimental results show that the proposed method has a good performance in Uniformity measure, Peak Signal‑to‑Noise Ratio and Feature Similarity Index and CPU time.

Among all the methods of image segmentation, Otsu [16] method is the most popular one. Computational complexity of Otsu methods increases exponentially with the increasing number of thresholds due to exhaustive search. It is a difficult task to study how to improve the segmentation accuracy of Otsu with multi-thresholds method. The expansion of the actual Otsu's thresholding to multilevel thresholding is known as multi-Otsu thresholding [17]. Nevertheless, these methods are unable to obtain effective results for noisy images. To solve this problem, J. Zhuang [18] proposed a 2-D Otsu method that selects the optimal threshold on a 2-D histogram. Jing [19] proposed the maximum between-cluster variance by using a 3-D histogram approach and was named the 3-D Otsu method. In this method, the 3D histogram takes the median value of neighborhood pixels as the third feature of the existing features of the 2D OTSU method, that is, gray information and neighborhood mean value. L. Wang [20] derived a group of recurrence formula for 3-D Otsu's method and eliminated redundancy in the formula by introducing a look-up table. The method reduced the computation of the 3DOtsu. Therefore, in order to optimize the search process, a faster and automatic optimal threshold selection method is needed.
The traditional exhaustive methods take the large amount of computation. In this case, metaheuristic methods have attracted much attention in recent years. L. Bian proposed a new multithreshold MRI image segmentation algorithm based on mixed entropy using Curvelet transformation and Multi-Objective Particle Swarm Optimization [21]. This method could deal with the difficulties caused by noise disturbance, intensity inhomogeneity and edge blurring in Magnetic Resonance Imaging image segmentation. N. Muangkote proposed the nature-inspired meta-heuristic named multilevel thresholding moth-flame optimization algorithm (MTMFO) for multilevel thresholding [22]. This algorithm effectively solved the problem of satellite image segmentation. B. Surina proposed a multi-level thresholding model based on gray-level & local-average histogram (GLLA) and Tsallis-Havrda-Charvát entropy for RGB color image [23]. This method had the effectiveness and reasonability. A. Wunnava proposed an adaptive Harris Hawks optimization (AHHO) technique to solve the multi-level image segmentation [24]. The experimental results were beneficial to the segmentation field of image processing. The optimization algorithm is adopted to solve the threshold selection of the multi-threshold image segmentation method, which effectively improves the segmentation precision of the image segmentation method [25,26].
The optimization algorithm can solve practical engineering problems in recent years [27]. Different optimization algorithms adapt to different engineering problems and have different optimization capabilities [28,29]. These nature-inspired optimization algorithms were mainly classified into two classes recently which are evolutionary algorithm (EA) and biology-inspired or bioinspired algorithms. EA imitated the Darwinian theory of evolution [30]. There were many good algorithms in this class. In 1975, GA was invented by John Holland [31], it used the binary representation of individuals. In 1997, Differential evolution was proposed Rainer stone, the essence was a multi -objective optimization algorithm [32]. The most popular class was the biology-inspired or bio-inspired algorithms right now. One of the most famous algorithms was the Particle Swarm Optimizer (PSO) which was developed based on the swarming behavior of fish and birds [33]. In 2015, the ant lion optimizer was proposed by Mirjalili [34]. In 2016, Askarzadeh proposed the crow search algorithm [35]. In 2017, the killer whale algorithm was proposed by Biyanto [36]. These algorithms were inspired from the predation behavior animal, so as to obtain better searching ability. There also some algorithms inspired from the physics and chemistry, these algorithms usually had simple mathematical models, but had good optimization effect. In 2001, the harmony search algorithm was proposed by Geem [37]. In 2015, Zheng Yu-Jun proposed water wave optimization algorithm [38]. In 2019, A. Faramarzi proposed a novel optimization algorithm, called Equilibrium optimizer (EO), which controlled volume mass balance models used to estimate both dynamic and equilibrium states [39]. No-Free-Lunch [40] proved that no algorithm can solve all optimization problems.
There is no perfect optimization algorithm and the optimization algorithm should be improved to better solve engineering problems. Many scholars study the hybrid optimization algorithm [41]. Pankaj U. proposed a new multistage hybrid optimization algorithm to optimize multilevel threshold [42]. The method had a good performance in test images. Amandeep proposed a fast SAR image segmentation method based on Particle Swarm Optimization-Gravitational Search Algorithm [43]. The method had good segmentation accuracy. D. Kole proposed a new approach to automatic unsupervised efficient image segmentation algorithm using hybrid technique based on Particle Swarm Optimization and Genetic Algorithm [44]. Gao H. presented a learning strategy-based particle swarm optimization algorithm with an exchange method [45]. The experiment shows that the method had a good result using the Berkeley images. So, the hybrid optimization algorithm could use the advantage of the different algorithms to enhance the search ability of the original algorithm.
This paper focuses on the segmentation of wood fiber images. The wood fiber images have the small target, it takes huge challenge for the segmentation method. We use 3DOtsu as a fitness function to segment wood fiber images. The threshold image method can overcome the difficulty of wood fiber image difference channel. The Equilibrium optimizer algorithm can find the threshold of the wood fiber images, however the segmentation accuracy is low and the CPU time is large. In order to improve the optimal ability of EOA, we use the GOA improve the EOA. The HEOA obtains the strong ability find the optimal threshold from the wood fiber images.
In this paper, the HEOA is proposed. The main contribution of this study is that the GOA improves the original EOA for multilevel threshold. Experiments are performed on CEC2015 data, classic images and wood fiber images. The proposed algorithm is compared with the original EOA and other six algorithms include CSA, FPA, PSO, HSOA and HWOA. The GOA algorithms can balance the exploration and exploitation of the EOA. The results show the superiority of the proposed algorithm in terms of the objective function value, image quality measures on both normal and high-level thresholding.

Otsu's Function
Otsu algorithm is a classical image segmentation method, and its segmentation results are excellent. This method can be extended to multi-threshold Otsu to obtain the maximum variance between two classes, so as to obtain the optimal threshold of the image [46].
Assuming that there are K thresholds, which divide the image into K+1 classes. The extended between-class variance is calculated by The sigma terms are determined by Eq. (6) and the mean levels are calculated by Eq. (7): The optimum thresholds are found by maximizing the between-class variance by Eq. (8):

3DOtsu's Function
3D-Otsu, the histogram is constructed by taking gray values of pixels along with their spatial information including the neighborhood mean and median [47]. The Otsu only segment the single channel of the image, however the color images have three channels. There are more information in the three channels, so the 3DOtus can use the information of three channels and get the best threshold form the color images. An image I with K gray levels and N number of pixels is considered, where the intensity value of pixel at the location ( , ) denoted by ( , ). The mean and median value of × neighborhood of pixel is denoted by ( , ) andℎ( , ), which is defined by Eq. (9) and Eq. (10).
( , ) = Where, the value of l is taken as 3 in this paper. For every pixel in the image I, mean and median values are calculated in the × neighborhood.
Let ( , , ℎ ) as the optimal threshold of the three histograms, and use the Eq. (8) to calculate the optimal threshold from the three histograms. The optimal threshold is expressed as: The final optimum thresholds are average of the result of * , * and ℎ * , and can be defined by Eq.10: The 3DOtsu image segmentation method uses the information of three channels of color images, the optimal threshold can segment the image exactly.

Equilibrium optimizer algorithm
The EO method is inspired by the simple well-mixed dynamic mass balance on the control body, in which the mass balance equation is used to describe the coordination of non-active components in the control body as a function of its various source and aggregation mechanisms. Similar to most metaheuristic algorithms, EO uses the initial population to start the optimization process. The equilibrium candidates' collaboration can be seen from Figure1. The initial concentrations are constructed based on the number of particles and dimensions with uniform random initialization in the search space as follows: Where, is the initial concentration vector of the ith particle, and denote the minimum and maximum values for the dimensions, rand is a random vector in interval of [0, 1]. The equilibrium state is the final convergence state of the algorithm, which is desired to be the global optimum. At the beginning of the optimization process, there is no knowledge about the equilibrium state and only equilibrium candidates are determined to provide a search pattern for the particles. According to the different experiments under different types of case problems, these candidate particles are the four optimal particles determined in the whole optimization process plus another particle. These particles are nominated as equilibrium candidates and are used to construct a vector called the equilibrium pool:

Probable positions
Where, → (1) is the first particle updates all of its concentrations, → ( ) is the average of the particle.
The main concentration updating rule is the exponential term (F). In order to guarantee convergence by slowing down the search speed along with improving the exploration and exploitation ability of the algorithm, the version can be seen as: Where: Where, Iter and Max_iter present the current and the maximum number of iterations.
The generation rate is one of the most important terms in the proposed algorithm to provide the exact solution by improving the exploitation phase. The final set of generation rate equation is as follows: Where: Where, 1 and 2 are random numbers in [0, 1] and GCP vector is constructed by the repetition of the same value resulted from Eq. (16).
Finally, the updating rule of EO will be as follows: Where, F is defined in Eq. (13), and V is considered as unit.

Mathematical model of GOA
In 2017, Mirjalili Seyedali proposed the grasshopper optimization algorithm [48]. The grasshoppers are a genus of straight fins of insect, they are seen as pests, because they are in crops for food, to cause damage to agriculture. The growth cycle of grasshoppers is shown in Figure 2. The grasshoppers usually exist alone in nature, but they are one of the biggest swarm of all species. The grasshoppers are unique in that they crowd behavior in adults and larvae of between. Millions of larva foraging on the basis of jumping, they feed on almost all plants, and when they reach adulthood, they form a large group in the air, making long migrations, looking for the next food source.
In larvae stage, the main characteristic of grasshopper is moving slowly, small scale food. When they become adult, collective action has became the main activity characteristics of grasshopp er. The natureinspired algorithms logically divide the search process into two tendencies: exploration and exploitation. So mathematical model of the gregarious grasshoppers is represented as follows: where defines the position of the i-th grasshopper, is the social interaction, is the gravity force on the i-th grasshopper, and shows the wind advection.
where is the distance between the i-th and the j-th grasshopper, calculated as s is a function to define the strength of social forces, ⃗ is an unit vector from the i-th grasshopper to the j-th grasshopper.
where g is the gravitational constant and ⃗ shows an unity vector towards the center of earth.
Where u is a constant drift and ⃗ is a unity vector in the direction of wind. Substituting S, G, and A into Eq. (19), then this equation can be expanded as follows: However, this mathematical model cannot be used directly to solve optimization problems, mainly because the grasshoppers quickly reach the comfort zone and the swarm does not converge to a specified point. A modified version of this equation is proposed as follows to solve optimization problems: Among them, and are a type of upper and lower limitation, ⃗⃗ is the optimal value after each iteration, 1 = 2 = − − , 1 balances the global search and local search for the target area, 2 balances the relationship among the attraction between two grasshopper, cmax and cmin can set the maximum and minimum search ability, l represents the current iteration number, L is the largest number of iterations.

The proposed method
In this subsection, we describe the hybrid equilibrium optimizer algorithm in detail. The EOA fall into the local optimal easily. The algorithm cannot balance the exploitation and exploration. In order to solve this problem, we use the advantage of the GOA to improve the optimization ability of the GOA. We use the Eq. (19) to enhance the individual ability of the EOA. The have the strong ability to avoid the EOA drop into the local optimal. The formula can be seen below: A comprehensive algorithm step of HEOA based multilevel color image segmentation is given in Algorithm  In order to use the information of the three channels of color images, we use the fitness functions Eq. (10) to calculate the histogram of the three channels. And then, we use the HEOA to optimize the fitness function. Finally, we can get the best threshold and segment the color images. The flowchart of the BMPA can be seen from the Figure 3.
The computational complexity of the proposed method depends on the number of each combination (L), the number of generations (g), the number of population (n) and the parameters dimensions (d). So, computational complexity on L combination is ( ) . The computational complexity of population location update is O(n*d). The calculation of fitness function values of all seagull populations is ( * ). Therefore, the final computational complexity of the proposed method is:

Benchmark function experiments and results
To verify the optimization performance of HEOA, its performance is compared with five other optimization methods including CSA, FPA, PSO, BA and basic EOA. The optimization algorithm compared in this section tests CEC2015 benchmark test functions. The detailed description of CEC 2015 benchmark test functions [49] is presented in Table 2. For fair comparison, the other parameters of all algorithms are set according to their original papers. The results obtained by the algorithms on benchmark functions are presented in Table 3. All parameters of the comparison optimization algorithm are shown in table 1. Figure 4 show the result of the CEC2015. The population size is 30 and the number of iterations is 100. The proposed DLNN are testing in Matlab 2018b. As can be seen from table 3, the results of HEOA algorithm in processing all standard functions are better than those of other comparison algorithms, indicating that the HEOA algorithm can not only solve single-dimensional mathematical functions but also deal with multi-dimensional mathematical functions effectively. It shows that the optimization ability of HEOA algorithm is superior to other comparison algorithms. It can be seen from the Figure 4, the EOA and BA obtains the worst result and the HEOA gets the best result. Above the analysis, HEOA obtains the strong optimal ability, and in the next section we use the HEOA optimize the 3DOtsu.

Color image segmentation experiment
In this section, HEOA algorithm is applied to optimize the 3DOtsu. In order to better verify the image segmentation ability of proposed algorithm, it is compared with the optimized 3DOtsu algorithm of CSA, PSO, FPA and BA. The color image has three color channels. In this paper, the images of the three channels are segmented, and then the three resulting images are fused to obtain the final segmentation result graph. Firstly, the segmentation effect and precision of HEOA algorithm are analyzed when the threshold value is increased. Then the segmentation ability, statistical analysis and stability analysis of the proposed HEOA algorithm and other optimization algorithms in 3DOtsu image segmentation are analyzed. All parameters of the comparison optimization algorithm are shown in table 3. The test images and the histogram of three channels of color images are as follows Figure 5. The test images included color natural images and satellite images. It can be seen from the histogram, the histogram of three channels has significant different and it take huge challenge for optimization algorithm to find the optimal threshold. Color image segmentation requires a higher threshold level, so it is more complex to use optimization technology to solve the problem. Therefore, the optimization algorithm has the characteristics of randomness. In order to better observe the performance of the algorithm, we select K = 4, 8, 12 and 15. The evaluation index can better observe the performance of the algorithm. In order to comprehensively analyze the performance of the algorithm, we calculate the CPU time, Uniformity (U), Peak Signal-to-Noise Ratio (PSNR) and Feature Similarity Index (FSIM). The evaluation index of many object optimization methods can be seen table 4.

HEOA optimize Otsu and 3DOtsu function
In this section, we compare the different segmentation method as fitness function. The EOA and HEOA optimize Otsu and 3DOtsu function. The FSIM of the compared algorithms can be seen from table 5. The Bar chart of the FSIM can be seen in Figure 6.
It can be seen from table 5, the FSIM value of 3DOtsu is better than Otsu. The 3DOtsu can use the information of color image, and get the best segment result. And the result of HEOA is better than EOA, it means that the Hybrid algorithm improves the optimal ability of EOA and makes the algorithm find the best result. Above analyze, we use the 3DOtsu as the fitness function in the next experiment. The Figure 6 show the FSIM result of the compared algorithms. The result of 3DOtsu is better than the result of Otsu. The 3DOtsu use the information of three channels and obtains the better threshold than Otsu. At the same time, the result of HEOA is better than EOA, it means that the GOA can improve the optimal ability of the EOA.

Comparison with optimization algorithm based 3DOtsu
In this experiment, to show the merits of proposed technique, the results are compared with CSA, FPA, PSO, BA, HSOA [57] and HWOA [58] using 3DOtsu objective function. The parameters of the compared algorithms are set in the references.
The Figure 7 show the curve of Uniformity. It can be seen from figure, the HEOA obtains the best result in compared algorithms, the HSOA and HWOA gets the better result in compared algorithms, the CSA, FPA, PSO and BA obtains the worst result in all cases. It can be kwon that the hybrid optimization algorithms have the better optimal ability than original optimization algorithm. Most of all, the HEOA has the strongest ability in the compared algorithms.  Table 6, it can be observed that for all the test images, HEOA is better and more reliable than CSA, FPA, PSO, and BA, because of its precise search capability, at a high threshold level (K). Performance of HSOA and HWOA has closely followed HEOA. The solution update strategy for FPA and PSO may have led to poor results. The comprehensive performance ranking of the comparison algorithm is as follows: HEOA>HSOA>HWOA>PSO>BA>CSA> FPA. So, the HEOA have a better performance than other algorithms. Table 7 and table 8 Table 9 shows the CPU time of each algorithm under different thresholds. When the threshold value K = 4, the results of each optimization algorithm differ little. At this point, the number of thresholds is small, the search space is small, and the optimization capability of each optimization algorithm is basically the same. When K=15, the computational complexity of image segmentation increases and the CPU time increases absolutely. The average time of each algorithm in the test image is: HEOA < HSOA < HWOA < FPA < CSA < BA < PSO. So, the HEOA algorithm not only has the good performance in image segmentation, but also has the less CPU time than other compared algorithms.

Statistical analysis
The experimental results of each algorithm are the same, so statistical tests are needed. Parametric statistical tests are based on various assumptions [59]. The well-known non-parametric statistical tests, namely Friedman test [60] and Wilcoxon rank-sum test [61] are used in this section. For the average rank of Friedman's test given in table 10, the method presented in this paper takes the first place in all cases, and as the number of threshold levels increases, the rank value becomes smaller and smaller, which has greater advantages compared with other comparison methods. Through the above analysis, as the dimension of optimization problem increases, the optimization ability of the proposed algorithm HEOA becomes more and more obvious. The experimental statistical results are shown in Table 11 below. The null hypothesis is constructed as: there is no significant difference between the two algorithms. The alternative hypothesis states that there is a significant difference between the two algorithms. In the experiment, HEOA based method produces better result in 36 out of 40 cases when compared with HSOA based method and produces better result in 35 out of 40 cases when compared with HWOA based method and produces better result in 38 out of 40 cases when compared with CSA based method and produces better result in 38 out of 40 cases when compared with FPA based method and produces better result in 40 out of 40 cases when compared with the PSO based method. As can be seen from the results, there are significant differences among the six algorithms. In most cases, HEOA performs better than other algorithms.

Compared with novel image segmentation method using wood fiber images
In this section, we compare with the novel image segmentation methods. The compared algorithms are PCNN [62], fuzzy c-means (FCM) [63], grayscale co-occurrence matrix (GLCM) [64]. In order to test the performance of the color image segmentation algorithms, we select the wood fibers which are taken under a high-powered microscope as the test images. The figures 8-11 show the wood fiber images and the segmentation result.
It can be seen from the figures 4-7, the result of PCNN has the over-segmentation phenomenon and the segmented images are the worst of the compared algorithms. The FCM and GLCM have the under-segmentation phenomenon and the results of the fiber images are not clear. Among the result of the fiber images, the HEOA-3DOtsu get the best result. The table 12 shows the HEOS obtains a large improvement than the others compared image segmentation methods. The recall and precision are 93.19% and 91.28% respectively. The results show that the performance of this method can provide the segmentation result of the wood fiber image. The Figure12 show the segmentation result of the proposed method. It can be seen from figure, the number of wood fiber can be seen clearly. This method obtains independent wood fiber area. So, the proposed method can segment the wood fiber images successfully and have strong robustness.

Discussion
The analysis of wood fiber graphics can understand the state of the fiber, so as to ensure the production of wood or paper that meets industrial requirements. The scholar Mainly analyze the shape and thickness of individual wood fibers. However, the wood fibers in the collected graphics are more responsible and similar to the background. Traditional segmentation methods cannot solve this problem. So, study the novel image segmentation method is necessary.
In the field of optimization algorithm, the proposed method has a good optimal ability solve the CEC2015. And the proposed method has a good competitiveness with the CSA, FPA, PSO, BA and basic EOA. Because of the hybrid optimization algorithm use the advantage of the two optimization algorithms to optimize the complex benchmark function. At the same time, the proposed method solves the threshold image segmentation and find the best threshold from the 3DOtsu. The algorithm gets the best result among CSA, FPA, PSO, BA, HSOA and HWOA. The hybrid optimization algorithms enhance the optimal ability of the original optimization algorithm.
In the field of the fiber wood image segmentation, the proposed method obtains the highest segmentation accuracy with PCNN, FCN and GLCM. The PCNN obtains the worst result in compared algorithms, the performance of PCNN rely on the set of parameters. The FCN and GLCM has strong ability to solve the grey image, however, these two methods take huge challenge to segment color image. The proposed method can overcome the difficult of color image. Finally, the proposed method obtains the wood fiber area exactly.
The limitations of the proposed method can be divided in two contents. First, similar to other optimization algorithms, this algorithm takes time to iterate to find the best solution, which is timeconsuming. Second, this method has strong performance in the field of wood fiber image segmentation. In order to make the proposed method can adopt more real area, we will study the novel optimization algorithm.
The proposed method can solve the other problem of optimization. At the same time, it can be used in the field of medical image segmentation, forest fire image segmentation and so on. In the future, we will continue to study many object multi-level threshold methods and different optimization algorithms, so as to improve the image segmentation accuracy.

Conclusions
In this paper, the HEOA algorithm is used to optimize the 3DOtsu algorithm to obtain the optimal multi-threshold image. We use GOA to improve EOA algorithm and enhance the optimization ability of the algorithm. The CEC2015 is selected as benchmark function to test the performance of the hybrid optimization algorithms. The result shows that the hybrid algorithm can enhance the optimal ability of the EOA. And then, the HEOA is compared with other optimization algorithms to jointly optimize 3DOtsu algorithm for classic images and wood fiber images segmentation experiments. From U measure, PSNR and FSIM values, it can be seen that 3DOtsu-HEOA algorithm has the best segmentation accuracy. Finally, we compare the 3DOtsu-HEOA algorithm with the novel image segmentation method. It can be seen from the segmented result that HEOA can get the best segmented result. So, the 3DOtsu-HEOA algorithm proposed in this paper has better image segmentation accuracy and better stability.