A minimum cross-entropy multi-thresholds segmentation algorithm based on improved WOA

. Minimum cross-entropy is widely used in image segmentation for its effectiveness. However, when the algorithm is applied to multi-threshold segmentation, there are some problems such as large amount of calculation, time-consuming and poor practicability due to exhaustive search for the optimal threshold. Therefore, in this paper, a hybrid whale optimization algorithm (IWOA) which incorporates whale optimization algorithm (WOA) and invasive weed optimization (IWO) is proposed and the minimum cross-entropy is used as the fitness function of optimization algorithm to select the optimal threshold. It is established that IWOA algorithm is able to select the optimal threshold in more accuracy and segment high quality image than other algorithms.


Introduction
Image segmentation is of great significance to extract a region of interest from the image and pave the way for subsequent image processing [1]. The threshold segmentation problem can be regarded as a single objective programming problem or a multi-objective programming problem according to the number of thresholds. The Whale Optimization Algorithm [2] (WOA) selected in this paper is one of the new swarm intelligence optimization algorithms, which has strong optimization ability. The optimization algorithm also has the problem of falling into local optimum in the process of solving the global optimum and the convergence rate decreases in the later stage.
Based on WOA and Invasive Weed Optimization [3] (IWO), this paper improves the algorithm to enhance WOA optimization ability and accuracy. Improved WOA has stronger global and local search ability. IWOA selects the minimum cross-entropy as the objective function and transforms the multi-threshold segmentation problem into multi-objective optimization problem. IWOA, WOA, IWO and PSO are applied in multi-threshold segmentation task in comparison.
According to the bionic principle that whales use bubble-net hunting strategies for hunting activities, WOA proposes three location update strategies: Encircling prey, Bubble-net attacking method and Search for prey. It can be described as follows.

Encircling prey
In order to share the information of prey, WOA assumes that the current optimal solution is the global optimal solution, and other whales approach the one that approached the prey, thus shrinking the net to encircle their prey. The Position of whales can be computed using: where * ( ) X t represents the global optimal solution. Here t indicates the current iteration. and are the coefficient vector, their equations are as follows: where a is convergence factor, it decreases linearly from 2 to 0 during iteration. 1 r and 2 r as two parameters, they are random numbers in [0,1] and obey the normal distribution.

Bubble-net attacking method
The whale approached the target through a spiral search. The position updating function of the whale is where b is a constant variable. l is a random number in [-1,1].

Search for prey
In this phase, algorithm tries to search a random position rather than best position. The equation expression as follows.
t is a random individual in current population. When A>1, the whale random search to enhance global search capability. When 1 A ≤ the whale narrow their search scope, according to a random number of [0,1], determine whether the update method is Encircling prey or Bubble-net attacking method.

An Improved Hybrid WOA with IWO
Invasive Weed Optimization (IWO) is a new intelligent optimization algorithm proposed by Mehrabian et al. IWO [4] algorithm propagates multiple offspring from individuals with excellent fitness and the offspring are randomly distributed around the parent in the form of normal distribution. The offspring and those individuals are sorted by fitness [5]. When the population number exceeds the set maximum value, the individuals that meet the maximum population number are retained according to the competitive exclusion rules.
In the IWO algorithm, the individual with better fitness values will propagate more offspring. The number of offspring can be calculated as follows.
where max s and min s are the maximum and minimum number of the population. Here i f is the fitness of the current fitness, best f and worst f are the maximum and minimum fitness value of individual in the current population.
The produced individuals are normally distributed, which is given in Eq. (6).
where init σ and final σ represent the initial and final standard deviation values. Here n is a nonlinear adjustment factor and max iter is the maximum number of iterations.
According to the proposed IWO, the basic WOA's optimization ability has been improved, it also can effectively avoid the basic WOA falling into the local optimum.

Multi-threshold segmentation based on IWOA
The concept of cross entropy was first proposed by Kullback. The strategy [6] of minimum cross-entropy threshold segmentation is: the sum of foreground entropy and background entropy of optimal threshold is the minimum [7]. The gray level of image histogram is set in the range of [1, L+1], and the threshold t divides the image into foreground and background [8]. The cross-entropy model is usually defined as follows.
where ( ) h i represent the image histogram. According to the Eq. (7), the minimum cross entropy formula can be defined as follows. The optimal threshold is determined by searching for the minimum entropy value. It can be described as follows.
When generalizing to multi-threshold tasks, find a set of thresholds [ 0 1 , ,..., n t t t ] to minimize the total entropy value.

Experimental results and analysis
The experimental hardware platform is: Intel i5-9300H, 8G ram, 2.4GHz, 64-bit system and Matlab R2018b for the programming language.
In this paper, we choose image #296059, #3096 and #42049 from Berkeley Segmentation Dataset. Set threshold number M = 1, M = 2, M = 4 and M = 6, the results of image segmentation by IWOA is as follows in figures 1-3.  With the increase of threshold number, the more information of image contains, which indicates that a large amount of information can be extracted from the image. It is also established that IWOA can obtain better image segmentation effect.
The algorithm takes the minimum cross-entropy as the fitness function, and the fitness curve can be obtained, in iterations. In order to verify the effectiveness of IWOA, we chose WOA, IWO and PSO for comparison. We choose image #296059, set threshold numbers M=2 and M=6, fitness value curve of four algorithms as follows in figure4. Figure 4 shows that compared with other algorithms, IWOA is not easy to fall into the local optimal value and IWOA can find the global optimal value faster, in iteration.  shows that compared with other algorithms, IWOA is not easy to fall into the local optimal value and IWOA can find the global optimal value faster, in iteration.
Peak signal to noise ratio (PSNR) is an objective criterion for evaluating images. The higher the PSNR value, the better the image segmentation effect. Figur 5 shows the PSNR of three images under different segmentation thresholds.

Fig. 5. Comparision of PSNR values for different algorithms.
From figure 5, when the number of threshold is 2, it can be seen that the proposed IWOA and other compared algorithms has same PSNR values. With the increase of threshold number, the IWOA shows better PSNR values. Especially when the test picture is complex, the IWOA shows more accuracy.

Conclusion
In this paper, a multi-threshold segmentation method based on IWO algorithm is proposed. WOA will aggregate to the local optimal value with the increase of iteration times, so it is easy to precocious, poor convergence and reduce the diversity of population. IWO algorithm can strengthen the local search around the better individual and take into account the population diversity. Combining it with WOA, the optimization accuracy of IWOA is improved. In this paper, a series of experiments are carried out with three images, and the comparison is made for other optimization algorithms which demonstrates the effectiveness of our modifications.
The work presented in this paper is supported by the Plateau Disciplines in Shanghai.