Mathematical Problems in Engineering

Volume 2016 (2016), Article ID 3196958, 24 pages

http://dx.doi.org/10.1155/2016/3196958

## Improved Glowworm Swarm Optimization Algorithm for Multilevel Color Image Thresholding Problem

^{1}Department of Electronics and Communication Engineering, Kunming University of Science and Technology, Kunming 650093, China^{2}Department of Mineral Processing, Kunming University of Science and Technology, Kunming 650093, China

Received 12 May 2016; Revised 22 July 2016; Accepted 27 July 2016

Academic Editor: Masoud Hajarian

Copyright © 2016 Lifang He and Songwei Huang. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

The thresholding process finds the proper threshold values by optimizing a criterion, which can be considered as a constrained optimization problem. The computation time of traditional thresholding techniques will increase dramatically for multilevel thresholding. To greatly overcome this problem, swarm intelligence algorithm is widely used to search optimal thresholds. In this paper, an improved glowworm swarm optimization (IGSO) algorithm has been presented to find the optimal multilevel thresholds of color image based on the between-class variance and minimum cross entropy (MCE). The proposed methods are examined on standard set of color test images by using various numbers of threshold values. The results are then compared with those of basic glowworm swarm optimization, adaptive particle swarm optimization (APSO), and self-adaptive differential evolution (SaDE). The simulation results show that the proposed method can find the optimal thresholds accurately and efficiently and is an effective multilevel thresholding method for color image segmentation.

#### 1. Introduction

Image segmentation is to partition an image into multiple segments or regions and extract the meaningful and interested objects, which is the critical step in image processing and image analysis. The goal of image segmentation is to make an image more meaningful and easier to understand and analyze [1, 2]. Nowadays image segmentation has been widely used in many practical applications such as medical imaging [3], object detection [4], optical character recognition (OCR) [5], and remote sensing [6].

By now, several algorithms and techniques have been proposed for image segmentation in the literature and thresholding is one of the simplest but most effective methods in all the image segmentation algorithms. The fundamental principle of thresholding technique is to divide the whole pixel points of an image into several classes by setting different threshold values, so the key to this method is to find the proper threshold values. According to the number of threshold values, thresholding techniques can be separated into two groups: bilevel and multilevel thresholding. Bilevel thresholding is to divide an image into two parts by using one threshold value. If the threshold value is more than one, it will be extended into multilevel thresholding, which can accurately divide an image into several significant parts. Therefore, multilevel thresholding is an effective and famous technique, and it is extensively applied in many fields.

For years, a great number of thresholding techniques have been described in the literature. In 1979, Otsu’s method was presented by Otsu [7], which is one of the best ways of thresholding. However, the computation time is much longer in multilevel threshold problem because it exhaustively searches optimal threshold values by maximizing the between-class variance. In 1985, Tsai [8] proposed a new method to find optimal thresholding values of an input gray-level image by moment-preserving principle, which is called Tsallis entropy method. In 1986, Kittler and Illingworth [9] assumed that the pixel level values of each object in an image are normally distributed. Li and Lee [10] proposed minimum cross entropy thresholding method which selects the optimal thresholding values by minimizing the cross entropy between the original image and its segmented image. The Otsu, Tsallis entropy, and minimum cross entropy methods can be easily extended to multilevel thresholding. For bilevel thresholding, the traditional thresholding algorithms can find optimal threshold quickly and effectively and the image is accurately segmented into two parts. But, for multilevel thresholding, the traditional techniques become very time-consuming because a large number of iterations are needed for computing the optimal threshold values [11–13].

Swarm intelligence algorithms are very popular global optimization schemes, and the techniques imitate the collective behavior of natural or artificial systems that show some intelligence [14]. The algorithms have been widely used in complex optimization problems which show better performances. In order to solve the multilevel thresholding problem, swarm intelligence algorithms have been used to find optimal thresholds over the years, including genetic algorithm (GA) [15, 16], particle swarm optimization (PSO) [17–19], artificial bee colony (ABC) [20–22], differential evolution (DE) [23–25], firefly algorithm (FA) [26, 27], cuckoo search algorithm (CS) [28, 29], wind driven optimization (WDO) [29], and electromagnetism-like optimization (EMO) algorithm [30]. These methods use different basic swarm intelligence algorithms, different improved algorithms, and different objective functions for different types of images, such as between-class variance, Tsallis entropy, Kapur’s entropy, and minimum cross entropy. GA was inspired by the process of natural selection which has been used for multilevel thresholding [31, 32]. The PSO and the improved PSO algorithms were also used to solve the multilevel thresholding problem which mimics the social behavior of bird flock or fish school. The researchers Yin [17] and Maitra and Chatterjee [18] applied PSO algorithm to multilevel thresholding. Thereafter, particle swarm optimization (PSO) and artificial bee colony (ABC) have been adopted to search the optimal multilevel thresholds by Akay using Kapur’s entropy and between-class variance as objective functions [19]. Horng [20], Zhang and Wu [21], and Cuevas et al. [33] proposed a new image segmentation method using artificial bee colony algorithm for multilevel thresholding. And the algorithm is also used for segmentation of SAR image [34, 35] and satellite image [22]. In 2010, a novel multilevel thresholding segmentation method based on differential evolution (DE) algorithm is presented [23]. Firefly algorithm (FA), inspired by the social behavior of firefly swarm, is also used to find several threshold values on a given image [36]. Also, two new swarm intelligence algorithms, cuckoo search algorithm (CS) and wind driven optimization (WDO), using Kapur’s entropy for multilevel thresholding are proposed, and two algorithms can efficiently and accurately search multiple threshold values [29].

Color images include more information than gray images and multilevel color image segmentation is widely used now. Swarm intelligence algorithms are also used for color image multilevel segmentation. Zingaretti et al. [37] proposed the new method which is based on genetic algorithm (GA) for color image segmentation. Raja et al. [38] presented an improved particle swarm optimization (PSO) algorithm for cancer infected breast thermal images by Otsu’s method. Sarkar et al. [39] developed a novel multilevel color image thresholding method based on differential evolution (DE) algorithm and minimum cross entropy, and simulation results show that it is an effective method. Three different quantum inspired metaheuristic techniques, namely, Quantum Inspired Ant Colony Optimization, Quantum Inspired Differential Evolution, and Quantum Inspired Particle Swarm Optimization technique, for multilevel color image thresholding are presented. Simulations and results prove that the Quantum Inspired Ant Colony Optimization method outperforms the other methods [40]. Rajinikanth and Couceiro [41] used the firefly algorithm (FA) for color image segmentation. The evolutionary and swarm-based algorithms of evolution strategy (ES), genetic algorithm (GA), differential evolution (DE) algorithm, adaptive differential evolution algorithm (JADE), particle swarm optimization (PSO) algorithm, artificial bee colony (ABC) algorithm, cuckoo search (CS), and differential search (DS) algorithm are also used for multilevel color image thresholding problem [42].

The glowworm swarm optimization (GSO) is a novel swarm intelligence algorithm for optimization developed by Krishnanand and Ghose in 2005 [43] which mimics the flashing behavior of glowworms. In the algorithm, each glowworm carries a luminescence quantity called luciferin, which is decided by the function value of glowworm’s current location. During the course of movement, glowworm identifies its neighbors based on local-decision domain and selects a neighbor which has a luciferin value higher than its own using a probabilistic mechanism and moves toward it [44–49]. GSO algorithm has been applied for numerous complex optimization problems. Qifang et al. [50] and Horng [51] used GSO algorithm based on Otsu’s method and minimum cross entropy for multilevel threshold image segmentation and the experimental results show that the method has better performance for gray images. In order to improve the performance of the standard GSO algorithm and search the global optimal value efficiently and accurately, the improved glowworm swarm optimization (IGSO) is presented in this paper. Step size is an important parameter in determining the convergence of GSO algorithm, so a new update method of step size is proposed. Furthermore the sensor range is extended to the whole search space and the random movement of the brightest glowworms of firefly algorithm is also introduced. Subsequently the IGSO algorithm using different objective functions is used for multilevel color image thresholding problem, such as between-class variance and minimum cross entropy (MCE). The performance of IGSO algorithm for multilevel color image thresholding is measured in terms of the optimal threshold values, objective values, the peak signal to noise ratio (PSNR), and structural similarity index (SSIM) and then compared with other swarm intelligence algorithms such as adaptive particle swarm optimization (APSO) [52] and self-adaptive differential evolution (SaDE) algorithm [53].

The remainder of the paper is organized as follows. Section 2 presents the concepts of between-class variance method and minimum cross entropy method. Section 3 gives a detailed description of GSO algorithm and the proposed IGSO algorithm. In Section 4, the numerical experimental results of IGSO, GSO, APSO, and SaDE algorithms for multilevel color image segmentation are shown and discussions are also given. Finally, the conclusion is presented in Section 5.

#### 2. Formulation of the Problem

Swarm intelligence algorithms find the optimal thresholds by maximizing an objective function. In this paper, two commonly used thresholding methods, between-class variance method (Otsu’s) and minimum cross entropy are used as objective functions to find the optimal multilevel thresholds.

##### 2.1. Between-Class Variance Method (Otsu’s Method)

Thresholding based on Otsu’s method is a nonparametric segmentation method that divides the whole image into classes by maximizing the between-class variance.

Assume that an image has pixels and gray levels, and the number of pixels at level is represented by ; then . The occurrence probability of level is defined by

In bilevel thresholding, the optimum threshold divides the image into two classes, and the cumulative probabilities of each class can be described as follows:

The mean levels of two classes are described as follows:

The between-class variance of two classes is defined by (4):where is the mean levels of whole image:

The optimum threshold is searched exhaustively by maximizing the between-class variance, and the optimal threshold is

Otsu’s method can be extended to multilevel thresholding. Assume that an image is divided into classes; the extended between-class variance of classes is calculated by

The sigma terms are determined using (9) and the mean levels are calculated by (10):

The optimum thresholds are searched by maximizing the between-class variance by

##### 2.2. Minimum Cross Entropy Method

Assume that two probability distributions, and , belong to the same set. The cross entropy between and is defined as follows:

The concept of cross entropy is widely used for optimization problem, and the minimum cross entropy thresholding method selects an optimal threshold that minimizes the cross entropy between the original image and the processed image. If an original image in gray levels can be divided into two segments by threshold and , where is the number of gray levels, then the cross entropy can be calculated by where

We can select an optimal threshold by minimizing the cross entropy based on (13):

Since the first item is constant, the expression of the cross entropy can be modified aswhere is the zero-moment and is the first-moment of the image histogram.

It is quite straightforward to extend minimum cross entropy thresholding method to multilevel thresholding segmentation. If an image is required to find thresholds , the cross entropy is given by

We can obtain the optimal threshold by minimizing (17). As the swarm intelligence algorithms are usually used to solve maximization problems, we modified (17) as shown below:

All algorithms used in this paper calculate the minimum cross entropy fitness function by (18) for multilevel thresholding segmentation, which can find the optimal thresholds.

#### 3. Glowworm Swarm Optimization Algorithm

##### 3.1. The Standard Glowworm Swarm Optimization Algorithm

The standard GSO algorithm includes the following steps.

*Step 1 (parameters’ definition). *The key parameters impact the performance of GSO algorithm, that is, , , , , and .

*Step 2 (glowworms’ initialization). *In the phase, the glowworms are initially distributed randomly in the given fitness function space so that they are well dispersed, which have equal quantity of luciferin and sensor range. Furthermore, the current iteration is set to 1.

*Step 3 (luciferin update phase). *The luciferin depends on the function value at the current position of the glowworm, so the position of glowworms changes and the luciferin updates accordingly in the each iteration. Each glowworm updates luciferin according to the following equation:where is the luciferin of glowworm at time , is the luciferin decay constant , represents the luciferin enhancement constant, and is the function value.

*Step 4 (movement phase). *Each glowworm has a variable local-decision domain, which is bounded by a radial sensor range , and is attracted to brighter glowworms. In the movement phase, glowworms search a neighbor by a probabilistic mechanism that has higher luciferin value and move to it. For each glowworm , the probability equation of moving toward a neighbor can be stated aswhere , is the set of neighbors of glowworm , is the variable local-decision domain, and represents the Euclidean distance between glowworms and at time . Then, the equation of the glowworm movements is given bywhere represents the location of glowworms at time , is the step size, and is the Euclidean norm operator.

*Step 5 (local-decision domain update). *In the GSO algorithm, the local-decision domain is a dynamic value that is a function with the number of peaks captured. In order to update adaptively the local-decision domain range of each glowworm, the rule is stated aswhere is a constant parameter and is a threshold parameter used to control the number of neighbors.

##### 3.2. The Proposed Glowworm Swarm Optimization Algorithm

The size step is a key parameter, which affects the convergence of the GSO algorithm. In GSO algorithm, the step size should be smaller than the -distance in order to find the optimal solutions [54]. However, the lower step size value may lead to a slow convergence speed. So it can be a large value for starting the algorithm and gradually reducing the value of step size with the increase of iteration [54]. Also, the step size is relevant to the size of the search space. For the larger space, step size must be a larger value. In the standard GSO, is a constant. In order to improve the convergence of the GSO algorithm, we present a new step size update method in this section. Considering the search space and dimension of image segmentation, the expression is given bywhere is the range of step size, is iteration, is the maximum number of iterations, and , where is the dimension of the search space. When the dimension is a large value and is a low value, the step size will correspondingly increase and algorithm can search more quickly.

The local-decision domain is an important parameter that affects the ability of capturing multiple peaks. When the sensor range of each glowworm extends to the whole search space, all the glowworms move to the global optimal value and ignore the local optimum [54]. To ensure that the GSO algorithm can find the global optimal threshold of image segmentation, the sensor range covers the entire space of image gray histogram and the value is set to in this paper.

In the GSO algorithm, the glowworms with the maximum luciferin remain stationary during the each iteration. The above feature leads to the movements of glowworms that are confined to the interior region of the convex hull [54]. The firefly algorithm can search multiple global solutions simultaneously, and thus it is a very efficient algorithm. However, in the FA algorithm, the brightest fireflies move randomly. So the random movement of the brightest agents is introduced to GSO in this paper.

The pseudocodes of the IGSO algorithm are shown as Pseudocode 1.