Flame Image Segmentation Based on the Bee Colony Algorithm with Characteristics of Levy Flights

The real-time processing of the image segmentation method with accuracy is very important in the application of the flame image detection system. This paper considers a novel method for flame image segmentation. It is the bee colony algorithm with characteristics enhancement of Levy flights against the problems of the algorithm during segmentation, including long calculation time and poor stability. By introducing the idea of Levy flights, thismethod designs a new local search strategy. By setting the current optimal value and based on the collaboration between the populations, it reinforces the overall convergence speed. By adopting the new fitness evaluation method and combining it with the two-dimensional entropy multithreshold segmentation principle, this paper develops a threshold segmentation test of the flame image. Test results show that this method has some advantages in terms of accuracy of threshold selection and calculation time.The robustness of the algorithmmeets the actual demands in the engineering application.


Introduction
Image segmentation is one of the key technologies in the field of image processing [1].It aims to separate the target area of interest from the complex image background region for high-level vision technology processing, including target tracking, detection, and recognition [2].The quality of image segmentation directly affects the accuracy and effectiveness of the subsequent processing.An important segmentation method, threshold segmentation, has been widely applied in engineering because of its simple, intuitive, efficient, and practical characteristics [3].Threshold segmentation remains to be a topic challenge due to the complexity of image information [1].
The typical threshold segmentation method covers the minimum error method [4], the largest category among the poor (Otsu) [5], the image maximum entropy method [6], and so forth.These methods are designed to identify the optimal threshold value by selecting the proper segmentation principle and costing longer calculating time.In recent years, with the development of information entropy, the image entropy threshold segmentation algorithm has been widely used for image segmentation.Kapur et al. [6] effectively developed threshold segmentation using onedimensional gray maximum entropy; however, this algorithm is sensitive to noise.To overcome its sensitivity to noise, Brink [7] improved the algorithm into two-dimensional entropy threshold segmentation.This method makes full use of the gray information and local space information of the image to obtain better segmentation results; however, this method entails long consumption time.In fact, most threshold segmentation methods take much more time, and multithreshold segmentation involves huge computation and long calculating time with a large memory.For the above problems, many scholars have proposed optimization by combining multithreshold segmentation method with optimization algorithm.Chen et al. [8] developed twodimensional entropy multithreshold rapid image segmentation to improve the segmentation of complex images and multitarget images.Lan and Zeng [9] proposed multithreshold segmentation by combining the genetic algorithm (GA) and the improved maximum fuzzy entropy.The literature [10] also recounts the development of a rapid image segmentation method based on the particle swarm and two-dimensional Otsu.Particle swarm optimization (PSO) is designed to improve the segmentation effectiveness of two-dimensional Otsu and enhance its practical performance.The literature [11] also discusses the development of flame image threshold selection based on reciprocal cross-entropy and bee colony optimization for a more accurate segment flame image.These methods improve the speed to identify multiple thresholds, but they also have their own limitations, including the ease with which they are trapped in a local extreme value and slow convergence in late stages in process of the algorithm to find the best threshold values, which affect the accuracy of the segmentation results.The work [12] discusses resilient particle swarm global optimization algorithm based on chaos and two-dimensional cross-entropy threshold segmentation, and the algorithm is also based on the decomposition as a means of escaping the local extreme value, which uses the ergodic features of chaos to improve the convergence accuracy of the particle swarm algorithm.The self-adapting strategy of flight speed is adopted to enhance the ability to escape the local extreme value and to improve the convergence speed and accuracy.However, the particle swarm algorithm involves many parameters and has a complex structure, so that the accuracy of optimization can still be greatly improved [13].
This paper develops a bee colony based algorithm with the characteristics of Levy flights (LFABC) for two-dimensional entropy threshold optimization problem in flame image segmentation.The LFABC algorithm aims to enhance accuracy, convergence rate, and robustness of the artificial bee colony (ABC) algorithm [14].The LFABC enhances the local development of the algorithm and its ability to escape the local optimal restriction by introducing the improved local and global search strategy and new fitness evaluation method based on the ABC algorithm.Through collaboration between populations, the convergence of the algorithm is accelerated, thereby increasing the efficiency.

Problem Formulation
Suppose that a digital image  with the size of × is given.(, ) refers to the gray value of a pixel at coordinate (, ) in the image, where 0 ≤  ≤ , 0 ≤  ≤ , and  is the gray level of the image.Image  is defined as the mean gray image in the  neighborhood of image .(, ) indicates the mean gray value in the  ×  neighborhood of the pixel to which the coordinate (, ) in the image  corresponds.(, ) is defined as (, ) = (1/ 2 ) ∑ /2 =−/2 ∑ /2 =−/2 ( + ,  + ), where  = 3,  is the gray value of image  in pixel (, ), and  is the mean gray value of the neighborhood of image  in pixel (, ).  is defined as the frequency of binary (, ), on the basis of which the two-dimensional histogram is established, as shown in Figure 1.
The horizontal coordinate refers to the gray value of the image.The vertical ordinate refers to the mean gray value in the neighborhood of the image.  is defined as the joint probability density of the gray value  in the two-dimensional histogram and the mean gray value  in its neighborhood, and   is defined as   =   /( × ), where ,  = 0, 1, . . .,  − 1, 0 ≤   ≤ 1, and ∑ −1 =0 ∑ −1 =0   = 1.As shown in Figure 1, the threshold value (, ) is given to divide the image into four rectangular zones, which are , respectively.They are represented as follows after normalization: The two-dimensional entropy   of the category of background   can be shown as follows [7]: The two-dimensional entropy   of the category of target   can be shown as follows [7]: Mathematical Problems in Engineering 3 The sum of the two-dimensional entropies of the category of the target and the category of the background is [7] By the image of two-dimensional entropy modeling, a two-dimensional histogram was established; the threshold value (, ) is given to divide the two-dimensional histogram into four rectangular zones, which are recorded as Regions 1, 2, 3, and 4. The smaller the difference of gray level pixel within class, the greater the two-dimensional entropy.When the corresponding two-dimensional entropy is bigger, the distribution of gray level within class is more uniform; the paper maximizes two-dimensional entropy of target and background classes to realize the image segmentation.
When we maximize (, ), the gray level pixel of the object and background is most uniform.The maximum two-dimensional entropy thresholding method determines the optimal threshold ( ṡ , ṫ ) by maximum two-dimensional entropy based on In our proposed algorithm, we try to obtain this optimum 2-dimensional vector ( ṡ , ṫ ) which can maximize (4).As the algorithm of LFABC is designed to solve maximization problems, we revise the objective function as the reciprocal of ( ṡ , ṫ ) and try to maximize it.

ABC Algorithm with the Characteristics of Levy Flights
3.1.Related Work.In a bee colony, some tasks are executed by particular bees.These particular bees attempt to maximize the nectar saved in the honeycomb through a highly efficient division of labor and self-organized behavior.The ABC [13] algorithm consists of the honey-gathering bees, observation bees, and scout bees.Half of the bee colony consists of honey-gathering bees, and the other half consists of observation bees.Honey-gathering bees are responsible for the collection of honey and transmission of messages to other bees (observation bees) in the honeycomb.They develop food sources and evaluate the quality of the nectar in the food sources.Observation bees wait in the honeycomb and decide on the development of the food sources based on the information shared by honey-gathering bees.Whether or not scout bees randomly search and identify a new food source in the surroundings depends on the internal motivation of the bees, possibly an external clue.This kind of intelligent foraging behavior characteristic of bees can be summarized as follows [14].(1) Before foraging, the bees randomly search for food sources in their surroundings.(2) After finding food sources, the bee becomes a foraging bee, starts to discover food sources, and brings back honey to the honeycomb.After unloading the honey, the bee can directly return to the food source or share information on such sources by following a dance pattern of "8" in the dancing area.If its food source information is not valued, it becomes a scout bee and randomly searches for a new food source.(3) Observation bees wait in the honeycomb and select food sources by observing dances.The frequency of the dances is directly proportional to the quality of the food sources.

Levy Flights.
The Levy flight model was developed by the German physicist Dirk Brockmann [15] in 2004.In his studies, Brockmann formulated the law of the circulation of paper money.That is, paper money is exchanged just in a small region most of the time.However, a small percentage of the paper money is circulated in far regions.This is the so-called law of power function distribution-the small probability of things having a serious impact.Levy flight is a kind of random walking process.Its step length is a kind of continuous heavy-tailed distribution, which is a stable distribution.Later, some scholars believed that this principle is similarly applicable to the patterns of animal behavior [16][17][18][19].In nature, animals always look for food in a random or quasi-random pattern.The flight behaviors of many animals and insects indeed verify the typical features of Levy flights.Reynolds and Frye [19] have conducted much research on the behavior of fruit flies to explore their vision.Their results show that the flight of fruit flies consists of a series of flight lines with 90 ∘ sudden turns.This is a Levy flight free-search model in an intermittent scale.Levy flights have also been subsequently applied in most optimization tasks and optimization searches [20].The results show that Levy flights have excellent performance.

Our
Proposed Approach: LFABC.The performance of the algorithm depends on the local search and global search capability.The search method of honey-gathering and observation bees for the ABC algorithm is where   refers to the randomly generated  food source and  ̸ = ,  ∈ {1, 2, . . ., SN}, and  ∈ {1, 2, . . ., }.SN refers to the number of food sources.  is a random number, and   ∈ [−1, 1].In the ABC algorithm, the search step of the bee is (  −   ).A food source  is selected in the surroundings of food source .The probability of the randomly selected food source being good is the same as that of it being bad.As such, the local developing ability of the algorithm is poor, and it may possibly be involved in the local extreme value, thereby affecting the speed of the global convergence of the algorithm.Levy flights are introduced into the foraging behaviors of honey-gathering bees to enhance the local development of the algorithm and reinforce the ability to escape from the local extreme value.Moreover, the improved ABC algorithm introduces the global optimal solution and individual extreme into the search mode of
Step 2. discard solution, upper limit of the iterations MSN.
Step the observation bees.The collaboration between the populations further improves the global convergence of the algorithm.
The pseudocode of the LFABC algorithm is shown in Pseudocode 1.Its stages are listed below.
Stage 1.To initialize, the population size is expressed by , and the dimension of the solution space is .The numbers of the honey-gathering bees, observation bees, and food sources are SN; here SN = /2.The initial iterations are Cycle = 1; the maximum cycle time is CM.Based on (6), /2  food source vector is randomly generated in the solution space {  = ( 1  ,  2  , . . .,    ) |  = 1, 2, . . ., /2}, and ( 7) is designed to evaluate the quality of nectar: fit  =  (  ) , where  max and  min refer to the upper and lower limits of the solution space and fit  refers to the fitness of food source .
Its value is directly proportional to the quality of nectar in the corresponding position.The target function (  ) is directly used to measure the quality of the solution, thereby ensuring that the algorithm well adapts to the engineering applications.
Stage 2. Honey-gathering bees randomly search /2 candidate food sources by means of Levy flights.Equation (7) greedily selects new and old food sources and generates new food sources.The Levy flight method is used to obtain new solutions.The new solution   ( + 1) generated from  iterations is given by where  = 1, . . ., SN and  = 1, . . ., .SN is the number of food sources and  is the number of optimization parameters. > 0 is the amount of the step control.Its value is related to the scale of the question; here  = 0.01.The product ⊗ means entrywise multiplications.The step length depends on the random number of the Levy distributions [21]: Levy ⊗  =  − , (1 <  ≤ 3), which has an infinite variance.Here, the consecutive jumps/steps of a bee are essentially from a random walk process which obeys a powerlaw step-length distribution with a heavy tail.According to the characteristics of Levy distribution, the bees will make exploratory walks in short distance for local search, but they may walk a long distance occasionally.Therefore part of the solutions will search near the optimal value, fully developing the food source, thereby speeding up the local search, but a part of them will search far enough space away from the current optimal solution.This way ensures that the algorithm does not fall into local optimum.
The equation for calculating the selection probability   of each food source is where fit  is the fitness of food source  and it is defined by (7).
The observation bees adopt (10) to update the solution.The calculating equation is as follows: where  ∈ [−1, 1] and  best refers to the optimal solution of the current.In the process of optimization, each food source is moving closer to the best position.Through the cooperation between populations, the convergence of the algorithm is accelerated, thereby increasing the efficiency.
Stage 4. If the quality of nectar in a food source cannot be increased in the pointed iterations, the leading bees in the corresponding position become observation bees.A new food source is generated randomly in the solution space based on (11), and bees greedily select new and old food sources and remember the best.Equation ( 11) is given by where  = 1, . . ., .  is the number of optimization parameters.  ∈ (−1, 1),   new refers to the position of the randomly generated new food source, and   min and   max refer to the upper and lower limits of the solution space, respectively; here   min = 1 and   max = 255.When the generated   new value is beyond the range, the corresponding extreme value is taken.

Stage 5. Proceeding to
Step 2, the updated optimal solution of this cycle is saved, and Cycle plus 1 automatically.If Cycle is up to CM, the circling is stopped.Finally, the obtained optimal threshold value is used to segment the image.
Pseudocode 1 shows the pseudocode of the LFABC algorithm.Steps 1, 2, and 3 deal with the initialization phase of the algorithm.Steps 5, 6, and 7 deal with the behavior of the honey-gathering bees.Steps 8 and 9 deal with the behavior of the observation bees.Steps 10, 11, and 12 deal with the behavior of the scout bees.

Experimental Result and Analysis
To verify the segmentation effect of the flame image segmentation method based on two-dimensional entropy and LFABC algorithm and its advantages in the calculating speed, this study adopts the flame image in constructing the segmentation test and compares it with the test results using twodimensional exhaust segmentation, PSO two-dimensional entropy segmentation, and ABC two-dimensional entropy segmentation for verifying the performance of the algorithm.The test environment for the simulation consists of Windows 7 Intel Core i3-2348M CPU, 2.30 GHz main frequency, and 4 G memory and the programming environment for Microsoft VS2010 VC++ and OpenCV 2.9.10 is used to achieve algorithm code.
This paper also uses the misclassification error (ME) as the segmentation test standard.ME can directly reflect the proportion of the incorrectly classified image background pixels to the front regions.The method of calculating it is given by where   and   refer to the background in the image and standard binary mask in the target region, respectively.  and   refer to the background region and target region in the image after segmentation, respectively.∩ refers to the number of pixels in overlapping part and ∑ collects the number of pixels of   ∩  ,   ∩  ,   , and   .In the actual segmentation test, the researcher artificially makes the standard binary mask after observation.Based on our experience, if the image segmentation effect is better, the intersection of the same regions before and after segmentation (i.e., target or background) is larger, and the ME value is smaller based on the equation.

Segmentation Result of Flame Image.
The flame image is 500 pixels × 400 pixels.The segmentation result of the flame image is shown in Figures 2 and 3, where (a1) and (a2) refer to the original gray image (b1) and (b2) refer to the standard binary mask image; (c1) to (f1) and (c2) to (f2) refer to the segmentation results of two-dimensional exhaust segmentation, PSO two-dimensional segmentation, ABC two-dimensional segmentation, and LFABC two-dimensional segmentation, respectively.In many experiments, the parameters of the algorithm are set as follows: the number of populations  = 20, the number of food sources SN = 10, the dimension of the solution space  = 2 to judge if the maximum cycle times being involved in the local extreme value are Limit = 10, and the maximum number of iterations Cycle = 100,  = 0.01, and  = 1.8.Figures 2 and 3 show that the PSO and ABC segmentation methods are not sufficiently accurate with regard to the left corner of the image.The exhaust segmentation algorithm and LFABC segmentation have better segmentation effect than the above two methods.Tables 1 and 2 show that the exhaust segmentation algorithm requires too long of a time in terms of CPU processing, so it cannot adapt to the processing of

Analysis of Stability and Convergence.
The stability and convergence of the algorithm are the essential indices for measuring the performance of the algorithm.For further analysis and comparison of the performance of the algorithm, set Cycle = 1500 to make the statistical analysis of the data obtained from 30 runs of the experiment.The convergence of the ABC and LFABC algorithms can be directly expressed using the correspondence between the main function value and iterations of the algorithm, as shown in Figure 4. Figure 4 shows that the convergence of the ABC algorithm is more rapid at 100 to 300 iterations.However, it becomes involved in the local optimization in the range of 0-100 and 300-1200, thereby affecting the overall convergence of the algorithm and causing inaccurate results.The improved LFABC algorithm has more excellent optimization performance.It is also involved in the local optimization, but it rapidly escapes the local extreme value, the convergence is greatly increased, and the accuracy of the function is also improved.
Moreover, the concept of mean square error (MSE) in mathematical statistics is introduced to facilitate the quantitative analysis of the data in the experiments.In mathematical statistics, MSE [22] refers to the expected square difference between the estimated and real values.MSE is a more convenient method of measuring the mean error.It can evaluate changes in the data.If MSE is smaller, it indicates that the experimental data have better stability.The calculation of MSE is given by where   and  avg refer to the standard and mean standard deviation of the main function value of  experiment, respectively.  collects the standard of the main function value in each run. avg collects the average of   over thirty different runs of ABC, LFABC.In Table 3, the best, worst, and mean refer to the minimum, maximum, and mean MSE value as given by 30 runs of the experiment, respectively.Table 2 also shows that the MSE value in the 30 runs of the experiment using the LFABC algorithm is smaller than that using the ABC algorithm.The LFABC algorithm has stronger stability and a certain measure of robustness.

Conclusion
We studied the problems of two-dimensional entropy threshold segmentation.We developed a flame image segmentation method based on the ABC algorithm with the characteristics

Figure 1 :
Figure 1: The two-dimensional histogram of the gray and the average gray value of the field.

(Figure 2 :
Figure 2: Thresholding results of the flame image.
* scout bees * / Step 10.For  = 1 to SN If (limit ≥ MSN) Discard solution, (9) is used to obtain the new solution.

Table 1 :
Comparison of ME values and consuming time of CPU using several methods for flames (image 1).

Table 2 :
Comparison of ME values and consuming time of CPU using several methods for flames (image 2).

Table 3 :
Comparison of the MSE of the main function between the ABC and LFABC algorithms (30 runs of the experiment).The experimental results show that this algorithm can better segment images and have rapid convergence and short run time, with improved stability.The algorithm also improves the practical performance of two-dimensional entropy segmentation.