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

Authors: Xiaolin Zhang; Tao Yang; Ningning Cui
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

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, this method 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 algorithm meets the actual demands in the engineering application.


---

## Body

## 1. 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 one-dimensional 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 two-dimensional 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.


## 2. Problem Formulation

Suppose that a digital imageF with the size of M×N is given. F(m,n) refers to the gray value of a pixel at coordinate (m,n) in the image, where 0≤m≤M, 0≤n≤N, and L is the gray level of the image. Image G is defined as the mean gray image in the K neighborhood of image F. G(m,n) indicates the mean gray value in the K×K neighborhood of the pixel to which the coordinate (m,n) in the image F corresponds. G(m,n) is defined as G(m,n)=1/k2∑i=-k/2k/2∑j=-k/2k/2I(m+i,n+j), where k=3, i is the gray value of image F in pixel (m,n), and j is the mean gray value of the neighborhood of image G in pixel (m,n). Rij is defined as the frequency of binary (i,j), on the basis of which the two-dimensional histogram is established, as shown in Figure 1.Figure 1
The two-dimensional histogram of the gray and the average gray value of the field.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.Pij is defined as the joint probability density of the gray value i in the two-dimensional histogram and the mean gray value j in its neighborhood, and Pij is defined as Pij=Rij/M×N, where i, j=0,1,…,L-1, 0≤Pij≤1, and ∑i=0L-1∑j=0L-1pij=1.As shown in Figure1, the threshold value (s,t) is given to divide the image into four rectangular zones, which are recorded as Regions 1, 2, 3, and 4. Region 1 refers to the category of the background Co=m,n∣Fm,n≤s,Gm,n≤t. Region 2 refers to the category of the target Cb=m,n∣s+1≤Fm,n≤L-1,t+1≤Gm,n≤L-1. Regions 3 and 4 refer to the edge and noise of the image, respectively. Regions 2 and 4 are always ignored in the calculation of two-dimensional entropy. The probabilities of Regions 1 and 2 are P1=∑i=0s∑j=0tpij and P2=∑i=s+1L-1∑j=t+1L-1pij, respectively. They are represented as follows after normalization:(1)P1′=Pij∑i=0s∑j=0tpij,P2′=Pij∑i=s+1L-1∑j=t+1L-1pij.The two-dimensional entropyHo of the category of background Co can be shown as follows [7]:(2)Ho=-∑i=0s∑j=0tP1′ln⁡P1′=-∑i=0s∑j=0tPijP1ln⁡PijP1=ln⁡P1-1P1∑i=0s∑j=0tpijln⁡pij.The two-dimensional entropyHb of the category of target Cb can be shown as follows [7]:(3)Hb=-∑i=s+1L-1∑j=t+1L-1P2′ln⁡P2′=-∑i=s+1L-1∑j=t+1L-1PijP2ln⁡PijP1=ln⁡P2-1P2∑i=s+1L-1∑j=t+1L-1pijln⁡pij.The sum of the two-dimensional entropies of the category of the target and the category of the background is [7](4)φs,t=Ho+Hb=-∑i=0s∑j=0tP1′ln⁡P1′-∑i=s+1L-1∑j=t+1L-1P2′ln⁡P2′=ln⁡P1+ln⁡P2-1P1∑i=0s∑j=0tpijln⁡pij-1P2∑i=s+1L-1∑j=t+1L-1pijln⁡pij.By the image of two-dimensional entropy modeling, a two-dimensional histogram was established; the threshold value(s,t) 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φ(s,t), the gray level pixel of the object and background is most uniform. The maximum two-dimensional entropy thresholding method determines the optimal threshold (s˙,t˙) by maximum two-dimensional entropy based on(5)s˙,t˙=arg⁡max0≤s≤L-1⁡max0≤t≤L-1⁡φs,t.In our proposed algorithm, we try to obtain this optimum 2-dimensional vectors˙,t˙ which can maximize (4). As the algorithm of LFABC is designed to solve maximization problems, we revise the objective function as the reciprocal of s˙,t˙ and try to maximize it.


## 3. 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.


### 3.2. 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–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.


### 3.3. 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 isvij=xij+φij(xij-xkj), where xkj refers to the randomly generated k food source and k≠i, k∈1,2,…,SN, and j∈1,2,…,D. SN refers to the number of food sources. φij is a random number, and φij∈[-1,1]. In the ABC algorithm, the search step of the bee is (xij-xkj). A food source k is selected in the surroundings of food source i. 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 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 Pseudocode1. Its stages are listed below.Pseudocode 1:The pseudocode of LFABC algorithm.
Begin
Step  1. Initialized population parameters.
Step  2. discard solution, upper limit of the iterations MSN.
Step  3. Evaluating xij (I=1,2,…,SN,j=1,2,…,D), Cycle = 0, limit = 0.
Step  4. Repeat
/∗honey-gathering bees∗/
Step  5. For i=1 to SN then do
Equation (6) is used to generate the new solution xij(t+1), Evaluate xij(t).
If (xij(t+1) was superior to xij(t))
replacexij(t) by xij(t+1).
else
limit++.
End If
Step  6. End For
Step  7. Memorize the best solution Xbest.
/∗observation bees∗/
Step  8. For i=1 to SN
If (rand[] < pro[i])
Equation (8) is used to generate the new solution xij(t+1), Evaluate xij(t).
If (xij(t+1) was superior to xij(t))
replacexij(t) by xij(t+1).
else
limit++.
End If
Step  9. End For
/∗scout bees∗/
Step  10. For i=1 to SN
If (limit ≥ MSN)
Discard solution, (9) is used to obtain the new solution.
End If
Step  11. End For
Step  12. Memorize the best solution Xbest till now, Cycle = Cycle + 1.
Step  13. Until (Cycle = maximum cycle number)
End.Stage 1.
To initialize, the population size is expressed byN, and the dimension of the solution space is D. The numbers of the honey-gathering bees, observation bees, and food sources are SN; here SN=N/2. The initial iterations are Cycle = 1; the maximum cycle time is CM. Based on (6), N/2  D food source vector is randomly generated in the solution space Xi=xi1,xi2,…,xiD∣i=1,2,…,N/2, and (7) is designed to evaluate the quality of nectar:(6)Xi=Xmin⁡+rand⁡0,1Xmax⁡-Xmin⁡,(7)fiti=fXi,where Xmax⁡ and Xmin⁡ refer to the upper and lower limits of the solution space and fiti refers to the fitness of food source i. Its value is directly proportional to the quality of nectar in the corresponding position. The target function f(Xi) 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 searchN/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 Xij(t+1) generated from t iterations is given by(8)Xijt+1=Xijt+α⊗Levyλ,where i=1,…,SN and j=1,…,D. SN is the number of food sources and D 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⊗u=t-λ, (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 power-law 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.Stage 3.
Observation bees select food sourceXij(t) at the roulette table, based on the selection probability for each food source pi∣i=1,2,…,N/2 (i.e., (7)). Equation (9) randomly selects a new food source Xij(t+1). Equation (7) evaluates the quality of nectar; and bees greedily select new and old food sources and remember the best one.
The equation for calculating the selection probabilitypi of each food source is(9)pi=fiti∑n=1N/2fitn,where fiti is the fitness of food source i and it is defined by (7).
The observation bees adopt (10) to update the solution. The calculating equation is as follows:(10)Xijt+1=Xijt+r∗Xij-Xbest,where r∈[-1,1] and Xbest 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(11)xjnew=xjmin⁡+φijxjmax⁡-xjmin⁡,where j=1,…,D. D is the number of optimization parameters. φij∈(-1,1), xjnew refers to the position of the randomly generated new food source, and xjmin⁡ and xjmax⁡ refer to the upper and lower limits of the solution space, respectively; here xjmin⁡=1 and xjmax⁡=255. When the generated xjnew 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 toCM, the circling is stopped. Finally, the obtained optimal threshold value is used to segment the image.
Pseudocode1 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.


## 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.


## 3.2. 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–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.


## 3.3. 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 isvij=xij+φij(xij-xkj), where xkj refers to the randomly generated k food source and k≠i, k∈1,2,…,SN, and j∈1,2,…,D. SN refers to the number of food sources. φij is a random number, and φij∈[-1,1]. In the ABC algorithm, the search step of the bee is (xij-xkj). A food source k is selected in the surroundings of food source i. 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 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 Pseudocode1. Its stages are listed below.Pseudocode 1:The pseudocode of LFABC algorithm.
Begin
Step  1. Initialized population parameters.
Step  2. discard solution, upper limit of the iterations MSN.
Step  3. Evaluating xij (I=1,2,…,SN,j=1,2,…,D), Cycle = 0, limit = 0.
Step  4. Repeat
/∗honey-gathering bees∗/
Step  5. For i=1 to SN then do
Equation (6) is used to generate the new solution xij(t+1), Evaluate xij(t).
If (xij(t+1) was superior to xij(t))
replacexij(t) by xij(t+1).
else
limit++.
End If
Step  6. End For
Step  7. Memorize the best solution Xbest.
/∗observation bees∗/
Step  8. For i=1 to SN
If (rand[] < pro[i])
Equation (8) is used to generate the new solution xij(t+1), Evaluate xij(t).
If (xij(t+1) was superior to xij(t))
replacexij(t) by xij(t+1).
else
limit++.
End If
Step  9. End For
/∗scout bees∗/
Step  10. For i=1 to SN
If (limit ≥ MSN)
Discard solution, (9) is used to obtain the new solution.
End If
Step  11. End For
Step  12. Memorize the best solution Xbest till now, Cycle = Cycle + 1.
Step  13. Until (Cycle = maximum cycle number)
End.Stage 1.
To initialize, the population size is expressed byN, and the dimension of the solution space is D. The numbers of the honey-gathering bees, observation bees, and food sources are SN; here SN=N/2. The initial iterations are Cycle = 1; the maximum cycle time is CM. Based on (6), N/2  D food source vector is randomly generated in the solution space Xi=xi1,xi2,…,xiD∣i=1,2,…,N/2, and (7) is designed to evaluate the quality of nectar:(6)Xi=Xmin⁡+rand⁡0,1Xmax⁡-Xmin⁡,(7)fiti=fXi,where Xmax⁡ and Xmin⁡ refer to the upper and lower limits of the solution space and fiti refers to the fitness of food source i. Its value is directly proportional to the quality of nectar in the corresponding position. The target function f(Xi) 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 searchN/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 Xij(t+1) generated from t iterations is given by(8)Xijt+1=Xijt+α⊗Levyλ,where i=1,…,SN and j=1,…,D. SN is the number of food sources and D 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⊗u=t-λ, (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 power-law 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.Stage 3.
Observation bees select food sourceXij(t) at the roulette table, based on the selection probability for each food source pi∣i=1,2,…,N/2 (i.e., (7)). Equation (9) randomly selects a new food source Xij(t+1). Equation (7) evaluates the quality of nectar; and bees greedily select new and old food sources and remember the best one.
The equation for calculating the selection probabilitypi of each food source is(9)pi=fiti∑n=1N/2fitn,where fiti is the fitness of food source i and it is defined by (7).
The observation bees adopt (10) to update the solution. The calculating equation is as follows:(10)Xijt+1=Xijt+r∗Xij-Xbest,where r∈[-1,1] and Xbest 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(11)xjnew=xjmin⁡+φijxjmax⁡-xjmin⁡,where j=1,…,D. D is the number of optimization parameters. φij∈(-1,1), xjnew refers to the position of the randomly generated new food source, and xjmin⁡ and xjmax⁡ refer to the upper and lower limits of the solution space, respectively; here xjmin⁡=1 and xjmax⁡=255. When the generated xjnew 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 toCM, the circling is stopped. Finally, the obtained optimal threshold value is used to segment the image.
Pseudocode1 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.


## 4. 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 two-dimensional 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(12)ME=1-∑Bo∩Bt+∑Fo∩Ft∑Bo+∑Fo,where Bo and Fo refer to the background in the image and standard binary mask in the target region, respectively. Bt and Ft 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 Bo∩Bt, Fo∩Ft, Bo, and Fo. 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.


### 4.1. Segmentation Result of Flame Image

The flame image is 500 pixels × 400 pixels. The segmentation result of the flame image is shown in Figures2 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 N=20, the number of food sources SN=10, the dimension of the solution space D=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.Figure 2
Thresholding results of the flame image.Figure 3
Thresholding results of the flame image 2.Figures2 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 the flame image in real time. The segmentation effect of the LFABC method is very excellent in terms of segmentation ME value and CPU processing time. The overall segmentation performance is better than the three above-mentioned programs. There are multiple targets existing in image 2. The experimental results show that algorithm can segment the target area more effectively; the running time reduces by about 30% compared with ABC. The CPU computing time is the mean value of the total time consumption as running 30 times of the experiment.Table 1
Comparison of ME values and consuming time of CPU using several methods for flames (image 1).
Exhaustive search
PSO
ABC
LFABC
ME
0.001805
0.027374
0.023092
0.001805
Run time of CPU (ms)
48267
3620
1747
1257Table 2
Comparison of ME values and consuming time of CPU using several methods for flames (image 2).
Exhaustive search
PSO
ABC
LFABC
ME
0.002034
0.036704
0.029852
0.002034
Run time of CPU (ms)
46395
3480
1640
1170


### 4.2. 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 Figure4.Figure 4
Rate of convergence of objective function values with ABC and LFABC.Figure4 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(13)MSE=1n∑t=1nεt-εavg2,where εt and εavg refer to the standard and mean standard deviation of the main function value of t experiment, respectively. εt collects the standard of the main function value in each run. εavg collects the average of εt over thirty different runs of ABC, LFABC.In Table3, 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.Table 3
Comparison of the MSE of the main function between the ABC and LFABC algorithms (30 runs of the experiment).
MSE
ABC
LFABC
Best
0.02576
0.00517
Worst
0.09917
0.01232
Mean
0.04832
0.00936


## 4.1. Segmentation Result of Flame Image

The flame image is 500 pixels × 400 pixels. The segmentation result of the flame image is shown in Figures2 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 N=20, the number of food sources SN=10, the dimension of the solution space D=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.Figure 2
Thresholding results of the flame image.Figure 3
Thresholding results of the flame image 2.Figures2 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 the flame image in real time. The segmentation effect of the LFABC method is very excellent in terms of segmentation ME value and CPU processing time. The overall segmentation performance is better than the three above-mentioned programs. There are multiple targets existing in image 2. The experimental results show that algorithm can segment the target area more effectively; the running time reduces by about 30% compared with ABC. The CPU computing time is the mean value of the total time consumption as running 30 times of the experiment.Table 1
Comparison of ME values and consuming time of CPU using several methods for flames (image 1).
Exhaustive search
PSO
ABC
LFABC
ME
0.001805
0.027374
0.023092
0.001805
Run time of CPU (ms)
48267
3620
1747
1257Table 2
Comparison of ME values and consuming time of CPU using several methods for flames (image 2).
Exhaustive search
PSO
ABC
LFABC
ME
0.002034
0.036704
0.029852
0.002034
Run time of CPU (ms)
46395
3480
1640
1170


## 4.2. 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 Figure4.Figure 4
Rate of convergence of objective function values with ABC and LFABC.Figure4 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(13)MSE=1n∑t=1nεt-εavg2,where εt and εavg refer to the standard and mean standard deviation of the main function value of t experiment, respectively. εt collects the standard of the main function value in each run. εavg collects the average of εt over thirty different runs of ABC, LFABC.In Table3, 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.Table 3
Comparison of the MSE of the main function between the ABC and LFABC algorithms (30 runs of the experiment).
MSE
ABC
LFABC
Best
0.02576
0.00517
Worst
0.09917
0.01232
Mean
0.04832
0.00936


## 5. 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 of Levy flights. 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.



---

*Source: 805075-2015-10-25.xml*