Abstract
A multilevel thresholding algorithm for histogrambased image segmentation is presented in this paper. The proposed algorithm introduces an adaptive adjustment strategy of the rotation angle and a cooperative learning strategy into quantum genetic algorithm (called IQGA). An adaptive adjustment strategy of the quantum rotation which is introduced in this study helps improving the convergence speed, search ability, and stability. Cooperative learning enhances the search ability in the highdimensional solution space by splitting a highdimensional vector into several onedimensional vectors. The experimental results demonstrate good performance of the IQGA in solving multilevel thresholding segmentation problem by compared with QGA, GA and PSO.
1. Introduction
Image segmentation which is considered as an important basic operation for computer vision is a lowlevel image processing task, and its result could be presented as input to higherlevel processing tasks such as pattern recognition, object tracking, and scene analysis. Image segmentation is also a classical problem of image processing. Various techniques for image segmentation have been proposed and improved so far, but most of the existing segmentation methods are designed for specific applications. There’s neither a unified theoretical system for image segmentation nor a kind of common and effective approach to all types of images. For the advantages of simplicity of implementation, small amount of calculation, and stable performance, image thresholding technique becomes an effective and widely used tool in image segmentation [1, 2]. It is useful to separate objects from background or discriminate objects from objects that have distinct grey levels. Thresholding can be divided into bilevel thresholding and multilevel thresholding. Bilevel thresholding classifies the pixels into two groups (object and background), one including those pixels with gray levels above a certain threshold and the other including the rest. Multilevel thresholding divides the pixels into several classes. The pixels belonging to the same class have gray levels within a specific range defined by several thresholds [3]. Especially for the images of which target and background occupy different range of gray, the target and background which are with different gray levels can be separated by thresholding techniques, such as extraction of the logos, printed characters, or images in the document images [4]; segmentation of blood cell image and CT image in medical applications [5, 6]; and segmentation of infrared thermal image in infrared nondestructive detection [7]. The use of thresholding techniques has been a very crucial step for fast and accurate segmentation.
Thresholding methods are distinguished as six categories, based on the exploitation of histogram shape information, measurement space clustering, histogram entropy information, image attribute information, spatial information, and local characteristics, respectively, and then spread out dozens of objective functions [7]. Generally, existing image thresholding segmentation problem is transformed into an optimization problem: to propose an objective function which is based on the different information considered or different theory and then to obtain the optimal thresholds by getting the maximum or minimum value of the objective function. Among all the objective functions existing, the thresholding technique, the objective functions based on the entropy (Kapur method) [8], and the betweenclass variance (Otsu method) [9] are the most popular ways [10]. Otsu method can obtain a good segmentation result to the images with obvious bimodal histogram; Kapur method can also achieve a desired result to the images with no obvious bimodal or no bimodal histogram. However, due to the exhaustive searching mechanism, the increasing number of the thresholds leads computation time to grow exponentially which makes the above two methods become timeconsuming issues, and it will greatly limit the application of the multilevel thresholding segmentation algorithm.
Image thresholding segmentation is also a task to find the optimal parameters in the complex parameter space, and the global optimal parameters of the space can be found through optimization algorithms in an acceptable period of time for their fast computational ability. Many algorithms are performed to multilevel thresholding segmentation to improve the computational efficiency [11–13].
Genetic algorithm (GA) provides a common system framework to solve complex optimization problems, and independent on the specific problem areas. GA has been applied to select the parameters in segmentation problem successfully and plays a very important role in image segmentation [14–18]. However, it falls into local optimum easily for the decrease of the diversity of the population in the later period of evolution [19].
Quantuminspired genetic algorithm (QGA) is a new optimization algorithm which combines the concept of quantum computing and classical GA. QGA which was firstly introduced by Narayanan and Moore [20] is a new and promising branch of evolutionary algorithms. The experiment in [20] has demonstrated that QGA has a faster convergence speed than classical GA. In QGA, quantuminspired bit (Qbit) and quantuminspired gate (Qgate) are applied to represent genotype individuals and update Qbits to generate offspring, and the genotypes and phenotypes are linked by a probabilistic observation process. The Qbit encoding of chromosome of QGA has a better diversity of population, and the Qgate which is defined as an update operator of QGA to drive the individuals toward better solutions can treat the balance between exploration and exploitation and avoid premature convergence and escape local optimal efficiently. Nowadays, the research on QGA has attracted the interest of many researchers of various research areas. QGA has been introduced to combinatorial optimization problems [21–23], numerical optimization problems [24], face detection [25], disk allocation [26], image segmentation [27, 28], feature selection [29], multiobjective optimization problems [30, 31], digital filter design [32], power dispatch [33], and so forth. The research on QGA has become a rapidly expanding field. QGA was introduced to image segmentation and achieved a faster speed of convergence than GA [34]. QGA was applied in [35] to determine the parameters and got better segmentation results than traditional fuzzy entropybased method.
The convergence speed of QGA is dependent on the rotation angle greatly. An appropriate angle can help to accelerate the convergence speed and improve the searching ability of the algorithm. Many studies are interested in the research of the rotation angles and the update strategies [36]. Fixed rotation angles in lookup table are proposed in [21]; a gate is employed in [22] to avoid premature convergence; the adjustments of the rotation angles which decrease gradually with the iterations are introduced in [37, 38]. Additionally, for highdimensional optimization problem, the individual is an dimensional vector. In the processing of evolution, the update operation of Qgate is only guided by the current best individual which has the maximum fitness but not always has a reasonable structure of the solution, and each update step is performed on a full dimensional vector. This leads to the possibility of some components of the dimensional vector having been moved closer to the best solution, while others have actually been moved away from the best solution [39]. This kind of holistic information exchange may cause the sharp decline of the search ability with the increase of the dimension. So it still can potentially get trapped in suboptimal locations in search space. In order to solve the above problems and improve the performance of the QGAbased multilevel thresholding segmentation, an improved QGA (IQGA) with adaptive rotation angle and cooperative learning for maximum entropy based multilevel thresholding segmentation is proposed in this paper. The experimental results show that the convergence speed, accuracy, and stability of the proposed algorithm are superior to traditional GA and QGA.
This paper is arranged as follows. Section 2 describes basic concept of the QGA and the improved QGA which introduced the adaptive adjustment strategy and cooperative learning strategy. Section 3 presents the maximum entropy criterion to multilevel thresholding segmentation. The detailed algorithm for IQGAbased image multilevel thresholding segmentation is presented in Section 4. The experimental results are given in Section 5. The conclusions are drawn in Section 6.
2. Improved Quantum Genetic Algorithm
2.1. QGA
QGA is an attractive tool to provide efficient solutions for most complex optimization problems. It is a probabilistic optimization algorithm which introduces the concept and theory of quantum computing into classical GA. Like classical GA, QGA is characterized by the representation of individuals, population diversity, and the use of a fitness evaluation mechanism. However, a quantuminspired bit (Qbit) representation is used in QGA instead of binary, numeric, or symbolic representation which is usually used in GA. Since the Qbit representation can achieve a linear superposition of states given its probabilistic approach, it is conductive to population diversity. A Qbit is the basic computing unit in a QGA and is defined as a column vector: (a Qbit is often represented as in quantum mechanical ketnotation), where the numbers of and satisfy the normalization condition . The values of and denote the probabilities that the Qbit will be found in the states of “0” and “1,” respectively. By a process of probabilistic observation, each Qbit can be rendered into one binary bit. A multiQbit system can be extended naturally. For example, a Qbits system can be described as follows:
This representation has the advantage that it is able to represent any superposition of states. The combination of the Qbits is called quantum chromosome. GA uses the operations such as selection, crossover, and mutation, to maintain the diversity of the population and to obtain the global optimal solution. However, QGA applies quantuminspired rotation gate (Qgate) to update the state of Qbits only. The Qgate is represented as follows:
The Qgate is a unitary operation which is used to change the phase of the Qbit and does not change the length of the Qbit. The Qgate is employed to update the state of a Qbit as follows: where and are the th Qbits of the chromosome before and after the updating, respectively. represents the rotation angle of each Qbit whose value and direction can be adjusted by some strategies.
2.2. Adaptive Adjustment Strategy of the QGate
In QGA, the evolution of the individual is guided by the current best individual and adjusted by the Qgate, so that the individual approximates and converges to the global optimal solution ultimately. A Qgate is used to change the state of the quantum chromosome to evolve the individual. In the processing of evolution, the choice of the quantum rotation angles is very important, and a suitable choice of the rotation angles can help improving the search ability of the algorithm. Different design of the quantum rotation angle is suitable for different problem. Although the designs of the quantum rotation angle are different, the core idea of the designs is the same—to make the current individual evolve to a higher fitness solution.
Considered the feature of the problem and the relation between the current individual and the current best individual, an adaptive rotation angle is proposed in this study, and the rotation angle is defined as follows: where the value of can be looked up in Table 1.
is an adjustment function which is defined as where , , and represent the fitness of the current individual, the current best individual, and the current worst individual, respectively. The value of reduces when approach to in order to decrease the search step length and vice versa. The rotation angle is updated by
2.3. Cooperative Learning Strategy
The classical analysis on GA considers that the population represents a set of competing structures that explore various parts of the search space in parallel. Instead of emphasizing the notion of competition, Cobb regarded population as a set of cooperative agents, and the members are cooperative in that they share information; that is, they communicate partial solutions to one another [40]. Without sharing information, the time required for an agent to find a solution may be very long. It is believed that a group of cooperating agents engaged in problem solving can solve a task faster than either a single agent or the same group of agents working in isolation from each other [41]. A general model was presented for coevolution of cooperating species to improve the performance of GA [42]. A cooperative method was introduced to particle swarm optimization (PSO) to help the particle contribute its merits to the population in each dimension and to promote the cooperation between particles in each dimension [39].
As represented by the quantum probability model in QGA, each individual of the population, regardless of its fitness value being high or low, represents a potential solution which evolves towards the global optimum guided by the current best individual. The relationship among individuals is not only competition but also cooperation. That is to say, the information sharing and exchange exist in QGA also, but the information sharing and exchange are between the individual and the current best individual. The current best individual has the maximum fitness value, but, for highdimensional optimization problem, the structure of the solution of the current best individual is not always reasonable for each individual is usually represented as an dimensional vector. This means that the same update operation performed on each dimensional of an individual may not always evolve the individual. Therefore, it is important to take into account not only the whole adjustment of the individual, but also the rationality of the structure of the solution. And it is an effective way to improve the global and local optimization ability of QGA to reinforce the holistic and local information exchange and promote the information sharing among individuals, especially for the highdimensional optimization. In other words, updating a part of an individual instead of updating it as a whole item sometimes may help accelerate the evolution processing and improve the search capability of QGA.
Image multilevel thresholding segmentation is a highdimensional optimization problem, and it is timeconsuming. Applying QGA to multilevel thresholding can reduce computational time greatly. The individual in QGAbased method is an dimensional vectors, and the performance of QGA declines with the increase in the dimensions. In order to improve the performance of QGA, a cooperative learning strategy is proposed in this study. The dimensional vector is split into onedimensional vectors, and then each onedimensional vector is updated in the direction of the current best individual. This mean is called cooperative learning in this study. The cooperative learning strategy is presented as follows.
Assuming an dimensional unconstrained optimization which needs to maximize the objective function , where represents the dimension of the parameters, is the global optimal solution, and is the collection of the candidate solutions.
The QGA which introduced cooperative learning strategy is performed to this optimization problem. Assuming is the current optimal dimensional individual with fitness , some dimensional individuals are selected based on the fitness proportional model. For every individual with fitness , each dimensional component of is replaced by the corresponding dimensional component of , and its fitness value is computed. The best individual with the maximum fitness is selected, and then its fitness is selected to be compared with , if , is replaced by ; otherwise, is retained. By means of this way, the structures of the individuals are readjusted. This method accelerates the global convergence. The pseudocode of the cooperative learning strategy is shown in Pseudocode 1.

3. Entropy Criterion Based Measure
An image which contains pixels and gray levels is divided into categories by , thresholds. For convenience, the lowest gray and the highest gray are set as the lowest threshold and the highest threshold , respectively. If a pixel with gray meets the condition , the pixel is classified under the category . Searching for the optimal threshold which met the given classification requirements in the histogram, we can maximize or minimize an objective function which chooses the threshold as its parameter. That is to say, thresholding problem can be seen as a global optimization problem to choose a collection of thresholds by optimization of an objective function . This can be described as follows: Based on the entropy criteria, Kapur method looks the object and background of the image as two different sources, and when the total entropy of the two categories is maximum, the best segmentation and its corresponding optimal threshold are considered to have been obtained. Kapur method was originally used to solve the bilevel thresholding segmentation and later extended to the multithresholding segmentation. Kapur method works as follows.
For an image with gray levels, the number of the pixels with gray is , and the total number of the pixels of the image is ; the normalized probability of each gray level is defined as . Determining thresholds for a given image, the Kapur entropy can be defined as: where where represent the histogram entropy of each category. The best thresholds based on maximum entropy are satisfied with
Kapur method can obtain the best thresholds with the maximum entropy by computing and comparing the entropy values of all categories. Its time complexity is . Obviously, the computation complexity and calculation time will increase greatly with the increase in the threshold numbers that limits the implementation and generalization of the Kapur method. IQGA proposed in this study can solve this problem in an acceptable time.
4. IQGA for Image Multilevel Thresholding Segmentation
The proposed algorithm uses IQGA to solve image multilevel thresholding segmentation problem, and the details are described in this section.
4.1. Quantum Angle Encoding
A Qbit can be represented as ,where the numbers of and satisfy the normalization condition . Make and , so a Qbit can be represented by a phase angle in a twodimensional space. The phase angle which is called quantum angle is represented by . is equivalent to or . A quantum chromosome with length of can be represented as . The update of the quantum chromosome can be simplified to the following expression: .
A gray image includes gray levels in the range of , and each gray level can be coded by an 8Qbits quantum angle . If an image is divided into classes by thresholds, the corresponding chromosome is composed by bits quantum genes: where represent the probability amplitude of 0 and 1. The binary number of the gray value can be obtained by quantum measure.
4.2. Crossover
It is necessary to introduce crossover in the algorithm to increase the diversity of the population and avoid premature convergence. Twopoint crossover with the crossover probability is adopted as follows: choose two chromosomes with length and select crossbits. For example, select a pair of chromosomes randomly: and generate crossbits ; the crossed chromosomes are presented as
4.3. Mutation
Mutation imitates the phenomenon of a certain gene mutation on chromosome in the processing of evolution. Mutation changes the structure and the physical properties of the chromosome. The operation of mutation in QGA can increase the diversity of the population effectively. This study introduces the NORgate and Hadamardgate to the mutation operation. The proposed mutation is performed as follows: select one or several gene bits randomly on a chromosome with mutation probability , and update the gene bits by NORgate or Hadamardgate randomly. The operation is performed by
5. Experimental Results
In this section, the performance of the proposed algorithm is evaluated by comparing its results with QGA which using a fixed lookup table and full crossinterference scheme [43], PSO [13] and GA [15] which using a fixed lookup table and full crossinterference scheme [43]. In order to compare the performances of the algorithms, all algorithms (PSO, GA, QGA, and IQGA) adopted the same objective function which is based on maximum entropy criterion. The parameters are set as follows: , crossover probability , and mutation probability . The pseudocode for the proposed algorithm is shown in Pseudocode 2.

Some popular images are selected in the experiment. The original test images along with their corresponding gray level histogram are shown in Figures 1 and 2.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
Table 2 shows the optimal segmentation thresholds, the maximum values of the objective function, and the average computation times obtained by standard Kapur method. Since the standard Kapur method is an exhaustive algorithm, the results of the method can be used to be the standard evaluation criteria, and the results obtained by other algorithms can be evaluated by this criterion. The letters “” and “” represent the optimal objective function values and the corresponding segmentation thresholds, respectively. As can be seen from Table 2, the average computational time increases from 9.5236 seconds to 19428 seconds exponentially when changes from 2 to 4. The exhaustive method is a timeconsuming task, and it is almost difficult to apply the method to obtain the optimal thresholds while increasing the number of the thresholds. Otherwise, the QGAbased multilevel thresholding method can reduce the computational time to several seconds.
5.1. Comparison of the Computation Speed
An experiment is performed to contrast the convergence speed and the average computational time of the GA, QGA, particle swarm optimization (PSO), and the proposed algorithms. Computation ceased when the value of the objective meets the termination condition: . Every algorithm is executed 100 times and yielded the following results presented in Table 3. The letters “” and “” in Table 3 represent the mean computational time and the average convergence generation, respectively. Data in this table is the average of 100 times repeated experiments of the test images. The results show that the convergence generation of the proposed algorithm is much smaller than other methods, and the computational speed of the proposed algorithm is faster than other methods.
5.2. Comparison of the Search Ability and Stability
In order to test the search ability and stability of the proposed algorithm, some experiments have been implemented as follows. The terminal condition of the algorithms is changed to compare the stability and the search ability of the algorithm. Iteration will be terminated when ( presents the average of the fitness at generation , ) or reach to the maximum number of iterations (). Since all the compared methods except ESKupar in this study are based on stochastic search mechanism, every experiment except ESKupar runs 100 times and the performance will be evaluated by the results of the 100times experiments.
The maximum objective function values and the optimal thresholds with are shown in Tables 4 and 5, respectively. As can be seen from the tables, QGA and IQGA have obtained all optimal solutions when , while PSO and GA have obtained most optimal solutions; with the increasing numbers of the segmentation threshold, the ability of the PSO and GA decreased sharply, QGA can search most of the global optimal solutions, and IQGA can obtain all the global optimal solutions. It can be seen that the search ability outperforms the PSO, GA, and QGA. The optimal thresholded images which are obtained by the proposed algorithm are shown in Figure 3.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
Table 6 represents the variance and the mean values of the objective functions. It can be seen that the variance values increase with the increasing numbers of the threshold; that is to say, the stability of the algorithms declines with the increasing number of the threshold. In the cases of the variance, IQGA is smaller than other algorithms by more than two orders of magnitude. Utilizing the quantum superposition and coherence, QGA maintains the diversity of the population better than classical GA and PSO, so QGA has a stronger performance than GA. The strategy which introduces cooperative learning method to QGA promotes the local information exchanges among the individuals and enhances the ergodicity of the solutions. Therefore, IQGA has better search performance and stronger stability than QGA.
6. Conclusion
A multilevel thresholding image segmentation method based on IQGA has been proposed in this paper. Combining the merits of QGA and the cooperative learning strategy and adjusting the quantum rotation angle adaptively, the proposed algorithm is employed for several test images. The significant improvement performance of the IQGA has been demonstrated by comparing it with QGA, GA, and PSO for several test images.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgment
This work is supported by the project of Sichuan Provincial Education Department under Grant 13za0151.