A multi-level image segmentation method

By employing the two-stage evolutionary mechanism of the animal migration optimization algorithm and the Taguchi orthogonal experiment, the problems of local optima and slow convergence speed in multi-level image segmentation were solved, achieving faster and more accurate multi-threshold segmentation results and improving the contrast and detail clarity of image segmentation.

CN121010619BActive Publication Date: 2026-01-30NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511536137.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-01-30
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

Existing multi-level image segmentation methods are prone to getting trapped in local optima, have slow convergence speed, and insufficient segmentation accuracy, making it difficult to achieve fast and accurate multi-threshold segmentation in complex images.

Method used

The two-stage evolutionary mechanism of the animal migration optimization algorithm is used to iteratively optimize the objective function of minimum cross-entropy threshold. Combined with dynamic Gaussian perturbation and Lévy flight perturbation, local fine-tuning is performed through Taguchi orthogonal experiments to solve for the optimal threshold vector.

Benefits of technology

It improves the algorithm's global optimization capability and convergence speed, enhances the accuracy and stability of the optimal threshold vector, and improves the contrast and detail clarity of image segmentation, adapting to the segmentation needs of different types and distribution characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010619B_ABST
    Figure CN121010619B_ABST
Patent Text Reader

Abstract

This invention discloses a multi-level image segmentation method, belonging to the field of image segmentation technology. The method includes: obtaining the pixel histogram of the original image and constructing a minimum cross-entropy threshold optimization objective function based on the pixel histogram; iteratively optimizing the minimum cross-entropy threshold optimization objective function using a two-stage evolutionary mechanism of the animal migration optimization algorithm to solve for the optimal threshold vector; introducing dynamic Gaussian perturbation in the population iterative update in the first stage; applying Lévy flight perturbation to individuals with fitness below the fitness standard in the second stage; locally fine-tuning the optimal threshold vector using Taguchi orthogonal experiments to optimize the image quality assessment index, obtaining the final optimal threshold vector; and using the final optimal threshold as a multi-level segmentation parameter to perform multi-level image segmentation on the original image to obtain the multi-level image segmentation result. This method can improve the speed, accuracy, and stability of multi-threshold segmentation of complex images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a multi-level image segmentation method, belonging to the field of image segmentation technology. Background Technology

[0002] Multilevel image segmentation is one of the important tasks in digital image processing. It aims to segment an image into several regions with semantic consistency or grayscale / color consistency, and is widely used in fields such as medical diagnosis and remote sensing interpretation.

[0003] Traditional multi-threshold segmentation methods often employ histogram analysis and entropy criteria, combined with fixed thresholds or simple search algorithms. However, as the complexity of image content increases, existing methods generally suffer from low computational efficiency, susceptibility to local optima, and difficulty in adaptively adjusting to complex distributions.

[0004] In recent years, swarm intelligence optimization algorithms have been introduced into image segmentation. However, algorithms such as Particle Swarm Optimization (PSO) and Grey Wolf Optimization (GWO) are difficult to balance between global optimization ability and local exploitation ability, especially in high-dimensional multi-threshold problems. There is an urgent need for an algorithm framework that has more advantages in global exploration and local exploitation. Summary of the Invention

[0005] The purpose of this invention is to provide a multi-level image segmentation method that can solve the problems of existing multi-level image segmentation methods being prone to getting trapped in local optima, having slow convergence speed, and insufficient segmentation accuracy, and achieve faster, more accurate, and more stable multi-threshold segmentation results in complex images.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a multi-level image segmentation method, comprising:

[0008] Obtain the pixel histogram of the original image, and construct the minimum cross-entropy threshold optimization objective function based on the pixel histogram;

[0009] Initialize the population for the animal migration optimization algorithm. Each individual in the population represents a candidate threshold vector that is randomly distributed within the pixel grayscale range.

[0010] The two-stage evolutionary mechanism of the animal migration optimization algorithm is used to iteratively optimize the objective function of minimum cross-entropy threshold and solve for the optimal threshold vector. In the first stage, a dynamic Gaussian perturbation is introduced in the population iterative update, and the perturbation intensity decreases with the number of iterations. In the second stage, Levy flight perturbation is applied to individuals with fitness below the fitness standard, and the perturbation intensity decreases with the number of iterations.

[0011] The optimal threshold vector is locally fine-tuned using the Taguchi orthogonal experiment to optimize the image quality assessment index, thus obtaining the final optimal threshold vector.

[0012] The final optimal threshold is used as the multi-level segmentation parameter to perform multi-level image segmentation on the original image, resulting in multi-level image segmentation results.

[0013] In conjunction with the first aspect, further obtaining the pixel histogram of the original image includes:

[0014] Convert the original image to a grayscale image and calculate the pixel histogram of the grayscale image;

[0015] Alternatively, the pixel histograms of the original image in the red, green, and blue channels can be calculated separately.

[0016] Building upon the first aspect, the objective function for optimizing the minimum cross-entropy threshold based on the pixel histogram of the grayscale image is further defined as follows:

[0017] ;

[0018] in, Describe the objective function. Represents a set of multiple thresholds. , , … … They represent the 1st, 2nd, ..., … Threshold for each grayscale range The first pixel is calculated based on the pixel histogram. The pixel probability of each grayscale range.

[0019] Building upon the first aspect, further, the objective function for optimizing the minimum cross-entropy threshold, constructed based on the pixel histograms of the original image in the red, green, and blue channels, is as follows:

[0020] ;

[0021] in, This represents the total objective function value. , , These represent the objective function values ​​corresponding to the red, green, and blue channels, respectively. , , They represent , , The corresponding weights.

[0022] Building upon the first aspect, further, the formula for updating individual positions in the first stage of the animal migration optimization algorithm is:

[0023] ;

[0024] in, , They represent the first The individual in the first , Position at the next iteration Indicates the first The individual in the first Position at the next iteration This represents a foraging factor used to control the stride length of an individual's movement tendency. This represents a dynamic Gaussian perturbation. ,express Follows a pattern with a mean of 0 and a variance of 0. The normal distribution , This indicates the initial disturbance intensity. This indicates the maximum number of iterations.

[0025] Building upon the first aspect, further, the individual location update formula for the animal migration optimization algorithm in the second stage is:

[0026] ;

[0027] in, , They represent the first The individual in the first , Position at the next iteration This represents the Lévy flight disturbance intensity scaling factor used to control the step size of individual movement trends. Let represent a random variable that follows a Lévy distribution. , Represents the Lévy distribution index parameter. , Let each represent two independent random variables. ,express , All follow a mean of 0 and a variance of . The normal distribution Indicates and The relevant standard deviation.

[0028] In conjunction with the first aspect, further, during the iterative optimization of the objective function for the minimum cross-entropy threshold using the two-stage evolutionary mechanism of the animal migration optimization algorithm, if the improvement in the optimal fitness of the population is lower than the improvement threshold, the iteration is stopped early.

[0029] In conjunction with the first aspect, further, by using Taguchi orthogonal experiments to locally fine-tune the optimal threshold vector, the image quality assessment index is optimized, and the final optimal threshold vector is obtained. This includes designing experimental combinations based on the noise factor, using orthogonal arrays L8 or L16 to locally fine-tune the optimal threshold vector, so that the image quality assessment index is optimized, and the final optimal threshold vector is obtained.

[0030] Building upon the first aspect, the formula for locally fine-tuning the optimal threshold vector using the Taguchi orthogonal experiment is as follows:

[0031] ;

[0032] in, This represents the final optimal threshold vector. This represents the optimal threshold vector for the current iteration round. This represents the threshold vector calculated based on the mean fitness of all individuals in the current iteration round. This represents the perturbation term generated by the Taguchi orthogonal experiment.

[0033] In conjunction with the first aspect, further image quality assessment metrics include peak signal-to-noise ratio and structural similarity index.

[0034] In a second aspect, the present invention provides a multi-level image segmentation system, comprising:

[0035] The image preprocessing module is used to obtain the pixel histogram of the original image and construct the minimum cross-entropy threshold optimization objective function based on the pixel histogram;

[0036] The algorithm initialization module is used to initialize the population of the animal migration optimization algorithm. Each individual in the population represents a candidate threshold vector that is randomly distributed within the pixel grayscale range.

[0037] The two-stage optimization module is used to iteratively optimize the minimum cross-entropy threshold optimization objective function using the two-stage evolution mechanism of the animal migration optimization algorithm, and solve for the optimal threshold vector. In the first stage, a dynamic Gaussian perturbation is introduced in the population iterative update, and the perturbation intensity decreases with the number of iterations. In the second stage, a Levy flight perturbation is applied to individuals with fitness below the fitness standard, and the perturbation intensity decreases with the number of iterations.

[0038] The fine-tuning module is used to locally fine-tune the optimal threshold vector using the Taguchi orthogonal experiment, so that the image quality assessment index reaches the optimal level and the final optimal threshold vector is obtained.

[0039] The image segmentation module is used to perform multi-level image segmentation on the original image by using the final optimal threshold as a multi-level segmentation parameter, and obtain multi-level image segmentation results.

[0040] Thirdly, the present invention provides a computer device, comprising:

[0041] Storage medium: used to store computer programs;

[0042] Processor: for executing the computer program to implement the multi-level image segmentation method of the first aspect.

[0043] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-level image segmentation method described in the first aspect.

[0044] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the multi-level image segmentation method described in the first aspect.

[0045] Compared with the prior art, the beneficial effects of the present invention are:

[0046] The multi-level image segmentation method provided by this invention utilizes the two-stage evolutionary mechanism of the animal migration optimization algorithm to iteratively optimize the minimum cross-entropy threshold optimization objective function and solve for the optimal threshold vector. In the first stage, dynamic Gaussian perturbation is introduced to enhance global exploration. In the second stage, Levy flight perturbation is applied to individuals with poor fitness to enhance their ability to escape local optima. Finally, the optimal threshold vector is locally fine-tuned through Taguchi orthogonal experiments. This method can effectively improve the algorithm's global optimization ability and convergence speed, and improve the accuracy and stability of the optimal threshold vector.

[0047] The threshold optimization objective function based on the minimum cross-entropy criterion provided by this invention combines pixel distribution probability and regional information features to improve the contrast and detail clarity of image segmentation, and can adapt to the segmentation needs of different types and different distribution characteristics.

[0048] The animal migration optimization algorithm provided by this invention automatically optimizes the segmentation threshold parameters, enabling the segmentation threshold to be dynamically and adaptively adjusted under complex multi-peak conditions. This effectively improves the subjective visual effect and objective quality indicators (such as edge preservation, peak signal-to-noise ratio, and structural similarity index) of the segmented image. Attached Figure Description

[0049] Figure 1 This is a flowchart of the multi-level image segmentation method provided in the embodiments of the present invention;

[0050] Figure 2 This is a flowchart of the animal migration optimization algorithm based on Taguchi strategy provided in an embodiment of the present invention;

[0051] Figure 3This is a schematic diagram comparing the animal migration optimization algorithm based on Taguchi strategy provided in this embodiment of the invention with other algorithms, where (a) represents the iterative convergence curve on the test function F4, and (b) represents the iterative convergence curve on the test function F6;

[0052] Figure 4 This is the histogram of each band of the 5-threshold segmentation of image 5 by the animal migration optimization algorithm based on Taguchi strategy provided in this embodiment of the invention. Among them, (a), (b), and (c) correspond to the red, green, and blue channel histograms and threshold positions when the 5-threshold segmentation is performed, respectively. The red dashed lines represent the optimized threshold positions.

[0053] Figure 5 The image 5 is segmented by the Taguchi strategy-based animal migration optimization algorithm provided in this embodiment of the invention, and the histogram of each band of the 8-threshold segmentation algorithm is shown. (a), (b), and (c) correspond to the red, green, and blue channel histograms and threshold positions when segmenting with 8 thresholds, respectively. The red dashed lines represent the optimized threshold positions.

[0054] Figure 6 The image 5 is segmented by the Taguchi strategy-based animal migration optimization algorithm provided in this embodiment of the invention, and the histogram of each band of the 11 thresholds is shown. Among them, (a), (b), and (c) correspond to the red, green, and blue channel histograms and threshold positions when segmenting with 11 thresholds, respectively. The red dashed lines represent the optimized threshold positions.

[0055] Figure 7 This is a schematic diagram of the animal migration optimization algorithm based on Taguchi strategy provided in this embodiment of the invention for segmenting image 5, wherein (a) corresponds to the original image, (b) corresponds to 5-threshold segmentation, (c) corresponds to 8-threshold segmentation, and (d) corresponds to 11-threshold segmentation. Detailed Implementation

[0056] The technical solution of the present invention will be further described in detail below with reference to specific embodiments.

[0057] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. Unless otherwise specified, embodiments of the present invention and the technical features thereof can be combined with each other.

[0058] This invention provides a multi-level image segmentation method, comprising:

[0059] Obtain the pixel histogram of the original image, and construct the minimum cross-entropy threshold optimization objective function based on the pixel histogram;

[0060] Initialize the population for the animal migration optimization algorithm. Each individual in the population represents a candidate threshold vector that is randomly distributed within the pixel grayscale range.

[0061] The two-stage evolutionary mechanism of the animal migration optimization algorithm is used to iteratively optimize the objective function of minimum cross-entropy threshold and solve for the optimal threshold vector. In the first stage, a dynamic Gaussian perturbation is introduced in the population iterative update, and the perturbation intensity decreases with the number of iterations. In the second stage, Levy flight perturbation is applied to individuals with fitness below the fitness standard, and the perturbation intensity decreases with the number of iterations.

[0062] The optimal threshold vector is locally fine-tuned using the Taguchi orthogonal experiment to optimize the image quality assessment index, thus obtaining the final optimal threshold vector.

[0063] The final optimal threshold is used as the multi-level segmentation parameter to perform multi-level image segmentation on the original image, resulting in multi-level image segmentation results.

[0064] The multi-level image segmentation method provided in this invention utilizes the two-stage evolution mechanism of the Adaptive Protozoa Optimization (APO) algorithm to iteratively optimize the minimum cross-entropy threshold optimization objective function and solve for the optimal threshold vector. In the first stage, a dynamic Gaussian perturbation is introduced to enhance global exploration. In the second stage, a Levy flight perturbation is applied to individuals with poor fitness to enhance their ability to escape local optima. Finally, the optimal threshold vector is locally fine-tuned through Taguchi orthogonal experiments. This method can effectively improve the algorithm's global optimization ability and convergence speed, and improve the accuracy and stability of the optimal threshold vector. This enhances the robustness and adaptability of the algorithm in complex optimization tasks, making it suitable for various scenarios such as medical imaging, remote sensing images, and document images. It has stronger versatility and engineering application value.

[0065] Figure 1 This is a flowchart of the multi-level image segmentation method provided in this embodiment. This flowchart only shows the logical order of the method in this embodiment. Provided there are no conflicts, different methods can be used. Figure 1 Complete the steps shown or described in the order indicated.

[0066] The multi-level image segmentation method provided in this embodiment can be applied to a terminal and can be executed by a multi-level image segmentation system. This system can be implemented by software and / or hardware and can be integrated into the terminal, such as any tablet computer or computer device with communication capabilities.

[0067] This invention provides a multi-level image segmentation method, which specifically includes the following steps:

[0068] Step 1: Obtain the pixel histogram of the original image, and construct the minimum cross-entropy threshold optimization objective function based on the pixel histogram;

[0069] In one possible embodiment, obtaining the pixel histogram of the original image specifically includes: converting the original image into a grayscale image and calculating the pixel histogram of the grayscale image.

[0070] In this embodiment, the minimum cross-entropy threshold optimization objective function constructed based on the pixel histogram of the grayscale image is:

[0071] ;

[0072] in, Describe the objective function. Represents a set of multiple thresholds. , , … … They represent the 1st, 2nd, ..., … Threshold for each grayscale range The first pixel is calculated based on the pixel histogram. The pixel probability of each grayscale range.

[0073] The threshold optimization objective function based on the minimum cross-entropy criterion provided in this embodiment, combined with pixel distribution probability and regional information features, improves the contrast and detail clarity of image segmentation, and can adapt to the segmentation needs of different types and different distribution characteristics.

[0074] In one possible embodiment, obtaining the pixel histogram of the original image specifically includes: calculating the pixel histograms of the original image in the red, green, and blue channels respectively.

[0075] In this embodiment, the minimum cross-entropy threshold optimization objective function, constructed based on the pixel histograms of the original image in the red, green, and blue channels, is as follows:

[0076] ;

[0077] in, This represents the total objective function value. , , These represent the objective function values ​​corresponding to the red, green, and blue channels, respectively. , , They represent , , The corresponding weights meet the application requirements of comprehensive utilization of multi-channel information in real-world scenarios. , , The settings can be adjusted based on the contribution of different channels to the overall segmentation effect; for example, when brightness information is dominant. It can be increased appropriately.

[0078] Specifically, a color image is acquired, and the pixel histograms of the color image in the red, green, and blue channels are calculated respectively. To meet the needs of practical applications with many details and complex grayscale distribution, a minimum cross-entropy threshold optimization objective function is constructed.

[0079] The minimum cross-entropy threshold optimization objective function provided in this embodiment is not only applicable to single-channel image grayscale histogram optimization, but can also be extended to multi-channel processing of color images. When processing color images, the minimum cross-entropy threshold optimization objective function values ​​can be calculated separately for the red, green, and blue color channels to obtain the corresponding objective function values. , , The objective function values ​​of the three channels are then fused using a weighted average to form a unified multi-channel optimization objective. This fusion strategy not only segments individual channels but also effectively combines the structural features of different channels, improving detail preservation and visual consistency after color image segmentation. It is particularly suitable for segmentation tasks of multispectral, multi-channel data such as cloud images, remote sensing images, and natural scene images. By weighting and combining the objective functions of multiple channels, the integrity and complementary relationships of information from each channel can be taken into account, thereby improving the overall accuracy and robustness of segmentation and enhancing the algorithm's versatility in adapting to different color image data.

[0080] Step 2: Initialize the population for the animal migration optimization algorithm. Each individual in the population represents a candidate threshold vector that is randomly distributed within the pixel grayscale range.

[0081] Specifically, the population size is set to... Each individual in the population represents a random distribution of length within the pixel grayscale range [0, 255]. Candidate threshold vector , , … … They represent the 1st, 2nd, ..., … Candidate thresholds for each grayscale range are used to ensure that the pixel grayscale range adapts to the pixel dynamic range of medical images, remote sensing images, or document images.

[0082] Step 3: Iteratively optimize the minimum cross-entropy threshold optimization objective function using the two-stage evolution mechanism of the animal migration optimization algorithm to solve for the optimal threshold vector; In the first stage, a dynamic Gaussian perturbation is introduced in the population iterative update, and the perturbation intensity decreases with the number of iterations; In the second stage, Levy flight perturbation is applied to individuals with fitness below the fitness standard, and the perturbation intensity decreases with the number of iterations.

[0083] like Figure 2 As shown, this embodiment optimizes the animal migration optimization algorithm. The animal migration optimization algorithm is a swarm intelligence optimization method that simulates the survival, foraging, autotrophic, heterotrophic, hibernation and reproduction behaviors of protozoan groups in complex environments. Its basic idea is to construct a set of search and update rules by simulating the biological behavioral characteristics of protozoa, so that the algorithm can achieve a good balance between global search and local exploitation, so as to efficiently solve nonlinear, multi-peak, and multi-dimensional optimization problems.

[0084] In animal migration optimization algorithms, each individual represents a candidate solution to the problem, and its position is iteratively updated in a multidimensional search space to optimize the objective function value. The algorithm population contains multiple individuals, each... Represents a length of The parameter vector corresponds to a set of segmentation thresholds in the image segmentation problem.

[0085] To improve the global optimization ability of the animal migration optimization algorithm and prevent premature convergence, this embodiment introduces a two-stage optimization mechanism into the standard framework of the animal migration optimization algorithm: the first stage uses the basic animal migration optimization algorithm to update the rules and combines dynamic Gaussian perturbation to increase the jumping ability and diversity of individuals in the search space; the second stage specifically applies Levy flight perturbation to individuals with poor fitness in the population to enhance their ability to escape local optima.

[0086] Firstly, in the first stage of the animal migration optimization algorithm, this embodiment employs an improved individual position update strategy. This strategy comprehensively considers the differences between the current individual and global information, and dynamically balances the algorithm between global search and local exploration by adaptively adjusting the search step size. Specifically, the individual position not only references the positional differences of random individuals but also incorporates a Gaussian perturbation term to enhance diversity, ensuring that the perturbation intensity gradually decreases with the iteration progress, achieving the goal of rapid global search in the early stage and stable convergence in the later stage.

[0087] The improved dynamic perturbation control mechanism employs the following constraint: as the number of iterations increases, the amplitude of the perturbation term gradually decreases according to a linear decay law, allowing the search to gradually transition from large-scale global exploration to local fine-grained development. Compared to the fixed perturbation intensity mechanism of traditional animal migration optimization algorithms, this adaptive adjustment method is more flexible and efficient, and is particularly suitable for optimization problems with multi-peak, multi-dimensional, and complex solution spaces.

[0088] This strategy allows the initial population to cover a larger search space, avoiding local extremum traps, while the later population can focus on detailed development around the optimal solution. The improved update method not only enhances the global search capability of the animal migration optimization algorithm but also effectively improves the convergence stability and accuracy of threshold solutions in multi-threshold segmentation problems, laying a solid foundation for subsequent fine-tuning through Taguchi orthogonal experiments.

[0089] In the autotrophic state simulated by the animal migration optimization algorithm, individuals adjust their positions by referring to the differences between random individuals and their neighbor pairs, enhancing information exchange and local search capabilities among individuals. The specific formula is as follows:

[0090] ;

[0091] in, Indicates the first Regarding individual differences among neighbors, Represents the number of neighbor pairs. This represents the foraging mapping vector, used to control the choice of dimensions and improve the dimensionality adaptability of the algorithm.

[0092] In heterotrophic states, individuals no longer simply follow global information, but adaptively adjust their positional relationship with their local neighborhood. The specific formula is as follows:

[0093] ;

[0094] in, It indicates the location of food-rich areas in the local neighborhood, increases the ability to perceive the local environment, and makes it easier for individuals to find the optimal area in multi-peak situations.

[0095] The main objective of this stage is to maintain population diversity by utilizing the core mechanism of animal migration optimization algorithms, conduct large-scale global exploration, and enable individuals to make adaptive adjustments within a local range through alternation of autotrophic and heterotrophic states.

[0096] In addition to foraging, autotrophic, and heterotrophic behaviors, this embodiment also considers the "sleep" and "reproduction" behaviors of protozoan populations in the implementation of the animal migration optimization algorithm, to further enrich the search patterns and improve algorithm performance. In each iteration, some individuals in the population are selected to enter a dormant or reproductive state based on dynamic probabilities, thereby increasing the diversity of individual states and adjusting the search rhythm.

[0097] For individuals selected to sleep, the update rule is as follows:

[0098] ;

[0099] That is, the position does not change, simulating the hibernation of animals in nature under certain conditions to reduce energy consumption, thereby enhancing the stability of the solution and avoiding oscillations caused by excessive movement.

[0100] For individuals selected for reproduction, the update formula is:

[0101] ;

[0102] in, These are the control factors for positive and negative disturbance directions. For the reproduction mapping vector, The global disturbance amplitude, ,in, This represents a random scaling factor, typically uniformly distributed between 0 and 1. , These represent the maximum and minimum positions of an individual, respectively. This represents the selected subset of dimensions to be updated, used for random dimension selection to enhance diversity. This update formula achieves the effect of "partial dimension positive and negative diffusion" of local perturbations in reproductive individuals, ensuring the randomness and locality of the solution, and simulating the generation mechanism of "locally mutated offspring".

[0103] In one possible embodiment, the individual location update formula for the animal migration optimization algorithm in the first stage is:

[0104] ;

[0105] in, , They represent the first The individual in the first , Position at the next iteration Indicates the first The individual in the first Position at the next iteration This represents a foraging factor used to control the stride length of an individual's movement tendency. This represents a dynamic Gaussian perturbation. ,express Follows a pattern with a mean of 0 and a variance of 0. The normal distribution , This indicates the initial disturbance intensity. This indicates the maximum number of iterations.

[0106] Specifically, set the initial disturbance intensity. The value is 0.5, which is suitable for the actual scenario where global exploration is required in the early stage of multi-level segmentation and local convergence is required in the later stage.

[0107] In one possible embodiment, the individual location update formula for the animal migration optimization algorithm in the second stage is:

[0108] ;

[0109] in, , They represent the first The individual in the first , Position at the next iteration This represents the Lévy flight disturbance intensity scaling factor used to control the step size of individual movement trends. Let represent a random variable that follows a Lévy distribution. , Represents the Lévy distribution index parameter. , Let each represent two independent random variables. ,express , All follow a mean of 0 and a variance of . The normal distribution Indicates and The relevant standard deviation.

[0110] To further enhance the ability of the animal migration optimization algorithm to escape local optima in the later stages, this embodiment designs a perturbation mechanism for individuals with poor fitness. The principle is based on the long-tailed stochastic characteristics of Lévy flight, causing the individual's position to jump non-uniformly with large strides in random directions. In this way, individuals in a low-fitness state can be guided away from the current local optimum, thereby improving the robustness of the overall search and the global exploration performance.

[0111] Levy flight perturbations only affect individuals with poor current fitness, and the perturbation strength is proportional to the difference between individual fitness and mean, in order to help low-quality candidate solutions in medical images escape local optima and improve robustness.

[0112] In this embodiment, the fitness standard is set as the top 50% of the fitness ranking. That is, Levy flight perturbation is applied to the bottom 50% of individuals. At the same time, in the second stage, the remaining individuals are further optimized through the "foraging-autotrophic-heterotrophic" mechanism of the animal migration optimization algorithm.

[0113] In one possible embodiment, the Lévy distribution index parameter is set. The range is .

[0114] Specifically, setting the Lévy distribution index parameters. The Levy flight disturbance intensity scaling factor is 1.5. The value decreases as the number of iterations increases to balance global search and local exploitation, thus meeting the application requirements of multi-peak solution distribution in complex images.

[0115] In one possible embodiment, during the iterative optimization of the minimum cross-entropy threshold objective function using the two-stage evolution mechanism of the animal migration optimization algorithm, if the improvement in the optimal fitness of the population is lower than the improvement threshold, the iteration is stopped early.

[0116] Specifically, the animal migration optimization algorithm has a maximum of [number] iterations. Furthermore, in any iteration, if the improvement in the optimal fitness of the population is less than the improvement threshold... If the iteration stops early, it saves computing resources and adapts to the large-scale segmentation computing needs of medical images and remote sensing images.

[0117] Overall, this embodiment, by introducing a "sleep-reproduction-perturbation" multi-state mechanism and combining it with foraging, autotrophic, and heterotrophic behaviors, further enhances the diversity and global exploration capabilities of animal migration optimization algorithms when solving complex, multi-modal, and multi-dimensional problems. Particularly in multi-threshold image segmentation scenarios, this multi-behavioral pattern enables the population to dynamically adjust global and local search intensity, adapting to image data with different grayscale distributions and detailed features, thereby improving the accuracy and precision of the final multi-threshold segmentation.

[0118] Through this multi-behavior improved animal migration optimization algorithm, the final optimal solution not only has a higher global optimal probability, but also stronger solution diversity and stability, effectively providing a high-quality initial solution guarantee for subsequent local fine-tuning of the Taguchi orthogonal experiment.

[0119] The animal migration optimization algorithm provided in this embodiment automatically optimizes the segmentation threshold parameters, enabling the segmentation threshold to be dynamically and adaptively adjusted in complex multi-peak conditions. This effectively improves the subjective visual effect and objective quality indicators of the segmented image, such as edge preservation, peak signal-to-noise ratio, and structural similarity index.

[0120] Step 4: Use the Taguchi orthogonal experiment to locally fine-tune the optimal threshold vector to optimize the image quality assessment index and obtain the final optimal threshold vector.

[0121] In one possible embodiment, the optimal threshold vector is locally fine-tuned using Taguchi orthogonal experiments to optimize the image quality assessment index and obtain the final optimal threshold vector. Specifically, this involves considering different application requirements (such as the sensitivity of medical images to edge details), designing experimental combinations based on noise factors, and using orthogonal arrays L8 or L16 to locally fine-tune the optimal threshold vector to optimize the image quality assessment index and obtain the final optimal threshold vector.

[0122] In this embodiment, the formula for locally fine-tuning the optimal threshold vector using the Taguchi orthogonal experiment is as follows:

[0123] ;

[0124] in, This represents the final optimal threshold vector. This represents the optimal threshold vector for the current iteration round. This represents the threshold vector calculated based on the mean fitness of all individuals in the current iteration round. This represents the perturbation term generated by the Taguchi orthogonal experiment.

[0125] Specifically, image quality assessment metrics include peak signal-to-noise ratio and structural similarity index.

[0126] Step 5: Use the final optimal threshold as the multi-level segmentation parameter to perform multi-level image segmentation on the original image to obtain the multi-level image segmentation result.

[0127] In one possible embodiment, the image segmentation process is applicable to multi-source images such as medical images (e.g., computed tomography, magnetic resonance imaging), remote sensing images, multispectral images, and document images, and can adapt to different threshold levels and histogram spans. After threshold segmentation, post-processing steps can be introduced, including image morphological processing, region connectivity analysis, or small region merging, to improve the structural integrity of the segmented image.

[0128] In one possible implementation, the optimal threshold set after Taguchi fine-tuning is obtained. Then, it is applied to pixel-level classification of the original input image to achieve multi-level image segmentation.

[0129] The multi-threshold segmentation rules are as follows:

[0130] For each pixel Normalized gray values ​​are compared with a set of thresholds to determine the category of the region to which they belong. :

[0131] like ,but ;

[0132] like ,but ;

[0133] ...;

[0134] like ,but .

[0135] The output is the segmented image, which can be displayed in different colors or grayscale values ​​according to the category region, forming a multi-level segmentation effect image.

[0136] As shown in Table 1, in multi-level image segmentation tasks, accurately restoring image details, maintaining local structural consistency, and improving the overall visual effect are key indicators for evaluating the performance of segmentation algorithms.

[0137] To verify the advantages of the Taguchi-based Animal Migration Optimization Algorithm (TGAPO) provided in this embodiment of the invention in multi-threshold segmentation tasks, eight complex images of different types were selected. The performance of the TGAPO algorithm in contrast enhancement, detail preservation, and visual consistency in multi-level image segmentation was comprehensively examined. Comparative experiments were conducted with existing algorithms such as APO, PSO, and GWO. The experimental results are shown in Table 1.

[0138] Table 1: Comparison of Image Quality Evaluation Indicators for Each Algorithm - Experimental Results

[0139] .

[0140] The experiment used commonly used objective quality assessment metrics, including peak signal-to-noise ratio (PSNR, used to measure the pixel consistency between the segmented image and the original image), structural similarity index (SSIM, used to measure the ability to preserve structure), and feature similarity index (FSIM, used to measure overall visual quality).

[0141] As shown in Table 1, the TGAPO algorithm outperforms the comparison algorithms on all test images, making it particularly suitable for multi-level image segmentation tasks with rich details and complex grayscale distributions. For example, in terms of PSNR, the TGAPO algorithm achieves the highest value in most images, reflecting that its segmentation result has the smallest pixel difference from the original image and higher visual fidelity. Taking image 4 as an example, the PSNR of the TGAPO algorithm reaches 34.6063dB, significantly better than the APO algorithm (34.0331dB), PSO algorithm (34.5689dB), and GWO algorithm (33.5176dB), demonstrating significant advantages in detail reconstruction and noise suppression.

[0142] In terms of the SSIM metric, the TGAPO algorithm also demonstrates excellent local structure preservation capabilities, ensuring that the image after multi-level segmentation still retains a visual structure highly consistent with the original image. For example, in image 3, the TGAPO algorithm achieves an SSIM of 0.9145, which is better than the APO algorithm (0.9110), PSO algorithm (0.9110), and GWO algorithm (0.9104), verifying its excellent ability to preserve local structure in multi-level detail segmentation.

[0143] In terms of the FSIM metric, the TGAPO algorithm further demonstrates its advantages in visual detail representation and global perceptual quality. The TGAPO algorithm achieves the highest FSIM values ​​in typical images such as Image 1, Image 2, and Image 3. Among them, the FSIM of Image 3 reaches 0.9710, which is significantly higher than the APO algorithm (0.9454), PSO algorithm (0.9439), and GWO algorithm (0.9435), making it particularly suitable for application scenarios that require visual consistency and improved subjective visual quality.

[0144] The TGAPO algorithm provided in this embodiment of the invention was compared with existing APO algorithm, Butterfly Optimization (BOA) algorithm, Differential Evolution (DE) algorithm, Grey Wolf Optimization (GWO) algorithm, and Particle Swarm Optimization (PSO) algorithm. The experimental results are shown in Table 2.

[0145] Table 2: Comparative Experimental Results of TGAPO Algorithm with Other Algorithms

[0146] .

[0147] In Table 2, 30D represents 30 dimensions, Mean represents the mean, and Std represents the standard deviation. Table 2 shows that the TGAPO algorithm exhibits strong performance on the CEC2022 test suite. Compared to the original APO algorithm, the TGAPO algorithm achieves better average results in 9 out of 12 functions, with slightly worse average results in the remaining 3 functions. Regarding standard deviation, the TGAPO algorithm shows less variability across the 9 functions, demonstrating more stable performance. Furthermore, compared to the BOA algorithm, the TGAPO algorithm achieves a lower mean in 11 functions, performs similarly in 1 function, and consistently achieves a lower standard deviation across all functions. These results highlight the advantages of the TGAPO algorithm in optimization quality and robustness. Compared to the DE algorithm, the TGAPO algorithm achieves lower or similar means across all 12 functions, with generally smaller standard deviations, exhibiting stronger convergence robustness, particularly in complex functions. Compared to the GWO algorithm, the TGAPO algorithm outperforms GWO in average solution across 10 functions and has a lower standard deviation across 9 functions, indicating that TGAPO has better ability to avoid local optima and improves overall search quality in multimodal optimization problems. Compared to the PSO algorithm, TGAPO achieves better mean values ​​across 11 functions and a lower standard deviation across 10 functions, demonstrating that TGAPO significantly outperforms PSO in stability, accuracy, and search capability. In summary, TGAPO achieves optimizations in 9 average solution performance metrics and more than 10 minimum values ​​in standard deviation metrics, comprehensively surpassing the APO, BOA, DE, GWO, and PSO algorithms. This algorithm effectively improves optimization accuracy and global robustness in complex search spaces by introducing a two-stage evolutionary mechanism and Taguchi orthogonal strategy. It is particularly suitable for tasks with high accuracy requirements, such as image segmentation, feature extraction, and high-dimensional parameter tuning.

[0148] The curves comparing the TGAPO algorithm provided in this embodiment with other algorithms are as follows: Figure 3 As shown. The histograms for each band of image 5 segmented using the TGAPO algorithm provided in this embodiment of the invention, with thresholds of 5, 8, and 11, are shown below. Figure 4 , Figure 5 and Figure 6 As shown. The results of 5-threshold segmentation, 8-threshold segmentation, and 11-threshold segmentation of image 5 using the TGAPO algorithm provided in this embodiment of the invention are as follows: Figure 7 As shown, the TGAPO algorithm provided in this embodiment of the invention segments each channel of the image separately, and then merges the obtained segmented channels to generate the final segmented image. The threshold numbers for the three channels are specified as 5, 8 and 11, respectively. As the threshold number increases, the segmentation result gradually becomes clearer.

[0149] The multi-level image segmentation method provided in this invention not only significantly improves the contrast, detail clarity, and visual quality of multi-level image segmentation, but also adapts to image data of various types and features, demonstrating wide applicability and robustness in segmentation tasks in multiple scenarios such as medical images, remote sensing images, and document images.

[0150] This invention primarily addresses the high demands for segmentation accuracy, detail preservation, and visual consistency in multi-level image segmentation tasks. It tackles challenges common in practical applications of multi-level image segmentation, such as complex grayscale distributions, diverse target structures, and rich levels of detail. In particular, traditional algorithms often suffer from insufficient global search capabilities, strong parameter dependencies, susceptibility to local optima, and slow convergence speeds in typical scenarios like medical imaging, remote sensing images, and document images. This invention improves the ergodicity of the solution space during the global search phase and enhances the ability to escape local optima during the local exploration phase by simulating diverse foraging, hibernation, and reproductive behaviors of protozoa, combined with dynamic Gaussian perturbations and the Lévy flight mechanism.

[0151] Meanwhile, to further meet the comprehensive requirements of multi-level image segmentation for both segmentation accuracy and stability, this invention introduces a Taguchi orthogonal experimental design after all iterations to fine-tune the current optimal solution, thereby optimizing the local accuracy and stability of the multi-threshold set. This method employs an adaptive parameter adjustment mechanism, which can dynamically adjust the segmentation strategy according to the grayscale distribution and detail characteristics of the input image. Combined with the minimum cross-entropy objective function and a multi-channel weighted fusion strategy, the segmentation results not only outperform traditional methods in pixel consistency but also show better subjective visual quality and detail restoration.

[0152] This invention provides a multi-level image segmentation system, comprising:

[0153] The image preprocessing module is used to obtain the pixel histogram of the original image and construct the minimum cross-entropy threshold optimization objective function based on the pixel histogram;

[0154] The algorithm initialization module is used to initialize the population of the animal migration optimization algorithm. Each individual in the population represents a candidate threshold vector that is randomly distributed within the pixel grayscale range.

[0155] The two-stage optimization module is used to iteratively optimize the minimum cross-entropy threshold optimization objective function using the two-stage evolution mechanism of the animal migration optimization algorithm, and solve for the optimal threshold vector. In the first stage, a dynamic Gaussian perturbation is introduced in the population iterative update, and the perturbation intensity decreases with the number of iterations. In the second stage, a Levy flight perturbation is applied to individuals with fitness below the fitness standard, and the perturbation intensity decreases with the number of iterations.

[0156] The fine-tuning module is used to locally fine-tune the optimal threshold vector using the Taguchi orthogonal experiment, so that the image quality assessment index reaches the optimal level and the final optimal threshold vector is obtained.

[0157] The image segmentation module is used to perform multi-level image segmentation on the original image by using the final optimal threshold as a multi-level segmentation parameter, and obtain multi-level image segmentation results.

[0158] The multi-level image segmentation system provided in this embodiment of the invention can execute the multi-level image segmentation method provided in this embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0159] This invention provides a computer device, comprising:

[0160] Storage medium: used to store computer programs;

[0161] Processor: Used to execute computer programs to implement the multi-level image segmentation method provided in the embodiments of the present invention.

[0162] This invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the multi-level image segmentation method provided in this invention.

[0163] This invention provides a computer program product, including a computer program that, when executed by a processor, implements the multi-level image segmentation method provided in this invention.

[0164] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0165] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1A system that specifies functions in one or more boxes.

[0166] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0167] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0168] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A multi-stage image segmentation method, characterized by, The method comprises the following steps: acquire a pixel histogram of the original image, and construct a minimum cross-entropy threshold optimization objective function based on the pixel histogram; initialize a population of an animal migration optimization algorithm, each individual in the population representing a candidate threshold vector randomly distributed in a pixel gray scale range; use a two-stage evolution mechanism of the animal migration optimization algorithm to iteratively optimize the minimum cross-entropy threshold optimization objective function, and solve an optimal threshold vector; in the first stage, a basic animal migration optimization algorithm update rule is used, a dynamic Gaussian disturbance is introduced in the iterative update of the population, and the disturbance intensity decreases with the increase of the iteration number, so that the jumping and diversity of individuals in the search space are enhanced, and the algorithm dynamically balances between global search and local development; in the second stage, a Levy flight disturbance is applied to individuals with a fitness lower than a fitness standard, and the disturbance intensity decreases with the increase of the iteration number, so that the ability of the algorithm to jump out of a local optimum is enhanced; use a Taguchi orthogonal experiment to locally fine-tune the optimal threshold vector, so that an image quality evaluation index reaches an optimum, and a final optimal threshold vector is obtained; use the final optimal threshold vector as a multi-level segmentation parameter to perform multi-level image segmentation on the original image, and obtain a multi-level image segmentation result. The step of acquiring the pixel histogram of the original image comprises the following steps: convert the original image into a gray scale image, and calculate a pixel histogram of the gray scale image; the minimum cross-entropy threshold optimization objective function constructed based on the pixel histogram of the gray scale image is: ; wherein, represents an objective function, represents a multi-threshold set, , , , , represent the threshold values of the 1st, 2nd, …, , gray scale intervals, respectively, represents the pixel probability of the 1st gray scale interval calculated based on the pixel histogram. the formula for locally fine-tuning the optimal threshold vector using the Taguchi orthogonal experiment is: ; wherein, denotes the final optimal threshold vector, denotes the optimal threshold vector of the current iteration round, denotes the threshold vector calculated according to the mean of the fitness of all individuals of the current iteration round, denotes the perturbation term generated by the Taguchi orthogonal experiment; The image quality evaluation index comprises a peak signal-to-noise ratio and a structural similarity index.

2. The multi-stage image segmentation method of claim 1, wherein, The step of acquiring the pixel histogram of the original image comprises the following steps: respectively calculate pixel histograms of the original image in red, green and blue channels.

3. The multi-stage image segmentation method of claim 2, wherein, the minimum cross-entropy threshold optimization objective function constructed based on the pixel histograms of the original image in the red, green and blue channels is: ; wherein, denotes the total objective function value, , , denote the objective function values corresponding to the red, green, and blue channels, respectively, , , denote the weights corresponding to , , , respectively.

4. The multi-stage image segmentation method of claim 1, wherein, the individual position update formula of the animal migration optimization algorithm in the first stage is: ; wherein, , denote the position of the i-th individual at the j-th iteration, , denote the position of the i-th individual at the j-th iteration, denote the position of the i-th individual at the j-th iteration, denote the foraging factor used to control the step size of the individual movement tendency, denote the dynamic Gaussian perturbation, denote that the perturbation obeys a normal distribution with mean 0 and variance , denote the initial perturbation strength, denote the maximum number of iterations.​​​​ 5. The multi-stage image segmentation method of claim 1, wherein, the individual position update formula of the animal migration optimization algorithm in the second stage is: ; wherein, , denote the position of the i-th individual at the j-th iteration, , denotes a Levy flight perturbation intensity scaling factor used to control the step size of the individual movement tendency, denotes a random variable subject to a Levy distribution, , denotes a Levy distribution exponent parameter, , denote two independent random variables, , are both subject to a normal distribution with mean 0 and variance denotes a standard deviation related to .​​​​ 6. The multi-stage image segmentation method of claim 1, wherein, In the process of iteratively optimizing the minimum cross-entropy threshold optimization objective function using the two-stage evolution mechanism of the animal migration optimization algorithm, if the improvement amount of the optimal fitness of the population is lower than an improvement amount threshold, the iteration is stopped in advance.

7. The multi-stage image segmentation method of claim 1, wherein, The step of using the Taguchi orthogonal experiment to locally fine-tune the optimal threshold vector, so that an image quality evaluation index reaches an optimum, and a final optimal threshold vector is obtained comprises the following steps: design an experimental combination according to a noise factor, use an orthogonal table L8 or L16 to locally fine-tune the optimal threshold vector, so that an image quality evaluation index reaches an optimum, and a final optimal threshold vector is obtained.

Citation Information

Patent Citations

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

    CN116309668A

  • Method and system for lossless classification of ginseng seeds

    CN120808048A