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.

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 image with the size of is given. refers to the gray value of a pixel at coordinate in the image, where , , 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 , where , 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 , , , and .

As shown in Figure 1, the threshold value () 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 . Region 2 refers to the category of the target . 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 and , 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]:

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.

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 [1619]. 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 is , where refers to the randomly generated food source and , , and . SN refers to the number of food sources. is a random number, and . 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 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.

Begin
  Step  1. Initialized population parameters.
  Step  2. discard solution, upper limit of the iterations MSN.
  Step  3. Evaluating (), Cycle = 0, limit = 0.
  Step  4. Repeat
    /honey-gathering bees/
  Step  5. For to SN then do
        Equation (6) is used to generate the new solution , Evaluate .
        If ( was superior to )
          replace   by .
        else
          limit++.
        End If
  Step  6. End For
  Step  7. Memorize the best solution .
    /observation bees/
  Step  8. For to SN
        If (rand < pro[])
          Equation (8) is used to generate the new solution , Evaluate .
        If ( was superior to )
          replace by .
        else
          limit++.
        End If
  Step  9. End For
    /scout bees/
  Step  10. For 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 till now, Cycle = Cycle + 1.
  Step  13. Until (Cycle = maximum cycle number)
End.

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 ; here . The initial iterations are Cycle = 1; the maximum cycle time is . Based on (6),    food source vector is randomly generated in the solution space , and (7) is designed to evaluate the quality of nectar:where and refer to the upper and lower limits of the solution space and 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 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 generated from iterations is given bywhere and . is the number of food sources and is the number of optimization parameters. is the amount of the step control. Its value is related to the scale of the question; here . The product means entrywise multiplications. The step length depends on the random number of the Levy distributions [21]: , , 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 source at the roulette table, based on the selection probability for each food source (i.e., (7)). Equation (9) randomly selects a new food source . 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 probability of each food source iswhere 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 and 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 bywhere . is the number of optimization parameters. , refers to the position of the randomly generated new food source, and and refer to the upper and lower limits of the solution space, respectively; here and . When the generated 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 , 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.

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

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 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 , the number of food sources , the dimension of the solution space 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, , and .

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

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 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 bywhere and 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. 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.

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.

Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

Acknowledgment

This work has been supported by the National Science Foundation of China (61164018).