Image Segmentation Method Based on Elite Lévy Flight Diffusion Driven Differential Shrinkage Enclosure
By combining grayscale transformation, non-local mean filter, differential evolution algorithm, artificial bee colony shrinkage encirclement and elite Levi diffusion strategy to optimize image segmentation methods, the problems of inefficiency and local optimality in the existing technology are solved, and efficient and accurate image segmentation is achieved.
Patent Information
- Application Number
- CN202310040379.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-12
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2043-01-12
AI Technical Summary
The existing image segmentation method is inefficient when finding the optimal threshold, has high time complexity, and it is difficult for differential evolution algorithms to jump out of local optimality, resulting in poor segmentation effect.
Combining grayscale transformation and non-local mean filters to process images, a two-dimensional histogram was constructed, a differential evolution algorithm was used for global search, and a local search was performed by combining the shrinkage encirclement strategy of artificial bee colonies and the elite Levi diffusion strategy, the threshold vector was optimized, the fitness value was calculated through Kapur entropy, and the optimal threshold was selected.
It improves the accuracy and efficiency of image segmentation, and can find the best threshold without increasing the complexity of the model, which improves the accuracy of image segmentation.
Smart Images

Figure CN117197172B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image segmentation, and particularly to an image segmentation method based on elite Lévy diffusion-driven differential shrinkage enclosure. Background Art
[0002] In image segmentation methods, the threshold-based segmentation method is one of the main methods. An appropriate threshold can accurately and effectively segment an image, providing a reliable basis for subsequent operations on the image. However, exhaustive search makes the search for the optimal threshold inefficient, and the time complexity increases exponentially with the increase in the number of thresholds. In contrast, metaheuristic algorithms start searching from random positions and can find the optimal solution in the search space faster through random transformations and forward movement of the search direction, which has received extensive attention in the field of image segmentation. Although metaheuristic algorithms have achieved good performance in image segmentation, there are still deficiencies. Deficiencies such as poor convergence accuracy and inability to jump out of local optima will cause the image segmentation model to fail to obtain the optimal threshold, resulting in poor segmentation effects. The differential evolution algorithm is an evolution-based metaheuristic algorithm. Because there are few control parameters in the algorithm, the differential evolution algorithm has strong robustness. However, the differential evolution algorithm cannot jump out of local optima well.
[0003] Therefore, in view of the technical defects existing in the prior art, it is necessary to propose a solution to solve the technical problems existing in the prior art. Summary of the Invention
[0004] The technical problem to be solved by the embodiments of the present invention is to provide an image segmentation method based on elite Lévy diffusion-driven differential shrinkage enclosure, which can efficiently obtain the threshold of the image segmentation model and achieve high-accuracy image segmentation.
[0005] To solve the above technical problem, the embodiments of the present invention provide an image segmentation method based on elite Lévy diffusion-driven differential shrinkage enclosure, and the method includes the following steps:
[0006] Step S1: Process the original image using gray-scale transformation and a non-local means filter to obtain the two-dimensional histogram of the image; then construct the corresponding Kapur entropy according to the two-dimensional histogram and set the threshold range of the segmentation model;
[0007] Step S2: At the current number of evaluation times, use the differential evolution algorithm to perform a global search on the initial threshold vector set to obtain an optimized threshold vector set;
[0008] Step S3: Based on Step S2, use a shrinkage enclosure strategy based on artificial bee colony to perform a local search on the threshold vector set to obtain an optimized threshold vector set; then calculate the fitness value with the Kapur entropy as the objective function, and select the optimal threshold according to the greedy strategy;
[0009] Step S4: Use the elite Levy diffusion strategy to perform local search on the optimal threshold vector;
[0010] Step S5: Select the optimal threshold vector from the threshold vector set obtained in Step S4. Determine whether the iteration number threshold is reached. If so, use the obtained optimal threshold vector as the threshold vector of the optimized image segmentation model. Otherwise, jump to Step S2 to sequentially execute the relevant steps for the population positions in the current evaluation times to perform optimal threshold search.
[0011] As a further improvement, in the said Step S1, the image segmentation model is the Kapur entropy threshold segmentation method based on the two-dimensional histogram of the image.
[0012] As a further improvement, in the said Step S2, use the differential evolution algorithm to perform global search on the initial threshold vector set, including:
[0013]
[0014] V new,j = X k1,j + F × (X k2,j - X k3,j ),
[0015] where X cr,j is the value of the threshold vector optimized by the differential algorithm in the j-th dimension. X i,j represents the value of the current individual in the j-th dimension. V new,j represents the value of the individual obtained by the mutation operation in the j-th dimension. rand() is a random number in [0, 1]. p cr is the probability coefficient. j rand represents a dimension value randomly selected from the current threshold vector. X k1,j , X k2,j , X k3,j are three vectors randomly selected from the threshold vector set. F is a contraction factor.
[0016] As a further improvement, in the said Step S3, use the contraction and enclosure strategy based on the artificial bee colony to perform global search on the threshold vector set:
[0017]
[0018] where X i (t + 1) represents the new individual obtained after optimization. X rand is an individual randomly selected from the search range. X i (t) and X b(t) represents the individual in the current evaluation and the optimal individual in the current evaluation population. dim represents the dimension of the problem to be optimized (i.e., the number of thresholds). rand(1, dim) represents a 1×dim column vector composed of random numbers with a uniform distribution between 0 and 1. The value of α increases linearly from 0 to 1. ρ is a control parameter used to control the search direction and search step of the current individual. fes represents the current number of evaluations, and Maxfes represents the maximum number of evaluations. r1 and r2 represent random numbers selected from [0, 1]. Temp is an individual that communicates with the population. It is determined by the index value i of the current individual. If the individual in the current evaluation is the first individual in the population, then Temp is the optimal individual. Otherwise, Temp is the previous individual of the current individual.
[0019] As a further improvement scheme, in the step S4, local search is performed on the first EP optimal individuals through the elite Levy diffusion strategy:
[0020] EP = 1 + floor((1 - fes / Maxfes)*(Np - 1)).
[0021]
[0022] γ = (2*rand() - 1)*(1 - fes / Maxfes),
[0023]
[0024] Among them, Np represents the population size. floor(·) represents rounding the element to the nearest integer less than or equal to the element. γ is a control factor that determines the search direction of the individual. represents an individual randomly selected from EP individuals. θ is a parameter that controls the diffusion range. θ is a parameter that controls the diffusion range. step is a parameter that controls the forward step of the individual. levy represents a vector that follows the Levy distribution. u is a random number that follows a normal distribution with a mean of 0 and a variance of normal distribution. v is a random number that follows a normal distribution with a mean of 0 and a variance of of the normal distribution. σ v = 1, β = 3 / 2. Γ represents the standard gamma function.
[0025] As a further improvement scheme, in the step S5, the obtained optimal solution is used as the threshold for image segmentation to segment the image.
[0026] Implementing the embodiments of the present invention has the following beneficial effects:
[0027] Compared with the existing threshold - based image segmentation methods, the present invention belongs to a multi - threshold image segmentation method based on the differential evolution algorithm. The method of the present invention can better find the threshold of image segmentation without increasing the model complexity, so as to improve the accuracy of image segmentation; the performance of the original differential evolution algorithm is improved by combining the shrinking - enclosure mechanism and the elite Lévy diffusion strategy. The shrinking - enclosure mechanism improves the global search ability of the differential evolution algorithm by expanding the search range of the population, and the elite Lévy diffusion strategy improves the local search ability of the algorithm by further searching for the optimal solution. The combination of the two realizes the improvement of the differential evolution algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following - described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, obtaining other drawings based on these drawings still belongs to the scope of the present invention.
[0029] Figure 1 It is a flowchart of the image segmentation method based on elite Lévy diffusion - driven differential shrinking - enclosure provided by the embodiment of the present invention;
[0030] Figure 2 It is a flowchart of the differential evolution algorithm based on the shrinking - enclosure mechanism and the elite Lévy diffusion strategy provided by the embodiment of the present invention.
[0031] Figure 3 It is an experimental convergence curve graph of the image segmentation method based on elite Lévy diffusion - driven differential shrinking - enclosure provided by the embodiment of the present invention on the breast cancer test set with a threshold of 30.
[0032] Figure 4 It is a segmentation result graph of the image segmentation method based on elite Lévy diffusion - driven differential shrinking - enclosure provided by the embodiment of the present invention on the breast cancer test set with a threshold of 30. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0033] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will further describe the present invention in detail with reference to the drawings.
[0034] Among existing image segmentation methods, the differential evolution algorithm has strong robustness. However, the differential evolution algorithm cannot well jump out of the local optimum. Therefore, the present invention makes further improvements to the existing algorithm by adding two mechanisms, namely, a contraction and enclosure mechanism based on artificial bee colony and an elite Levy diffusion strategy, to the differential evolution algorithm to improve the algorithm performance. Among them, the contraction and enclosure mechanism based on artificial bee colony can improve the global search ability of the algorithm by expanding the search range of solutions. Secondly, the elite Levy diffusion strategy can guide the population to search in the region with higher quality solutions, find the optimal solution and output it.
[0035] See Figure 1 , which shows the step flowchart of an image segmentation method based on elite Levy diffusion-driven differential contraction and enclosure proposed in an embodiment of the present invention. The method includes the following steps:
[0036] Step S1: Process the original image using gray-scale transformation and non-local means filter to obtain the two-dimensional histogram of the image; then construct the corresponding Kapur entropy according to the two-dimensional histogram and set the threshold range of the segmentation model;
[0037] Step S2: At the current evaluation times, use the differential evolution algorithm based on the contraction and enclosure mechanism and the elite Levy diffusion strategy to search for the optimal threshold, as Figure 2 shown. First, initialize the control parameters involved in the algorithm. Subsequently, calculate the fitness value for each vector in the threshold vector set, and select the optimal threshold at the current evaluation times. Next, use the differential evolution algorithm to perform a global search on the threshold vector set to obtain an optimized threshold vector set. In this process, a new threshold vector is obtained by performing mutation and crossover operations on each threshold vector. Then, update the threshold vector according to the greedy strategy, that is, calculate the fitness value of the new threshold vector. If the fitness value is less than the fitness value of the current threshold vector, then the new threshold vector replaces the current threshold vector;
[0038] Step S3: Based on Step S2, use the contraction and enclosure strategy based on artificial bee colony to perform local search on the threshold vector set to obtain an optimized threshold vector set, as Figure 2 shown in the lower right part. Perform corresponding operations on each vector in the threshold vector set to obtain a new threshold vector, and then calculate the fitness value with the Kapur entropy as the objective function, and select the optimal threshold according to the greedy strategy;
[0039] Step S4: Use the elite Levy diffusion strategy to perform local search on the optimal threshold vector set, as Figure 2 shown in the upper right part. Perform relevant operations on each vector in the optimal threshold vector set to obtain the corresponding new threshold vector and calculate its fitness value. Subsequently, update the optimal threshold vector set according to the greedy strategy;
[0040] Step S5: Select the optimal threshold from the threshold vector set obtained in step S4. Determine whether the iteration number threshold is reached. If so, use the obtained optimal threshold vector as the threshold vector of the optimized image segmentation model; otherwise, jump to step S2 to sequentially execute the relevant steps for the population positions in the current evaluation number to perform the optimal threshold search.
[0041] In the step S1, the image segmentation model is the Kapur entropy threshold segmentation method based on the two-dimensional histogram of the image. The expression of the two-dimensional Kapur entropy K(g,f) is:
[0042]
[0043] where L is the gray level, and K k (g k ,f k ) represents the kth sub-region on the central diagonal line composed of the gray value g k of the gray image and the gray value f k of the non-local mean image. P ij represents the pixel value of this point, and P k represents the sum of the values of the kth sub-region on the central diagonal line.
[0044] In the step S2, the differential evolution algorithm is used to perform a global search on the initial threshold vector set, including:
[0045]
[0046] V new,j = X k1,j + F * (X k2,j - X k3,j ),
[0047] where X cr,j is the value of the threshold vector optimized by the differential algorithm in the jth dimension. X i,j represents the value of the current individual in the jth dimension. rand() is a random number in [0,1]. p cr is the probability coefficient, and p cr = 0.2. j rand represents a dimension value randomly selected from the current threshold vector. X k1,j , X k2,j , X k3,j are three vectors randomly selected from the threshold vector set. F is a contraction factor.
[0048] In the step S3, a global search is performed on the threshold vector set using the contraction and enclosure strategy based on the artificial bee colony:
[0049]
[0050] Among them, X i (t + 1) represents the new individual obtained after optimization. X rand is an individual randomly selected from the search range. X i (t) and X b (t) respectively represent the individual in the current evaluation and the optimal individual in the current evaluation population. dim represents the dimension of the problem to be optimized (i.e., the number of thresholds). rand(1, dim) represents a 1×dim column vector composed of random numbers uniformly distributed between 0 and 1. The value of α increases linearly from 0 to 1. ρ is a control parameter used to control the search direction and search step of the current individual. fes represents the current number of evaluations, and Maxfes represents the maximum number of evaluations. r1 and r2 represent random numbers selected in [0, 1]. Temp is an individual that communicates with the population. It is determined by the index value i of the current individual. If the individual in the current evaluation is the first individual in the population, then Temp is the optimal individual. Otherwise, Temp is the previous individual of the current individual. In the step S4, local search is performed on the top EP optimal individuals through the elite Lévy diffusion strategy:
[0051] EP = 1 + floor((1 - fes / Maxfes) * (Np - 1)).
[0052]
[0053] γ = (2 * rand() - 1) * (1 - fes / Maxfes),
[0054]
[0055] Among them, Np represents the population size. floor(·) represents rounding the element to the nearest integer less than or equal to the element. γ is a control factor that determines the search direction of the individual. represents an individual randomly selected from the EP individuals. θ is a parameter that controls the diffusion range. levy represents a vector subject to the Lévy distribution. u is a random number subject to a normal distribution with a mean of 0 and a variance of a normal distribution. v is a random number subject to a normal distribution with a mean of 0 and a variance of of. σ v = 1, β = 3 / 2. Γ represents the standard gamma function.
[0056] In the step S5, it is judged whether the current number of evaluations has reached the maximum number of evaluations. If not, return to step S2. If the maximum number of evaluations has been reached, the obtained optimal solution is used as the threshold for image segmentation to segment the image.
[0057] Implementing the embodiments of the present invention has the following beneficial effects:
[0058] Compared with existing meta-heuristic algorithms, the method of the present invention can find the approximate range of high-quality solutions in the early stage of evaluation, and perform multiple searches near the currently obtained optimal value, so as to gradually approach the optimal value we expect. We compare the proposed algorithm with the differential evolution algorithm (DE, please refer to: Storn, R., K. Price, Differential Evolution – A Simple and Efficient Heuristic for global Optimization over Continuous Spaces[J]. Journal of Global Optimization, 1997.11(4): p. 341-359.), the improved differential evolution algorithm (MDE, please refer to: Liu L, Zhao D, Yu F, Heidari A A, Ru J, Chen H, Mafarja M, Turabieh H, Pan Z. Performance Optimization of Differential Evolution with Slime Mould Algorithm for Multilevel Breast Cancer Image Segmentation[J]. Computers in Biology and Medicine, 2021), the weighted differential evolution algorithm (WDE, please refer to: P. Civicioglu, E. Besdok, M. A. Gunen, and U. H. Atasever, Weighted differential evolution algorithm for numerical function optimization: a comparative study with cuckoo search, artificial bee colony, adaptive differential evolution, and backtracking search optimization algorithms[J], Neural Computing and Applications, vol. 32, no. 8, pp. 3923-3937, 2020), the differential evolution algorithm based on chaotic local search (DECLS, please refer to: D. Jia, G. Zheng, and M.Khurram Khan, An effective memetic differential evolution algorithm based on chaotic local search[J], Information Sciences, vol. 181, no. 15, pp. 3175 - 3187), the cuckoo search algorithm (CS, please refer to: Gandomi, A. H., X. S. Yang, A. H. Alavi, Cuckoo search algorithm: a metaheuristic approach to solve structural optimization problems[J]. Engineering with Computers, 2013. 29(1): p. 17 - 35), the grey wolf optimization algorithm (GWO, please refer to: Mirjalili, S., S. M. Mirjalili, A. Lewis, Grey Wolf Optimizer[J]. Advances in Engineering Software, 2014. 69: p. 46 - 61), the enhanced moth - flame optimization algorithm (LGCMFO, please refer to: Xu, Y, Chen, H., Luo, J., Zhang, Q., Jiao, S., & Zhang, X. Enhanced Moth - flame Optimizer with Mutation Strategy for Global Optimization[J]. Information Sciences, 2019, 492: 181 - 203), the improved grey wolf optimization algorithm (IGWO, please refer to: Cai Z, Gu J, Luo J, et al. Evolving an optimal kernel extreme learning machine by using an enhanced grey wolf optimization strategy[J]. Expert Systems with Applications, 2019, 138: 112814) have carried out comparative experiments with different thresholds on the breast cancer dataset and used three indicators, namely feature similarity (FSIM), peak signal - to - noise ratio (PSNR), and structural similarity (SSIM), to evaluate the image segmentation results. The comparison results of FSIM, PSNR, and SSIM are shown in Tables 1, 2, and 3. It can be seen from the results in the table that the optimization results of this algorithm are the best among different thresholds. Table 1.Comparison results of different algorithms on the FSIM metric ("+ / - / =" indicates whether the performance of this algorithm is better than, worse than, or equal to other algorithms compared to other algorithms, "Avr" represents the average ranking value of the algorithm, and "Rank" represents the final ranking value of the algorithm).
[0059]
[0060] Table 2. Comparison results of different algorithms on the PSNR metric
[0061]
[0062]
[0063] Table 3. Comparison results of different algorithms on the SSIM metric
[0064]
[0065] Figure 3 The convergence curve graph of the segmentation experiment with a threshold of 30 on 9 breast cancer images of the proposed algorithm and another 9 algorithms is shown. It can be clearly seen that the convergence speed of the method we proposed is better than most of the compared algorithms, and the final fitness value is also the largest. The segmentation result graphs of all algorithms for a certain image are shown in Figure 4 . Although all methods can divide the image into different pixel sets, in the segmentation result graph of the proposed method, the boundary between different pixel sets is relatively clear. This further shows that the method can better segment images at different threshold levels.
[0066] The above-disclosed is only a preferred embodiment of the present invention. Of course, it cannot be used to limit the scope of the rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.
Claims
1. An image segmentation method based on elite Lévy diffusion-driven differential contraction enclosure, characterized in that At least include the following steps: Step S1: Process the original image using gray-scale transformation and non-local means filter to obtain the two-dimensional histogram of the image; then construct the corresponding Kapur entropy based on the two-dimensional histogram and set the threshold vector search range of the image segmentation model; Step S2: At the current evaluation times, use the differential evolution algorithm to globally search the threshold vector set to obtain a candidate threshold vector set; Step S3: Based on Step S2, use the shrinking enclosing strategy based on artificial bee colony to perform local search on the candidate threshold vector set to obtain an optimized threshold vector set; then calculate the fitness value with the Kapur entropy as the objective function, and obtain the first threshold vector according to the greedy strategy; Step S4: Use the elite Lévy diffusion strategy to perform local search on the first optimal threshold vector; Step S5: Select the optimal threshold vector from the results obtained by the local search in Step S4; and determine whether the iteration times threshold is reached. If so, use the obtained optimal threshold vector as the threshold of the optimized image segmentation model. Otherwise, jump to the population position in the current evaluation times of Step S2 and execute the relevant steps in sequence to search for the optimal threshold vector; In the said Step S3, using the shrinking enclosing strategy based on artificial bee colony to perform local search on the candidate threshold vector set includes: Among them, X i (t + 1) represents the new individual obtained after optimization; X rand represents an individual randomly selected from the search range; X i (t) and X b (t) represent the individual in the current evaluation and the optimal individual in the current evaluation population respectively; dim represents the dimension of the problem to be optimized; rand(1, dim) represents a 1×dim column vector composed of random numbers uniformly distributed between 0 and 1; the value of α increases linearly from 0 to 1; ρ represents the control parameter used to adjust the search direction and search step of the current individual; fes represents the current number of evaluations, and Maxfes represents the maximum number of evaluations; r1 and r2 represent random numbers selected in [0, 1]; Temp represents the individual communicating with the population, which is determined by the index value i of the current individual. If the current individual is the first individual in the population, then Temp is the optimal individual; otherwise, Temp is the previous individual of the current individual; In the said Step S4, perform local search on the first EP optimal individuals through the elite Lévy diffusion strategy: EP = 1 + floor((1 - fes / Maxfes)*(Np - 1)), Among them, Np represents the population size; floor(·) represents rounding the element to the closest integer less than or equal to the element; γ is a control factor that determines the individual search direction; represents an individual randomly selected from EP individuals; θ represents a parameter that controls the diffusion range; step represents a parameter used to adjust the individual's forward step; rand() represents a random number in [0, 1].
2. The image segmentation method based on elite Lévy diffusion-driven differential contraction enclosure according to claim 1, wherein In the said Step S1, the image segmentation model is the threshold segmentation method based on the Kapur entropy constructed from the two-dimensional histogram of the image.
3. The image segmentation method based on elite Lévy diffusion-driven differential shrinkage enclosure according to claim 1, wherein, In the said Step S2, using the differential evolution algorithm to globally search the threshold vector set includes: V new,j = X k1,j + F * (X k2,j - X k3,j ), Among them, X cr,j represents the value of the new threshold vector optimized by the differential evolution algorithm on the j-th dimension; X i,j represents the value of the current individual on the j-th dimension; V new,j represents the value of the individual obtained by the mutation operation on the j-th dimension; p cr is the probability coefficient; j rand represents a dimension value randomly selected from the current threshold vector; X k1,j , X k2,j , X k3,j are three vectors randomly selected from the threshold vector set; F represents the contraction factor.
4. A method for image segmentation based on elite Levy diffusion-driven differential shrinkage enclosure according to claim 1, characterized in that In the said Step S4, using the elite Lévy diffusion strategy to perform local search on the optimal threshold vector set also includes: γ = (2*rand() - 1)*(1 - fes / Maxfes), wherein, u represents a random number subject to a normal distribution with a mean of 0 and a variance of v represents a random number subject to a normal distribution with a mean of 0 and a variance of 1; levy represents a vector subject to a Levy distribution; β = 3 / 2; Γ represents the standard gamma function.
5. The image segmentation method based on elite Lévy diffusion-driven differential contraction enclosure according to claim 1, wherein In the said Step S5, use the obtained optimal solution as the threshold for image segmentation to segment the image.