A Comparative Study of Improved Artificial Bee Colony Algorithms Applied to Multilevel Image Thresholding

Multilevel thresholding is a highly useful tool for the application of image segmentation. Otsu’s method, a common exhaustive search for finding optimal thresholds, involves a high computational cost.There has been a lot of recent research into various metaheuristic searches in the area of optimization research. This paper analyses and discusses using a family of artificial bee colony algorithms, namely, the standard ABC, ABC/best/1, ABC/best/2, IABC/best/1, IABC/rand/1, and CABC, and some particle swarm optimization-based algorithms for searching multilevel thresholding. The strategy for an onlooker bee to select an employee bee was modified to serve our purposes. The metric measures, which are used to compare the algorithms, are the maximum number of function calls, successful rate, and successful performance. The ranking was performed by Friedman ranks. The experimental results showed that IABC/best/1 outperformed the other techniques when all of themwere applied tomultilevel image thresholding. Furthermore, the experiments confirmed that IABC/best/1 is a simple, general, and high performance algorithm.


Introduction
Image thresholding is a fundamental problem when trying to extract knowledge from an image.It has been effectively applied to many types of images.The homogeneous image regions are grouped together and separated from the rest.Thresholding can be bilevel or multilevel thresholding, and both of these types can be classified into parametric or nonparametric approaches.This problem area has been receiving attention from various research groups, and hundreds of algorithms have been proposed based on that research.There are five publications in various journals that have reviewed image thresholding [1][2][3][4][5] from which a comprehensive review can be accessed.The literature review revealed that Otsu's method [6] is a commonly used technique.It is a nonparametric approach and can solve both bilevel and multilevel thresholding.This method, which finds the optimal thresholds by maximizing the weighted sum of between-class variance of the classes, is called Otsu's function [6].However, its computation is very time consuming; the complexity of the method grows exponentially with the number of thresholds.
The research carried out by Hammouche et al. has influenced the work carried out in this paper [7].Their research focused on solving the image thresholding problem by merging Otsu's function with six metaheuristic techniques.The results of [7] concluded that the differential evolution (DE) [8] was the most efficient with respect to the quality of solution and because the particle swarm optimization (PSO) [9] converged more quickly.In this paper, a new family of metaheuristic techniques is used with Otsu's function to solve the image thresholding problem.The aim of this paper is to find a single metaheuristic technique that has the same characteristics of both DE and PSO.Some researchers proposed the same criterion as [7].Kulkarni and Venayagamoorthy [10] formulated the sensor node localization to solve the image segmentation problem using PSO and the bacteria foraging algorithm (BF) [11].Both of these algorithms are faster than Otsu's method for searching the optimal thresholds of multilevel image thresholding.In 2012, Ghamisi et al. [12] proposed methods for image segmentation based on two search techniques, namely, Darwinian particle swarm optimization (DPSO) [13] and the fractional-order Darwinian particle Swarm optimization (FODPSO) [14].The results of FODPSO regarding the fitness value, standard deviation (STD), and CPU process time were better than those of its competitors, namely, DPSO, PSO, genetic algorithm (GA), and BF, especially when the segmentation level increased.
Artificial bee colony (ABC) is gaining popularity among the metaheuristic techniques because of its simplicity, generality, and remarkable performance [15][16][17][18][19][20][21][22].It was also successfully applied to image thresholding [23,24].The evolution of ABC has seen continued improvements, and it has shown good performance levels in optimization problems.Balancing exploration and exploitation during a search is a successful criterion.In that regard, a family of the five modified search equations were chosen to generate the candidate solutions.The five equations were inspired by DE and GA.Those equations were embedded in the improved ABCs, that is, "ABC/best/1" and "ABC/rand/1" proposed in [25], "ABC/best/1" and "ABC/best/2" proposed in [26], and CABC proposed in [27].Due to the fact that the equation used in ABC/best/1 in [25] is different from the equations used in ABC/best/1 in [26], this paper has renamed the algorithms in [25] to "IABC/best/1" and "IABC/rand/1, " respectively.The improved ABCs showed outstanding performance in finding solutions to the benchmarking problems.However, their ability to search the optimal image thresholding is not known.To the best of the authors' knowledge, there is no paper published that reports this problem.The no free lunch theorem (NFLT) [28] is a major consideration in the area of optimization research.The theorem states that because the prior assumptions of the optimization problem are not known, no optimization algorithm can outperform any other algorithm.A general-purpose universal optimization algorithm has been proven to be theoretically impossible.One algorithm can outperform another if the specific problem is considered under reasonable restrictions.In this research, not only the five modified ABCs but also the standard ABC and other metaheuristic searches, that is, PSO, DPSO, and FODPSO, were implemented in the multilevel thresholding to compare their capabilities.
The remainder of the paper is organized as follows.In Section 2, the multilevel thresholding problem is formulated.Section 3 deals with the overview of ABC algorithm.Details of the various versions of the ABC algorithm are presented in Section 4. Performance evaluation and experimental results are presented in Section 5.The conclusions are given in Section 6.

Multilevel Thresholding Problem Formulation
Searching the optimal thresholding is a method to minimize or maximize the objective function of the separating classes.Otsu's method [6] is based on the maximization of the between-class variance.Given the image having size  × , where  is the width and  is the height, the pixels of a given picture are represented in  gray levels, and these levels are in the range {0, 1, 2, . . .,  − 1}.The number of pixels at level  is denoted by   and the total number of pixels by  =  1 +  2 + ⋅ ⋅ ⋅ +   .The gray-level histogram is normalized and regarded as a probability distribution: The total mean of the image can be defined as The multilevel thresholding with respect to the given  − 1 threshold values   ,  = 1, . . .,  − 1, can be performed as below: where (, ) is the coordinate of a pixel, (, ) denotes the intensity level of a pixel.The pixels of a given image will be divided into  classes  1 , . . .,   in this regard.If  is two, then (, ) is called bilevel thresholding.The optimal threshold is the one that maximizes the between-class variance,  2  , which can be defined by Otsu's function: where  represents a specific class in such a way that   and   are the probability of occurrence and the mean of class , respectively.The probabilities of occurrence   of classes  1 , . . .,   are defined by ,  = . ( The mean of each class   can be given by Thus, the -level thresholding problem is transformed to an optimization problem.The process is to search for  − 1 thresholds   that maximize the value , which is generally defined as The computational complexity of ( 7) can be as large as ( −1 ) [7].This is an NP-hard problem, which means that the exhaustive search will take a very long time if  is large.

Standard Artificial Bee Colony Algorithm
The artificial bee colony (ABC) algorithm was inspired by the foraging behaviors of bee colonies.This algorithm was first proposed by Karaboga [29], and it is referred to as the standard ABC.The ABC contains three groups of bees: employed bees, onlooker bees, and scout bees.The number of employed bees equals the number of onlooker bees.The employed bees search for the food around the food sources from their knowledge.Then, they pass their food information to the onlooker bees.Each onlooker bee tends to select good food sources founded by the employed bees.It then searches for more food around the selected food source.The bees that abandon their food sources will become scout bees, and they must now search for new food sources.A description of the algorithm is given below.
where  min, and  max, are the lower and upper bounds for the dimension , respectively.The fitness of food sources   ,  = 1, 2, . . .,  will be evaluated.The counters that store the number of trials of each bee are set to 0 in this phase.

Employed Bees Phase.
In the employed bees phase, each employed bee goes to the food source in its knowledge base and finds a neighboring food source.The neighboring food source V  is defined by (9) as follows: where  ∈ {1, 2, . . ., } and  ∈ {1, 2, . . ., } are randomly chosen indexes:  ̸ =  and  , is a uniform random number in the range [−1, 1].
Fitness value for a minimization problem can be assigned to the solution V  by (10) as follows: where   is the cost value of the solution V  .Once V  is obtained, it will be evaluated and compared with   .If the fitness of V  is equal to or better than that of   ,   will be replaced by V  , and V  will become a new member of the population; otherwise,   is retained.

Calculating Probability Values Involved in Probabilistic
Selection.After all of the employed bees complete their searches, the onlookers receive the information of the food sources from the employed bees.Then, they will each choose a food source to exploit depending on a probability related to the nectar amount of the food source (fitness values of the solution).That is to say, there may be more than one onlooker bee choosing the same food source if the source has a higher fitness.The probability is calculated according to (11) as follows: The lower the   , the more probability that the  food source is selected.

Onlooker Bees
Phase.After food sources have been chosen, each onlooker bee   finds a new food source V  in its neighbourhood, following (9), just like the employed bees do.If a new food source has better food than   , the new food source will replace   and become a new member in the population.

Scout Bees Phase.
A greedy selection mechanism is employed between the old and candidate solutions of the employed and the onlooker bees phases.The trials counter of food will be reset to zero if the food source is improved; otherwise, its value will be incremented by one.In the scout bees phase, if the value of the trials counter of a food source is greater than a parameter, known as the "limit, " the food source is abandoned and the bee becomes a scout bee.A new food source will be produced randomly in the search space using (8), as in the case of the initialization phase.The trials counter of the bee will be reset to zero.

The Various Artificial Bee Colony Algorithms
To enhance the performance of ABC, some modifications to the classical ABC algorithm have been made; the details of these modifications are as follows.

The Modified Probabilistic Selection Phase for the Maximization
Problem.The original ABC was designed for minimization problems.However, multilevel thresholding is a maximization problem.Thus, some modifications are required.An onlooker bee will choose a food source in a different way to (10) and (11).That is, an onlooker bee will randomly choose a food source with a probability value   , which is calculated by the following form: where  2  is obtained from Otsu's function of the solution ,  2  best is the best  2  among the employed bees population.As per (12), a higher between-class variance  2  computed by (4) obtains a higher probability.Thus, ABC can solve the maximization problem.That means that if the probability is calculated by (12), then the information from the elite employee bees that have higher between-class variances is passed to the onlooker bees.

Various Search Equations.
Search equations are usually beneficial to the performance of metaheuristic techniques.The standard ABC is good at exploration but poor at exploitation [25][26][27].The modified search equations were accordingly proposed to address this problem.A family of search equations have been suggested to create a new value of the randomly selected dimension  ∈ {1, 2, . . ., } of the candidate food source V  .The family of search equations are as follows.
Gao et al. [26] borrowed the mutation strategies of DE [8] to modify the solution search equation and proposed two global best-guided artificial bee colony algorithms; the search equations are shown as follows: ABC/best/2: where the indices 1, 2, 3, and 4 are mutually exclusive integers randomly chosen from {1, 2, . . ., } and different for the base index ,  best is the best individual vector with the best fitness in the current population, and  , is a random number in the range Gao and Liu [25] also included the other mutation strategies of DE [8] to ABC and proposed two strategies for improved artificial bee colony algorithms (IABC/best and IABC/rand), the equations for which are shown as follows: IABC/rand/1: where the indices 1 and 2 are distinct integers uniformly chosen from the range {1, 2, . . ., }, 1 ̸ = , 2 ̸ = ,  best is the best individual vector with the best fitness in the current population, and  , is a random number in the range [−1, 1].
Gao et al. [27] brought the crossover operator of GA [30] to improve ABC.Their new search equation is as follows: where the indices 1 and 2 are distinct integers uniformly chosen from the range {1, 2, . . ., }, 1 ̸ = , 2 ̸ = , and  , is a random number in the range [−1, 1].This search equation is similar to the crossover operator of GA and is called CABC.

Procedure of Various Artificial Bee Colony Algorithms
for Multilevel Image Thresholding.This subsection shows the pseudocode of the five modified ABCs which apply to the image thresholding selection.The most important changes to these algorithms were the creation of a new candidate solution in each.Thus, the modified probabilistic selection phase and modified search equations from the previous subsections will be reformed in the pseudocode.In summary, IABC/best/1 is depicted as Algorithm 1.The four remaining algorithms have the same structure as of IABC/best/1, but line 09 and line 24 are different.
The Evaluate(⋅) functions at lines 02, 10, 25, and 41 are performed by Otsu's function, (4).Line 09 and line 24 of IABC/best/1 algorithm produce new candidates using the search equation (15).The algorithm can be performed as ABC/best/1, ABC/best/2, IABC/rand/1, or CABC algorithms by replacing ( 15) with ( 13), ( 14), (16), or (17), respectively.When the algorithm is applied to multilevel image thresholding,  is the number of thresholds.A food source represents a candidate -threshold values.Once the algorithm terminates, the best food source is the solution, and the optimal threshold is the expected outcome.At this point in time, there are six algorithms where the standard ABC is included.Hence, the six-ABCs refers to them from now on.

Experimental Setup.
The multilevel thresholding problem deals with finding optimal thresholds within the range [0,  − 1] that maximize a fitness criterion.The dimension of the optimization problem is the number of thresholds, , and the search space is [0,  − 1]  .Five new metaheuristic algorithms, that is, ABC/best/1, ABC/best/2, IABC/best/1, IABC/rand/1, and CABC, have never been applied to image thresholding before.These techniques are implemented and compared with the existing metaheuristics that perform image thresholding, that is, PSO, DPSO, FODPSO, and ABC algorithms.All methods were programmed in MATLAB on a personal computer with a 3.2 GHz CPU with 8 GB RAM running on a Microsoft Windows 7 system.Experiments were conducted on 12 real images.The images, namely starfish, snow, fox, human, burro, mountain, girl, scenery, penguin, pillar, waterfall, and bridge, were taken from the Berkeley Segmentation Dataset and Benchmark [31].Each image has a unique gray level histogram.These original test images and their histograms are depicted in Figure 1.The segmented images, with regards to their optimal thresholds (listed in Table 2) are depicted in Figure 2. A subproblem refers to a process of an image thresholding with respect to a given number of thresholds.The numbers of thresholds investigated in the experiments were two to five.Thus, the total number of sub-problems is 12 × 4. Each sub-problem was repeated 50 times per image, and each time is called a run.
With reference to the six-ABCs and PSO algorithms, the objective function evaluation is computed for   ×   , where   is the population size and   is the number of generations.A PSO particle calls Otsu's function one time per generation.The population size in the PSO algorithm was set to 50.A bee in the six-ABCs calls Otsu's function two times per generation their numbers of food sources were set to a half of the PSO's size, 25.As for the DPSO and FODPSO algorithms comprising of 25 particles with 4 swarms, their objective function evaluations per generation are twice those of the six-ABCs and PSO.In this regard, the number of generations cannot be used as a metric for algorithm comparison, but the NFC is comparable.The other control parameters of PSO, DPSO, and FODPSO are tabulated in Table 1.The maximum number of generations was set to 50, 100, 150, and 150 when  is 2, 3, 4, and 5, respectively.

Comparing Strategies and Metrics.
To minimize the effect of the stochastic nature of the algorithms on the metrics, the reported number of function calls for each sub-problem is the average or the maximum value over 50 runs.In this study, three metrics, namely, the maximum number of function calls (NFC max ), successful rate (SR), and successful performance (SP), have been utilized to compare the algorithms.The convergence speed was compared by the measurement of the maximum number of function calls NFC max .A smaller NFC max means higher convergence speed.The termination criterion of an algorithm is generally to find a value smaller than the value to reach (VTR) before reaching both the maximum number of function calls NFC max and the maximum number of generations.The VTR in this research is the maximum between-class variance when the optimal thresholds were obtained from Otsu's method.Finding the NFC max is a priority.Once all 50 runs were completed, the runs that reached the optimal solutions within the maximum number of generations were selected.These were called the successful runs.The maximum value of their NFCs represents the NFC max .The average of NFC max represents the NFC max .
The ratio for which the algorithm succeeds in reaching the VTR for each sub-problem is measured as the successful rate.SR is SR = number of successful runs total number of runs .
Furthermore, the average successful rate (SR avg ) over the entire data set per sub-problem is calculated as follows: where SR  represents the SR of each image of each subproblem, and  represents the number of images.The highest SR and the lowest NFC max are the ultimate goals in an optimization process.Therefore, two individual objectives must be considered simultaneously.In order to produce a single measure, called successful performance (SP), the two measures mentioned above have to be combined; this gives the following: The SP is the main measure in judging which algorithm performs better than others.

Results of Otsu's Method.
The VTR and optimal thresholds provided comparative experimental results as shown in columns 3 and 4 in Table 2.The results were as same as the optimal values of the nine metaheuristic techniques.However, the number of Otsu's function evaluations, in the case of an exhaustive search method based on Otsu's method, is !/(( − )!!), where  is the total number of gray-levels (usually 256) and  is the number of thresholds.For instance, when  = 256 and  = 1, the number of objective function evaluations is 256, and when  = 256 and  = 2, it is 32640.Thus, the computational complexity of Otsu's methods is (  ) which grows exponentially with the number of thresholds.The computation time of a sub-problem with  = 5 took over 10 days to compute on our test machine.

Stability Analysis.
In general, the metaheuristic methods are stochastic and random searching algorithms.The results are not absolutely identical in each run of the algorithm and are influenced by the searching ability of the algorithm.As a result, it is necessary to evaluate the stability of the algorithms.The comparison of the convergence gives us valuable information in terms of the ratio representing the successful rates (SR) in Table 2. Table 2 presents the number of thresholds, the maximum between-class variance or VTR, the optimal threshold values, successful rates (SR) of the 50 independent runs, and the maximum number of function calls (NFC max ).The average successful rate for each sub-problem SR avg is shown in Table 3.The last row and respective column of Table 3 show the averages from all of the experiments.A higher SR means a higher stability.From the results, the stability of each algorithm can be sorted in decreasing order by SR avg into the following order: IABC/best/1, ABC/best/2, ABC/best/1, IABC/best/2, ABC, PSO, DPSO, CABC, and FODPSO.This means that the IABC/best/1 is the most stable metaheuristic algorithm when compared to the others.

Convergence Rate Comparison.
The maximum numbers of NFC of the successful runs are listed in Table 2.A smaller NFC max means a higher convergence rate.The average of NFC max for each sub-problem is shown in Table 3.The last row and respective column of Table 3 show the average of each NFC max from all of the experiments.From the results, the convergence rate can be sorted in decreasing order by NFC max into the following order: IABC/best/1, ABC/best/1, ABC/best/2, IABC/rand/1, CABC, PSO, ABC, DPSO, and FODPSO.This means that the IABC/best/1 has the highest convergent rate when compared to the other algorithms.The results also revealed that the NFC max increases significantly as the number of thresholds increases.

Performance Comparison.
Scatter plots helped to reveal the relationships between the variables.There are four figures, one figure per threshold number; that is, Figure 3 is for  = 2, Figure 4 is for  = 3, Figure 5 is for  = 4, and Figure 6 is for  = 5.Each figure is constructed using two data sets, the successful rates (SR) versus the maximum number of function calls NFC max of all competitors from Table 2 and the average successful rates (SR avg ) versus the average of NFC max (NFC max ) from Table 3; the locations are pointed to using arrows.Those locations represent the average performances over twelve tested images of the algorithms.Some of the algorithm's labels are not shown because its NFC max is much larger than that of the others, and therefore, they are out of range.To interpret a figure, a lower NFC max and a larger SR imply a higher performing algorithm in the search for optimal thresholds.This relationship can be seen as a point at the topleft of each scatter graph.Due to the fact that all of the scatter graph results are so similar, only information regarding the IABC/best/1 will be interpreted.In Figures 3 to  6, it was realized that the positions of IABC/best/1 are closer to the left-top corners than those of the other techniques for all the figures.This means that IABC/best/1 outperformed its competitors.
However, if there is a lot of data, the conclusion from the previous paragraph may not be so clear.Therefore, a new tool is required.The successful performance (SP) is a measure that considers the maximum number of function calls and the successful rate simultaneously, as listed in Table 4.The best SPs are highlighted in boldface.To rank the algorithm by successful performance, an average ranking of Friedman ranks [32] was used to compare the performance.The average ranks are shown in the last row of Table 4.A smaller rank means a better performance.We noticed that the SPs of the nine algorithms can be sorted in decreasing order by average ranking into the following order: IABC/best/1, ABC/best/1, ABC/best/2, IABC/rand/1, CABC, PSO, ABC, DPSO, and FODPSO.The best average ranking was obtained by the IABC/best/1 algorithm, which outperformed the other eight algorithms.

Conclusions
This paper adopted the ABC algorithm to solve the maximization problem by modifying the strategy of the elite employee bees selection.Five methods for multilevel segmentation of images were presented, namely, ABC/best/1, ABC/best/2, IABC/best/1, IABC/rand/1, and CABC.These methods were used to solve the Otsu problem for examining multilevel threshold values of images and to overcome the disadvantages of previous metaheuristic methods in terms of          IABC/best/1 algorithm widely outperformed the other algorithms in terms of successful performance, computation efficiency, and stability.Another advantage of the ABC algorithm is that it has fewer control parameters than those of PSO.The experiments confirmed that IABC/best/1 is a simple, general, and high performance algorithm.Future research is to be carried out to test the feasibility of IABC/best/1 algorithm for various types of image processing applications such as remote sensing applications, automatic target recognition, and complex document analysis.

Figure 1 :Figure 2 :
Figure 1: The test images and corresponding histograms.

Figure 5 : 4 .
Figure 5: The successful rate (SR) and maximum number of function calls (NFC max ) of the nine methods with the number of thresholds = 4.

Figure 6 :
Figure 6: The successful rate (SR) and maximum number of function calls (NFC max ) of the nine different methods with the number of thresholds = 5.

Table 2 :
The successful rate (SR) and maximum number of function calls (NFC max ) of the nine methods.

Table 3 :
The average of successful rates (SR avg ) and average of maximum number of function calls (NFC max ) of the nine methods.

Table 4 :
The successful performance (SP) and ranks of the nine methods.
The successful rate (SR) and maximum number of function calls (NFC max ) of the nine methods with the number of thresholds = 2.The successful rate (SR) and maximum number of function calls (NFC max ) of the nine methods with the number of thresholds = 3. exploration and exploitation.The performance of the algorithms was tested with 12 standard test images and compared with the ABC, PSO, DPSO, and FOPSO methods.The ranking was performed by Friedman ranks.The segmentation results obtained from various test images showed that the