Advertisement

Iran Journal of Computer Science

, Volume 2, Issue 1, pp 9–22 | Cite as

A multilevel image thresholding using the animal migration optimization algorithm

  • Taymaz Rahkar FarshiEmail author
Original Article
  • 514 Downloads

Abstract

Thresholding is an important and well-known technique that plays a major role in distinguishing the image objects from its background. In the other hand, separating the images into several different regions by determining multiple threshold values is called multilevel image thresholding. The Kapur entropy thresholding and maximum between-class variance (Otsu) have been widely used in image thresholding. However, these methods are computationally expensive and with increase in level numbers computational complexity increase exponentially. To overcome this problem, this paper presents animal migration optimization algorithm for multilevel thresholding. For evaluating the efficiency of proposed method, various benchmark images are used for carrying out the experiments, and obtained results via animal migration optimization algorithm compared with most popular optimization technique such as Particle Swarm Optimization, Genetic and bacterial foraging algorithm. Experimental results figure out that the proposed method provides better result than the other tested algorithms.

Keywords

Image segmentation Multilevel thresholding Animal migration optimization Kapur’s function Otsu’s function 

1 Introduction

Segmentation is the fundamental and the basic step in image processing and generally used in partitioning of images into meaningful segments and objects. The aim of segmentation is changing the representation of the images into images that are meaningful and more simpler for interpreting and analyzing [1]. Generally, in image processing applications, there are many differences between grey levels of pixels that belong to the background and those that belong to the foreground (objects). Thresholding is one of the easiest and well-known techniques for distinguishing the image objects from its background. Undoubtedly, image histogram in grey-level images is a fully effective tool for developing algorithm in the field of the image thresholding [2]. Dividing images into different regions (background and object) by calculating a single threshold value is known as bi-level thresholding [3], while separating the images into several different regions by determining multiple threshold values is called multilevel image thresholding [4, 5].

Histogram of grey-level image is regarded as fully effective tool in image segmentation algorithm. The aim of thresholding is determining a proper threshold value in bi-level thresholding and determining proper multiple threshold values in multilevel thresholding. The easiest problem is the bi-level thresholding, where existing peaks represent the different segments, and the valley between the existing peaks represents the threshold. Each pixel in an image which is greater than the threshold value is replaced with a white pixel and considered as an object pixel (foreground). On the other hand, rest of the pixels that are less than threshold value are replaced with black pixels and belong to the background [6]. Moreover, the problem ramp up into more complex by employing multilevel thresholding. Hence the image will be segmented into many regions. Then pixels that are in same range will be placed into a class [7].

In general, determining the exact locations of distinct valleys in an image histogram which include multiple peaks (multimodal histogram) is not easy. A wide variety of algorithms have been proposed in histogram thresholding area [8, 9, 10, 11, 12, 13, 14, 15, 16]; a large number of these algorithms refer to bi-level thresholding and rest of them address the multilevel thresholding. Algorithms that are developed for bi-level thresholding problems (such as Otsu and Entropy) [8, 9] can also be extended to solve multilevel thresholding problems [17, 18, 19].

Optimal thresholds can be determined by analyzing and evaluating the histogram information or by optimizing certain and reliable objective function [20, 21]. In both of bi-level and multilevel thresholding, the aim is determining an accurate threshold or multiple thresholds, respectively.

In the linear search the search process performed by considering all the elements. Hence, with increasing the number of thresholds, computational complexity increases exponentially. This limits the ability of multilevel thresholding algorithms.

Meta-heuristic techniques have been proved to be an efficient tool to solve such problems and they are one of the best ways to yield optimal solutions and also can be helpful to overcome these limitations [22]. PSO, Genetic, Firefly Algorithm (FA), Cuckoo search, Artificial Bee Colony (ABC) and bacterial foraging algorithm (BF), which are the heuristic algorithms, have been applied in multilevel thresholding [23].

Sathya and Kayalvizhi proposed bacterial foraging algorithm, modified bacterial foraging algorithm and amended bacterial foraging algorithm for the minimum variance and maximum entropy criterions [22, 24, 25]. Moreover, Yin [26] proposed a particle swarm optimization for the multilevel minimum cross-entropy criterion; on the other hand, Horng and jiang [2] applied the firefly optimization algorithm to optimize minimum cross-entropy criterion. In addition to the mentioned algorithms, Pal and et al. [27] also proposed a multilevel thresholding algorithm for the minimum variance and maximum entropy criterions using Spider Monkey Optimization Algorithm. Finally, Horng [28] also proposed a multilevel thresholding algorithm based on ABC algorithm to optimize the maximum entropy criterion.

Animal migration optimization (AMO) developed by Xiangtao and et al. is one of the novel heuristic algorithm [29].AMO is inspired by the animal migration behavior, which is a widespread phenomenon that can be seen in most of animal groups. In this study, AMO algorithm is used to solve the problem of multilevel thresholding for image segmentation. In the proposed method Otsu’s and Kapur’s methods are considered as the objective functions. Experimental results are reported and are also compared with some widely used optimization algorithm for multilevel thresholding.

The paper is structured as follows. Section 2 presents problem formulation. Section 3 presents the concepts of animal migration model and algorithm. Section 4 provides the illustration of the proposed method. Section 5 analyzes and compares the results obtained for the proposed approach and other methods. Finally, conclusion is presented in Sect. 6.

2 Problem formulation

In this proposed paper, two most popular methods that were used for finding optimal threshold on image histogram are known by the name of Kapur entropy and the between-class variance (Otsu’s) method. Both of these methods separately are used for maximizing an objective function [25].

2.1 Entropy criterion method (Kapur’s method)

As stated by Kapur’s method, for bi-level thresholding, the objective function is represented with the following equation:
$$ \,J(t_{1} ) = H_{0} + H_{1} $$
(1)
where
$$ H_{0} = - \sum\limits_{i = 0}^{{t_{1} - 1}} {\tfrac{{p_{i} }}{{\omega_{0} }}} \ln \tfrac{{p_{i} }}{{\omega_{0} }},\,\,\omega_{0} = \sum\limits_{i = 0}^{{t_{1} - 1}} {p_{i} } $$
and
$$ H_{1} = - \sum\limits_{{i = t_{1} }}^{L - 1} {\tfrac{{p_{i} }}{{\omega_{1} }}} \ln \tfrac{{p_{i} }}{{\omega_{1} }},\, \,\omega_{1} = \sum\limits_{{i = t_{1} }}^{L - 1} {p_{i} } $$
Maximization of Eq. (1) is the objective function that demonstrates grey-level optimal threshold. Here, H0 represents partial entropy of histogram for first segment and H1 is for second segment. Kapur’s entropy criterion method can also extended for settling problem of multilevel thresholding. Then, the problem can be turned as a multi-dimensional problem. Determining all of threshold values can be described with the following equation:
$$ \,J(t_{1} ,t_{1} , \ldots ,t_{m} ) = H_{0} + H_{1} + H_{2} + \cdots + H_{m} $$
(2)
where
$$ \begin{aligned} H_{0} = - \sum\limits_{i = 0}^{{t_{1} - 1}} {\tfrac{{p_{i} }}{{\omega_{0} }}} \ln \tfrac{{p_{i} }}{{\omega_{0} }},\,\,\omega_{0} = \sum\limits_{i = 0}^{{t_{1} - 1}} {p_{i} } \hfill \\ H_{1} = - \sum\limits_{{i = t_{1} }}^{{t_{2} - 1}} {\tfrac{{p_{i} }}{{\omega_{1} }}} \ln \tfrac{{p_{i} }}{{\omega_{1} }},\,\,\omega_{1} = \sum\limits_{{i = t_{1} }}^{{t_{2} - 1}} {p_{i} } \hfill \\ H_{2} = - \sum\limits_{{i = t_{2} }}^{{t_{3} - 1}} {\tfrac{{p_{i} }}{{\omega_{2} }}} \ln \tfrac{{p_{i} }}{{\omega_{2} }},\,\,\omega_{2} = \sum\limits_{{i = t_{2} }}^{{t_{3} - 1}} {p_{i} } \hfill \\ \vdots \hfill \\ H_{m} = - \sum\limits_{{i = t_{m} }}^{L - 1} {\tfrac{{p_{i} }}{{\omega_{m} }}} \ln \tfrac{{p_{i} }}{{\omega_{m} }},\,\,\omega_{m} = \sum\limits_{{i = t_{m} }}^{L - 1} {p_{i} } \hfill \\ \end{aligned} $$

2.2 Between-class variance method (Otsu’s method)

As stated by between-class variance (Otsu’s) method, for bi-level thresholding, the objective function is represented with the following equation:
$$ \,J(t_{1} ) = \sigma_{0} + \sigma_{1} $$
(3)
where
$$ \,\sigma_{0} = \omega_{0} (\mu_{0} - \mu_{T} )^{2} \,\,{\text{and}}\,\,\,\,\sigma_{1} = \omega_{1} (\mu_{1} - \mu_{T} )^{2} $$
with
$$ \,\omega_{0} = \sum\limits_{i = 0}^{{t_{1} - 1}} {p_{i} } ,\,\,\mu_{0} = \sum\limits_{i = 0}^{{t_{1} - 1}} {\frac{{i\,p_{i} }}{{\omega_{0} }}} $$
$$ \,\omega_{1} = \sum\limits_{{i = t_{1} }}^{L - 1} {p_{i} } ,\,\,\mu_{1} = \sum\limits_{{i = t_{1} }}^{L - 1} {\frac{{i\,p_{i} }}{{\omega_{1} }}} $$
$$ \,\mu_{\text{T}} = \sum\limits_{i = 0}^{L - 1} {} i\,p_{i} , $$
here \( \mu_{\text{T}} \) is the mean of the whole image intensity, it is formulated in following equation:
$$ \,\omega_{0} \mu_{0} + \omega_{1} \mu_{1} = \mu_{\text{T}} \,\,\,{\text{and}}\,\,\,\omega_{0} + \omega_{1} = 1 $$
Like entropy criterion (Kapur’s) method, between-class variance (Otsu’s) method can also be extended for settling problem of multilevel thresholding, then the problem can be tuned as a multiple dimension problem. Determining all of threshold value can be described as Eq. (4):
$$ \,J(t_{1} ,t_{2} , \ldots ,t_{m} ) = \sigma_{0} + \sigma_{1} + \sigma_{2} + \cdots + \sigma_{m} $$
(4)
where
$$ \begin{aligned} \,\sigma_{0} = \omega_{0} (\mu_{0} - \mu_{\text{T}} )^{2} \hfill \\ \,\sigma_{1} = \omega_{1} (\mu_{1} - \mu_{\text{T}} )^{2} \hfill \\ \,\sigma_{2} = \omega_{2} (\mu_{2} - \mu_{\text{T}} )^{2} \hfill \\ \vdots \hfill \\ \,\sigma_{m} = \omega_{m} (\mu_{m} - \mu_{T} )^{2} \hfill \\ \end{aligned} $$
with
$$ \begin{aligned} \,\omega_{0} = \sum\limits_{i = 0}^{{t_{1} - 1}} {p_{i} } ,\,\,\mu_{0} = \sum\limits_{i = 0}^{{t_{1} - 1}} {\frac{{i\,p_{i} }}{{\omega_{0} }}} \hfill \\ \,\omega_{1} = \sum\limits_{{i = t_{1} }}^{{t_{2} - 1}} {p_{i} } ,\,\,\mu_{1} = \sum\limits_{{i = t_{1} }}^{{t_{2} - 1}} {\frac{{i\,p_{i} }}{{\omega_{1} }}} \hfill \\ \vdots \hfill \\ \,\omega_{m} = \sum\limits_{{i = t_{m} }}^{L - 1} {p_{i} } ,\,\,\mu_{m} = \sum\limits_{{i = t_{m} }}^{L - 1} {\frac{{i\,p_{i} }}{{\omega_{m} }}} \hfill \\ \end{aligned} $$
In both of Otsu and Kapur methods, there are constrains which are defined as:
$$ \,t_{1} < t_{2} < t_{3} < \cdots < t_{m} . $$

3 Animal migration model and algorithm

The animal migration optimization algorithm is a new meta-heuristic population-based optimization algorithm, which is inspired by the natural animal migration behavior. This algorithm consists of two processes. The first process is simulation of moving animals to new position from current position (migration process). For this motion there are three essential rules that should be obeyed by each individual: (1) the neighbours must move in the same direction; (2) keep distance between neighbours and (3) overlapping of neighbours should be avoided. The latter process of algorithm simulates leaving and joining interaction of animals in the group (population updating process). In this algorithm two simple ideas are considering:
  1. 1.

    The animal with the best objective function value is considered as the leader, and its position is preserved in next generation.

     
  2. 2.

    Size of population is fixed, and a new member will be replaced with the existing animal probability pa. Therefore, an animal is leaving from the group and a new one will be joining instead of the leaving one.

     
Assume that the faced problem is a global optimization problem and there are populations of candidate individuals. The individual is denoted as a multi-dimensional real coded vector. Like other swarm-based optimization algorithms, AMO also starts with a randomly initial population of candidate. So, initialization of jth component from ith vector defined as:
$$ x_{j,i,0} = x_{{j,{ \hbox{min} }}} + {\text{rand}}_{i,j} \left[ {0,1} \right] \times \left( {x_{{j,{ \hbox{max} }}} - x_{{j,{ \hbox{min} }}} } \right), $$
(5)
where randi,j [0, 1] is a random number with uniformly distribution between 0 and 1, i = 1, …, N and j = 1, …, D. where N denotes the population size.
As it was mentioned earlier, the algorithm consists of two processes: migration and updating process. As it mentioned before for obeying the first rule in the migration process, position of all individual group members should be different. For the rest rules, all individual group members should be moves to a new position under consideration of current position of their neighbours. Ring topology has been applied to determine local neighbourhood of an individual. Scheme of the ring topology has been illustrated in Fig. 1.
Fig. 1

The scheme of the local neighbourhood of an individual

In this algorithm, the topology of the neighbourhood is as static and based on the indices set of vectors. Because of easiness, the neighbourhood length for all dimensions of each individual is set to five. In this case, for the ith index, indices of neighbourhood animal are i − 2, i − 1, i, i + 1 and i + 2 as it is clear from Fig. 1. The first animal is the neighbor of the last animal and vice versa. So the indices of neighbours of first animal are 1, 2, 3, N and N − 1. When the topology of the neighbourhood has been constructed, one of neighbour will be selected randomly and the individual position will be updated according to this neighbour, as it is formulated in the equation:
$$ x_{i,G + 1} = x_{i,G} + \delta \times \left( {x_{{{\text{neighborhood,}}G}} - x_{i,G} } \right) $$
(6)
where \( x_{{{\text{neighborhood}},G}} \) is the current position of the neighbourhood and \( \delta \) is depend on the problems. In the original paper of AMO, \( \delta \) is a random number which is generated by Gaussian distribution. During the process of population updating, some animals leave the group, and then instead of those, some new animal join in the population. Population size must be fixed, so the number of the existing members cannot be changed in any iteration performed. A new animal that desires to join the group must be placed instead of an animal that has left the group depending on a probability value. The probability is related to fitness value. For the animal with the highest fitness value probability Pa is 1 and for the animal with the smallest fitness value probability, Pa is 1/N.
The pseudocode of this process is illustrated as follows:

where r1, r2 are two randomly selected integers between [1, Population size], and r1\( \ne \)r2\( \ne \)i. The new generated solution xi, G + 1, will be evaluated to compare with the existing solution xi, G, if the fitness value of xi, G+1 is better than fitness of Xi, G, the new solution will be xi, G+1; otherwise, the accepted solution is xi, G. Algorithm 1 show the pseudocode of standard animal migration optimization algorithm.

4 Multilevel thresholding based on AMO

In this proposed algorithm, optimum D-dimensional vector x = [t1, t2, t3, \( \ldots \), tD] will be obtained by maximized the Eqs. (2) or (4). In AMO algorithm both of these objective functions are also applied as the fitness function. Each individual position corresponds to a solution. The number of thresholds determines the dimension number of optimization algorithm. Each dimension of optimization algorithm represents a solution to a threshold. The algorithm starts with a D-dimension population that is initiated randomly. Each dimension is constrained by bounds [0, 255]. So, initialization of jth component from ith vector defined as Eq. (7):
$$ x_{j,i,0} = x_{j,0} + {\text{rand}}_{i,j} \left[ {0,1} \right] \times \left( {x_{j,255} - x_{j,0} } \right) $$
(7)
Each solution is formulated as:
$$ {\text{x }} = \, [{\text{t}}_{ 1} ,{\text{ t}}_{ 2} ,{\text{ t}}_{ 3} , \ldots ,{\text{ t}}_{\text{D}} ]{\text{ subject to}}\,\,\,1 < t_{1} < t_{2} < t_{3} < \cdots < t_{m} < L $$

5 Experimental results and performance evaluation

The proposed method and all compared algorithms (Genetic Algorithm, Bacterial foraging optimization, Particle Swarm Optimization) have been implemented in Matlab programming language under a same PC with Intel Core(TM) i7-3632QM 2.2 GH processor and 8 gigabytes of RAM. To evaluate the efficiency of proposed method, six benchmark images named ‘‘CAMERMAN”, ‘‘LENA”, ‘LİVİNGROOM‘”, ‘‘HUNTER”, ‘‘PEPPER”, and ‘‘MANDRILL” shown in Fig. 2 are used for carrying out the experiments.
Fig. 2

Images used for performance evaluation

Number of solutions (animals, particles, chromosome and bacteria in AMO, PSO, GA, and BF, respectively) and number of maximum generation for all applied optimization algorithm have been set to 200. The other parameters for the algorithms used in the experiments are given in Table 1.
Table 1

Control parameters of the optimization algorithms

Algorithm

Initial values of control parameters

AMO

Neighbourhood length = 5,\( \delta \) is a random number controlled by a Gaussian distribution

PSO

Cognitive coefficient (C1 and C2) = 0.88, inertia weight (W) = 0.91

GA

Roulette selection, CR = 0.8, Gaussian Mutation scale = 2 shrink = 1

BF

Number of chemotactic steps (Nc) = 100, swimming length (Ns) = 3, number of reproduction steps (Nre) = 4, number of elimination of dispersal events (Ned) = 2, step size(Ci) = 5.1, probability of elimination and dispersal (Ped) = 0.25

All the algorithms run 30 times over each test image. After 30 times running of the algorithms, the average of obtained results for all runs is reported. The obtained thresholds by Otsu’s and Kapur’s method and corresponding fitness values of six test images with AMO, PSO, GA, and BF have been reported in Tables 2 and 5. For evaluating the consistency and stability of algorithms, standard deviation (STD) has been calculated from the results obtained in the 30 times run of algorithms and reported in Tables 3 and 6. The formulation of STD is expressed in equation
Table 2

Comparison of best obtained objective and optimal threshold values based on Kapur

Test images

No. of thresholds

Average fitness value

Average optimal threshold values

AMO

PSO

GA

BF

AMO

PSO

GA

BF

Cameraman

2

12.2987

12.2802

12.2802

12.2651

125,196

125,196

125,196

125,196

3

15.4172

15.3880

15.3880

15.3765

43,101,196

44,102,196

44,102,196

44,103,196

4

18.6073

18.5497

18.5494

18.5080

42,96,145,196

42,96,145,198

42,96,145,197

42,97,145,197

5

21.3531

21.2613

21.2525

21.2230

41,96,143,191,221

42,96,145,191,222

42,90,133,180,214

26,66,108,153,201

Lenna

2

12.3753

12.3753

12.3464

12.3344

97,164

97,164

97,164

97,164

3

15.3737

15.3184

15.3184

15.2996

82,127,175

82,126,175

82,126,175

83,127,176

4

18.1020

18.0079

18.0061

17.9662

73,111, 147,183

66,101,140,181

68,103,141,180

68,102,141,180

5

20.7592

20.6093

20.6091

20.5042

63,94,127,162,193

63,94,128,163,194

63,94,128,163,194

63,95,128,162,194

Livingroom

2

12.4285

12.4059

12.4059

12.3945

89,170

94,175

94,175

94,175

3

15.5210

15.4056

15.5519

15.5262

49,107,178

60,123,192

47,104,175

48,104,174

4

18.4067

18.2453

18.4679

18.4198

46,100,159,215

47,102,171,230

47,98,149,196

47,98,150,194

5

21.1718

21.0947

21.1439

21.0683

45,93,139,183,233

47,98,145,188,236

44,87,125,163,199

41,86,125,164,199

Hunter

2

12.0302

12.0033

12.0033

11.9948

114,179

112,179

112,179

112,179

3

15.0333

14.9748

14.9745

14.9580

86,132,180

86,129,180

86,131,180

87,133,181

4

17.7674

17.6193

17.6581

17.6032

76,113,149,183

77,115,152,187

76,114,149,183

76,113,148,183

5

20.1427

20.0197

20.1024

20.0033

73,107,139,171,200

72,105,138,170,205

68,96,125,154,183

67,96,125,156,186

Pepper

2

12.6138

12.5852

12.5852

12.5781

76, 146

77,147

77,147

77,147

3

15.6802

15.6238

15.6238

15.6158

61,112,163

61,112,164

61,112,164

62,113,165

4

18.5368

18.5286

18.4608

18.4269

56,99,144,190

52,92,136,182

59,105,149,195

58,105,150,195

5

21.3175

21.3175

21.1922

21.1447

45,78,114,154,195

45,78,114,154,195

45,78,115,154,195

43,77,116,156,195

Mandrill

2

12.1245

12.1245

12.1245

12.1114

80,143

80,143

80,143

80,143

3

15.1310

15.1310

15.1309

15.1137

56,104,153

56,104,153

56,104,153

57,105,153

4

17.8940

17.8953

17.8936

17.8589

46,84,122,162

45,82,120,161,

47,85,124,163

45,83,121,161

5

20.5081

20.5084

20.5037

20.4341

40,73,107,139,172

40,73,106,139,172

42,75,108,140,172

38,72,106,141,174

Table 3

Comparison of standard deviation for Kapur based

Test images

No. of thresholds

Standard deviation

AMO

PSO

GA

BF

Cameraman

2

5.4202e−15

3.6450e−15

3.6450e−15

0.0987

3

1.6113e−05

9.1125e−15

9.1125e−15

0.0523

4

0.000031

3.6450e−15

4.2827e−04

0.0706

5

3.0161e−04

3.6450e−15

0.0232

0.0640

Lenna

2

0.0022

3.6450e−15

3.6450e−15

0.1082

3

0.0117

0

0

0.0985

4

0.0072

0.0092

0.0079

0.0876

5

3.4142e−04

0

3.7072e−04

0.0884

Livingroom

2

5.4202e−15

5.4675e−15

5.4675e−15

0.0948

3

0.2346

0.2500

0.0013

0.0906

4

0.1465

0.0972

0.0040

0.0654

5

0.0202

7.2900e−15

0.0031

0.0541

Hunter

2

1.8067e−15

0

0

0.0819

3

7.5814e−04

0

3.4816e−04

0.0745

4

3.6134e−15

0.1208

0.0012

0.0810

5

0.0705

0.0836

0.0085

0.0621

pepper

2

0

5.4675e−15

5.4675e−15

0.0650

3

9.0597e−05

0

3.7205e−06

0.0435

4

0.0145

0.0161

5.0796e−04

0.0290

5

3.7449e−15

1.0840e−14

0.0011

0.0275

Mandrill

2

5.4675e−15

5.4675e−15

5.4675e−15

0.1055

3

9.1125e−15

9.1125e−15

1.7303e−04

0.0874

4

0.0021

0.0021

0.0023

0.0663

5

4.6559e−04

3.6450e−15

0.0048

0.0585

Figure 3 shows the segmented Lena, Livingroom, Hunter and Mandrill images by Otsu method with various “m” levels. The best obtained results are bolded in each row. As it is clear from Tables 2 and 5, in most case the best results are obtained by AMO algorithm. Also, Tables 3 and 6 reveal that except BA, most of the calculated standard deviations from other three algorithms are too small. By comparing Tables 3 and 6 it turns out that the obtained standard deviation from Kapur method is lower than Otsu method. Moreover, two well-known performance indicators, peak signal-to-noise ratio (PSNR) and structural-similarity index (SSIM), are used to compare the segmentation results using the multilevel image threshold methods. General form of PSNR and SSIM can be modelled as in Eqs. (8) and (9), respectively.
$$ {\text{PSNR}} = 10 \log_{10} \left( {\frac{{255^{2} }}{\text{MSE}}} \right) $$
$$ {\text{MSE}} = \frac{1}{M \times N}\mathop \sum \limits_{x = 0}^{M - 1} \mathop \sum \limits_{y = 0}^{N - 1} \left[ {I\left( {x,y} \right) - \tilde{I}\left( {x,y} \right)} \right]^{2} $$
(8)
Here \( I \) and \( \tilde{I} \) are original and segmented images of size M\( \times \)N, respectively.
$$ {\text{SSIM}}\left( {I,\tilde{I}} \right) = \frac{{\left( {2\mu_{I} \mu_{{\tilde{I}}} + c_{1} } \right)\left( {2\sigma_{{I\,\tilde{I}}} + c_{2} } \right)}}{{\left( {\mu_{I}^{2} \mu_{{\tilde{I}}}^{2} + c_{1} } \right)\left( {\sigma_{I}^{2} + \sigma_{{\tilde{I}}}^{2} + c_{2} } \right)}} $$
(9)
where \( \mu_{I} \) and \( \mu_{{\tilde{I}}} \) are the local sample averages of original image \( I \) and segmented image \( \tilde{I} \), respectively\( \sigma_{I\,} \), and \( \sigma_{{\,\tilde{I}}} \) the local sample standard deviations of \( I \) and \( \tilde{I} \), respectively, \( \sigma_{{I\,\tilde{I}}} \) the local sample correlation coefficient between \( I \) and \( \tilde{I} \), C1, C2 the constants required to balance the calculations. The SSIM can take values in range [− 1, 1].
Fig. 3

Segmented Lena, Livingroom, Hunter and Mandrill images by Otsu method with 2, 3, 4 and 5 “m” levels

Tables 4 and 7 give the PSNR and SSIM results between the original images and its threshold image for different algorithms and number of thresholds, respectively. Experimental results demonstrate that our proposed method is more impressive and stable than other three compared methods.
$$ \sigma = \frac{1}{N}\mathop \sum \limits_{i = 1}^{N} \left( {x_{i} - \mu } \right)^{2} $$
(10)
where N indicates number of runs, \( x_{i} \) is fitness value in ith run and \( \mu \) is mean values among all runs.
Table 4

Comparison of PSNR and SSIM for Kapur based

Test images

Number of thresholds

Standard deviation

AMO

PSO

GA

BF

PSNR

SSIM

PSNR

SSIM

PSNR

SSIM

PSNR

SSIM

Cameraman

2

13.7753

0.5146

13.7753

0.5146

13.7753

0.5146

13.7753

0.5146

3

14.3070

0.6019

14.4263

0.6046

14.4263

0.6046

14.5417

0.60701

4

20.1555

0.6637

20.1555

0.6637

20.1633

0.6636

20.2167

0.66456

5

20.1686

0.6707

20.2799

0.6628

20.0774

0.6480

21.4091

0.68342

Lenna

2

14.5859

0.52382

14.5859

0.52382

14.5859

0.52382

16.838

0.51895

3

17.2232

0.6231

15.7096

0.62779

17.2244

0.62506

18.9112

0.61391

4

18.6493

0.67944

19.4767

0.69249

18.8699

0.67877

20.8974

0.64346

5

19.856

0.70838

19.7569

0.70255

19.8211

0.70712

22.2527

0.65467

Livingroom

2

14.631

0.49419

14.5962

0.48312

14.5962

0.48312

14.5962

0.48312

3

17.2887

0.60866

16.9132

0.57559

17.1987

0.61413

17.2845

0.61542

4

18.2184

0.64196

10.8862

0.38196

19.1671

0.66974

19.22

0.66957

5

19.8144

0.68587

19.6189

0.6816

21.2505

0.72583

21.0899

0.72317

Hunter

2

13.1492

0.3477

13.2331

0.35289

13.2331

0.35289

13.2331

0.35289

3

16.1986

0.48296

16.2147

0.48668

16.1971

0.48375

16.1222

0.48013

4

17.8826

0.56959

17.7638

0.56322

17.894

0.56994

17.9166

0.57187

5

18.4828

0.59193

18.5315

0.59075

19.2596

0.63065

19.3138

0.63115

Pepper

2

16.4554

0.58523

16.4435

0.58126

16.4435

0.58126

16.4435

0.58126

3

18.3578

0.65889

18.3578

0.65889

18.3578

0.65889

18.3571

0.65832

4

20.397

0.69456

20.397

0.69456

19.1435

0.68261

19.1194

0.68263

5

21.3492

0.74725

21.3492

0.74725

21.3756

0.74773

21.3604

0.74863

Mandrill

2

16.1789

0.61377

16.1789

0.61377

16.1789

0.61377

16.1789

0.61377

3

19.1587

0.72407

19.1587

0.72407

19.1587

0.72407

19.2053

0.72503

4

21.0974

0.77348

21.0733

0.77163

21.0668

0.77425

21.0887

0.77336

5

22.7607

0.82299

22.7317

0.82299

22.8556

0.825

22.5138

0.8171

6 Conclusion

In this paper, based on animal migration optimization (AMO) algorithm a new multilevel image thresholding is presented for image segmentation. Kapur and Otsu are considered as objective functions. The proposed method has been tested on the various widely used benchmark images. Obtained results via animal migration optimization algorithm are compared with PSO, GA and BF methods. In most case, the obtained results from proposed method give worthy results than the other three tested algorithms in terms of objective function value. Under consideration of standard deviation values, the stability of the AMO is promising. In this study, the number of thresholds was a pre-defined parameter. However, automatic threshold number could be tested in future investigation (Tables 5, 6 and 7).
Table 5

Comparison of best obtained objective and optimal threshold values based on Otsu

Test images

No. of thresholds

Average fitness value

Average optimal threshold values

AMO

PSO

GA

BF

AMO

PSO

GA

BF

Cameraman

2

3.6098e+03

3.6098e+03

3.6039e+03

3.5985e+03

69,144

69,144

70,144

70,144

3

3.6765e+03

3.6774e+03

3.6774e+03

3.6735e+03

59,119,155

56,115,153

56,115,153

56,115,153

4

3.7325e+03

3.7325e+03

3.7324e+03

3.7264e+03

41,94,139,169

41,94,139,169

43,95,139,169

42,93,139,169

5

3.7617e+03

3.7631e+03

3.7624e+03

3.7544e+03

36,85,125,152,175

35,82,121,148,172

40,85,123,149,172

34,83,122,149,172

Lenna

2

1.9618e+03

1.9618e+03

1.9618e+03

1.9563e+03

92,152

92,152

93,151

93,151

3

2.1379e+03

2.1379e+03

2.1283e+03

2.1236e+03

79,125,172

79,125,172

81,127,171

81,126,171

4

2.2103e+03

2.2103e+03

2.1918e+03

2.1845e+03

74,112,145,177

74,112,145,177

75,114,145,180

74,114,145,179

5

2.2176e+03

2.2178e+03

2.2177e+03

2.2085e+03

73,108,136,160,188

73,109,136,160,188

71,105,133,157,186

70,107,134,160,189

Livingroom

2

1.6280e+03

1.6280e+03

1.6273e+03

1.6196e+03

86,145

86,145

87,145

87,145

3

1.7747e+03

1.7747e+03

1.7594e+03

1.7510e+03

73,123,164

73,123,164

76,123,163

75,123,163

4

1.8600e+03

1.8593e+03

1.8281e+03

1.8178e+03

48,91,132,168

48,92,133,168

56,97,132,168

56,97,132,168

5

1.9158e+03

1.9150e+03

1.8709e+03

1.8583e+03

47,86,123,151,182

47,87,124,152,182

51,89,121,148,179

45,86,120,146,177

Hunter

2

1.9962e+03

1.9962e+03

1.9945e+03

1.9907e+03

87,143

87,143

86,141

86,141

3

2.1396e+03

2.1396e+03

2.1153e+03

2.1114e+03

70,116,158

70,116,158

71,114,155

71,113,155

4

2.2643e+03

2.2443e+03

2.1697e+03

2.1653e+03

46,83,124,163

54,93,133,168

67,106,140,172

68,106,141,174

5

2.2006e+03

2.2006e+03

2.2006e+03

2.1935e+03

62,93,122,150,181

62,93,122,150,181

63,93,122,150,180

62,94,123,151,181

Pepper

2

2.4715e+03

2.4715e+03

2.4695e+03

2.4616e+03

66,135

66,135

69,136

69,136

3

2.6555e+03

2.6555e+03

2.6367e+03

2.6339e+03

61,118,167

61,118,167

64,119,166

64,119,167

4

2.7308e+03

2.7302e+03

2.6983e+03

2.6943e+03

53,90,130,175

50,88,128,173

48,86,126,170

48,87,126,169

5

2.7425e+03

2.7425e+03

2.7424e+03

2.7364e+03

43,79,113,146,177

43,79,113,146,177

44,80,113,146,177

44,78,113,147,178

Mandrill

2

1.3673e+03

1.3673e+03

1.3673e+03

1.3588e+03

98,148

98,148

98,148

98,148

3

1.4546e+03

1.4546e+03

1.4546e+03

1.4472e+03

86,124,159

86,124,159

86,124,159

86,124,159

4

1.5039e+03

1.5039e+03

1.5039e+03

1.4946e+03

73,106,135,165

73,106,135,165

73,106,135,165

73,106,135,165

5

1.5282e+03

1.5286e+03

1.5285e+03

1.5164e+03

68,98,123,146,171

69,100,125,148,172

69,100,125,148,172

66,96,122,146,171

Table 6

Comparison of standard deviation for Otsu based

Test images

No. of thresholds

Standard deviation

AMO

PSO

GA

BF

Cameraman

2

1.8501e−12

1.8501e−12

1.3997e−12

44.2376

3

1.7373

53.9406

1.8662e−12

15.9253

4

0.0120

9.3312e−13

0.1830

10.8050

5

0.9896

4.6656e−13

0.8725

7.1871

Lenna

2

9.2504e−13

9.2504e−13

2.3328e−13

51.8123

3

1.3876e−12

1.3876e−12

0

23.8312

4

1.8352e−12

1.8501e−12

4.6656e−13

15.3602

5

0.3689

0.3160

0.6278

9.8940

Livingroom

2

6.9378e−13

6.9378e−13

6.9984e−13

64.2211

3

9.2504e−13

9.2504e−13

0

35.7859

4

0.1456

3.6995

0.0154

21.6782

5

2.3126e−13

1.5258

0.2647

14.1206

Hunter

2

9.2504e−13

9.2504e−13

2.3328e−13

31.9147

3

9.2504e−13

9.2504e−13

0

14.4766

4

12.6234

32.1884

0.0024

7.1271

5

0.0940

0

0.1160

6.5958

Pepper

2

9.2504e−13

9.2504e−13

0

71.8040

3

1.1012e−15

0

4.6656e−13

14.4440

4

0.4845

1.8383

0.0945

10.1671

5

0.1946

0.9984

0.1275

4.5501

Mandrill

2

4.6656e−13

4.6656e−13

4.6656e−13

73.1514

3

4.6656e−13

4.6656e−13

4.6656e−13

32.4821

4

4.6656e−13

4.6656e−13

0.0069

17.6939

5

0.5030

4.6656e−13

0.0370

12.4319

Table 7

Comparison of PSNR and SSIM for Otsu based

Test images

Number of thresholds

Standard deviation

AMO

PSO

GA

BF

PSNR

SSIM

PSNR

SSIM

PSNR

SSIM

PSNR

SSIM

Cameraman

2

17.1732

0.59537

17.1732

0.59537

17.2478

0.59641

17.2478

0.59641

3

20.2363

0.63574

20.3227

0.64408

20.3227

0.64408

20.3227

0.64408

4

21.5455

0.65043

21.5455

0.65043

21.6175

0.65091

21.4807

0.64909

5

23.2902

0.68322

23.3765

0.68896

23.4499

0.68699

23.3814

0.6886

Lenna

2

15.2802

0.54522

15.2802

0.54522

15.2823

0.54652

15.2823

0.54652

3

17.3742

0.63411

17.3742

0.63411

17.3146

18.6142

17.3146

18.6142

4

18.6337

0.67846

18.6337

0.67846

0.62887

0.67729

18.6502

0.6786

5

19.2572

0.70155

19.2517

0.70288

19.4237

0.69785

19.4245

0.70323

Livingroom

2

16.0077

0.53765

16.0077

0.53765

15.9995

0.53677

15.9995

0.53677

3

18.1379

0.61375

18.1379

0.61375

18.1975

0.61634

18.1415

0.61475

4

20.54

0.70526

20.6179

0.70537

20.6735

0.70428

20.6735

0.70428

5

21.9078

0.74681

21.9366

0.7466

22.1618

0.75334

22.244

0.75756

Hunter

2

15.5292

0.45068

15.5292

0.45068

15.5917

0.45593

15.5917

0.45593

3

17.8573

0.5603

17.8573

0.5603

17.7883

0.56217

17.7709

0.56207

4

20.0522

0.6475

19.4655

0.62044

18.7652

0.60213

18.6814

0.59819

5

19.8157

0.65123

19.8157

0.65123

19.8157

0.65123

19.8263

0.65048

Pepper

2

16.2227

0.61328

16.2227

0.61328

16.3234

0.60961

16.3234

0.60961

3

18.3452

0.65895

18.3452

0.65895

18.4696

0.65733

18.4426

0.65726

4

20.6145

0.702

20.6753

0.71086

20.6804

0.71674

20.6766

0.71482

5

22.393

0.76129

22.393

0.76129

22.4186

0.7591

22.3611

0.76169

Mandrill

2

15.4335

0.58674

15.4335

0.58674

15.4335

0.58674

15.4335

0.58674

3

17.8513

0.67863

17.8513

0.67863

17.8513

0.67863

17.8513

0.67863

4

20.4155

0.77083

20.4155

0.77083

20.4155

0.77083

20.4155

0.77083

5

21.8362

0.81077

21.6952

0.80974

21.6952

0.80974

22.0639

0.8137

Notes

Acknowledgements

The author declares no conflict of interest in this study.

Funding

We confirm that we do not have a funding source.

Compliance with ethical standards

Conflict of interest

The authors declare that they have no competing interests.

References

  1. 1.
    Sarkar, S., Das, S., Chaudhuri, S.S.: A multilevel color image thresholding scheme based on minimum cross entropy and differential evolution. Pattern Recogn. Lett. 54, 27–35 (2015)Google Scholar
  2. 2.
    Horng, M.-H., Liou, R.-J.: Multilevel minimum cross entropy threshold selection based on the firefly algorithm. Expert Syst. Appl. 38(12), 14805–14811 (2011)Google Scholar
  3. 3.
    Chang, C.-C., Wang, L.-L.: A fast multilevel thresholding method based on lowpass and highpass filtering. Pattern Recogn. Lett. 18(14), 1469–1478 (1997)MathSciNetGoogle Scholar
  4. 4.
    Kurban, T., Civicioglu, P., Kurban, R., Besdok, E.: Comparison of evolutionary and swarm based computational techniques for multilevel color image thresholding. Appl. Soft Comput. 23, 128–143 (2014)Google Scholar
  5. 5.
    Oliva, D., Cuevas, E., Pajares, G., Zaldivar, D., Perez-Cisneros, M.: Multilevel thresholding segmentation based on harmony search optimization. J. Appl. Math. (2013)Google Scholar
  6. 6.
    Arora, S., Acharya, J., Verma, A., Panigrahi, P.K.: Multilevel thresholding for image segmentation through a fast statistical recursive algorithm. Pattern Recogn. Lett. 29(2), 119–125 (2008)Google Scholar
  7. 7.
    Maitra, M., Chatterjee, A.: A hybrid cooperative–comprehensive learning based PSO algorithm for image segmentation using multilevel thresholding. Expert Syst. Appl. 34(2), 1341–1350 (2008)Google Scholar
  8. 8.
    Kapur, J.N., Sahoo, P.K., Wong, A.K.: A new method for gray-level picture thresholding using the entropy of the histogram. Comput. Vis. Graph. Image Process. 29(3), 273–285 (1985)Google Scholar
  9. 9.
    Otsu, N.: A threshold selection method from gray-level histograms. Automatica 11(285–296), 23–27 (1975)Google Scholar
  10. 10.
    Pun, T.: Entropic thresholding, a new approach. Comput. Graph. Image Process. 16(3), 210–239 (1981)Google Scholar
  11. 11.
    Brink, A.: Minimum Spatial Entropy Threshold Selection. In: Vision, image and signal processing, IEE proceedings, vol. 3. IET, pp 128–132 (1995)Google Scholar
  12. 12.
    Cheng, H., Chen, J.-R., Li, J.: Threshold selection based on fuzzy c-partition entropy approach. Pattern Recogn. 31(7), 857–870 (1998)Google Scholar
  13. 13.
    Li, X., Zhao, Z., Cheng, H.: Fuzzy entropy threshold approach to breast cancer detection. Inf. Sci. Appl. 4(1), 49–56 (1995)Google Scholar
  14. 14.
    Tobias, O.J., Seara, R.: Image segmentation by histogram thresholding using fuzzy sets. IEEE Trans. Image Process. 11(12), 1457–1465 (2002)Google Scholar
  15. 15.
    Huang, L.-K., Wang, M.-J.J.: Image thresholding by minimizing the measures of fuzziness. Pattern Recogn. 28(1), 41–51 (1995)Google Scholar
  16. 16.
    de Albuquerque, M.P., Esquef, I.A., Mello, A.G.: Image thresholding using Tsallis entropy. Pattern Recogn. Lett. 25(9), 1059–1065 (2004)Google Scholar
  17. 17.
    Liao, P.-S., Chen, T.-S., Chung, P.-C.: A fast algorithm for multilevel thresholding. J. Inf. Sci. Eng. 17(5), 713–727 (2001)Google Scholar
  18. 18.
    Yin, P.-Y., Chen, L.-H.: A fast iterative scheme for multilevel thresholding methods. Signal Process. 60(3), 305–313 (1997)zbMATHGoogle Scholar
  19. 19.
    Cao, L., Shi, Z., Cheng, E.: Fast automatic multilevel thresholding method. Electron. Lett. 38(16), 868–870 (2002)Google Scholar
  20. 20.
    Pikaz, A., Averbuch, A.: Digital image thresholding, based on topological stable-state. Pattern Recogn. 29(5), 829–843 (1996)Google Scholar
  21. 21.
    Hertz, L., Schafer, R.W.: Multilevel thresholding using edge matching. Comput Vis Graph Image Process 44(3), 279–295 (1988)Google Scholar
  22. 22.
    Sathya, P., Kayalvizhi, R.: Modified bacterial foraging algorithm based multilevel thresholding for image segmentation. Eng. Appl. Artif. Intell. 24(4), 595–615 (2011)Google Scholar
  23. 23.
    Sezgin, M., Sankur, B.: Survey over image thresholding techniques and quantitative performance evaluation. J. Electron. Imaging 13(1), 146–166 (2004)Google Scholar
  24. 24.
    Sathya, P., Kayalvizhi, R.: Amended bacterial foraging algorithm for multilevel thresholding of magnetic resonance brain images. Measurement 44(10), 1828–1848 (2011)Google Scholar
  25. 25.
    Sathya, P., Kayalvizhi, R.: Optimal segmentation of brain MRI based on adaptive bacterial foraging algorithm. Neurocomputing 74(14), 2299–2313 (2011)Google Scholar
  26. 26.
    Yin, P.-Y.: Multilevel minimum cross entropy threshold selection based on particle swarm optimization. Appl. Math. Comput. 184(2), 503–513 (2007)MathSciNetzbMATHGoogle Scholar
  27. 27.
    Pal, S.S., Kumar, S., Kashyap, M., Choudhary, Y., Bhattacharya, M.: Multi-level Thresholding Segmentation Approach Based on Spider Monkey Optimization Algorithm. In: Proceedings of the second international conference on computer and communication technologies. Springer, Berlin, pp 273–287 (2016)Google Scholar
  28. 28.
    Horng, M.-H.: Multilevel thresholding selection based on the artificial bee colony algorithm for image segmentation. Expert Syst. Appl. 38(11), 13785–13791 (2011)Google Scholar
  29. 29.
    Li, X., Zhang, J., Yin, M.: Animal migration optimization: an optimization algorithm inspired by animal migration behavior. Neural Comput. Appl. 24(7–8), 1867–1877 (2014)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  1. 1.Computer Engineering DepartmentAltinbas UniversityIstanbulTurkey

Personalised recommendations