Computational Intelligence and Neuroscience

Volume 2017, Article ID 3295769, 16 pages

https://doi.org/10.1155/2017/3295769

## Modified Discrete Grey Wolf Optimizer Algorithm for Multilevel Image Thresholding

^{1}School of Computer, Nanjing University of Posts and Telecommunications, Nanjing 210003, China^{2}College of Information Engineering, Fuyang Normal University, Fuyang 236041, China^{3}School of Internet of Things, Nanjing University of Posts and Telecommunication, Nanjing 210003, China

Correspondence should be addressed to Linguo Li; moc.361@2121-gll

Received 1 July 2016; Revised 21 November 2016; Accepted 6 December 2016; Published 3 January 2017

Academic Editor: Cheng-Jian Lin

Copyright © 2017 Linguo Li et al. 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 computation of image segmentation has become more complicated with the increasing number of thresholds, and the option and application of the thresholds in image thresholding fields have become an NP problem at the same time. The paper puts forward the modified discrete grey wolf optimizer algorithm (MDGWO), which improves on the optimal solution updating mechanism of the search agent by the weights. Taking Kapur’s entropy as the optimized function and based on the discreteness of threshold in image segmentation, the paper firstly discretizes the grey wolf optimizer (GWO) and then proposes a new attack strategy by using the weight coefficient to replace the search formula for optimal solution used in the original algorithm. The experimental results show that MDGWO can search out the optimal thresholds efficiently and precisely, which are very close to the result examined by exhaustive searches. In comparison with the electromagnetism optimization (EMO), the differential evolution (DE), the Artifical Bee Colony (ABC), and the classical GWO, it is concluded that MDGWO has advantages over the latter four in terms of image segmentation quality and objective function values and their stability.

#### 1. Introduction

Image segmentation involves the technique and process of segmenting an image into several particular unique areas and extracting useful or interested targets [1]. These areas or targets are the keys for image analysis and understanding. With the in-depth research of image segmentation technology, image segmentation techniques have been widely applied in various fields, such as medical analysis [2], image classification [3], object recognition [4], image copy detection [5], and motion estimation [6].

In recent years, many researchers have conducted massive research on image segmentation. However, there has been no theory of segmentation so far which is universally applicable. There are many algorithms for image segmentation, and classical ones are classified as algorithms based on threshold, edge, area, and others which are combined with other specific theories [7, 8]. As a commonly used image segmentation algorithm, threshold segmentation selects proper threshold to divide image into different areas or classes. Numerous different thresholding approaches have been reported in the literature. Basically, thresholding methods fall into two kinds: parametric and nonparametric [9, 10]. Parametric methods are time-consuming and computationally expensive, while nonparametric methods try to determine the optimal threshold value by optimizing some standards [10]. By introducing the optimization methods, nonparametric methods reduce the time consumption and computation and show better robustness and accuracy. Based on the above analysis, the paper will take nonparametric methods to analyze and study multilevel image segmentation.

It has proved to be feasible to determine the optimal threshold value by analyzing the histogram characteristics or optimizing objective functions [9]. These nonparametric methods can be achieved by optimizing objective functions. The commonly used optimization functions include maximization of the entropy [11], maximization of the between-class variance (e.g., Otsu’s method) [12], the use of the fuzzy similarity measure [13], and minimization of the Bayesian error [14]. Among them, Kapur’s optimal entropy threshold method does not require prior knowledge, which can obtain desirable segmentation result for the nonideal bimodal histogram of images which make it the most widely used method [4]. All of these techniques were originally used for bilevel thresholding and then extended to multilevel thresholding areas. However, after these methods are used for multilevel thresholding (MT), the computational complexity grows exponentially. Therefore, numerical evolutionary and swarm-based intelligent optimizations are much preferred in MT [3].

Optimization algorithm [15] is mainly used to solve the problem of the option of the threshold value and reduce the time consumption from the increase of the number of the thresholds. Genetic algorithm (GA) [16] is an early method used in the image thresholding. With the constantly emerging of the optimization algorithms, a large number of MT methods based on optimization algorithms follow. Fujun et al. [17] put forward an improved adaptive genetic algorithm (IAGA) image segmentation method; this method can adjust control parameters adaptively according to the size of individual fitness and dispersion degree of the population, which keeps the diversity of the population and improves the convergence speed; evolutionary algorithms which are inspired by swarm behavior such as Particle Swarm Optimization (PSO) [18] and artificial colony algorithm (ABC) [19] are also widely used in image segmentation problem. Oliva et al. [20] used EMO algorithm for MT problem and also applied HAS algorithm [17] to MT tasks; there are many other optimization algorithms which are also used to deal with this kind of problem and the results are also satisfactory, such as DE, CS, BF, and FFA [21–25].

As a newly proposed optimization algorithm, the GWO [26] algorithm mimics the leadership hierarchy and hunting mechanism of grey wolves in nature. Four types of grey wolves (, , , ) are employed as the leadership hierarchy. The main steps are hunting, searching for prey, encircling, and attacking. Compared to well-known evolutionary-based algorithms such as PSO, GSA, DE, EP, and ES, the GWO algorithm shows better global convergence and higher robustness. Moreover, the GWO has high performance in solving challenging problems in unknown search spaces, and the results on semireal and real problems also prove that GWO can show high performance not only on unconstrained problems but also on constrained problems [26]. This paper, by making an analysis of GWO, tries to determine the optimal threshold for image segmentation, discretizes the continuous GWO algorithm, and then proposes modified discrete GWO algorithm. Original GWO algorithm mainly solves the problem of continuity, but the image thresholding is a discrete problem for different thresholds; therefore, GWO algorithm has to be discretized. In addition, this paper has also improved the wolves attack strategy (i.e., determining the optimal solution). While the original GWO used the average of the optimal three wolves as the best solution, the proposed algorithm in this paper abandons the average optimization strategy in the process of determining the optimal solution, and calculates the different weights on the basis of wolves fitness function and, at the same time, gives the highest weight to the dominant wolf so as to improve the convergence. The experimental results show that the algorithm determines the appropriate thresholds quickly and has better segmentation effect, high efficiency, and accuracy. Finally, the simulation experiment verifies the superiority of MOGWO. Moreover, it is the first time that MDGWO algorithm is applied to multilevel image segmentation.

The rest of the paper is organized as follows: Section 2 introduces Kapur’s entropy and related work of intelligent optimization in the field of MT. Section 3 presents the formulation of MT and Kapur’s entropy objective function. The detailed process and pseudocode of the initializing, encircling, hunting, and attacking behaviors in MDGWO are presented in Section 4. Section 5 analyzes the superiority of MDGWO based on numerous experiments in combination with Figures and Tables. Section 6 concludes.

#### 2. Related Works

In recent years, image segmentation methods based on intelligent optimization takes Otsu’s method, between-class variance, Tsallis entropy, and Kapur’s entropy for objective functions. These methods optimized the threshold through optimization algorithm and obtained better results on image segmentation [4]. Moreover, Akay [27] compared ABC with PSO by employing between-class variance and Kapur’s entropy as objective functions. Kapur’s entropy-based ABC showed better performance when the number of thresholds increases and reduced time complexity. Bhandari [28] et al. conducted comparative analysis in detail between Kapur’s, Otsu, and Tsallis functions. The results show that, in remote sensing image segmentation, Kapur’s entropy-based algorithm performs better than the rest generally. Ghamisi [29] et al. analyzed the performances of Particle Swarm Optimization (PSO), Darwinian Particle Swarm Optimization (DPSO), and Fractional-Order Darwinian Particle Swarm Optimization (FODPSO) in MT. By comparing them to Bacteria Foraging (BF) algorithm and genetic algorithms (GA), PODPSO shows better performance in overcoming local optimization and computational speed. Electromagnetism was introduced for MT by Horng [19], which compared it to Kapur’s entropy and Otsu’s method, respectively. The experimental results show that Kapur’s entropy is more efficient. Before that, they verified the same test experiment through Harmony Search Optimization and obtained similar results [20]. In our previous work [30], we also take Discrete Grey Wolf Optimizer (GWO) as the tool, with fuzzy theory and fuzzy logic to achieve image segmentation. Compared with EMO and DE, our method shows better performance in segmentation quality and stability. Based on the above analysis, the algorithm which takes Kapur’s entropy for objective function shows better performance. By taking Kapur’s entropy as the optimization goal, the paper analyzes and studies the application of GWO in MT.

Wolf Pack Algorithm (WPA) is a new swarm intelligent method proposed by Wu et al. in 2013 [25–29, 31–33]. According to the wolf pack intelligent behavior, the researchers abstracted three intelligent behaviors, scouting, calling, and besieging, and two intelligent rules, winner-take-all generation rule of lead wolf and stronger-survive renewing rule of wolf pack. The experiments show that WPA has better convergence and robustness, especially for high-dimensional functions. In the same year, Q. Zhou and Y. Zhou [34] proposed Wolf Colony Search Algorithm based on Leader Strategy (LWCA). The idea of the algorithm originated from the phenomenon that there exists individual competitions among the wolf pack. The strongest wolf was selected as the leader of the wolves; the wolves hunted prey under the leadership of the leader, so that they could be more effective in capturing prey. The experiments show that the algorithm has better performance on convergence speed and accuracy, and it is difficult to trap-in local minimum. Coincidentally, Mirjalili et al. [26] proposed grey wolf optimizer (GWO) inspired by grey wolves in 2014. In GWO algorithm, The wolf is also called the dominant wolf, the level of other three types decreases in turn, and the is the lowest-level wolf. In addition, the three main steps of hunting, searching for prey, encircling prey, and attacking prey, are implemented. Compared to well-known heuristics such as PSO, GSA, DE, EP, and ES [35–38], the GWO algorithm shows better convergence and higher local optima avoidance. In 2014, Muangkote et al. [39] proposed an improved grey wolf optimizer method (IGWO). The strategy on parameter selection of IGWO improves the search capability and the hybridization strategy increases the diversity of the agent. Zhu et al. [40] proposed to combine GWO with difference algorithm for solving the global optimization problem in 2015.

By introducing MDGWO to MT, the paper solves the problem of thresholds option by taking Kapur’s entropy for objective function. The proposed algorithm shows better segmentation result, high efficiency and accuracy, and stability of the range of threshold.

#### 3. Formulation of the Multilevel Image Thresholding

MT needs to set a set of threshold values ; based on that, the image can be segmented into different regions. By means of intelligent optimization to obtain the optimal threshold value, the process of image segmentation has to be formulated before taking image elements or image features as parameters, to determine the optimized objective functions with the purpose of getting close to the optimal threshold value.

##### 3.1. Pixel Grouping Based on Thresholding

Supposing that each image has grey levels, the thresholding conversion is a process in which the pixels of image are divided into different classes or groups according to the grey levels. This kind of classification has to choose a threshold (th) or follow the following rules:where indicates the grey level of a pixel in image , . , is the class of pixel and th is the threshold.

Equation (1) is the description of bilevel thresholding. For MT problem, the description is where indicates different thresholds. Therefore, MT can be described as the problem of solving the set of th. Kapur’s entropy is a well-known method used to solve this kind of problem by maximizing the objective function to determine the optimal threshold.

##### 3.2. Concept of Kapur’s Entropy for Image Segmentation

Kapur’s entropy is one of the early methods used in bilevel thresholding, and it has been applied in MT field by scholars. Kapur’s entropy is an effective image segmentation technique based on threshold and probability distributions of image histogram. When the optimal threshold is allocated correctly, the entropy is the biggest of all. Entropy is used to measure the compactness and separability between classes. The purpose of the method is to find the optimal threshold and produce the maximum entropy. This method extracts the brightness level from a greyscale image or a RGB image. The probability distribution of brightness value is calculated as follows:where indicates a specific brightness level, ranging from 0 to , parameter is used to judge whether the image is a grey image or a RGB image, SP is the total of pixels, and is the pixel number of the brightness level in . For the simplest segmentation, there are two classes defined as follows:where , are the probability distribution of , , respectively; the equation is as follows:

Therefore, the objective function of Kapur’s entropy can be defined aswhere entropy and entropy are derived by (4): where is the probability distribution of strength grades by (3) and , are the probability distribution of , , respectively.

Naturally, the entropy-based method can be extended to multithresholding method. In this case, image can be divided into classes with thresholds. Therefore, multilevel thresholding objective function can be defined as follows:where is a vector containing multiple thresholds and each entropy is calculated with the corresponding threshold, respectively. And (7) can be extended to the calculation of entropies as follows: where the probabilities of classes are calculated by (10); finally, it needs to categorize the pixels into corresponding classes and complete the multilevel image segmentation by (2):

As mentioned above, multilevel thresholding is formulated to maximize Kapur’s entropy, and the objective function is shown in (8). As previously mentioned, this paper will use the MDGWO to optimize the objective function; the optimization algorithm is the key to the quality of image segmentation.

#### 4. Image Segmentation Based on MDGWO

##### 4.1. Standard Grey Wolf Optimizer

Grey wolfs (*Canis lupus*) belongs to Canidae family, which are considered as apex predators, meaning that they are at the top of the food chain. They have a very strict social dominant hierarchy. The algorithm divides the wolves into four types: , , , and . The social behavior of each type wolves can be summarized as follows.

The leaders are a male and a female, called alpha. They are the most brilliant wolves and the best in terms of managing the pack. The alpha wolf is also called the dominant wolf since his/her orders should be followed by the pack unconditionally. The location of alpha presents the best solution of the problem.

The second level in the hierarchy of grey wolves is beta. The betas are subordinate wolves that help the alpha in decision-making or other pack activities. The beta wolf should respect the alpha but commands the other lower-level wolves as well. It plays the role of an advisor to the alpha and discipliner for the pack. The beta reinforces alpha’s commands throughout the pack and gives feedback to the alpha.

The third level in the hierarchy of grey wolves is delta. Delta wolves have to submit to alphas and betas, but they dominate the omega, scouts, sentinels, elders, hunters, and caretakers who belong to this category. They are responsible for watching the boundaries of the territory, warning the pack in case of any danger, protecting and guaranteeing the safety of the pack, helping the alphas and betas when hunting prey, and providing food for the pack and caring for the weak, ill, and wounded wolves in the pack.

The lowest ranking grey wolf is omega. It may seem the omega is not an important individual in the pack, but it has been observed that the whole pack face internal fighting and problems in case of losing the omega, which is harmful to the group structure.

In addition to the social hierarchy of wolves, group hunting is another interesting social behavior of grey wolves. The main phases of grey wolf hunting are as follows: searching for the prey; tracking, chasing, and approaching the prey; pursuing, encircling, and harassing the prey until it stops moving; attacking toward the prey.

In order to mathematically model the social hierarchy of wolves in GWO [26], the fittest solution is considered as the alpha (). Consequently, the second and third best solutions are named beta () and delta (), respectively. The rest of the candidate solutions are assumed to be omega (). In the GWO algorithm, the hunting (optimization) is guided by , , and . The wolves follow these three wolves.

In addition to the above four abstract models, this paper proposes MDGWO based on the standard GWO settings for MT. In the improved algorithm, the corresponding relationships between grey wolf hunting and image segmentation are shown in Table 1.