Multilevel Image Thresholding for Image Segmentation by Optimizing Fuzzy Entropy using Firefly Algorithm

- Image thresholding is the process of extracting objects in a scene from the background accompanies for the analysis and interpretation of image which is mostly employed for its advanced simplicity, robustness, less convergence time and accuracy. The main intend of image segmentation is to segregate the foreground from background. As ordinary thresholding method of image segmentation is computationally expensive while extending for multilevel image thresholding, the need for optimization techniques is highly recommended. The so called optimization techniques such as Particle swarm optimization and bat algorithm undergo instability when the particle velocity is maximum and stagnation stage attributable to quick exploration. This paper proposes for the first time the multilevel image thresholding for image segmentation by using Fuzzy entropy maximized by naturally inspired firefly algorithm. A firefly based multilevel image thresholding is established by maximizing Fuzzy entropy where the results are proved better in misclassification, standard deviation, Structural Similarity Index and segmented image quality while comparing with differential evolution, Particle swarm optimization and bat algorithm..

using amended bacterial foraging (ABF) algorithm. The optimal thresholds are obtained by maximizing the Kapur's or Otsu's entropy with the help of ABF algorithm. The results are compared and proved better in the separation of gray, white and cerebrospinal fluid in MRI image for recognition as well as to diagnosis the disease. The same authors employed some modifications to bacterial foraging (BF) for Segmentation of brain magnetic resonance images . They did adaptive variation of step size of bacteria instead of fixed step size which is followed by ordinary bacterial foraging . Mbuyamba et al. (2016) used Cuckoo Search (CS) algorithm for energy minimization of alternative Active Contour Model (ACM) for global minimum and exhibited that polar coordinates with CS is better than rectangular. Among many optimization techniques are available in the literature, a few are used for bi-level thresholding for ordinary image segmentation, Ye 2015) proposed a Tsallis entropy based multilevel thresholding for colored satellite image segmentation using high dimensional problem optimizer that is Differential Evolution (DE), WDO, PSO and Artifical Bee Colony (ABC). The same authors carried out gray scale satellite image segmentation using modified artificial bee colony (MABC) by optimizing the Kapur's, Otsu and Tsallis entropy and compared the result with ABC, PSO and GA . The drawback of DE is constant tuning parameters (scaling factor (F) and crossover rate (CR)). So Ayala et al. (2015) vary the parameters of DE that follow beta probability distribution function. The beta distribution is flexible for modeling data that are measured in a continuous scale on a truncated interval in range [0,1]. They compared the beta differential evolution (BDE) based segmentation with fractional-order Darwinian particle swarm optimization (PSO). Li et al. (2015) proposed a modification to PSO that is dynamic-context cooperative quantum-behaved particle swarm in which updating of context vector is dynamic for Otsu's entropy based medical image segmentation. Sun et al. (2016) hybridize the gravitational search algorithm (GS) with genetic algorithm for multi-level thresholding of ordinary images for effective segmentation. They took the advantage and disadvantage of both the algorithms and proper hybridization which has resulted into the best segmentation compared to other methods. Akay (2013) proposed PSO and ABC based image segmentation using Kapur's and Otsu's entropy but PSO performance is further improved with position-velocity model which is based on inherent communication mechanism of celllike P systems of PSO (Penga et al., 2015). Ouadfel and Ahmed (2016) used social spiders optimization and flower pollination algorithm for multilevel image thresholding by optimizing Kapur's and Otsu's entropy and compared the results with BA and PSO. Saha et al. (2014) proposed Quantum Inspired Genetic Algorithm, Particle Swarm Optimization, Differential Evolution, Ant Colony Optimization, Simulated Annealing and Tabu Search with Otsu method, maximum tsallis entropy thresholding and proved that Quantum Inspired Particle Swarm Optimization is better than others by statistical test and Friedman test measures which reduce the computational complexities.
For the first time in this paper the researchers have applied Firefly algorithm (FA) for image thresholding by optimizing the Fuzzy entropy and compared the results with previous optimization techniques such as DE, PSO and BA. For the performance evolution of proposed firefly algorithm based image thresholding, we considered objective function value, standard deviation, structural similarity index, peak signal to noise ratio, misclassification error and computational complexity. In all performance measuring parameters the proposed algorithm performance is better when compared to other DE, PSO and BA.
II. PROBLEM FORMULATION OF OPTIMUM THRESHOLDING METHODS Image thresholding is a process of converting a grayscale input image to a black and white image by using optimal thresholds. Thresholding may be a local or global but these methods are computationally expensive, so there is a need of optimization techniques which optimize the objective function results in the reduction of computational time of local or global methods. The optimization techniques find the optimal thresholds by maximizing the objective function such that segmented image clearly distinguishes the background and foreground of image. In this paper, researchers have chosen Fuzzy entropy as objective functions on which optimization techniques works. Let us assume an image that contains L gray levels and the range of these gray levels are {0, 1, 2,. . . , (L -1)}. Then probability P i = h(i)/N (0 <i< (L -1)), where h(i) denotes number of pixels for the corresponding gray-level L and N denotes total number of pixels in the image which is equal to ∑ ℎ( )

A. Concept of Fuzzy Entropy
Let D={(i,j):i=0,1,2,…..,M-1; j=0,1,2,…….N-1} and G={0,1,2,……,L-1}, Where M is width of image, N is height of image and L is number of gray level in image. I(x,y) is the intensity of image at position (x,y) and D k = {(x,y):I(x,y) = k, (x,y) = D}, k=0,1,2,…..,L-1. Let us assume two thresholds i.e. T 1 , T 2 which divide the domain D of the original image into three regions such as E d , E m and E b . E d region covers the pixels whose intensity value is less than T 1 , E m contains the pixels whose intensity is in between T 1 , T 2 and E b covers the pixels whose intensity is greater than T 2 . Π 3 ={E d , E m , E b } is an unknown probabilistic partition of D whose probability distribution is given as (Zhao et. al, 2001) . µ d , µ m and µ b are the membership functions (µ) of E d , E m and E b respectively and require six parameters like a 1 , b 1 , c 1 , a 2 , b 2 , c 2 . The thresholds T 1 and T 2 values are variable based on the membership functions. For each k=1, 2,…., 255, let If the conditional probability of E d , E m and E b is p d|k , p m|k and p b|k respectively under the circumstance that the pixel pertains to D k with p d|k + p m|k +p b|k = 1(k=0, 1, 2,….., 255) then above equations can be rewritten as Let the grade of pixels with gray level value of k belong to the class dark (E d ), dust (E m ) and bright (E b ) be equivalent to their conditional probability p d|k , p m|k and p b|k respectively. Then the following equations will hold as: The fuzzy membership functions is drawn and shown in Fig. 1. The function Z (k, a 1 , b 1 , c 1 , a 2 , b 2 , c 2 ), U(k, a 1 , b 1 , c 1 , a 2 , b 2 , c 2 ) and S(k, a 1 , b 1 , c 1 , a 2 , b 2 , c 2 ) are assigned as membership functions of class dark µ d (k), dust µ m (k) and bright µ b (k) respectively. Then the membership functions is given as The above said equations are written by assuming 0≤a 1 <b 1 <c 1 <a 2 <b 2 <c 2 ≤255. Then, the fuzzy entropy function of each class could be given as (Tao et al., 2007) = − ∑ * µ ( ) * ln ( * µ ( ) ) ( 1 3 ) The whole fuzzy entropy is calculated through summarizing fuzzy entropy of each class i.e. H (a 1 , b 1 , c 1 , a 2 , b 2 , c 2 ) = H d + H m + H b (16) The above equation is an objective function which is to be optimized with the optimization techniques. Optimization techniques optimize or maximize H (a 1 , b 1 , c 1 , a 2 , b 2 , c 2 ) function by varying a 1 , b 1 , c 1 , a 2 , b 2 , c 2 . Once these values are optimized, then threshold values are calculated with the following equation µ d (T 1 ) = µ m (T 1 ) = 0.5 and µ m (T 2 ) = µ b (T 2 ) = 0.5 (17) From Fig. 1 it is observed that T 1 and T 2 are the point of interaction of µ d (k), µ m (k) and µ b (k) curve. From Eqs (10)- (12), the values of T 1 and T 2 calculated with the below equation As per the requirements of researchers, the two level thresholding can be extended to three or more and can be restricted to single level also. For two thresholds the number of parameters to be optimized is six and as levels of increasing number parameters to be optimized is also increasing, so fuzzy entropy takes much time for convergence. Hence two level image thresholding for image segmentation with the Fuzzy entropy proved to be efficient and effective but for multilevel thresholding, entropy technique consume much convergence time and increase exponential with level of thresholds. The drawback of Fuzzy entropy is convergence time. To improve the performance of these methods further and to reduce the convergence time, researchers used applications of optimization techniques such as differential evolution, Particle swarm optimization, Bat algorithm and Firefly algorithm for image thresholding and henceforth image segmentation. This techniqueis set to maximize the Fuzzy entropy as given in (16).
III. OVERVIEW OF FIREFLY ALGORITHM Firefly algorithm (FA) was introduced by Yang (2008). FA is inspired by the flashing pattern and characteristics of fireflies where the brightness of a firefly is equal to the objective function value. The lighter firefly (lower fitness value) moves towards brighter firefly (higher fitness value). FA is based on the following idealized behavior of the flashing characteristics of fireflies: (1) All fireflies are unisex so that one firefly is attracted to other fireflies regardless of their sex.
(2) Attractiveness is proportional to their brightness, thus for any two flashing fireflies, the low brighter one will move towards the high brighter one. The attractiveness is proportional to the brightness and they both decrease as their distance increases. If there is no brighter one than a particular firefly, it will move randomly.
(3) The brightness of a firefly is affected or determined by the landscape of the objective function.
In firefly algorithm, each firefly is assumed as solution to the problem and thereby fitness/brightness (I) is calculated with objective function. In this paper objective function is H(a 1 , b 1 , c 1 , a 2 , b 2 , c 2 ) which is to be maximized by optimizing a 1 , b 1 , c 1 , a 2 , b 2 , c 2 values. So dimensions (D) of the problem are six. Whenever all the firefly fitness values are obtained, firefly whose fitness value is larger among is assigned as brighter firefly. All lighter fireflies (lower fitness value) move towards the brighter firefly by updating their values. Attractiveness (β) is varied exponentially with Cartesian distance (r ij ) which is in between brighter firefly i and lighter firefly j. Following is the equation for Cartesian distance between i th firefly and j th firefly at location X i and X j respectively.
Where X i,k is the k th component of the spatial coordinate X i of i th firefly. Then the attractiveness is given as Where β is the attractiveness at r i,j = 0 and γ is light absorption coefficient of the medium. With this attractiveness, lighter firefly i moves towards brighter firefly j with the following equation Where u is a random number that lies between 0 and 1 and is calculated by Eq (23) Where rand1 is a random number lies between 0 and 1 IV. FA-BASED FUZZY ENTROPY METHOD In this section, the image thresholding for image segmentation by optimizing/maximizing the fuzzy entropy with proposed ordinary firefly algorithm is explained. The proposed method for image thresholding is very simple and easy to implement. The algorithm of firefly for image thresholding with fuzzy entropy is as follows. Input: Initialize the population (N), maximum number of iterations, level of thresholding (Th) and its corresponding a 1 , b 1 , c 1 , a 2 , b 2 , c 2 values. Initialize randomization parameter (α), attractiveness (β), absorption coefficient (γ). Output: The optimized a 1 , b 1 , c 1 , a 2 , b 2 , c 2 values and its corresponding thresholding values and segmented image.
Initialize all the required parameters and there corresponding dimensions and time t = 0. Calculate the fitness value or light intensity Ii of each solution Xi (i=1,2,3,….n) using Eq. (16) for Fuzzy. While (t < Maximum iterations or until termination criteria reached) for i =1:n all n fireflies The same number of populations and maximum number iterations are employed for all optimization algorithms. The maximum number iterations are 30 and population/solutions are 10 times higher of threshold value (i.e if threshold = 2 then population = 10×2). In DE, Weighting Factor (F) value is 0.5 and Crossover probability (CR) is 0.9 since chosen at these values DE gives the best results. The performance of PSO algorithm depends on two tuning parameters such as acceleration constants (C 1 and C 2 ) and inertia weight factor (W). In general C 1 and C 2 are set as 2; at these values experimentally PSO has given the best fitness values. Whereas inertia weight factor (W) is a random number that lies between 0 and 1. The performance of FA depends upon the parameters such as number of solutions (N), dimensions (D), maximum number of iterations (itr), randomization parameter (α), attractiveness (β 0 ) and absorption coefficient (γ). While applying FA, these control parameters should be carefully chosen for the successful implementation of the algorithm. Successive experiments were conducted for the selection of these parameters and carry out the best values where objective function is found maximum. Table.Ishows the variation of objective function maximum value, mean and standard deviation with respect to the control parameters for Goldhill image with number of thresholds equal to 2. 50 independent experiments are conducted for fixing FA parameter for validation of the algorithm. From Table.I, it is observed that at α = 0.1, β = 0.6, γ = 0.1 and N =100 the objective function value is maximum. These selected parameter values are carried on for all other images. It is observed that beyond N = 100, the value of objective function is slightly improved but with the cost of computational time. The parameters of BA such as Loudness (A = 0.5), Pulse rate (R = 1), Frequency minimum (Qmin = 0), Frequency maximum (Qmax = 30), and Step sizes of random walk (W = 0.001) are initialized.

B. Quantitative validation
To examine the influence of FA algorithm on multilevel thresholding problem, objectives functions/fitness function is Fuzzy entropy

1)Maximization of fuzzy entropy
In this case, the objective function to be optimized with optimization technique is fuzzy entropy which is said to be popular and better in the performance of FA when compared with the other POS, DE and BA. All the algorithms are optimized to maximize the objective function.   Fig. 6f and Starfish image at 2, 3, 4 and 5-level thresholds as shown in Fig. 8e-h.). Proposed algorithm is better compared to other earlier algorithms in visual quality of image for all other images likewise. The consequence of multilevel thresholding is noticeable from different images. From Fig. 5e, the background in the Lake image is not visibly dissimilar with two level thresholding. But as the number of threshold is extended to 5 (i.e. Fig. 5h), the background becomes recognizable. Similarly in Fig. 8e, the Starfish image mixes up with the background objects. But as the number of threshold is increased to 5 (i.e. Fig. 8h), the Starfish image becomes clearly recognizable.

D. Comparison of other methods 1) Stability analysis
The optimization technique's outcome is random in nature because randomness is involved in the procedure and the results are not unique for each run. So the algorithm performance is validated by more than one run and with different initial values. An algorithm is said to be robust if its outcome is acceptable (i.e indifferent from one run to another run) under same circumstances. So we run the same algorithm 50 times and considered result at an average of 50 independent runs. The stability of the algorithm is measured with mean and standard deviation. Optimization technique in general can be considered to be better, if its stability factor is higher among all the techniques i.e objective function value should be the same for each run. Mean and standard deviation is calculated by Eq. 25 and Eq. 26 Where µ j is the objective function value/fitness value at j th run and N is the number of runs. Table.IV shows the standard deviation values obtained with Fuzzy entropy by proposed firefly algorithm and other algorithms. An     optimization technique with higher value of standard deviation seems unstable. From Table.IV, it is observed that DE algorithm has lower standard deviation value for all images including Fuzzy entropy; hence DE is stable and better compared with others. The stability of PSO, BA and FA is found almost similar. It is also observed that there is no effect of standard deviation with the increment of thresholding levels for all images.

2) Computational complexity:
It's a measure of time of convergence of an optimization technique which is variable with respect to the thresholds. The computational complexity of Fuzzy entropy is O (L m ) which rises exponentially with the number of thresholds (Th) and the number of gray levels (L). Convergence time of proposed FA depends on the size of image and maximum number of iterations.
Where (MSE) which is given by in Eq. 28

4) Misclassification error/Uniformity measure:
It is measure of uniformity in threshold image and is used to compare optimization techniques performance (Sahoo et al., 1988). Misclassification error is measured by Eq. 29 Where T is the number of thresholds that are used to segment the image, R j is the jth segmented region, I i is the intensity level of pixel in that particular segmented area, σ j is the mean of j th segmented region of image, N is total number of pixels in the image and I min & I max are the maximum and minimum intensity of image respectively. In general misclassification errors lie between 0 & 1 and higher value of misclassification error shows better performance of the algorithm. Hence, the Uniformity measure in thresholding is measured from the difference between maximum value, 1 (better quality of image) and minimum value, 0 (worst quality of image). Table.VII demonstrate misclassification error of proposed and other techniques where the proven proposed method has lesser misclassification error and draws better visual quality.

VI. CONCLUSIONS
A firefly algorithm based multilevel image thresholding for image segmentation has been productively proposed with desired output. Firefly algorithm maximizes the Fuzzy entropy for the efficient and effective image thresholding. The proposed algorithm is tested on natural images to show the merits of algorithm. Results of the proposed method are compared with other optimization techniques such as DE, PSO and BA with Fuzzy entropy. It is observed that proposed algorithm has higher/maximum fitness value compared to DE, PSO and BA. The PSNR value shows higher values with proposed algorithm than DE, PSO and BA and thereby draws better quality of the segmented image with proposed method. It can be concluded that proposed algorithm outperform the DE, PSO and BA in all performance measuring parameters. Further in future scope the firefly algorithm convergence time and efficiency is improved by modifying the algorithm process. Reference: