Complex image multi-threshold segmentation method based on improved grey wolf optimization algorithm

By improving the grey wolf optimization algorithm combined with the maximum entropy model and multiple strategies, the problems of slow convergence and stability in multi-threshold segmentation of complex images are solved, and efficient and accurate image segmentation effects are achieved.

CN116309668BActive Publication Date: 2025-10-21JIANGSU UNIV OF TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310278139.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-21
Publication Date
2025-10-21
Estimated Expiration
2043-03-21

AI Technical Summary

Technical Problem

Existing image segmentation methods have problems such as slow early convergence speed, easy to fall into local optimality, and inaccurate multi-threshold segmentation in complex images, making it difficult to achieve high-precision and high-stability multi-threshold segmentation.

Method used

An improved gray wolf optimization algorithm is used, combined with the maximum entropy optimization model and reverse learning strategy, the alpha wolf approaching strategy and the population mutation strategy to optimize the image segmentation process, and multi-threshold segmentation is performed by finding the optimal segmentation threshold matrix.

Benefits of technology

It achieves fast and accurate multi-threshold segmentation of complex images, improves the stability and accuracy of segmentation, and is superior to traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116309668B_ABST
    Figure CN116309668B_ABST
Patent Text Reader

Abstract

The application discloses a complex image multi-threshold segmentation method based on an improved grey wolf optimization algorithm, and establishes an optimization model of maximum entropy threshold segmentation; the improved grey wolf optimization algorithm is used to solve the best segmentation threshold of image segmentation, wherein the improvement of the grey wolf optimization algorithm comprises the following steps: firstly, the non-linear factor is improved to balance the searching and mining capabilities of the algorithm; then, a reverse learning strategy is introduced to improve the population quality, a sine function is introduced again and the weight of the head wolf is adjusted to improve the grey wolf updating formula and enhance the mining capability of the algorithm; next, the head wolf closing strategy and the population mutation strategy are alternately introduced to update the position, the former improves the convergence performance of the algorithm, and the latter enhances the ability of the algorithm to jump out of the local optimum; further, the best segmentation threshold matrix of the grey image is obtained; finally, the image is segmented by using the best segmentation threshold matrix; and the stability of the complex image segmentation and the precision of the segmentation result are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a complex image multi-threshold segmentation method based on an improved grey wolf optimization algorithm. Background Art

[0002] Image segmentation is an important step in image processing. The quality of image segmentation directly affects the results of subsequent image processing, such as target positioning, feature extraction, and feature recognition. Nowadays, the application fields of image segmentation are becoming increasingly broad, such as military, medicine, industrial automation, and agricultural modernization. Therefore, high-precision and high-stability image segmentation is particularly important. A simple image contains only two regions (background region and target region), which can be separated by single threshold segmentation. However, the images involved in the field of industrial automation are often complex images with multiple types of regions. The target pixels occupy a small proportion of the pixels in the entire image, and the histogram distribution often presents a tailing distribution or a multi-peak distribution, which increases the difficulty of segmentation and requires higher optimization performance of the image segmentation algorithm.

[0003] Image segmentation methods can be categorized into threshold segmentation, edge segmentation, and region segmentation based on their segmentation criteria. Threshold-based segmentation methods are widely used due to their simplicity, low computational effort, and stable performance. The core of threshold segmentation methods lies in finding an appropriate threshold. The most commonly used threshold segmentation methods are those based on grayscale histograms, such as Otsu's method, maximum entropy, and minimum cross-entropy. These methods use exhaustive methods to quickly determine the threshold for single-threshold image segmentation. However, when performing multi-threshold segmentation, the computational effort increases exponentially, resulting in a long processing time. In recent years, swarm intelligence optimization algorithms have been widely applied to image segmentation due to their parallelism and ease of integration with other algorithms. In 2022, Guo Songlin proposed an improved whale optimization algorithm and image threshold segmentation method. This method uses the Otsu method as the segmentation function and an improved whale optimization algorithm for optimization, achieving rapid image segmentation. However, it is only applicable to single-threshold segmentation. In 2022, Lu Jianhong et al. proposed a multi-threshold image segmentation algorithm based on an improved seagull algorithm, achieving multi-threshold segmentation for complex images. However, the algorithm suffers from poor stability when the number of thresholds exceeds three. In 2022, Zhang Daming et al. proposed a bidirectional search gray wolf optimization algorithm based on stagnation detection for image segmentation. Using Kapur entropy as the segmentation function, they achieved multi-threshold segmentation of images. However, the algorithm suffers from low optimization accuracy and is not suitable for complex images. Chinese invention patent application number 201910258297.4 proposes a HT-29 image segmentation method based on an improved teaching-learning optimization algorithm. This improved teaching-learning optimization algorithm achieves accurate single-threshold segmentation of HT-29 images, but is not suitable for multi-threshold images.

[0004] Compared with the original optimization algorithm, using the improved optimization algorithm for image segmentation optimization calculations can effectively enhance the algorithm's early convergence and optimization capabilities, and improve the stability of accurate image segmentation. However, as image complexity increases, the requirements for improved intelligent optimization algorithms also become higher. Therefore, it is necessary to design a high-precision and high-stability multi-threshold segmentation method suitable for complex images. Summary of the Invention

[0005] The present invention aims to solve the problems of slow early convergence, easy falling into local optimum and inaccurate complex image segmentation in existing image segmentation methods, and provide a complex image multi-threshold segmentation method based on an improved gray wolf optimization algorithm.

[0006] The technical solutions adopted in the present invention are:

[0007] The complex image multi-threshold segmentation method based on the improved gray wolf optimization algorithm includes the following steps:

[0008] 1) Input the image, perform grayscale processing, obtain a one-dimensional grayscale histogram, and set the image grayscale value range to [0, 255];

[0009] 2) Establish a maximum entropy optimization model for image multi-threshold segmentation and use the maximum entropy optimization model as the segmentation function;

[0010] 3) Improve the Grey Wolf optimization algorithm and apply it to the segmentation function to obtain the optimal segmentation threshold matrix;

[0011] 4) Use the optimal segmentation threshold matrix to perform multi-threshold segmentation on the image to obtain the segmented image.

[0012] Furthermore, in step 2), the step of using the maximum entropy optimization model as the segmentation function is:

[0013] 2.1) According to step 1), input the image grayscale histogram and obtain the frequency h of each grayscale level i i , frequency p i and the threshold matrix (t1, t2, ..., t n ) After segmentation, the probability w of n+1 segmented regions appearing j , j=0,1,...,n, the specific calculation is as follows:

[0014] p i =h i / (M×N),p i ≥0 and

[0015]

[0016] Among them, M×N is the size of the image to be segmented;

[0017] 2.2) The information entropy used in the multi-threshold segmentation of the image in step 2) is the maximum entropy, and the maximum entropy value calculation formula is:

[0018] H(t1,t2,...,t n )=H0+H1+...+H n

[0019]

[0020] Among them, the threshold matrix (t1, t2, ..., t n ) Divide the image into n+1 regions, H0,H1,...,H n are the entropy values ​​of each region after segmentation, H(t1,t2,...,t n ) is the maximum entropy value of the segmented image, and its value is given by (t1, t2, ..., t n )Decide;

[0021] 2.3) Establish the maximum entropy optimization model, which is as follows:

[0022]

[0023] in, is the optimal multi-threshold segmentation matrix. At this time, the sum of the entropy values ​​of the segmented regions is the largest.

[0024] Furthermore, the specific process of step 3) is as follows:

[0025] 3.1) Initialize the gray wolf population, including: maximum number of iterations T max , the number of gray wolf populations N, the location boundary of the gray wolf population [lb, ub], where lb = 0, ub = 255;

[0026] 3.2) Randomly generate the initial position of the gray wolf population, each gray wolf position X i Represents a matrix with 1 row and n columns Where i = 1, 2, ..., N;

[0027] 3.3) Take each wolf position X i As the segmentation threshold, the image is segmented and the maximum entropy value of the segmented image is used as the fitness of each gray wolf individual fit(i). The top three gray wolf individuals in terms of fitness are respectively recorded as α wolf, β wolf and δ wolf, and their positions are recorded as X α 、X β 、X δ ;

[0028] 3.4) Before updating the position of individual gray wolves, a reverse learning strategy is introduced to improve the quality of the gray wolf population;

[0029] 3.5) Calculate the distances between the remaining gray wolf individuals and wolf α, wolf β, and wolf δ, and update the positions of the gray wolf individuals using the following formula:

[0030]

[0031]

[0032]

[0033] Among them, D α 、D β 、D δ are the distances between the gray wolf and the α wolf, the β wolf and the δ wolf, respectively. α 、X β With X δ is the current location of wolf α, wolf β and wolf δ, C1, C2, C3 are random vectors, C i =2*rand i , i=1,2,3, t is the current iteration number;

[0034] A1, A2, A3 are coefficient factors, A i =2a*rand i -a,rand i is a random number between 0 and 1, i = 1, 2, 3; w1, w2, w3 are weight factors, X1, X2, X3 are the positions of the gray wolf after it moves towards wolf α, wolf β, and wolf δ; a is the improved linear attenuation factor;

[0035] 3.6) After the individual gray wolf positions are updated, the leader-approaching strategy and the population mutation strategy are alternately introduced to update the positions, balancing the convergence performance of the gray wolf algorithm and its ability to escape local optimality;

[0036] 3.7) Determine whether the iteration is finished. If the current number of iterations is equal to the maximum number of iterations, the iteration is finished and the α wolf position is output as the optimal segmentation threshold matrix. Otherwise, the number of iterations is t=t+1 and the process goes to step 3.3).

[0037] Furthermore, the specific formula of the reverse learning strategy in step 3.4) is:

[0038]

[0039] Among them, X i is the position of the gray wolf, ub and lb are the upper and lower boundary values ​​of the gray wolf position, and fit(i) is the gray wolf X i The fitness value of , mean(fit) is the average fitness value of all gray wolves in the current iteration.

[0040] Furthermore, the improved linear attenuation factor a calculation formula in step 3.5) is as follows:

[0041]

[0042] Among them, t is the current iteration number, T max is the maximum number of iterations.

[0043] Furthermore, the alpha wolf approach strategy in step 3.6 is as follows: if the current number of iterations is an even number, the wolf pack as a whole moves closer to the alpha wolf α, thereby improving the convergence performance of the gray wolf algorithm in the early stage;

[0044] The population mutation strategy is: if the current number of iterations is an odd number, use population mutation to perform position mutation to improve the ability of the gray wolf algorithm to escape from the local optimum;

[0045] The formulas corresponding to the alpha wolf's approach strategy and the population mutation strategy are as follows:

[0046]

[0047] Among them, a is the improved linear attenuation factor, X i is the position of the gray wolf, X α is the position of wolf α before update, and fit(i) is the position of individual wolf X i The fitness value of .

[0048] Furthermore, the step 4) specifically includes:

[0049] Using the upward segmentation method, according to the optimal segmentation threshold matrix The image to be segmented is divided into n+1 regions and input into the grayscale image. The pixel values ​​between The value between And so on, The value between The region value is 255, and the segmented image is finally obtained. The analogy formula is as follows:

[0050]

[0051] Among them, i is the gray level of the pixel in the image to be segmented, i∈[0,255].

[0052] The present invention has the following beneficial effects:

[0053] The present invention can quickly find the optimal image segmentation threshold. Compared with the Grey Wolf Optimization (GWO), the Disturbance and Somersault Foraging-Grey Wolf Optimization (DSF-GWO) based on the somersault foraging strategy proposed by Wang Zhengtong et al. in 2021, the Levy Flight Trajectory-based Salp Swarm Algorithm (LSSA) proposed by Xing Zhikai et al. in 2021, and the Improved Northern Goshawk Optimization (INGO) proposed by Fu Xue in 2022, the Improved Grey Wolf Optimization Algorithm is applied to complex image segmentation and has the advantages of high precision and high stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 This is the basic flow chart of the present invention;

[0055] Figure 2 This is a flowchart for the specific implementation of the complex image multi-threshold segmentation method based on the improved gray wolf optimization algorithm;

[0056] Figure 3 To improve the Grey Wolf optimization algorithm, the numerical curve of the nonlinear attenuation parameter a when the number of iterations is 100;

[0057] Figure 4 There are five experimental images and their one-dimensional grayscale histograms, including two classic test images, Lena and Baboon, one remote sensing image, Building, and two QFN package chip surface defect images, QFN1 and QFN2, where the defects are scratches and abrasions respectively.

[0058] Figure 5 The segmentation results obtained by the method of the present invention after performing 2, 3, 4, and 5 threshold segmentation on 5 experimental images respectively;

[0059] Figure 6.1-Figure 6.5 The segmentation convergence diagrams of 5 experimental images subjected to 5-threshold segmentation using the GWO, DSF-GWO, LSSA, INGO image segmentation methods and the method of the present invention, respectively;

[0060] Figure 7.1-Figure 7.5 Corresponding to Figure 6.1-Figure 6.5 A partial enlarged view of DETAILED DESCRIPTION

[0061] The present invention will be further described below with reference to the accompanying drawings.

[0062] like Figure 1 The information entropy used in image segmentation is Kapur entropy (also known as maximum entropy). The multi-threshold selection criterion based on the maximum entropy method is: the total entropy value of the target and background classes after segmentation is the largest, that is, the maximum amount of information. The entropy value calculation formula is as follows:

[0063] H(t1,t2,...,t n )=H0+H1+...+H n

[0064]

[0065] Among them, the grayscale frequency p i =h i / (M*N),p i ≥0 and h i is the frequency of gray level i in the gray level histogram, and the gray level probability is calculated as follows:

[0066]

[0067] Based on the principle of the maximum entropy threshold segmentation method, we know that to obtain the optimal threshold, we need to find the threshold that maximizes the entropy value. Therefore, we can use an intelligent optimization algorithm to replace the traditional exhaustive method to optimize the threshold, reducing the algorithm's running time.

[0068] Implementation flow chart as follows Figure 2 The specific implementation steps are as follows:

[0069] Step (1): Input image. Initialize the parameters of the Gray Wolf Optimization Algorithm, including: maximum number of iterations T max , the number of gray wolf populations N, the location boundary of the gray wolf population [lb, ub], where lb = 0, ub = 255;

[0070] Step (2): Randomly generate the initial position X of the gray wolf population. The specific formula is as follows:

[0071]

[0072] Among them, X is the gray wolf population, which is an N-row n-column matrix, N is the number of populations, and n is the population dimension, that is, the number of segmentation thresholds. The symbol is the dot product symbol, which means the multiplication of the corresponding position elements of the two matrices. ub and lb are the upper and lower boundary values ​​of the gray wolf position respectively. i Represents a 1-row n-column threshold matrix in, i∈[1,N], j∈[1,n].

[0073] Step (3): Take each wolf position X i The image is segmented as the segmentation threshold, and the Kapur entropy value of the segmented image is used as the fitness of each gray wolf individual fit(i). The top three gray wolf individuals in terms of fitness are respectively recorded as α wolf, β wolf and δ wolf, and their positions are recorded as X α 、X β 、X δ ;

[0074] Step (4): Improve the nonlinear factor a and calculate the parameters A and C. The linear attenuation factor a in the original Grey Wolf algorithm is replaced by a combination of an outer parabola and a decaying oscillation curve. The decay curve is as follows: Figure 3 As shown in the figure, the value of a increases in the early stage of the algorithm, and then decays to 0 in a linear decay trend in the later stage of the algorithm. This enhances the diversity of the population in the early stage of the algorithm, reduces the probability of falling into the local optimum in the later stage of the algorithm, and balances the algorithm's search and mining capabilities. The specific formula of the linear decay factor a in the original gray wolf algorithm is as follows:

[0075]

[0076] A i =2a*r1-a

[0077] C i =2*r2

[0078] Among them, t is the current iteration number, T max is the maximum number of iterations, r1 and r2 are random numbers between 0 and 1, and i = 1, 2, 3, corresponding to α wolf, β wolf and δ wolf respectively.

[0079] Step (5): Before updating the position of the gray wolf, the current population fitness value is compared with the population average fitness value to determine the quality of the individual gray wolf position. The reverse learning strategy is introduced to improve the position of the gray wolf with poor position, so that the gray wolf position is closer to the global optimal position, thereby improving the population quality. The specific formula is as follows:

[0080]

[0081] Among them, X i is the position of the gray wolf, ub and lb are the upper and lower boundary values ​​of the gray wolf position, and fit(i) is the gray wolf X i The fitness value of , mean(fit) is the average fitness value of all gray wolves in this iteration.

[0082] Step (6): Introduce the sine function and adjust the weight of the alpha wolf to improve the gray wolf update formula. Based on the position update formula of β wolf and δ wolf in the original algorithm, the sine function sin(t) is added to improve the diversity of the distance between the gray wolf population and the alpha wolf β and δ, and enhance the mining ability of the algorithm. By continuously increasing the weight of X1 on position update, the dominant position of α wolf in the algorithm is improved. In the later stage of the algorithm, the position X1 is disturbed by X2 and X2 with relatively small weights to avoid local optimal phenomenon. The specific formula is as follows:

[0083]

[0084]

[0085]

[0086] Among them, D α 、D β 、D δ are the distances between the gray wolf and the α wolf, the β wolf and the δ wolf, respectively. α 、X β 、X δ is the current location of wolf α, wolf β and wolf δ, C1, C2, C3 are random vectors, C i =2*rand i , i=1,2,3, t is the current iteration number; A1, A2, A3 are coefficient factors, A i =2a*rand i -a,rand i is a random number between 0 and 1, i=1,2,3; w1, w2, w3 are weight factors, w1=1+t / T max , w2=w3=1, X1, X2, X3 are the positions of the gray wolf individual after moving towards wolf α, wolf β and wolf δ.

[0087] Step (7): After the position is updated, the leader approach strategy and the population mutation strategy are alternately introduced to update the position. If the current number of iterations is an even number, the leader approach strategy is adopted, and the wolf pack as a whole moves closer to the leader α, thereby improving the convergence performance of the algorithm in the early stage; if the current number of iterations is an odd number, the population mutation strategy is adopted to mutate the position, thereby improving the algorithm's ability to escape the local optimum. The specific formula is as follows:

[0088]

[0089] Among them, a is the improved attenuation factor, X i is the position of the gray wolf, X α is the position of wolf α before update, and fit(i) is the position of individual wolf X i The fitness value of .

[0090] Step (8): Determine whether the iteration is finished. If the current number of iterations is equal to the maximum number of iterations, the iteration is finished and the α wolf position is output as the optimal segmentation threshold matrix. Otherwise, the number of iterations is t=t+1 and the process goes to step (3).

[0091] Among them, before entering step (3), it is necessary to add boundary constraints, replacing the positions less than 0 and greater than 255 with 0 and 255 respectively, to avoid the boundary crossing phenomenon that causes errors when the algorithm calculates the fitness.

[0092] In order to verify the effectiveness of the method of the present invention, the present invention selects 9 single / multi-peak objective functions and 5 images for segmentation comparison experiments. The experimental images include 2 classic test images Lena and Baboon, 1 remote sensing image Building, and 2 QFN (Quad Flat Non-Lead) chip package images with surface defects, namely scratches and scrapes, which are marked as QFN1 and QFN2. Figure 4 The grayscale images of the five experimental images and their corresponding one-dimensional histograms are shown below. The experimental environment is a 2.9GHz CPU, 16GB memory, and MATLAB 2020b.

[0093] (1) In order to verify the optimization performance of IGWO in the proposed method, six unimodal objective functions (F1–F6) were selected from 23 benchmark functions to evaluate the mining ability of the algorithm, and three multimodal objective functions (F7–F9) were selected to evaluate the exploration ability of the algorithm, as shown in Table 1.

[0094] Table 1

[0095]

[0096]

[0097] For the sake of fairness, the same parameters are set for the five algorithms: the number of wolf packs is 30, the dimension is 30, the maximum number of iterations is 500, and the number of optimizations is 30. The mean and standard deviation (std) are introduced to evaluate them. The closer the mean is to the optimal value of the function theory, the better the algorithm optimization performance is. The calculation formula is: where K i is the optimal value of the i-th run; the smaller the standard deviation, the better the robustness of the algorithm, and the calculation formula is The optimization results are shown in Table 2, where the best data are shown in bold.

[0098] Table 2

[0099]

[0100] As can be seen from Table 2, the DSF-GWO and INGO algorithms perform well in both unimodal and multimodal functions. The LSSA algorithm outperforms the other algorithms only on function F6. Compared with the other algorithms, the IGWO algorithm performs well in unimodal functions, outperforming GWO and LSSA, and performs excellently in multimodal functions, outperforming the other four algorithms.

[0101] (2) The method of the present invention is compared with the multi-threshold image segmentation method based on GWO, DSF-GWO, LSSA, and INGO to perform segmentation comparison experiments on 5 images. Lena images and Baboon images are commonly used in image processing. Building images contain multiple targets and the background is not obvious. QFN images are commonly used packages and are easily scratched during use, causing external damage. These defects can easily cause loose welding, poor contact, etc., and are difficult to repair. Detecting surface defects can improve the recovery rate of chips, which has certain practical significance. Table 3 shows the segmentation thresholds obtained by the five optimization algorithms when segmenting the 5 test images. The images after segmentation are as follows: Figure 4 Table 4 shows the Kapur entropy values ​​obtained after image segmentation based on the thresholds in Table 3. The larger the entropy value, the higher the image segmentation accuracy. The entropy value convergence curve is shown in Figures 6.1 to 6.5 as well as Figures 7.1 to 7.5 .

[0102] Table 3

[0103]

[0104]

[0105] As shown in Table 3, if the number of segmentation thresholds is small, the segmentation thresholds selected by the algorithm are not much different and basically remain consistent. However, as the number of segmentation thresholds increases, the segmentation thresholds solved by the algorithm show differences. Whether the segmentation threshold solved by IGWO is optimal needs to be verified based on the corresponding Kapur entropy value in Table 4.

[0106] Table 4

[0107]

[0108] As shown in Table 4, for the five test images, when the IGWO proposed in this invention performs segmentation with 2, 3, 4, and 5 thresholds, the Kapur entropy values ​​obtained are always greater than or equal to those of other algorithms, showing better segmentation performance. Figures 6.1 to 6.5 as well as Figures 7.1 to 7.5 As shown in the figure, the IGWO proposed in the present invention is superior to the GWO, DSF-GWO, LSSA and INGO algorithms in both early convergence performance and late optimization performance.

[0109] (3) Table 5 shows the time required for 5-threshold segmentation based on GWO, DSF-GWO, LSSA, INGO and IGWO algorithms for 5 test images.

[0110] Table 5

[0111]

[0112] As shown in Table 5, the time consumption of IGWO and GWO segmentation in the present invention is less than that of DSF-GWO, LSSA and INGO, and the efficiency is higher.

[0113] (4) To demonstrate the effectiveness of the present invention for multi-threshold segmentation of complex images, four indicators, namely mean, standard deviation (std), best, and worst, are introduced to evaluate the method. Mean, std, best, and worst are the mean, standard deviation, best, and worst values ​​of the Kapur entropy after 30 consecutive runs of 5-threshold segmentation. A larger mean value indicates better segmentation performance; a smaller standard deviation indicates better robustness; a larger optimal value and a greater number of successful runs indicate better optimization performance; a smaller worst value indicates that the algorithm is at risk of falling into a local optimum and has poor optimization stability. The optimal value and the worst value are the maximum and minimum entropy values ​​in the 30 runs, respectively. The evaluation results are shown in Table 6.

[0114] Table 6

[0115]

[0116]

[0117] As shown in Table 6, compared with the multi-threshold segmentation of complex images based on GWO, DSF-GWO, LSSA and INGO algorithms, the average Kapur entropy obtained by the method of the present invention is the highest, indicating that the algorithm has excellent optimization performance and the image accuracy after segmentation is higher; the standard deviation is the smallest, and the algorithm is more stable; the worst value is closest to the optimal value, and the algorithm has the ability to escape the local optimum, and the optimization performance is better.

[0118] (5) To verify the effectiveness of each improvement point in the IGWO proposed by the method of the present invention, an ablation experiment was conducted on the improved points, and five indicators, including mean, standard deviation, best, worst, and number of successes (NS), were introduced to evaluate them. The number of successful runs was the number of times the entropy value after 30 consecutive runs of 5 threshold segmentation was equal to the maximum entropy value (obtained by exhaustive method). IGWO1, IGWO2, IGWO3, and IGWO4 respectively improved only the attenuation factor a, only improved the position update formula (including the reverse learning strategy before position update), only introduced the alpha wolf approach strategy throughout the process, and alternately introduced the alpha wolf approach strategy and population variation strategy. The evaluation results are shown in Table 7.

[0119] Table 7

[0120]

[0121]

[0122] As shown in Table 7, IGWO1, IGWO2, IGWO3, and IGWO4 all significantly improved their success rate compared to GWO, demonstrating that improving the attenuation factor, improving the position update formula, and introducing the alpha wolf approach strategy can effectively enhance the algorithm's optimization capabilities. IGWO3 performs best in segmenting the Lena and Baboon graphs, but suffers from local optima when segmenting the Building, QFN1, and QFN2 graphs. IGWO4, compared to IGWO3, incorporates a population mutation strategy, improving the algorithm's optimization performance while eliminating local optima.

[0123] (6) Table 8 shows that different intelligent optimization algorithms are used to perform 30 5-level threshold segmentation on the test image, and the Peak Signal to Noise Ratio (PSNR) and Feature Similarity Index Mersure (FSIM) are used to evaluate the segmentation performance of the algorithm. The higher the PSNR value, the lower the degree of distortion of the segmented image, and the higher the FSIM value, the lower the misclassification rate. The calculation formula of the signal-to-noise ratio is: in I and J are the original image and the segmented image of size M×N respectively. The calculation formula of feature similarity is Among them, Ω represents all pixel areas of the original image, and image similarity S L (X) = S PC (x)S G (x), image feature similarity PC1(x) and PC2(x) represent the phase consistency between the original image and the segmented image. The phase consistency information PC m (x) = max{PC1(x), PC2(x)}, image gradient similarity G1(x) and G2(x) are the gradient amplitudes of the original image and the segmented image respectively. T1 and T2 are constants. In the experiment, T1 = 0.85 and T2 = 160 are set.

[0124] Table 8

[0125]

[0126]

[0127] As shown in Table 8, the higher the segmentation threshold, the larger the PSNR and FSIM values ​​obtained after image segmentation, the less image distortion, and the lower the error rate. Compared with other algorithms, the IGWO-based method proposed in the present invention achieves the highest PSNR and the lowest distortion when segmenting the Lena, Building, and QFN1 images. It also achieves the highest FSIM and the lowest error rate when segmenting the QFN1 image. The PSNR and FSIM values ​​after segmenting the Baboon image are lower than those of the LSSA method, and the PSNR and FSIM values ​​after segmenting the QFN2 image are lower than those of the DSF-GWO method. Compared with other methods, the proposed method has a better segmentation effect.

[0128] The above description is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements can be made without departing from the principles of the present invention. These improvements should also be regarded as the scope of protection of the present invention.

Claims

1. A complex image multi-threshold segmentation method based on the improved gray wolf optimization algorithm, characterized by: The following steps are involved: 1) Input the image, perform grayscale processing, obtain a one-dimensional grayscale histogram, and set the image grayscale value range to [0, 255]; 2) Establish a maximum entropy optimization model for multi-threshold image segmentation and use the maximum entropy optimization model as the segmentation function; 3) Improve the Grey Wolf Optimization Algorithm and apply it to the segmentation function to obtain the optimal segmentation threshold matrix; 4) Use the optimal segmentation threshold matrix to perform multi-threshold segmentation on the image to obtain the segmented image; The specific process of step 3) is as follows: (3.1) Initialize the gray wolf population, including: maximum number of iterations , the number of gray wolf populations , the gray wolf population location boundary ,in, , ; (3.2) Randomly generate the initial position of the gray wolf population, each gray wolf position Represents a 1-line Column matrix ,in, ; (3.3) Take each gray wolf position As the segmentation threshold, the image is segmented and the maximum entropy value of the segmented image is used as the fitness of each gray wolf individual. , among which, the top three gray wolf individuals in terms of fitness are recorded as Wolf, Wolf and wolves, and record their positions as 、 、 ; (3.4) Before updating the position of individual gray wolves, a reverse learning strategy is introduced to improve the quality of the gray wolf population; (3.5) Calculate the remaining gray wolf individuals and Wolf, Wolf and The distance between the wolves and the individual positions of the gray wolves is updated using the following formula: , , , in, 、 、 Gray wolf individuals and Wolf, Wolf and Wolf's Pitch, 、 and for Wolf, Wolf and The wolf's current location, 、 、 is a random vector, , , is the current iteration number; 、 、 is the coefficient factor, , is a random number between 0 and 1, ; 、 、 is the weight factor, 、 、 For the gray wolf Wolf, Wolf and The wolf's position after moving; To improve the linear attenuation factor; (3.6) After the individual gray wolf positions are updated, the leader-approaching strategy and the population mutation strategy are alternately introduced to update the positions, balancing the convergence performance of the gray wolf algorithm and its ability to escape from local optimality. (3.7) Determine whether the iteration is finished. If the current number of iterations is equal to the maximum number of iterations, the iteration is finished and the output is The wolf position is used as the optimal segmentation threshold matrix, otherwise the number of iterations , go to step (3.3).

2. The complex image multi-threshold segmentation method based on the improved gray wolf optimization algorithm according to claim 1, characterized in that: The steps of using the maximum entropy optimization model as the segmentation function in step 2) are: (2.1) According to step 1), the grayscale histogram of the input image is obtained and the grayscale level of each image is obtained. Frequency ,frequency and the threshold matrix After segmentation, The probability of the segmented region appearing , , the specific calculation is as follows: , and , , in, is the size of the image to be segmented; (2.2) The information quotient used in the multi-threshold image segmentation in step 2) is the maximum entropy. The maximum entropy value calculation formula is: , , Among them, the threshold matrix Split the image into regions, are the entropy values ​​of each region after segmentation, is the maximum entropy value of the segmented image, and its value is given by Decide; (2.3) Establish the maximum entropy optimization model, which is as follows: , in, is the optimal multi-threshold segmentation matrix. At this time, the sum of the entropy values ​​of the segmented regions is the largest.

3. The complex image multi-threshold segmentation method based on the improved gray wolf optimization algorithm according to claim 1, characterized in that: The specific formula of the reverse learning strategy described in step (3.4) is: , in, is the individual position of the gray wolf, and are the upper and lower boundary values ​​of the gray wolf’s position, For the gray wolf The fitness value of , mean(fit) is the average fitness value of all gray wolves in the current iteration.

4. The complex image multi-threshold segmentation method based on the improved gray wolf optimization algorithm according to claim 1, characterized in that: Improve the linear attenuation factor in step (3.5) The calculation formula is as follows: , in, is the current iteration number, is the maximum number of iterations.

5. The complex image multi-threshold segmentation method based on the improved gray wolf optimization algorithm according to claim 4 is characterized in that: Step (3.6) The alpha wolf's approach strategy is: if the current iteration number is an even number, the wolf pack as a whole moves towards the alpha wolf. Closer,increase the convergence performance of the Grey Wolf Algorithm in the early stage; The population mutation strategy is: if the current number of iterations is an odd number, use population mutation to perform position mutation to improve the ability of the gray wolf algorithm to escape from the local optimum; The formulas corresponding to the alpha wolf's approach strategy and the population mutation strategy are as follows: , in, To improve the linear attenuation factor, is the individual position of the gray wolf, for The wolf's location before the update, Gray wolf individuals The fitness value of .

6. The complex image multi-threshold segmentation method based on the improved gray wolf optimization algorithm according to claim 1, characterized in that: Step (4) specifically includes: Using the upward segmentation method, according to the optimal segmentation threshold matrix Divide the image to be segmented into region and input it into the grayscale image. The pixel values ​​between , The value between , and so on, The value between , The region value is 255, and the segmented image is finally obtained. The analogy formula is as follows: , in, is the gray level of the pixel in the image to be segmented, .

Citation Information

Patent Citations

  • An HT-29 image segmentation method based on an improved teaching and learning optimization algorithm

    CN110047088B