# An Improved Cuckoo Search Algorithm for Multithreshold Image Segmentation

Authors: Wentan Jiao; Wenqing Chen; Jing Zhang
Journal: Security and Communication Networks
 (2021)

---

## Abstract

Image segmentation is an important part of image processing. For the disadvantages of image segmentation under multiple thresholds such as long time and poor quality, an improved cuckoo search (ICS) is proposed for multithreshold image segmentation strategy. Firstly, the image segmentation model based on the maximum entropy threshold is described, and secondly, the cuckoo algorithm is improved by using chaotic initialization population to improve the diversity of solutions, optimizing the step size factor to improve the possibility of obtaining the optimal solution, and using probability to reduce the complexity of the algorithm; finally, the maximum entropy threshold function in image segmentation is used as the individual fitness function of the cuckoo search algorithm for solving. The simulation experiments show that the algorithm has a good segmentation effect under four different thresholding conditions.


---

## Body

## 1. Introduction

With the rapid `development and application of computers, handheld terminals, networks, and multimedia technologies, multimedia data have gained more and more widespread applications, especially the explosive growth of image and video data [1]. Especially in SnapChat, Instagram, Facebook, Telnet, and other image-related portals, the number of images has reached hundreds of millions, and the trend is multiplying [2]. Therefore, the study of these data images has a relatively important value. In the field of image engineering, image processing, image analysis, and image understanding are classified according to the data source to be processed and the level of semantic abstraction of the image. The result of image processing directly affects the success or failure of image depth understanding and analysis. Image segmentation is one of the most important tools in graphics processing methods, which has a wide range of applications in target recognition, feature detection, image annotation, and semantic search. It is the process of dividing a digital image into multiple regions or multiple targets, which can provide more accurate and meaningful information than a single pixel, and it is obvious that image analysis and understanding based on multiple segmentation targets is better than image analysis and understanding based on isolated pixel points with no semantic meaning.In recent years, a large amount of related literature has shown that intelligent methods have significant advantages over traditional methods in image segmentation [3, 4]. Therefore, in this paper, we choose the cuckoo search (CS) [5] for image segmentation, which is one of the relatively new metaheuristics to efficiently solve the optimization problem by simulating the parasitic brood (Brood Parasitism) of some species of cuckoo, which uses the Levy flight search mechanism to improve the performance of the algorithm. The performance of the algorithm is improved by using the Levy flight search mechanism. Due to this unique optimization mechanism, CS can provide good global search functionality, which makes it popular in various engineering problems. In this work, we will try to explore the application of CS to image segmentation optimization problems under multiple thresholds. Specifically, the image segmentation scheme is mapped into the model of CS algorithm, and then the near-optimal solution is obtained using CS algorithm. Based on this, we propose an advanced method called ICS (Improved CS for Vehicle Scheduling), which aims to further improve the best solution search capability of CS. We provide a detailed implementation of ICS and evaluate the performance through simulation experiments. We summarize the contributions of this work as follows: (1) to improve the effectiveness of multithreshold image segmentation, we use the ICS algorithm to solve problem; (2) we propose a new method called ICS, which improves the convergence speed and accuracy of the ICS-based method by combining advanced optimization strategies to improve image segmentation; (3) we present the detailed design and implementation of ICS and compare it with modern metaheuristic algorithms such as CS, ACO, and PSO. The experimental results show that the ICS algorithm can provide better performance in terms of image segmentation with multiple thresholds.Section2 describes the results of related researches, Section 3 introduces the basic concepts of image segmentation, Section 4 describes the application of the improved cuckoo algorithm in image segmentation, Section 5 describes the process of simulation experiments, and Section 6 concludes the paper.


## 2. Related Research

As the application of image segmentation technology becomes more and more extensive, scholars at home and abroad have put forward a large number of related research results. The image segmentation is studied from different angles. Image segmentation based on metaheuristic algorithm is a segmentation method that has been used more in recent years. Firstly, one or more optimization objective functions are determined, and then these objective functions are maximized or minimized through metaheuristic algorithm. At the same time as the best, the image can also complete the best segmentation. Scholars have used a large number of intelligent optimization methods for image segmentation, such as Improved Moth-Flame Optimization Algorithm [6], Symbiotic Organisms Search [7], Dragonfly algorithm [8], Particle Swarm Optimization- Artificial Bee Colony [9], Bat Algorithm [10], Fruit Fly Optimization Algorithm [11], etc. The use of these intelligent algorithms improves the effect of image segmentation, which is the direction of this paper.The selection of the optimal threshold in the segmentation algorithm is the main optimization direction of the metaheuristic algorithm. It searches for the optimal value of the objective function under a certain criterion in an iterative manner to obtain the optimal segmentation threshold. Literature [12] proposed a multithreshold image segmentation method based on moth algorithm, which combined moth algorithm with maximum entropy to achieve image segmentation quickly and accurately; literature [13] proposed an image segmentation method based on improved hybrid particle swarm optimization (PSO). Simulation experiments show that the algorithm can effectively improve the segmentation effect; literature [14] applied the firefly algorithm to color image segmentation and accurately selects the optimal segmentation threshold to achieve image segmentation; literature [15] introduced an improved image threshold segmentation method of bee colony algorithm; simulation experiment results show that the proposed algorithm is efficient and robust. Literature [16] used the gray wolf algorithm to obtain the best segmentation threshold of the image and obtain higher quality segmentation results. At the same time, literature [17] introduced the whale algorithm to image multithreshold segmentation. Literature [18] proposed image multithreshold segmentation based on harmony algorithm and electromagnetic optimization algorithm. Literature [19] gave the application of social spider optimization and pollination algorithm in multithreshold image segmentation. Experiments show that the algorithm can effectively avoid local optima as the number of thresholds increases, and the segmentation stability is better.The single-element heuristic algorithm is easy to fall into the problem of local optimization in the later stage. The use of two intelligent algorithms of fusion is a research hotspot in the field of image segmentation. For example, literature [20] uses the combination of cuckoo algorithm and adaptive differential evolution algorithm to perform multithreshold segmentation of images. The experimental results show that the fusion algorithm has better segmentation results and requires fewer parameters, which has better results; literature [21] proposed an image segmentation method based on simulated annealing and genetic algorithm. Simulation experiments showed that the fusion algorithm was in segmentation accuracy. Literature [22] suggested mixing the wind-driven optimization algorithm with the cuckoo algorithm and using the fused algorithm to search for the best threshold under Kapur entropy. Compared with the two algorithms before mixing, the segmentation accuracy is higher. Literature [23] proposed an image segmentation algorithm based on PSO and FCM. Simulation experiments show that the fusion algorithm has better results in image segmentation.


## 3. Multithreshold Image Segmentation

Image segmentation is to divide an image segmentation into several different areas. The color, shape, and information similarity of the image in the same area are relatively high. At the same time, the similarity between different regions is very low, and the purpose of image segmentation is to select the region of interest from the image for subsequent image processing algorithm application. Think of an image as a setR, and each segmented A region is a nonempty subset R1R2,…Rn. These subsets satisfy the following conditions. Condition 1: ∪i=1nRi=R, which means that the sum of pixels in n subregions includes all pixels of the original image and all pixels in the same subregion are connected; condition 2: for the i th nonempty subset and the j th nonempty subset, when i≠j, Ri∩Rj=∅, it shows that any pixel in the image cannot belong to different subregions at the same time; condition 3: for i=1,2…n, PRi=True; this means that the pixel values in the same subregion have a high degree of similarity in some features; condition 4: for nonempty subset i≠j, PRi∪Rj=False. This means that pixels in different subregions should have different characteristics in some respect.Threshold segmentation algorithm is a simple and efficient method in image segmentation, which has the advantages of small computation, simple implementation, and stable performance. It is to divide the image pixel points into several classes based on several suitable thresholds found in the whole image, and to ensure that each set of pixel points divided is consistent from the perspective of gray level. Generally speaking, image segmentation is mainly divided into single-threshold and multithreshold, and this paper will study image segmentation under multithreshold based on the maximum entropy value method.The maximum entropy thresholding method [24] is an image segmentation algorithm proposed by Kapur et al. in 1985, which finds the optimal threshold to maximize the amount of information contained in the background and target regions of an image by analyzing the entropy of the image grayscale histogram. For an image with grayscale range [0, L−1], k represents any gray value, let the segmentation threshold be t, the pixel points with grayscale level below t are taken as the target region (T) as in expression (2), and the pixel points with grayscale level higher than t above are taken as the background region (B) as in expression (3), which is described as follows:(1)∑k=0L−1Pk=1,(2)T:P0Pn,P1Pn,…,PtPn,(3)B:Pt+11−Pn,Pt+21−Pn,…,PL−11−Pn,(4)Pn=∑k=0tPi.The entropies associated with the probability densities of these two regions are equations (5) and (6), respectively.(5)HT=−∑i=0tpkpnlnpkpn,(6)HB=−∑i=t+1L−1pk1−pnlnpk1−pn,(7)φt=HT+HB.In equation (7), φt is denoted as the sum of HT and HB. When φt achieves the maximum value, t is the optimal threshold.The maximum entropy thresholding method is applied to multithreshold segmentation, and the multithreshold problem to be solved can be viewed as a problem optimization inN dimensions, let the range of grayscale values of the image to be segmented be 0,1,2,…,L−1, and since the image needs to be segmented into n+1 regions, the objective function of maximum entropy is as follows:(8)Jt1,t2,…tn=H0+H1+⋯+Hn=−∑k=0t1−1piw0t1lnpiw0t1+∑k=0t2−1piw0t1,t2lnpiw0t1,t2+⋯+∑k=tnL−1piw0tn,L−1lnpiw0tn,L−1.In equation (8), pi is used to denote the probability of occurrence of gray value i in the image, and w is used to denote the probability of occurrence of gray values in a class. When the value of Jt1,t2,…tn reaches the maximum value of t1∗,t2∗,…tn∗, then this is the optimal segmentation threshold. The multithreshold segmentation algorithm has better segmentation accuracy than the single-threshold segmentation algorithm, but the traditional multithreshold segmentation algorithm increases the time complexity with the increase of the number of segmentation thresholds, and sometimes even exponentially, which can cause the image segmentation process time complexity to be too large or even the algorithm to be difficult to achieve; particularly, the segmentation effect of the segmentation time and segmentation quality effect indicators are difficult to ensure. The image segmentation problem can be converted into a multi-dimensional function problem, which is essentially a multi-objective optimization problem, and a large number of experiments have proved that the cuckoo algorithm has a strong global convergence ability and is better than other group intelligent optimization algorithms in solving the optimal value of the function of the local explosive; particularly, the use of Levy behavior makes the individual jump out of the local optimal solution, so this paper will use the bionic cuckoo algorithm for image segmentation to convert the problem of maximum entropy threshold objective function to segment the optimal threshold of an image into the problem of finding the optimal value of the fitness function.


## 4. Research on Improved Cuckoo Search in Multithreshold Image Segmentation

British scholars Xin-She Yang and Sua Deb proposed Cuckoo search in 2009 based on the unique nest parasitic behavior of cuckoos and the unique Levy behavior of birds. It is a metaheuristic algorithm based on nature. The content of the algorithm is described as follows:(1)
Randomly generateN bird nests, and the location is shown as X0=x10,x20,…xN0, by choosing an optimal bird’s nest location and keeping this location for the next generation.(2)
The position update is performed through the Levy flight in the algorithm, and the next iteration position in each current bird nest is obtained, and compared with the previous generation bird nest position, the position of the better individual of the two is used as the current position.(3)
Compare the random numberr∈0,1 with the probability of host bird discovering alien eggs Pa. When r>Pa, then randomly change the position of the bird’s nest; otherwise, it will not change. Compare the position of the previous generation of bird’s nest, and select a group of bird’s nest positions with better positions Xs=x1s,x2s,…xNs.(4)
When the algorithm obtains the bird’s nest position to meet the accuracy requirements or terminate the iteration condition, the bird’s nest is the global optimal solution; otherwise, continue to (3) execution.In ICS, each egg in the nest represents a solution, so the ICS solution is expressed as follows:(9)xis+1=xis+α⊗Lλ.In the formula,xis+1 means the location of the i bird nest in the s generation; ⊗ is point-to-point multiplication, α is pace length, and Lλ is random search path. After the update of location, use the random number r to compare with Pa. If r>Pa, change xis+1. Otherwise, keep it unchanged.Like other metaheuristic algorithms, ICS also has the problem of falling into local optimality and insufficient global search capabilities. Therefore, in order to better use in image segmentation, this article optimizes the three aspects of population initialization, step factor, and probability.


### 4.1. Population Initialization

The diversity of the population during initialization will affect the convergence speed and accuracy of the swarm intelligence algorithm, while the cuckoo search uses a random method to initialize the population, which cannot guarantee the diversity of the population solution. Chaos mapping has the characteristics of randomness, ergodicity, and regularity and is widely used in the optimization of intelligent algorithms. In order to make better use of the solution space, this paper uses chaotic mapping to initialize the population. This paper adopts formula (10) chaotic mapping, so the specific steps are shown in Table 1(10)xn+1=xn+rand0,1.Table 1
Population initialization.
Set the population size N, dimensionD, and the maximum chaotic iteration step pace Kfori=1toNdoforj=1toDdofork=1toKdoxk,j=xk−1,j+rand0,1endforxi,j=xmax,j−xk,j×xmax,j+xmin,j/2endforendforAmong them,xk−1,j represents the i individual in the j dimension of the k−1 iteration, xk,j represents the i individual in the j dimension of the k iteration after the chaotic map is adopted, xi,j represents the i individual in the j dimension, and xmax,j and xmin,j represent upper and lower bounds in j dimensional space, respectively.


### 4.2. Text Layout

The setting of step factorα in ICS is related to the performance of algorithm. When the search space is large, the parameter α can be set larger, which can effectively improve the search efficiency. On the contrary, when the search space is small, the value of parameter α can be selected relatively small. Therefore, the value of α may affect the possibility of obtaining the optimal solution of the algorithm to a certain extent. In this paper, the value of α and the number of iterations are comprehensively considered, and the ratio of the current number of iterations to the total number of iterations is used to assign the value of α to the value ofα, which can ensure that the value of α is selected to an appropriate value, as shown in(11)a=a0+ssmax×eΔfbest.In the formula,smax is the maximum number of iterations, s is the number of current iterations, and Δfbest is the absolute difference between the optimal value of individual fitness in the previous iteration and the optimal value of fitness in this iteration. a0 is 0.5. In the initial stage of algorithm, the value of α is small, which can ensure the local better results in a smaller search space. As the number of iterations increases, the value of α gradually increases, and the search scope expands.


### 4.3. Probability Optimization

In cuckoo search, probabilityPa is usually a fixed value. However, when the Pa ratio is large, the convergence speed of algorithm will be accelerated, but the optimal solution with high accuracy may not be obtained. On the contrary, the time complexity of the algorithm will be significantly improved. Therefore, the probability Pa is optimized as shown in the following expression:(12)Pa=Pmin+Pmax−Pmin×ssmax.In the formula,Pmin and Pmax, respectively, represent the minimum and maximum value of probability Pa, smax is the largest iteration number, and s is the number of iterations. As the number of iterations increases, the value of Pa is constrained by the maximum and minimum probability. The convergence rate of algorithm is controlled and closer to the optimal solution. Thus, the performance of algorithm is improved.


### 4.4. Algorithm Complexity

Time complexity refers to the computational workload required for the execution of the algorithm, which mainly depends on the number of repeated executions of the problem. In the cuckoo search algorithm, the time complexity is mainly affected by the population sizeN, the number of iterations T, and the search dimension D. The algorithm optimization step shows that its time complexity is ON∗T∗D. Since the ICS algorithm is improved from the CS algorithm, on the basis of the CS algorithm time complexity, more optimization steps can be known. The newly introduced strategy of judging individual attributes and dynamically adjusting the search equation increases the number of calculations of ON∗T∗D, and dynamically adjusting the convergence factor increases the number of calculations of O(T). In general, the time complexity of the ICS algorithm is slightly higher than that of the CS algorithm. The space complexity is mainly affected by the population size and search dimension, so the space complexity of the two algorithms is ON∗D.


### 4.5. Application of Improved Algorithm in Image Segmentation

Step 1: convert the image to be segmented into a grayscale image to obtain the grayscale distribution. According to the grayscale value of the image within [0, 255], the position limit of the ICS is also set in this interval.Step 2: initialize a certain number of cuckoo individuals in a specific solution space. The initialization process represents the population number, dimension, and number of iterations, and each individual represents a solution in the solution space.Step 3: use the segmentation algorithm in formula (2) as the fitness value function of the ICS, and calculate the fitness value of each particle according to the fitness function.Step 4: CS to different degrees according to the sections population initialization, text layout, and probability optimization.Step 5: calculate the individual fitness value of ICS, and reserve the respective fitness function values through the selection strategy to save the current optimal fitness function value, and save the position of the maximum function value during each iteration.Step 6: when the individual does not meet the termination condition, the next iteration needs to be carried out according to Steps 3–5, and the optimal effect is obtained through repeated operations until the termination condition is met, and the result obtained is the optimal threshold for segmenting the image.


## 4.1. Population Initialization

The diversity of the population during initialization will affect the convergence speed and accuracy of the swarm intelligence algorithm, while the cuckoo search uses a random method to initialize the population, which cannot guarantee the diversity of the population solution. Chaos mapping has the characteristics of randomness, ergodicity, and regularity and is widely used in the optimization of intelligent algorithms. In order to make better use of the solution space, this paper uses chaotic mapping to initialize the population. This paper adopts formula (10) chaotic mapping, so the specific steps are shown in Table 1(10)xn+1=xn+rand0,1.Table 1
Population initialization.
Set the population size N, dimensionD, and the maximum chaotic iteration step pace Kfori=1toNdoforj=1toDdofork=1toKdoxk,j=xk−1,j+rand0,1endforxi,j=xmax,j−xk,j×xmax,j+xmin,j/2endforendforAmong them,xk−1,j represents the i individual in the j dimension of the k−1 iteration, xk,j represents the i individual in the j dimension of the k iteration after the chaotic map is adopted, xi,j represents the i individual in the j dimension, and xmax,j and xmin,j represent upper and lower bounds in j dimensional space, respectively.


## 4.2. Text Layout

The setting of step factorα in ICS is related to the performance of algorithm. When the search space is large, the parameter α can be set larger, which can effectively improve the search efficiency. On the contrary, when the search space is small, the value of parameter α can be selected relatively small. Therefore, the value of α may affect the possibility of obtaining the optimal solution of the algorithm to a certain extent. In this paper, the value of α and the number of iterations are comprehensively considered, and the ratio of the current number of iterations to the total number of iterations is used to assign the value of α to the value ofα, which can ensure that the value of α is selected to an appropriate value, as shown in(11)a=a0+ssmax×eΔfbest.In the formula,smax is the maximum number of iterations, s is the number of current iterations, and Δfbest is the absolute difference between the optimal value of individual fitness in the previous iteration and the optimal value of fitness in this iteration. a0 is 0.5. In the initial stage of algorithm, the value of α is small, which can ensure the local better results in a smaller search space. As the number of iterations increases, the value of α gradually increases, and the search scope expands.


## 4.3. Probability Optimization

In cuckoo search, probabilityPa is usually a fixed value. However, when the Pa ratio is large, the convergence speed of algorithm will be accelerated, but the optimal solution with high accuracy may not be obtained. On the contrary, the time complexity of the algorithm will be significantly improved. Therefore, the probability Pa is optimized as shown in the following expression:(12)Pa=Pmin+Pmax−Pmin×ssmax.In the formula,Pmin and Pmax, respectively, represent the minimum and maximum value of probability Pa, smax is the largest iteration number, and s is the number of iterations. As the number of iterations increases, the value of Pa is constrained by the maximum and minimum probability. The convergence rate of algorithm is controlled and closer to the optimal solution. Thus, the performance of algorithm is improved.


## 4.4. Algorithm Complexity

Time complexity refers to the computational workload required for the execution of the algorithm, which mainly depends on the number of repeated executions of the problem. In the cuckoo search algorithm, the time complexity is mainly affected by the population sizeN, the number of iterations T, and the search dimension D. The algorithm optimization step shows that its time complexity is ON∗T∗D. Since the ICS algorithm is improved from the CS algorithm, on the basis of the CS algorithm time complexity, more optimization steps can be known. The newly introduced strategy of judging individual attributes and dynamically adjusting the search equation increases the number of calculations of ON∗T∗D, and dynamically adjusting the convergence factor increases the number of calculations of O(T). In general, the time complexity of the ICS algorithm is slightly higher than that of the CS algorithm. The space complexity is mainly affected by the population size and search dimension, so the space complexity of the two algorithms is ON∗D.


## 4.5. Application of Improved Algorithm in Image Segmentation

Step 1: convert the image to be segmented into a grayscale image to obtain the grayscale distribution. According to the grayscale value of the image within [0, 255], the position limit of the ICS is also set in this interval.Step 2: initialize a certain number of cuckoo individuals in a specific solution space. The initialization process represents the population number, dimension, and number of iterations, and each individual represents a solution in the solution space.Step 3: use the segmentation algorithm in formula (2) as the fitness value function of the ICS, and calculate the fitness value of each particle according to the fitness function.Step 4: CS to different degrees according to the sections population initialization, text layout, and probability optimization.Step 5: calculate the individual fitness value of ICS, and reserve the respective fitness function values through the selection strategy to save the current optimal fitness function value, and save the position of the maximum function value during each iteration.Step 6: when the individual does not meet the termination condition, the next iteration needs to be carried out according to Steps 3–5, and the optimal effect is obtained through repeated operations until the termination condition is met, and the result obtained is the optimal threshold for segmenting the image.


## 5. Simulation Experiment

In order to further illustrate the advantages of this algorithm in image segmentation, the simulation experiment is divided into two parts: the first part verifies the performance of this algorithm, and the second part verifies the effect of this algorithm in the index of image segmentation. In order to better illustrate the advantages of the algorithm in this paper, in terms of performance, compare the algorithm in this paper with the CS algorithm, and compare it with Ant Clony Optimization (ACO) and Particle Swarm Optimization (PSO) in terms of image segmentation. Matlab2012 is selected, the CPU is Core i7, the memory is 4GDDR3, and the operating system is running on a Windows 7 host.


### 5.1. Performance Comparison

In this paper, four test function algorithms are selected for comparison; the four test functions are(13)minf1x=∑i=1nxi2,minf2x=∑i=1nxi+∏i=1nxi,minf3x=∑i=1nxi+0.52,minf4x=maxabsxi.Run each algorithm 50 times under the conditions of 5, 10, and 50 dimensions, and compare the optimal value and variance results as shown in Tables2 to 5.Tables2–5 show the comparison results of the optimal value and variance of CS and ICS algorithms. From the table, it is found that the ICS algorithm has better results in the four benchmark functions than the CS algorithm. This shows that the performance of the ICS algorithm, after population initialization, text layout, and probability optimization, is significantly improved so that the optimal value and variance of the algorithm have better results. Table 6 shows the comparative effects of CS and ICS algorithms in different dimensions under the 4 benchmark functions. When the dimension is 5, the running time of ICS and CS in f1 and f3 is not much different. When the dimension is 10, the running time in f3 is not much different. The ICS proposed in this article has obvious advantages in other dimensions. It shows that the optimized algorithm can indeed improve the performance of the algorithm.Table 2
Optimizationf1 results of two algorithm pairs.
DimensionAlgorithmOptimal valueVariance5CS4.129e − 81.973e − 7ICS2.237e − 102.673e − 1210CS1.346e − 112.809e − 7ICS1.276e − 134.192e − 1150CS3.863e − 135.431e − 11ICS1.524e − 168.315e − 14Table 3
Optimizationf2 results of two algorithm pairs.
DimensionAlgorithmOptimal valueVariance5CS4.412e − 111.724e − 10ICS1.913e − 122.713e − 1110CS1.612e − 123.091e − 7ICS1.312e − 143.832e − 1150CS3.911e − 144.131e − 12ICS2.243e − 166.352e − 15Table 4
Optimizationf3 results of two algorithm pairs.
DimensionAlgorithmOptimal valueVariance5CS3.262e − 91.714e − 8ICS1.613e − 152.313e − 910CS1.527e − 113.101e − 9ICS2.932e − 144.102e − 1250CS4.127e − 134.272e − 12ICS3.141e − 167.124e − 14Table 5
Optimizationf4 results of two algorithm pairs.
DimensionAlgorithmOptimal valueVariance5CS8.172e − 112.714e − 9ICS1.872e − 122.823e − 1110CS1.915e − 123.751e − 10ICS1.173e − 136.912e − 1150CS4.173e − 156.201e − 12ICS2.271e − 187.412e − 14Table 6
Comparison of algorithm running time.
AlgorithmDimensionf1f2f3f4CS50.7320.8961.8540.734101.9151.8775.2251.8155012.31813.03940.41612.337ICS50.6310.8221.8520.936101.3721.6105.1721.516509.1349.86436.7197.421


### 5.2. Image Segmentation Effect Comparison

This paper uses theGC value in literature [24] as the multithreshold image segmentation quality evaluation standard, i.e., the evaluation of the GC value ranges between 0 and 1, and the larger the GC value, the better the segmentation quality. This paper chooses the segmentation quality and segmentation time as the standard hardware platform for comparison. This paper selects the Berkeley Segmentation Data Set and Benchmarks 500 (BSDS500) data set to randomly select 3 images as the segmentation object, set the segmentation threshold to 4, and the segmentation effect with the threshold value of 1–4 as shown in Figures 1(a) –3(e). Three pictures under the same threshold are represented by 1, 2, and 3, respectively.Figure 1
(a) Lean image, (b) threshold = 1, (c) threshold = 2, (d) threshold = 3, and (e) threshold = 4.
(a)(b)(c)(d)(e)Figure 2
(a) Rice image, (b) threshold = 1, (c) threshold = 2, (d) threshold = 3, and (e) threshold = 4.
(a)(b)(c)(d)(e)Figure 3
(a) Woman image, (b) threshold = 1, (c) threshold = 2, (d) threshold = 3, and (e) threshold = 4.
(a)(b)(c)(d)(e)Figures4– 7 show the comparison of the four algorithms for image segmentation quality GC values under different thresholds. When the threshold is 1, the GC value of the algorithm in this paper is significantly better than the other three comparison algorithms, especially compared to CS. In terms of the algorithm, the algorithm segmentation effect is obvious. When the threshold is 2, the GC value of the algorithm in this paper is slightly lower than when the threshold is 1, but overall it is still better than the other three algorithms, but it is compared with the GC value of the ICS algorithm. When the threshold is 3, the GC value of the algorithm in this paper is still stable at about 0.8, and the GC values of the other three algorithms have increased to varying degrees. When the threshold is 4, the GC value of the algorithm in this paper is close to 0.9, and the GC values ​​of the other three algorithms have risen to varying degrees. From the four results, as the threshold continues to increase, the GC values ​​of the four algorithms show an overall upward trend, but overall the ICS algorithm has certain advantages, mainly because the optimization and improvement measures of the ICS algorithm provide the segmentation effect which is a great help. With the use of chaotic initialization population to increase the diversity of the solution, the use of optimized step size factors to increase the possibility of the algorithm to obtain the optimal solution, and the use of probability to reduce the complexity of the algorithm, overall the algorithm’s image segmentation under multiple thresholds is improved effect. This shows that under the condition of multiple thresholds the image segmentation of the algorithm in this paper has a good effect. The speed of segmentation time is a very important indicator in image segmentation. Figures 8 –11 show the time required for the four algorithms to segment under different thresholds. When the threshold is 1, the image segmentation time of the algorithm in this paper is more obvious than other algorithms. When the threshold value is 2, the image segmentation time of the four algorithms is improved to a certain extent compared with the threshold value of 1, but the algorithm in this paper still has advantages. When the threshold value is 3, the image segmentation time of the four algorithms increases, but the gap between each other shrinks. When the threshold is 4, the average image segmentation time of the algorithm in this paper has reached 0.6, which is still the smallest image segmentation time required by the other three algorithms. In particular, compared with the CS algorithm, the image segmentation time of the algorithm in this paper can be shortened by 40%, which shows that the advantages of population initialization, optimization of the step size factor, and use of probability optimization have been significantly improved.Figure 4
Comparison ofGC values of four algorithms with a threshold of 1.Figure 5
Comparison ofGC values of four algorithms with a threshold of 2.Figure 6
Comparison ofGC values of four algorithms with a threshold of 3.Figure 7
Comparison ofGC values of four algorithms with a threshold of 4.Figure 8
Comparison of the segmentation time of the four algorithms with a threshold of 1.Figure 9
Comparison of the segmentation time of the four algorithms with a threshold of 2.Figure 10
Comparison of the segmentation time of the four algorithms with a threshold of 3.Figure 11
Comparison of the segmentation time of the four algorithms with a threshold of 4.


### 5.3. Analysis of Statistical Characteristics of Optimal Algorithm Based on Wilcoxon Test

Due to the importance of multi-question statistical analysis, this paper usesR+ and R− in the literature [25] to represent the maximum and minimum sum ranks, respectively. Table 7 also shows the statistical analysis results of ICS and the other three comparison algorithms through Wilcoxon test. The parameters of Wilcoxon test are α = 0.01 and 0.05.Table 7
Analysis of Wilcoxon statistical test results.
Algorithm typeR+R−P valueICS versus CS3642540.0056ICS versus PSO2051340.1839ICS versus ACO2001230.2189As can be seen from the results shown in Table7, in all cases, the R+ value provided by ICS is higher than R−. Therefore, we can conclude that ICS has the best optimization performance.


## 5.1. Performance Comparison

In this paper, four test function algorithms are selected for comparison; the four test functions are(13)minf1x=∑i=1nxi2,minf2x=∑i=1nxi+∏i=1nxi,minf3x=∑i=1nxi+0.52,minf4x=maxabsxi.Run each algorithm 50 times under the conditions of 5, 10, and 50 dimensions, and compare the optimal value and variance results as shown in Tables2 to 5.Tables2–5 show the comparison results of the optimal value and variance of CS and ICS algorithms. From the table, it is found that the ICS algorithm has better results in the four benchmark functions than the CS algorithm. This shows that the performance of the ICS algorithm, after population initialization, text layout, and probability optimization, is significantly improved so that the optimal value and variance of the algorithm have better results. Table 6 shows the comparative effects of CS and ICS algorithms in different dimensions under the 4 benchmark functions. When the dimension is 5, the running time of ICS and CS in f1 and f3 is not much different. When the dimension is 10, the running time in f3 is not much different. The ICS proposed in this article has obvious advantages in other dimensions. It shows that the optimized algorithm can indeed improve the performance of the algorithm.Table 2
Optimizationf1 results of two algorithm pairs.
DimensionAlgorithmOptimal valueVariance5CS4.129e − 81.973e − 7ICS2.237e − 102.673e − 1210CS1.346e − 112.809e − 7ICS1.276e − 134.192e − 1150CS3.863e − 135.431e − 11ICS1.524e − 168.315e − 14Table 3
Optimizationf2 results of two algorithm pairs.
DimensionAlgorithmOptimal valueVariance5CS4.412e − 111.724e − 10ICS1.913e − 122.713e − 1110CS1.612e − 123.091e − 7ICS1.312e − 143.832e − 1150CS3.911e − 144.131e − 12ICS2.243e − 166.352e − 15Table 4
Optimizationf3 results of two algorithm pairs.
DimensionAlgorithmOptimal valueVariance5CS3.262e − 91.714e − 8ICS1.613e − 152.313e − 910CS1.527e − 113.101e − 9ICS2.932e − 144.102e − 1250CS4.127e − 134.272e − 12ICS3.141e − 167.124e − 14Table 5
Optimizationf4 results of two algorithm pairs.
DimensionAlgorithmOptimal valueVariance5CS8.172e − 112.714e − 9ICS1.872e − 122.823e − 1110CS1.915e − 123.751e − 10ICS1.173e − 136.912e − 1150CS4.173e − 156.201e − 12ICS2.271e − 187.412e − 14Table 6
Comparison of algorithm running time.
AlgorithmDimensionf1f2f3f4CS50.7320.8961.8540.734101.9151.8775.2251.8155012.31813.03940.41612.337ICS50.6310.8221.8520.936101.3721.6105.1721.516509.1349.86436.7197.421


## 5.2. Image Segmentation Effect Comparison

This paper uses theGC value in literature [24] as the multithreshold image segmentation quality evaluation standard, i.e., the evaluation of the GC value ranges between 0 and 1, and the larger the GC value, the better the segmentation quality. This paper chooses the segmentation quality and segmentation time as the standard hardware platform for comparison. This paper selects the Berkeley Segmentation Data Set and Benchmarks 500 (BSDS500) data set to randomly select 3 images as the segmentation object, set the segmentation threshold to 4, and the segmentation effect with the threshold value of 1–4 as shown in Figures 1(a) –3(e). Three pictures under the same threshold are represented by 1, 2, and 3, respectively.Figure 1
(a) Lean image, (b) threshold = 1, (c) threshold = 2, (d) threshold = 3, and (e) threshold = 4.
(a)(b)(c)(d)(e)Figure 2
(a) Rice image, (b) threshold = 1, (c) threshold = 2, (d) threshold = 3, and (e) threshold = 4.
(a)(b)(c)(d)(e)Figure 3
(a) Woman image, (b) threshold = 1, (c) threshold = 2, (d) threshold = 3, and (e) threshold = 4.
(a)(b)(c)(d)(e)Figures4– 7 show the comparison of the four algorithms for image segmentation quality GC values under different thresholds. When the threshold is 1, the GC value of the algorithm in this paper is significantly better than the other three comparison algorithms, especially compared to CS. In terms of the algorithm, the algorithm segmentation effect is obvious. When the threshold is 2, the GC value of the algorithm in this paper is slightly lower than when the threshold is 1, but overall it is still better than the other three algorithms, but it is compared with the GC value of the ICS algorithm. When the threshold is 3, the GC value of the algorithm in this paper is still stable at about 0.8, and the GC values of the other three algorithms have increased to varying degrees. When the threshold is 4, the GC value of the algorithm in this paper is close to 0.9, and the GC values ​​of the other three algorithms have risen to varying degrees. From the four results, as the threshold continues to increase, the GC values ​​of the four algorithms show an overall upward trend, but overall the ICS algorithm has certain advantages, mainly because the optimization and improvement measures of the ICS algorithm provide the segmentation effect which is a great help. With the use of chaotic initialization population to increase the diversity of the solution, the use of optimized step size factors to increase the possibility of the algorithm to obtain the optimal solution, and the use of probability to reduce the complexity of the algorithm, overall the algorithm’s image segmentation under multiple thresholds is improved effect. This shows that under the condition of multiple thresholds the image segmentation of the algorithm in this paper has a good effect. The speed of segmentation time is a very important indicator in image segmentation. Figures 8 –11 show the time required for the four algorithms to segment under different thresholds. When the threshold is 1, the image segmentation time of the algorithm in this paper is more obvious than other algorithms. When the threshold value is 2, the image segmentation time of the four algorithms is improved to a certain extent compared with the threshold value of 1, but the algorithm in this paper still has advantages. When the threshold value is 3, the image segmentation time of the four algorithms increases, but the gap between each other shrinks. When the threshold is 4, the average image segmentation time of the algorithm in this paper has reached 0.6, which is still the smallest image segmentation time required by the other three algorithms. In particular, compared with the CS algorithm, the image segmentation time of the algorithm in this paper can be shortened by 40%, which shows that the advantages of population initialization, optimization of the step size factor, and use of probability optimization have been significantly improved.Figure 4
Comparison ofGC values of four algorithms with a threshold of 1.Figure 5
Comparison ofGC values of four algorithms with a threshold of 2.Figure 6
Comparison ofGC values of four algorithms with a threshold of 3.Figure 7
Comparison ofGC values of four algorithms with a threshold of 4.Figure 8
Comparison of the segmentation time of the four algorithms with a threshold of 1.Figure 9
Comparison of the segmentation time of the four algorithms with a threshold of 2.Figure 10
Comparison of the segmentation time of the four algorithms with a threshold of 3.Figure 11
Comparison of the segmentation time of the four algorithms with a threshold of 4.


## 5.3. Analysis of Statistical Characteristics of Optimal Algorithm Based on Wilcoxon Test

Due to the importance of multi-question statistical analysis, this paper usesR+ and R− in the literature [25] to represent the maximum and minimum sum ranks, respectively. Table 7 also shows the statistical analysis results of ICS and the other three comparison algorithms through Wilcoxon test. The parameters of Wilcoxon test are α = 0.01 and 0.05.Table 7
Analysis of Wilcoxon statistical test results.
Algorithm typeR+R−P valueICS versus CS3642540.0056ICS versus PSO2051340.1839ICS versus ACO2001230.2189As can be seen from the results shown in Table7, in all cases, the R+ value provided by ICS is higher than R−. Therefore, we can conclude that ICS has the best optimization performance.


## 6. Conclusions

Aiming at the problem of poor image segmentation under multithreshold, this paper proposes an improved cuckoo search image segmentation processing algorithm. First, the image segmentation is described, and then the chaotic initialization population, step factor, and probability selection are optimized. Finally, the maximum entropy threshold function in image segmentation is solved as an improved cuckoo search individual fitness function. The experiment shows that using the optimized improved cuckoo search for image segmentation has achieved good results. The ICS algorithm proposed in this paper has good application value in multithreshold image segmentation, especially in the medical field. It can segment patient images to assist doctors in observing patient images, and can also be used in the analysis of urban road traffic conditions and the application of the extracted target vehicle and so on. However, because this article only considers the two indicators of segmentation quality and segmentation time, the lack of consideration of the accuracy of the image after segmentation makes the algorithm of this paper have certain limitations. This requires continued research in the next step, while continuously improving the segmentation quality and reducing the split time.



---

*Source: 6036410-2021-08-03.xml*