APPLYING CHAOTIC IMPERIALIST COMPETITIVE ALGORITHM FOR MULTI-LEVEL IMAGE THRESHOLDING BASED ON KAPUR’S ENTROPY

Segmentation is one of the most important operations in image processing and computer vision. Normally, all image processing and computer vision applications are related to segmentation as a pre-processing phase. Image thresholding is one of the most useful methods for image segmentation. Various methods have been represented for image thresholding. One method is Kapur thresholding, which is based on maximizing entropy criterion. In this study, a new meta-heuristic algorithm based on imperialist competition algorithm was proposed for multi-level thresholding based on Kapur's entropy. Also, imperialist competitive algorithm is combined with chaotic functions to enhance search potency in problem space. The results of the proposed method have been compared with particle optimization algorithm and genetic algorithm. The findings revealed that the proposed method was superior to other methods.


INTRODUCTION
Image segmentation as a pre-processing phase plays an important role in image processing and computer vision applications.In fact, segmentation quality has great effects on other processing steps.Without proper segmentation, an efficient algorithm cannot operate efficiently.Hence, segmentation is constantly considered as an important phase for computer vision.There are various methods for segmentation.One method is applying histogram.Histogram of an image represents the way of intensity distribution of images.One segmentation method based on histogram is thresholding.Thresholding is an important technique for performing image segmentation and is computationally efficient.The main purpose is to determine a threshold for bi-level thresholding or several thresholds for multi-level thresholding.Bilevel thresholding determines only one threshold which separates pixels into 2 groups while multilevel thresholding determines several thresholds which separate pixels into multiple groups.
Thresholding based on entropy was first introduced by Pun.Pun proposed a method to select image optimal thresholds through representing new criterion of maximizing entropy between gray-levels of objects and gray-levels of image background.Another entropy-based method is Kapur's method.Kapur modified Pun's thresholding method by adding 2 gray-level probability distribution: one for background and another one for objects [1].
Almost all primary thresholding methods are able to select optimal thresholding.Using these methods for multi-level thresholding, most of them are improper in terms of performance time and increased thresholds results in exponential increase of time.One recent thresholding method is using meta-heuristic algorithms.These algorithms seek to minimize or maximize a function.Maitra and Chatterjee [4] first introduced a particle optimization algorithm for image multi-level threshold-ing.In their method, a multidimensional particle is changed into several one dimensional particles.The method prevents early convergence of particle optimization algorithm.This combined algorithm has increased efficiency of particle optimization algorithm in thresholding.The cost function used by them was based on Kapur's function.Musrrat Ali et al. [4] applied synergetic differential evolution, which is an improved version of differential evolution for thresholding, and applied fitness function based on Kapur's function.Also, algorithms such as honey bee mating and tabu search [5] have been used for the purpose.

IMPERIALIST COMPETITIVE ALGORITHM
Imperialist competitive algorithm is an optimization algorithm introduced by Atashpaz and Lucas in 2007 [6].This algorithm is inspired from a socio-political process started by some initial populations.In this algorithm, every element of population is called a country.The countries are divided into 2 classes: colonies and imperialists.Each imperialist colonizes and controls some countries.The core of this algorithm consists of a policy of attraction and colonial competition.According to policy of attraction historically applied by imperialists, such as France and England in their colonies, imperialists made efforts to destroy culture, tradition, and language of their colonies (e.g. through building schools to teach their own languages).In this algorithm, the policy is applied through moving colonies of an empire based on a specific relation.When a colony reaches a better position than the current imperialist, it replaces the current imperialist state of the empire.Also, the power of an empire consists of imperialist's power and a percentage of average of its colonies' power.Imperialist competition is another important part of this algorithm.During this process, weak empires lose their power and vanish.Finally, there is one empire which controls the world.In this situation, imperialist competitive algorithm reaches optimal point of objective function and stops.

PROPOSED APPROACH Thresholding through Kapur's method
Let there be L gray-level in the image I and these gray-levels range {1, 2, …, L}.When the pixels of an image are in L gray-level ([0, …, L]) and the number of pixels in i level is n i , normal histogram is as follows: 4 Let there be L gray-level in the image I and these gray-levels range {1, 2, …, L}.Wh pixels of an image are in L gray-level ([0, …, L]) and the number of pixels in i leve normal histogram is as follows: Kapur's method maximizes criterion of entropy of histogram so that separated areas maximum central distribution [7].The criterion is represented as follows for bi thresholding: where Kapur's method maximizes criterion of entropy of histogram so that separated areas have maximum central distribution [7].The criterion is represented as follows for bi-level thresholding: Maximize J(t) = H 0 + H 1 (2) where: 4 normal histogram is as follows: Kapur's method maximizes criterion of entropy of histogram so that separ maximum central distribution [7].The criterion is represented as follo thresholding: Maximize () = H 0 + H 1 where Kapur's method maximizes criterion of entropy of histogram so that separ maximum central distribution [7].The criterion is represented as follow thresholding: Maximize () = H 0 + H 1 where Maximum threshold is a threshold that maximizes the previous equation.In fact, H 0 and H 1 are entropies of each part.The objective of Kapur's method is to maximize this sum (maximizing the entropy).
Kapur's criterion of optimization for multilevel thresholding has developed.This criterion is defined as follows.Multi-level thresholding is supposed as an m dimensional optimization problem.We want to determine m for thresholding [t 1 , t 2 , …, t m ].The objective is to determine the maximum of the following function: Maximum threshold is a threshold that maximizes the previous equation.In fact, H 0 are entropies of each part.The objective of Kapur's method is to maximize th (maximizing the entropy).kapur's criterion of optimization for multi-level thresholding has developed.This c is defined as follows.Multi-level thresholding is supposed as an m dime optimization problem.We want to determine m for thresholding [t 1 , t 2 , …, t m objective is to determine the maximum of the following function:

Chaotic Imperialist Competitive Algorithm
In the proposed method, a sequence generated by chaotic maps is used in the param imperialist competitive algorithm instead of a random sequence of numbers.In this initial countries are generated as a repetition of chaotic maps.In this algorithm, N denote the number of dimensions of the problem and a country in the pop respectively.Varmin and varmax are lower and upper bounds, respectively.A Maximum threshold is a threshold that maximizes the previous equation.In fact, H 0 a are entropies of each part.The objective of Kapur's method is to maximize this (maximizing the entropy).
kapur's criterion of optimization for multi-level thresholding has developed.This cri is defined as follows.Multi-level thresholding is supposed as an m dimens optimization problem.We want to determine m for thresholding objective is to determine the maximum of the following function:

Chaotic Imperialist Competitive Algorithm
In the proposed method, a sequence generated by chaotic maps is used in the paramet imperialist competitive algorithm instead of a random sequence of numbers.In this se initial countries are generated as a repetition of chaotic maps.In this algorithm, N denote the number of dimensions of the problem and a country in the popul respectively.Varmin and varmax are lower and upper bounds, respectively.Als

Chaotic imperialist competitive algorithm
In the proposed method, a sequence generated by chaotic maps is used in the parameters of imperialist competitive algorithm instead of a random sequence of numbers.In this section, initial countries are generated as a repetition of chaotic maps.In this algorithm, N and i denote the num- (5) ber of dimensions of the problem and a country in the population, respectively.Varmin and varmax are lower and upper bounds, respectively.Also, x i,j denotes j th dimension of i th country in the population.Pseudo-code of initial population generation algorithm using chaotic maps is as follows: 6 denotes jth dimension of ith country in the population.Pseudo-code of initial population generation algorithm using chaotic maps is as follows:

Overall Structure of the Proposed Algorithm for Image Segmentation
The proposed algorithm based on chaotic imperialistic competition for multi-level thresholding is described in this section.
Step 1: Give initial values to ICA including Num Of Countries, Num Of Imp, and Num Of Col.The relationship between these parameters is as follows: Num of Countries= Num of Imp + Num of Col (6) Step 2: Produce initial countries by continuous repetition of chaotic map.
Step3: Compute cost function for each country based on Kapur's method.
Step 4: Select Num Of Imp of the strongest countries as imperialist, and the rest are Num Of Col. To establish an initial empire, the normalized cost of the empire can be defined as follows: MCI= the maximum number of chaotic iteration i =0 while ( i population size  ) Randomly initialize the first chaotic variables j =0 while (j<N) generate chaotic variable , i j cm according to the selected map , , var min cm (var max var min)

Overall structure of the proposed algorithm for image segmentation
The proposed algorithm based on chaotic imperialistic competition for multi-level thresholding is described in this section.
Where c k is the cost of the k th empire and C k is its normalized cost.Finally, the normalized power of each empire is defined as follows: c k is the cost of the kth empire and C k is its normalized cost.Finally, the normalized of each empire is defined as follows: | rmalized power of an empire represents the number of initial colonies that should be ered by an imperialist and is defined as follows.N.C n denotes the initial number of es of the nth empire.
: Apply revolution operator on each colony.In each repetition, produce a random max{ } The normalized power of an empire represents the number of initial colonies that should be conquered by an imperialist and is defined as follows.N.C n denotes the initial number of colonies of the n th empire. .( . ) • Step 5: Colonies turn into imperialists chaotically.• Step 6: Apply revolution operator on each colony.In each repetition, produce a random number between 0 and 1 for each imperialist.Next, the result is compared with probability of revolution rate.When the random number is less than the revolution rate, the revolution is produced.

EXPERIMENTAL RESULTS AND COMPARATIVE PERFORMANCES
Five pictures: "Lena", "Pepper", "Bird", "Camera", and "Goldhill", were applied to evaluate the performance of the proposed algorithm.These test images and corresponding histograms are shown in Figure 1.
We implemented the proposed algorithm in language of Matlab (2014) under a computer with 2GHz CPU, 1 G RAM with Windows 8.1 system.The size of "Camera" and "Pepper" image is 256×256 and the size of other images is 512×512.The most appropriate parameters of the algorithm to conduct experiments are shown in Table 1.

Computation time and thresholds
In this section, computation time and thresholds are obtained using the particle optimization algorithm and genetic algorithm.In obtaining thresholds using meta-heuristic algorithm, time is one of the major aspects.By increasing the number of thresholds, computation time increases.Table 2 demonstrates optimal thresholds and computation times based on entropy criterion.
As shown in Table 2, selected thresholds of the proposed algorithm are close to the optimal thresholds of the particle optimization algorithm and genetic algorithm.Also, the computation times of the proposed algorithm are often a little more than that of PSO and genetic algorithm due to using chaotic functions in producing random numbers.

Analysis of signal to noise ratio
The popular performance indicator, peak signal to noise ratio (PSNR) is used to compare segmentation results by threshold techniques of multilevel image [8][9][10].PSNR criterion has been investigated as an evaluation criterion of quality of thresholding.Increased value of PSNR results in higher quality of thresholding.We define the criterion, measured in decibel (dB) as: 10 255 20 log ( ) PSNR RMSE = (10) where: RMSE (root mean-squared error) is defined as follows:  Table 3 shows that by increasing the number of thresholding, signal to noise ratio increases.The results show that the proposed method often presents higher PSNR.Also, most of the time, the genetic algorithm has lower accuracy compared with other methods.

Cost values
The purpose of all meta-heuristic algorithms is to maximize or minimize a function which is called fitness function or cost function.In this study, an entropy based cost function is used, and the purpose is to maximize this function.Table 4 shows the value of cost using the entropy based method.
As shown in Table 4, the cost function increases by increased number of thresholds.Also, the values of the cost function of the proposed method were higher compared with other methods except for "Goldhill" image and the threshold of 4.

Stability analysis
In general, meta-heuristic methods are random algorithms; each implementation may reveal different results.The following formula is used to analyze stability of meta-heuristic algorithms: This formula is used to obtain standard deviation.Standard deviation shows the distribution of data.K denotes the number of implementations of algorithm (10 implementations), and δ i indicates the optimal value for objective function in each implementation.Also, the average of δ values is denoted by µ.Lower standard deviation results in higher stability of algorithm.Table 5 shows the standard deviations using the entropy based method.
As shown in table 5, all standard deviations are low, which shows higher stability of the proposed method compared with other methods.Higher stability means that the results of different implementations are closer while lower stability means that the results are not close.

CONCLUSIONS
In this study, we proposed a maximizing entropy criterion based method to select multi-level thresholds using chaotic imperialist competitive algorithm.Imperialist competitive algorithm is a new meta-heuristic algorithm impressed from imperialistic competition between countries.In this algorithm, each solution is called a country.Imperialists attempt to attract colonies toward themselves, and this process continues until there is only one imperialist.This algorithm has been proved efficient for different optimization problems.The purpose of this study was to segment images using chaotic imperialist competitive algorithm.Thereby, using chaotic functions, the efficiency of the imperialist competitive algorithm was improved.Using chaotic functions for population production the variety of the population increased.Next, the new algorithm was used for image segmentation through thresholding.Kapur-based cost function which applies the entropy criterion was used as fitness function.The results were applied on some images.Several criteria including time, signal to noise ratio, fitness function and standard deviation were applied to evaluate the efficacy.The results revealed that the algorithm is superior to other algorithms in efficacy.Also, applying chaos results in a variety of initial results and increased efficacy of the algorithm.

Fig. 1 .
Fig. 1.Test images and corresponding histograms I and I ^ are original and segmented images of size M×N, respectively.
• Step 7: Calculate the cost of all colonies and imperialists of the empire.In previous steps, if there is a colony in the empire which has lower cost than the imperialist that colony takes the control of the empire.• Step 8: Obtain the total power of all empires.• Step 9: Perform imperialistic competition.• Step 10: Remove the weakest empire.When an empire is removed, all its colonies are removed too.• Step 11: Add one unit to Dec value.• Step 12: When Dec value is more than max Dec (Dec>max Dec ), you can stop; otherwise return to step 6.

Table 1 .
Parameters used for thresholding images

Table 2 .
Optimal thresholds and computation times based on entropy criterion

Table 3 .
Signal to noise ratio for thresholding 5 images using entropy criterion

Table 4 .
Value of cost using the entropy based method

Table 5 .
Standard deviation for entropy criterion based thresholding