Abstract
In decades, Yang’s cuckoo search algorithm has been widely developed to select the optimal threshold of bi-level image threshoding, but the amount of computation of which increases exponentially with multi-level thresholding. To reduce the computation quantity, the iterative step size is adaptively decided by its fitness values of the current iteration without using the Lévy distribution in this study. The modification may cause the solution drops into the local optima during the later period. Therefore, the constant discovery probability pa is automatically changed relating to the current and total iterations. And then, to verify segmentation accuracy and efficiency of the proposed method, an adaptive cuckoo search algorithm proposed by Naik and Yang’s cuckoo search algorithm are included to test on several gray-scale images. The results show that the proposed algorithm is expert in selecting optimal thresholds for segmenting gray-scale image.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
Image segmentation is to separate an image into some distinct regions with different characteristics and extract the objective of interests from their background. In these years, lots of techniques have been proposed and applied in image segmentation [6, 15, 17, 19, 33]. Among all the existing techniques, the thresholding is thought as a prevalent technique whereas its perspicuity and precision [18]. The key of thresholding is to quickly find an optimal threshold with certain criteria to achieve segmentation accurately. However, for multi-level thresholding, owing to the exhaustive search, the traditional thresholding methods can’t select the optimal thresholds efficiently and the amount of calculation increases. To solve such limitations, researchers formulated the existing criteria of conventional thresholding methods as objective functions, and incorporated meta-heuristic algorithms to enhance the computational speed, such as GA [8], PSO [7], cuckoo search algorithm (CS) [28], etc., Hammouche [8] used GA to find multi-level thresholds. Zhang [32] developed artificial bee colony to optimize the Tsallis entropy. Ghamisi [7] proposed a fractional-order DPSO for determining thresholds. Wei [28] presented Yang’s CS algorithm for solving multi-level Otsu’s problem. Sharma [20] designed a firefly algorithm based on the Lévy flight to maximize Kapur’s entropy. Among these meta-heuristic algorithms, the Yang’s CS algorithm has drawn the attention of researchers. CS algorithm [31] is a technique for optimization problems proposed by Yang in 2009. Many researchers have proved the efficiency of Yang’s CS algorithm in different applications, such as face recognition [22], engineering design [29] and neural network training [24]. Although CS algorithm is simple and has few parameters as well as high efficiency, it’s easy to fall into local optima during the later period which causes premature problem and time-consuming. Therefore, to enhance the performance of CS algorithm, many scholars have proposed improved CS algorithm [10, 13, 21, 25, 26], such as an adaptive cuckoo search algorithm (ACS) was proposed by Naik [12], the adaptive strategy is used to adjust the step size and eventually leads to faster convergence. But the adaptive strategy isn’t applied to the discovery probability pa, this may influence the algorithm accuracy. Therefore, based on ACS algorithm, an improved ACS algorithm (IACS) is introduced to for segmenting. For the proposed method, the initial step size randomly yields without being designed a prior. Furthermore, to avoid local extremum point and enhance the variety of cuckoos, the pa value changes nonlinearly with iterations. To explain the efficiency of the IACS algorithm, two methods, Yang’s [31] and Naik’s [12] are involved to searching multi-level thresholds. The next parts are structured as: Section 2 briefly leads to three types objective functions usually applied for the multi-level image thresholding, namely, Otsu’s method, Kapur’s entropy and Tsallis entropy. Section 3 provides the methodologies of Yang’s CS and ACS algorithms and presents the improved method(IACS). And then in Section 4, some experiments are expressed to verify the effect of the proposed method and analyze the results. Finally, Section 5 offers some conclusions.
2 Multi-level thresholding
Recently, multi-level thresholding methods have been widely applied to separate multiple objectives from background for an image [2,3,4,5, 16, 21]. In this section, the key thought for multi-level thresholding is briefly introduced. Take a image I with L distinct gray levels into account, where L= 256, then the multi-level image thresholding is defined as:
where \(m\left (x,y \right )\) denotes a gray level value of pixel, t1,t2,…,tn are the different thresholds.
2.1 Otsu’s method
The Otsu’s criterion is to maximize the between-class variance [14], assume that the probability of pixels at level i is pi (pi ≥ 0 ), the cumulative probability of each class ωi can be calculated as:
Then the optimal thresholds are obtained as follows:
where
where \({{\mu }_{T}}=\sum \nolimits _{i=0}^{L-1}{i{{p}_{i}}}\) is the mean value of input image, μi (i = 0,1,…,n) is the mean value of the pixels of the corresponding region.
2.2 Kapur’s entropy method
Kapur’s entropy was proposed to maximize the sum of the entropy for segmenting images [9]. The entropies Hi are defined as:
The optimal thresholds are gained as:
2.3 Tsallis entropy method
Tsallis entropy is come from Shannon entropy [23], it’s defined as:
where q is Tsallis parameter. The relationship between the entropy of each subsystem is as follows:
For multi-level image thresholding problem [2], the optimal thresholds are obtained using (9):
where
subject to the following constraints:
In (11), \({{p}^{{{C}_{0}}}},{{p}^{{{C}_{1}}}},...,{{p}^{{{C}_{n}}}}\) corresponding to \({{S}^{{{C}_{0}}}},{{S}^{{{C}_{1}}}},{\ldots } ,{{S}^{{{C}_{n-1}}}}\) are computed with \({t}_{1}^{*},{t}_{2}^{*},...,{t}_{n}^{*}\), respectively.
3 Methodology
3.1 Yang’s CS algorithm
Yang’s CS algorithm is inspired by the obligate brood parasitism of some cuckoos, for simulating the whole process, Yang uses three assumptions [30]:
-
(1)
one egg is hatched and put in a nest randomly by each cuckoo;
-
(2)
the excellent nests will be preserved for next iteration;
-
(3)
the possibility of host bird finding cuckoo’s egg is represented by pa.
Then a solution \(x_{i}^{\left (t+1 \right )}\) is produced by Lévy flight:
where α represents the step size and ⊕ is entry-wise multiplications. The other part of CS algorithm is biased random walk [25]:
where p , g is the p th and g th random solutions in the population, respectively, r ∈ [0,1] and ra ∈ [0,1]. The flowchart of Yang’s CS is given by Fig. 1.
3.2 Adaptive CS algorithm
The Yang’s CS algorithm uses the Lévy step to search the optimal solution, which generally satisfies the Lévy distribution [11], but the Lévy step in the iteration process of Yang’s CS algorithm is not controlled by any measures, the process of optimization may be time-consuming. To promote the efficiency of the Yang’s CS, Naik [12] modified the Lévy step adaptively based on the individual fitness value and the current iterative number
where t represents current iterations, \({f_{i}^{t}}\) denotes the fitness of i th nest in tth iteration, \(f_{best}^{t}\), \(f_{worst}^{t}\) is the best, worst fitness in tth iteration, respectively. From the (14), the step size is long at the beginning, but as the iterations increase, it decreases. Hence, the step size will be very short when the algorithm achieves the global best solution. Equation (14) also reveals that the step size changes with fitness adaptively. Then (12) is rewritten as:
The superiority of ACS algorithm is that, it does not set any initial parameter, Therefore, the modified method is less parameter and faster than Yang’s CS algorithm.
3.3 Improved ACS algorithm
The discovery probability pa introduced in the Yang’s CS represents the possibility whether the nest will be discarded or be renewed [10]. It’s used to control the coordination of global and local search. If pa value is small, a large number of dimensions of a solution are changed in each generation, conversely, the poor individual will remain for the next generation, it may be unable to obtain the best solutions [25]. The parameter pa is fixed to 0.25 in the ACS algorithm [12], but for different problems, they need different values. In this work, the value of pa is changed with the number of iterations adaptively and showed as follows:
where T is total iterations, \({{p}_{a\_{\max \limits } }}\) and \({{p}_{a\_{\min \limits } }}\) are the predefined maximum, minimum discovery probability. It can be observed from the (16), in the early iterations, the pa value is relatively small, it will increase the diversity of solutions. In the final iterations, the value of pa will generate faster convergence to the optimum solutions. In short, pa is nonlinearly altered from a small value to a large value relatively in the whole process, it will improve the accuracy of the algorithm as a whole.
Further, (15) is reformulated as [13]:
where xgbest is global best solution. In the early search phase, the optimization efficiency of CS and ACS algorithms is faster, but in later period, the two algorithms are easy to sink into local extremum, which leads to low segmentation accuracy. The IACS algorithm can adaptively adjust pa value, hence it jumps out of the local extremum point in time, improves the nest’s fitness continuously. And then, the optimal threshold is obtained to extract the required target accurately. The basic steps of IACS and ACS algorithms are shown in Fig. 2 and the flowchart of IACS is given by Fig. 3.
4 Experiments and discussions
Table 1 is parametric settings of optimization algorithms. The number of nests and maximum iterations of all the three algorithms are fixed to 50 and 150, respectively. They are identical for all experiments due to having a great influence on convergence rate and computational time of the algorithm. The discovery probability pa decides whether to give up the nest,when pa = 1, host bird throws out the cuckoo’s egg or simply abandons its nest, when pa = 0, host bird can’t recognize the cuckoo’s egg and may hatch it. Hence, the range of pa is set between 0 and 1. For IACS algorithm, the maximum pa is 0.95 and the minimum pa is 0.15 [26].
4.1 Image dataset
To explore the effectiveness of the three optimization algorithms for segmentation, gray-scale test images namely Lena, Baboon, and Cameraman are taken from Image Databases and given in Fig. 4.
The size of Baboon and Cameraman are 512 × 512, Lena has size 256 × 256. As it can be seen from their respective histograms in Fig. 5, they are multimodal in nature, all the images own distinct histogram features with irregular distributions depicting objective and background. Hence, to identify the target region exactly, multi-level thresholding is a more efficient technique.
4.2 Performance metrics
The accuracy of the segmentation is assessed by Peak Signal to Noise Ratio(PSNR) [1]. The larger the PSNR, the better quality of thresholding, the mathematical expression is given below:
where
where E × F denotes the image size, I and \({I}^{\prime }\) are original, segmented images, respectively. Mean Square Error(MSE) is computed between the original image and its segmented image for different thresholds and for each algorithm. Lower MSE value indicates lower segmentation errors.
Structural similarity index(SSIM) [27] is to measure the structure of segmented and original image. Higher SSIM value shows that the segmented image contains more information, it’s defined as:
where μI and \({{\mu }_{{{I}^{\prime }}}}\) are the average values and \({{\sigma }_{I{I}^{\prime }}}\) is the covariance, \({\sigma _{I}^{2}}\) and \(\sigma _{{{I}^{\prime }}}^{2}\) are the variance, D1 = D2 = 0.065.
4.3 Experimental results evaluation
All the images were independently executed 20 times using each of presented multi-level segmentation methods. Tables 2, 3, 4, 5, 6 and 7 validate the contrast of different quality metric values received by Yang’s CS, ACS and the proposed IACS algorithm, where n represents the thresholds number. Best image segmentation results and the rate of convergence curve between different algorithms are shown visually in Figs. 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 and 17.
4.3.1 Analysis of the consequences employing Otsu’s method
In Table 2, all the algorithms perform equally for n= 5, however, as the number of thresholds increases, it’s clear that IACS algorithm has got higher values of PSNR which leads to a reduced MSE, SSIM values are also the highest, ACS algorithm has obtained acceptable results than CS. Hence the IACS algorithm exhibits more accuracy and robustness. Furthermore, Table 2c presents the information of average CPU time, compared to other algorithms, IACS has faster computational speed with minimum CPU time, ACS closely follows IACS. It can also be summarized that the proposed IACS algorithm can keep the lowest computational time along with the threshold levels increase.
For the visual analysis, the segmented results are shown in Figs. 6, 7 and 8. The three algorithms have produced better quality of the segmented images when n= 11. However, the segmented results obtained by IACS algorithm are more pleasant visually, ACS is slightly better than CS. In Fig. 6, at n= 11, the background in the Lena image is the clearest using IACS algorithm, to some extent, the hat and hair are identifiable clearly. But the segmentation quality of CS algorithm is not accurate, especially for hat. This phenomenon of segmenting is also observed in other two images.
Figure 9 presents the convergence curve of the three algorithms for n= 11. In Fig. 9a, after about 60 iterations, the maximum fitness value is acquired only in the case of IACS algorithm. ACS and CS algorithms require at least 150 iterations. In Fig. 9b, at 20 iterations, the fitness value is 1.445e + 03 by using IACS algorithm. However, the fitness value is 1.440e + 03 for ACS and CS algorithms at 20 iterations. In Fig. 9c, when the fitness value is 3.782e + 03, there are not more than 20 iterations for the IACS algorithm, while the ACS algorithm requires 40 iterations and the CS algorithm needs 60 iterations at least. Therefore, the proposed IACS algorithm is much faster to get the global optimum.
4.3.2 Analysis of the consequences employing Kapur’s method
In Table 4, the number of thresholds exceeds 5, for all the test images, IACS algorithm performs superior to the other algorithms quantitatively, it obtains the highest values of PSNR, SSIM and minimum values of MSE, ACS has gained acceptable results than CS. This indicates the IACS is more accurate and robust in image segmentation. Table 4c illustrates the information of average CPU time. IACS algorithm is always around 1 second faster than ACS and CS algorithms. Additionally, at higher threshold levels, IACS algorithm remains the lowest computational time that makes it efficient for segmenting. In Figs. 10, 11 and 12, the results depict that the segmented outputs based on IACS algorithm are much clearer visually for all the test images, ACS follows the IACS and CS is the last. In Fig. 12, for the Cameraman image when n= 11, the sky and buildings are clear and become recognizable by using IACS algorithm, but the thresholded images gained by the CS and ACS algorithms lose some information to some degrees. Similarly, Figs. 10 and 11 also demonstrate that the results of IACS algorithm seem better qualitatively. Fig. 13 displays the convergence curve of the three algorithms at n= 11. In Fig. 13a, when the fitness value is 34.5, just 20 iterations for IACS algorithm, whereas CS requires about 120 iterations and ACS needs 150 iterations at least. In Fig. 13b, it’s not competitive for IACS algorithm, the maximum fitness value is obtained at around 100 iterations. For CS and ACS algorithms, the maximum fitness value is gained after about 150 iterations. In Fig. 13c, the convergence curve of CS and ACS are not obviously different. For IACS algorithm, it only takes about 40 iterations to reach the fitness value, while the ACS and CS algorithms require 150 iterations at least. Therefore, the IACS algorithm displays a faster convergence to the best solutions.
4.3.3 Analysis of the consequences employing Tsallis method
In Table 6, with the number of thresholds increasing, it’s clear that IACS algorithm has better values of PSNR, SSIM and minimum values of MSE, and ACS algorithm has slightly better results than CS algorithm. In summary, the IACS algorithm can segment images more accurately than other algorithms. In Table 6c, the IACS has taken the least time compared to CS and IACS algorithms, CS algorithm costs the most. At different threshold levels, IACS algorithm is always around 2 seconds faster than CS algorithm and about 1 second faster than ACS algorithm.
Figures. 14, 15 and 16 give the segmented results visually. From these figures, It can be concluded that higher-threshold images contain more details. When n= 11, for the Baboon image, the results of IACS algorithm make the beard and nose object clearer, but in CS and ACS algorithms, the nose is not clearly distinct.
Further, Fig. 17 shows the convergence curve of the three algorithms at n= 11. It is clearly shown from Fig. 17a the convergence rate of the three algorithms have produced similar results in the early period, but the fitness value of IACS is always higher than the others. Only IACS obtains the maximum fitness value after about 100 iterations. ACS and CS algorithms require at least 150 iterations. In Fig. 17b, at 20 iterations, the fitness value is about 37.5 for IACS algorithm, whereas at least 80 iterations for ACS and CS algorithms to gain the value. In Fig. 17c, convergence rate of the proposed IACS algorithm is much faster. Only IACS algorithm obtains the maximum fitness value after about 80 iterations. ACS and CS algorithms require at least 150 iterations. Consequently, the IACS outperforms CS and ACS algorithms. In summary, from different
assessment measures, the proposed IACS algorithm gives higher segmentation performance using less CPU time and is well suited for segmenting,
5 Conclusions
Due to multi-level thresholding based on Yang’s CS algorithm has larger calculated amount, the IACS algorithm is introduced. Without employing the Lévy distribution, the iterative step size based on its fitness adaptively, it enables step size variable in the process of searching. Moreover, the dynamic adjustment strategy is also applied to the discovery probability pa, which can enrich the population variety and avoid premature. The IACS algorithm is then applied to searching optimal thresholds. To validate its performance, it is compared to Yang’s CS and ACS algorithms. The results reveal that the IACS algorithm can efficiently select the multi-level thresholds and has better segmented quality than other two algorithms. According to the rate of convergence curve, the IACS algorithm attains its optimal value in less iterations without falling into local optima. Next step is to check the effectiveness of IACS algorithm for all kinds of issues in image processing.
References
Abhinaya B, Sri Madhava Raja N (2015) Solving Multi-level Image Thresholding Problem-An Analysis with Cuckoo Search Algorithm. Adv Intell Syst Comput 339:177–186
Agrawal S, Panda R, Bhuyan S, Panigrahi BK (2013) Tsallis entropy based optimal multilevel thresholding using cuckoo search algorithm. Swarm Evol Comput 11:16–30
Alihodzic A, Tuba M (2014) Improved bat algorithm applied to multilevel image thresholding. Sci World J 2014:1–16
Bhandari AK, Kumar A, Singh GK (2015) Modified artificial bee colony based computationally efficient multilevel thresholding for satellite image segmentation using Kapur’s, Otsu and Tsallis functions. Expert Syst Appl 42(3):1573–1601
Bhandari AK, Singh VK, Singh GK, Singh GK (2014) Cuckoo search algorithm and wind driven optimization based study of satellite image segmentation for multilevel thresholding using Kapur’s entropy. Expert Syst Appl 41(7):3538–3560
Feng YC, Shen XJ, Chen HP, Zhang XL (2017) Segmentation fusion based on neighboring information for MR brain images. Multi Tools Appli 76(22):23139–23161
Ghamisi P, Couceiro MS, Benediktsson JA, Ferreira NMF (2012) An efficient method for segmentation of images based on fractional calculus and natural selection. Expert Syst Appl 39(16):12407–12417
Hammouche K, Diaf M, Siarry P (2008) A multilevel automatic thresholding method based on a genetic algorithm for a fast image segmentation. Comput Vision Image Understan 109(2):163–175
Kapur JN, Sahoo PK, Wong AKC (1985) A new method for gray-level picture thresholding using the entropy of the histogram. Comput Vision Graphics Image Process 29(3):273–285
Li XT, Yin MH (2015) Modified cuckoo search algorithm with self adaptive parameter method. Inf Sci 298(20):80–97
Mantegna RN (1994) Fast, accurate algorithm for numerical simulation of lévy stable stochastic processes. Phys Rev E 49(5):4677–4683
Naik MK, Nath MR, Wunnava A, Sahany S, Panda R (2015) A new adaptive Cuckoo search algorithm. In: Proceeding of international conference on recent trends in information systems, pp 1–5
Naik MK, Panda R (2016) A novel adaptive cuckoo search algorithm for intrinsic discriminant analysis based face recognition. Appl Soft Comput 38:661–675
Otsu N (1979) A threshold selection method from gray-level histograms. IEEE Trans Syst Man Cybern 9(1):62–66
Pal NR, Pal SK (1993) A review on image segmentation techniques. Pattern Recogn 26(9):1277–1294
Panda R, Agrawal S, Bhuyan S (2013) Edge magnitude based multilevel thresholding using Cuckoo search technique. Expert Syst Appl 40(18):7617–7628
Portes de Albuquerque M, Esquef IA, Gesualdi Mello AR (2004) Image thresholding using Tsallis entropy. Pattern Recogn Lett 25(9):1059–1065
Sahoo PK, Soltani S, Wong AKC (1988) A survey of thresholding techniques. Comput Vis Graph Image Process 41(2):233–260
Sezgin M, Sankur B (2004) Survey over image thresholding techniques and quantitative performance evaluation. J Electron Imaging 13(1):146–168
Sharma A, Chaturvedi R, Dwivedi U, Kumar S, Reddy S (2018) Firefly algorithm based Effective gray scale image segmentation using multilevel thresholding and Entropy function. Int J Pure Appl Math 118(5):437–443
Suresh S, Lal S (2016) An efficient cuckoo search algorithm based multilevel thresholding for segmentation of satellite images using different objective functions. Expert Syst Appl 58:184–209
Tiwari V (2012) Face recognition based on cuckoo search algorithm. Ind J Comput Sci Eng 3(3):401–405
Tsallis C (1988) Possible generalization of Boltzmann-Gibbs statistics. J Stat Phys 52(1):479–487
Valian E, Mohanna S, Tavakoli S (2011) Improved cuckoo search algorithm for feed forward neural network training. Int J Artif Intell Appl 2(3):36–43
Wang LJ, Zhong YW (2015) Cuckoo search algorithm with chaotic maps. Math Probl Eng 2015:1–14
Wang W, Xie C (2018) A cuckoo search algorithm based on self-adjustment strategy. J Phys Conference Series 1087(2):1–7
Wang Z, Bovik AC, Sheikh HR, Simoncelli EP (2004) Image quality assessment: from error visibility to structural similarity. IEEE Trans Image Process 13 (4):600–612
Wei HT, Yang Q (2017) A multilevel threshold segmentation technique using self-adaptive Cuckoo search algorithm. In: Advanced Information Technology, Electronic and Automation Control Conference, pp 2292–2295
Yang XS, Deb S (2010) Engineering optimisation by cuckoo search. Int J Math Model Numer Optim 1(4):330–343
Yang XS, Deb S (2013) Multiobjective cuckoo search for design optimization. Comput Oper Res 40(6):1616–1624
Yang XS, Suash D (2009) Cuckoo search via lévy flights, NaBIC, USA
Zhang YD, Wu LN (2011) Optimal Multi-Level thresholding based on maximum tsallis entropy via an artificial bee colony approach. Entropy 13(4):841–859
Zhou YQ, Yang X, Ling Y, Zhang JZ (2018) Meta-heuristic moth swarm algorithm for multilevel thresholding image segmentation. Multimed Tools Appl 77 (18):23699–23727
Acknowledgements
This work was supported by the National Natural Science Foundation of China under Grant No.11601007 and No.11701007.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Sun, M., Wei, H. An improved cuckoo search algorithm for multi-level gray-scale image thresholding. Multimed Tools Appl 79, 34993–35016 (2020). https://doi.org/10.1007/s11042-020-08931-5
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11042-020-08931-5