A method, device, medium and equipment for determining a medical image segmentation threshold
By introducing frost diffusion strategy and covariance matrix adaptation evolution strategy into the rime algorithm, the method of determining the threshold of medical image segmentation is improved, the problem of poor segmentation index in the prior art is solved, and the accuracy and efficiency of segmentation are improved.
Patent Information
- Application Number
- CN202411562010.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-05
AI Technical Summary
When the prior art finds the optimal threshold for medical images, it is easy to stay near the non-global optimal solution, resulting in a decrease in the accuracy of medical image segmentation.
By adding frost diffusion strategy and covariance matrix adaptation evolution strategy to the original rime algorithm, the rime algorithm is improved, and its global search ability and local fine search ability are enhanced, so as to find the segmentation threshold that makes the medical image segmentation index reach the optimal segmentation threshold.
It realizes extensive exploration and local accurate search in the search space, improves the accuracy and efficiency of obtaining the optimal segmentation threshold, and enhances the accuracy of medical image segmentation.
Smart Images

Figure CN119068011B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image segmentation, and in particular to a method, device, medium and equipment for determining a medical image segmentation threshold. Background Art
[0002] Multi-threshold image segmentation is a technique that uses a set of segmentation thresholds to divide an image into multiple non-overlapping regions, each corresponding to a specific grayscale range. Therefore, it has a wide range of applications in many fields, especially in medical image processing. However, choosing the right threshold combination is a challenging problem, which directly affects the quality of medical image segmentation.
[0003] In the application scenario of finding the optimal threshold of medical images, the optimal threshold usually refers to the segmentation threshold that can achieve the optimal performance indicator (such as mis-segmentation rate, accuracy, etc.). To achieve this goal, a meta-heuristic algorithm can be used to search the possible threshold space and gradually approach the solution that makes the performance indicator of the segmented medical image reach the optimal solution by evaluating the performance indicator of each candidate threshold.
[0004] However, since medical images usually present multi-level biological tissue structures, this image complexity may cause the metaheuristic algorithm to stay near a non-globally optimal solution during the search process, resulting in the obtained optimal solution may not correspond to the segmentation threshold that makes the medical image segmentation index reach the optimal value. As a result, based on this threshold, it is impossible to accurately segment pixels belonging to the same biological tissue, thereby reducing the accuracy of medical image segmentation. Summary of the invention
[0005] Based on this, in order to solve the technical problems in the prior art, the present invention provides a method, device, medium and equipment for determining a medical image segmentation threshold.
[0006] The present invention provides a method for determining a medical image segmentation threshold, comprising:
[0007] Get the size of m × n Medical images to be segmented I ; The medical image to be segmented I Converted into medical grayscale image to be segmented ;
[0008] Treat segmentation of medical grayscale images Perform a non-local mean filtering operation to obtain a non-local mean filtered image:
[0009]
[0010]
[0011]
[0012]
[0013]
[0014] in, is the medical image to be segmented Medium Pixels The gray value after denoising by non-local mean filtering operation, Refers to pixels and pixels The corresponding weight of It's pixels Gray value of represents the normalization coefficient, Refers to the control parameters, and It is pixel e and pixel The local mean of Refers to pixels The surrounding area is The pixel block, Represents pixels Gray value of Refers to pixels The surrounding area is The pixel block, Represents pixels Gray value of
[0015] Combine the non-local mean filtered image with the medical grayscale image to be segmented Together they form a two-dimensional histogram. x The axis represents the grayscale value of the medical grayscale image to be segmented. y The axis represents the value of the non-local mean filtered image, and the two-dimensional histogram z Axis value for:
[0016]
[0017] in, Is a pixel pair Number of occurrences;
[0018] set up L-1 The initial threshold value is L-1 The initial threshold is used to perform non-local mean filtering; L-1 The initial threshold and the result of the non-local mean filtering operation form a set U :
[0019]
[0020] in, ~ They are L-1 An initial threshold; ~ They are ~ The result obtained after the non-local mean filtering operation;
[0021] use L-1 The initial threshold is used to segment the medical grayscale image into L-1 Different areas: S 1 , ...., S L-1}, Kapur entropy is used as the characteristic value to characterize the consistency of pixels in the same category in the segmented medical grayscale image, and the L - 1 different areas S 1 , ...., S L-1 The sum of Kapur entropy corresponding to H :
[0022]
[0023] in, H 1 ~ H L-1 Respectively, the regions S 1 ~ S L-1 Kapur entropy;
[0024] The improved rime algorithm is used to search for a set of optimal segmentation thresholds in the two-dimensional histogram so that the pixels segmented into the same class in the segmented medical grayscale image have the maximum consistent feature value, that is, to obtain H Maximum threshold set U* :
[0025] U* =argmax( H )
[0026] Among them, argmax() means finding a set of U* , so that H maximum;
[0027] by U* Gray value in ~ * as the optimal segmentation threshold;
[0028] The improved rime algorithm comprises the following steps:
[0029] I: Initialization parameters, including the size of the rime population and the maximum number of evaluations ; Among them, the population size express A set of segmentation thresholds;
[0030] II: Take the Kapur entropy of all rime individuals in the rime population as the fitness value and find the optimal individual and the optimal fitness value ;
[0031] III: Determine the current number of evaluations Is it not less than , if yes, go to step IV; otherwise, go to step V;
[0032] IV: Adopting the covariance matrix adaptive evolution strategy to update the population position; the covariance matrix adaptive evolution strategy specifically includes:
[0033] Generate candidate solutions:
[0034]
[0035] in, For the t +1 iteration generated k Candidate solutions; For the t The search mean of iterations; For the t The step size factor for the iteration; For the t From the multivariate normal distribution The vector obtained by sampling in For the t The covariance matrix of the iterations;
[0036] Sort the generated candidate solutions and use the top candidate solutions to update the covariance matrix:
[0037]
[0038]
[0039]
[0040]
[0041] in, After the updatet +1 iteration of search mean; For the t +1 iteration to generate candidate solutions; is the number of candidate solutions ranked top; For the The weights of candidate solutions, and the weights satisfy ; After the update t +1 step size factor for iterations; The learning rate of the step-size control path; is the damping factor for step size control; Represents the expected length of a random variable under the standard normal distribution; After the update t +1 iteration of the step size control path; For the t The step size of the iteration controls the path; is the effective sample size; After the update t + covariance matrix of 1 iteration; The main learning rate for the covariance matrix update; It represents the secondary learning rate of the covariance matrix update; the superscript T represents the transpose;
[0042] Update the candidate solution based on the updated covariance matrix;
[0043] V: Generates a random number in the interval [0, 1] rand 1 ,if rand 1 < , then the soft rime strategy is adopted to update the rime individual; otherwise, execute step VI;
[0044] VI: Generate a random number in the interval [0, 1] rand 2 ,if rand 2 < , the hard puncture strategy is used to update the rime individuals, where Represents the current individual fitness Normalized value of; otherwise, execute step VII;
[0045] VII: Adopting frost diffusion strategy to update rime individuals; the frost diffusion strategy specifically includes:
[0046]
[0047]
[0048]
[0049] in, and Respectively t +1 iteration and t The first iteration generated i Candidate solutions; is the diffusion coefficient; For the t Two random individuals in the iteration and distance; rand is a random number between [-1, 1]; FEs is the current evaluation number; MaxFEs is the maximum number of evaluations; is a constant; To judge the t Whether to execute the frost diffusion strategy in the iteration;
[0050] The meaning of the above formula is that in the early optimization stage of the original rime algorithm, as the iteration progresses, The value of is used to increase the probability of executing the frost diffusion strategy, prompting individuals to diffuse over a larger range, thereby escaping the local optimum;
[0051] VIII: Determine whether it is satisfied ,in f Is the fitness value of the updated individual. If yes, use the greedy selection mechanism to update the optimal individual. and the optimal fitness value ; Otherwise, execute step VIIII;
[0052] VIIII: Check if it is satisfied FEs < MaxFEs , if so, return the best rime position and the best fitness value carrying the optimal segmentation threshold information; otherwise return to step III.
[0053] The present invention provides a device for determining a medical image segmentation threshold, comprising:
[0054] A data acquisition module, used for obtaining a two-dimensional histogram of the medical image to be segmented;
[0055] A threshold optimization module is used to use an improved rime algorithm to search for a set of optimal segmentation thresholds in a two-dimensional histogram as medical image segmentation thresholds; the set of optimal segmentation thresholds is a segmentation threshold that enables pixels segmented into the same class in the segmented medical image to have a maximum degree of consistency feature value;
[0056] The improved rime algorithm includes: adding a frost diffusion strategy in the early optimization stage of the original rime algorithm, and executing a covariance matrix adaptive evolution strategy in the later optimization stage;
[0057] The frost diffusion strategy introduces a diffusion coefficient to reduce the probability of population individuals concentrating or converging to a local optimal solution in advance. The diffusion coefficient is used to control the diffusion range of individuals carrying segmentation threshold information in the search space.
[0058] The covariance matrix adaptive evolution strategy dynamically adjusts the variation direction and variation scale of individuals carrying segmentation threshold information in the population within the search space to narrow the search range to around the individuals carrying the optimal segmentation threshold information.
[0059] The present invention provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method for determining the medical image segmentation threshold is implemented.
[0060] The present invention provides a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for determining the medical image segmentation threshold when executing the program.
[0061] At least one of the above technical solutions adopted by the present invention can achieve the following beneficial effects:
[0062] In the method for determining the medical image segmentation threshold provided by the present invention, the original rime algorithm is improved by adding a frost diffusion strategy in the early optimization stage of the original rime algorithm and executing a covariance matrix adaptive evolution strategy in the later optimization stage, so as to enhance the global search capability of the original rime algorithm in the early optimization stage and the local fine search capability in the later optimization stage. Specifically: the frost diffusion strategy introduces a diffusion coefficient to adjust the diffusion range of individuals in the search space in the early stage of the optimization phase, so that individuals carrying segmentation threshold information in the early stage of the optimization phase cover as many areas in the search space as possible, rather than searching for the segmentation threshold around a certain area, thereby reducing the probability of population individuals concentrating or converging to a local optimal solution in advance, and achieving "casting a wide net" in the search space; the covariance matrix adaptive evolution strategy dynamically adjusts the variation direction and variation scale of individuals carrying segmentation threshold information in the population in the search space, and narrows the search range to around individuals carrying the optimal segmentation threshold information. Therefore, narrowing the search range in the later stage of the optimization phase is "precise capture" after "casting a wide net", thereby obtaining a segmentation threshold that makes the medical image segmentation index reach the optimal level. Based on this threshold, pixels belonging to the same biological tissue can be accurately and effectively segmented. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0064] Figure 1 A schematic flow chart of a method for determining a medical image segmentation threshold provided by the present invention;
[0065] Figure 2 A schematic diagram of a plan view of a two-dimensional histogram provided by the present invention;
[0066] Figure 3 The process of finding the optimal segmentation threshold provided by the present invention;
[0067] Figure 4 A schematic diagram of the process flow of the improved rime algorithm provided by the present invention;
[0068] Figure 5 A schematic diagram of a device for determining a medical image segmentation threshold provided by the present invention. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the specification, all other implementations obtained by ordinary technicians in this field without creative work.
[0070] The basic idea of multi-threshold segmentation is to select multiple thresholds to segment the image pixel values into several different categories, so that the similarity of pixels within each category is maximized, while the similarity between categories is minimized. However, choosing a suitable threshold combination is a challenging optimization problem, which directly affects the quality of segmentation. Meta-heuristic algorithms are often used for multi-threshold segmentation of medical images due to their powerful performance in global optimization problems. Of course, meta-heuristic algorithms also have problems such as being prone to falling into local optimality and slow convergence, which limits their performance in practical applications.
[0071] Based on this, the present invention provides a method for determining a medical image segmentation threshold. The method improves the original rime algorithm by adding a frost diffusion strategy to the original rime algorithm and executing a covariance matrix adaptive evolution strategy in the later optimization stage of the algorithm. The improved rime algorithm is used to find a segmentation threshold that allows the segmented medical image to have a maximum Kapur entropy.
[0072] Figure 1 The following is a flow chart of the method for determining the medical image segmentation threshold provided by this embodiment. Figure 1The method for determining the medical image segmentation threshold is described in detail, and specifically includes the following steps:
[0073] S1: Obtain a two-dimensional histogram of the medical image to be segmented.
[0074] The medical image to be segmented Convert to medical grayscale image to be segmented , and based on the medical grayscale image to be segmented Perform non-local mean filtering:
[0075]
[0076]
[0077]
[0078]
[0079]
[0080] in, is the medical image to be segmented Medium Pixels The gray value after denoising by non-local mean filtering operation, Refers to pixels and pixels The corresponding weight of It's pixels Gray value of represents the normalization coefficient, Refers to the control parameters, and It is pixel e and pixel The local mean of Refers to pixels The surrounding area is The pixel block, Represents pixels Gray value of Refers to pixels The surrounding area is The pixel block, Represents pixels The gray value of .
[0081] If the medical grayscale image to be segmented The size is , then the image obtained by the non-local mean filtering operation The size is also In a two-dimensional histogram, the point It is a grayscale image Pixels in Grayscale value and image Pixels in The gray value generated by the two-dimensional histogram is shown in the plane view diagram Figure 2 Here, use Represents pixel pairs The number of occurrences, its joint probability density is given by the following formula, and then the final two-dimensional histogram is obtained z Axis values:
[0082] ;
[0083] S2: Use the improved rime algorithm to search for a set of optimal segmentation thresholds as medical image segmentation thresholds in a two-dimensional histogram; a set of optimal segmentation thresholds is the segmentation threshold that makes the pixels segmented into the same class in the segmented medical image have the most consistent eigenvalues; the improved rime algorithm includes: adding a frost diffusion strategy in the early optimization stage of the original rime algorithm, and executing a covariance matrix adaptive evolution strategy in the later optimization stage; the frost diffusion strategy introduces a diffusion coefficient to reduce the probability that individuals in the population concentrate or converge to a local optimal solution in advance, and the diffusion coefficient is used to control the diffusion range of individuals carrying segmentation threshold information in the search space; the covariance matrix adaptive evolution strategy dynamically adjusts the variation direction and variation scale of individuals carrying segmentation threshold information in the search space in the population to narrow the search range to around individuals carrying the optimal segmentation threshold information.
[0084] In the field of image segmentation, Kapur entropy is mainly a threshold segmentation method based on entropy maximization. It determines the optimal segmentation threshold by maximizing the entropy between the target and the background in the image. In this process, Kapur entropy focuses on how to best divide the image into multiple regions so that the consistency (or similarity) of the pixels within the divided regions is maximized relative to the differences between regions. Based on the constructed two-dimensional histogram, the process of finding the optimal segmentation threshold with Kapur entropy as the objective function is as follows: Figure 3 As shown, the specific steps include:
[0085] S201: Settings L-1 The initial threshold value is L-1 The initial threshold is used to perform non-local mean filtering; L-1 The initial threshold and the result of the non-local mean filtering operation form a set U :
[0086]
[0087] in, ~ They are L-1 An initial threshold; ~ They are ~ The result obtained after the non-local mean filtering operation.
[0088] S202: Use L-1 The initial threshold is used to segment the medical grayscale image into L-1 Different areas: S 1 , ...., S L-1},get L - 1 different areas S 1 , ...., S L-1 The sum of Kapur entropy corresponding to H:
[0089]
[0090]
[0091]
[0092] in, H 1 ~ H L-1 Respectively, the regions S 1 ~ S L-1 Kapur entropy; is the gray value in the two-dimensional histogram i , the non-local mean filter value is j Corresponding z Axis value.
[0093] S203: Kapur Entropy As the objective function, the improved rime algorithm is used to obtain H Maximum threshold set U* :
[0094] U* =argmax( H )
[0095] Among them, argmax() means finding a set of U* , so that H maximum.
[0096] S204: U* Gray value in ~ * as the optimal segmentation threshold.
[0097] Among them, the process of improving the rime algorithm is as follows Figure 4 As shown, the specific steps include:
[0098] I: Initialization parameters, including the size of the rime population and the maximum number of evaluations etc. Among them, the population size express Individuals ( A set of candidate segmentation thresholds), each of which contains L-1 Group( s, t ), so the problem dimension for L-1 .
[0099] II: Calculate the fitness values of all rime individuals in the rime population, namely Kapur entropy, and find the optimal individual and the optimal fitness value .
[0100] III: Judgment Is it not less than , if yes, proceed to step IV; otherwise, proceed to step V.
[0101] IV: Adopt the covariance matrix adaptive evolution strategy to update the population position. The covariance matrix adaptive evolution strategy dynamically adjusts the covariance matrix according to the distribution of individuals in the population and the fitness value, thereby changing the step size and direction of the search. The covariance matrix reflects the relationship between different dimensions in the search space, and can automatically adjust the individual's mutation direction (the direction in which the individual's parameters change at each iteration or when a new individual is generated) and mutation scale (the size or amplitude of the individual's parameter changes during the mutation process). As the evolutionary process continues, the search range will be gradually narrowed and the optimal solution area will be accurately located, thereby improving the convergence speed and accuracy of the algorithm. The greedy selection mechanism is then used to record the best fitness. With the best individual position ; and execute step VIII. The mathematical model of the covariance matrix adaptive evolution strategy is as follows:
[0102] First, generate candidate solutions according to the objective function Evaluate each candidate solution and sort it according to the objective function value, and select the top ranked solutions. The solution is used to update the covariance matrix. A solution is beneficial to the subsequent population optimization process:
[0103]
[0104] here, For the t +1 iteration generatedk Candidate solutions; For the t The search mean of iterations; For the t The step size factor of the iteration is used to adjust the distribution range of candidate solutions; For the t From the multivariate normal distribution The vector obtained by sampling in For the t The covariance matrix of the iterations.
[0105] Update the covariance matrix using the top candidate solutions:
[0106]
[0107]
[0108]
[0109]
[0110] in, After the update t +1 iteration of search mean; For the t +1 iteration to generate candidate solutions; is the number of top-ranked candidate solutions, that is, the number of optimal candidate solutions used to update the mean; For the The weights of candidate solutions, and the weights satisfy ;; The learning rate of the step-size control path; is the damping factor for step size control; Represents the expected length of a random variable under the standard normal distribution; After the update t +1 iteration step size control path, For the t The step size of the iteration controls the path; the covariance matrix path accumulates the directional information of the mean change, which is crucial for the subsequent update of the covariance matrix; The main learning rate for the covariance matrix update, used for the covariance path; It represents the secondary learning rate of the covariance matrix update, which is used for the candidate solution difference; is the effective sample size. Update the population position based on the updated covariance matrix.
[0111] V: Generates a random number in the interval [0, 1] rand 1,if rand 1 < E , then the soft rime strategy is used to update the rime individuals; otherwise, execute step VI. The mathematical model of the soft rime stage is:
[0112]
[0113]
[0114]
[0115]
[0116] in, is the new position of the individual rime after the update, indicating The next time an individual is evaluated The location of the dimension; Indicates the best individual position in the rime population. It indicates the direction of individual movement, which changes as the number of algorithm evaluations increases. is an environmental factor used to control the convergence of the algorithm. and Represent the current evaluation times and the maximum evaluation times respectively. is the number of segments of the step function, the value is 3, [·] represents the rounding operation; is the ratio of pi; is a random number in the range (-1,1); h is the adhesion coefficient, which is a random number in (0,1); and are the upper and lower boundaries of the problem respectively.
[0117] VI: Generate a random number in the interval [0, 1] rand 2 ,if rand 2 < , then the hard puncture strategy is used to update the rime individual; otherwise, directly execute step VII. The mathematical model of the hard puncture stage is:
[0118]
[0119] in, Represents the current individual fitness The normalized value of .
[0120] VII: Adopt frost diffusion strategy to update rime individuals.
[0121] The frost diffusion strategy enhances the algorithm's global search capability by simulating the natural diffusion process of frost in a low-temperature environment. The frost diffusion strategy introduces a diffusion coefficient based on the fitness of individuals in the population. This coefficient is used to control the diffusion range of individuals in the population, thereby preventing individuals from being too concentrated or converging to a local optimal solution too early. The mathematical model of the frost diffusion strategy is:
[0122]
[0123]
[0124]
[0125] in, and Respectively t +1 iteration and t The first iteration generated i Candidate solutions; is the diffusion coefficient; For the t Two random individuals in the iteration and distance. To judge the t Whether to execute the frost diffusion strategy in the iteration. is a constant with a value of 0.2. rand is a random number between [0, 1].
[0126] In the first 2 / 3 of the algorithm’s iterations, frost diffusion is used. At this time, the process of each iteration is: original rime -> frost diffusion. During this period, as the iterations proceed, the algorithm may fall into a local optimum, so it is necessary to jump out of the local optimum. At this time, as the iterations proceed, Gradually decreasing means that there is a greater possibility of adopting the frost diffusion strategy to jump out of the local optimum, allowing individuals to diffuse over a larger range to enhance global exploration capabilities and avoid falling into the local optimum. As the number of iterations increases, the diffusion range gradually shrinks, prompting individuals to conduct fine searches in the local solution space, thereby improving convergence speed and optimization accuracy. This mechanism combines randomness with adaptive control to achieve a balance between the algorithm at different stages and improve overall performance.
[0127] VIII: Determine whether it is satisfied ,in f Is the fitness value of the updated individual. If yes, use the greedy selection mechanism to update the optimal individual. and the optimal fitness value ; Otherwise, proceed to step VIIII.
[0128] VIIII: Check if it is satisfied FEs < MaxFEs , if so, return the best rime position and the best fitness value carrying the optimal segmentation threshold information; otherwise return to step III.
[0129] The threshold segmentation of the medical grayscale image to be segmented is performed based on the optimal segmentation threshold. Tables 1 to 3 show different algorithms (CFRIME (Improved RIME Algorithm based on Covariance Matrix Adaptation Evolution Srategy and Frost Fiffusion Strategy, an improved rime algorithm based on covariance matrix adaptation evolution strategy and frost diffusion strategy); WOA (Whale Optimization Algorithm, Whale Optimization Algorithm), CS (Cuckoo Search, Cuckoo Search Algorithm), MGSMA (Enhanced Slime Mould Algorithmbased on a New Movement Mechanism and Gaussian Kernel Probability Strategy, Enhanced Slime Mould Algorithm based on a New Movement Mechanism and Gaussian Kernel Probability Strategy), MDE (Modified Differential Evolution, Improved Differential Evolution Algorithm), IGWO (Improved Grey Wolf Optimizer, Improved Grey Wolf Optimization Algorithm), GLSMA (Improved Slime Mould Algorithm based on Gaussian Mutation and Lévy Flights , Improved slime mold algorithm based on Gaussian mutation and Lévy flight)) The Wilcoxon signed rank test is used to evaluate the quality of the segmented image using three image quality evaluation indicators, namely Peak Signal to Noise Ratio (PSNR), Structural Similarity Index (SSIM) and Feature Similarity Index (FSIM). These three evaluation indicators are used to evaluate the difference between the segmented image and the original image, measure the structural integrity of the image, and reflect the feature similarity between the original image and the segmented image. In the table, Thresholds represents the threshold level, Mean represents the average of the overall ranking, Rank represents the ranking level, "+" indicates that the performance of CFRIME is better than the comparison algorithm, "=" indicates that the performance of CFRIME is the same as the comparison algorithm, and "-" indicates that the performance of CFRIME is worse than the comparison algorithm.According to the results of the Wilcoxon signed rank test, among all threshold levels, the image segmented by the threshold set obtained using CFRIME shows superiority in multiple angles, with an overall average ranking of first, and has certain stability and robustness, which can effectively maintain the details and visual quality of the segmented image. The comparison results of PSNR are shown in Table 1 below:
[0130] Table 1. Comparison results of PSNR
[0131]
[0132] The comparison results of SSIM are shown in Table 2 below:
[0133] Table 2 Comparison results of SSIM
[0134]
[0135] The comparison results of FSIM are shown in Table 3 below:
[0136] Table 3 Comparison results of FSIM
[0137]
[0138] The present invention introduces the frost diffusion strategy and the covariance matrix adaptive evolution strategy into the rime algorithm, which improves the diversity and global search performance of the algorithm, enables the algorithm to search quickly in the local area, promotes the improvement of convergence speed, and enhances the stability and robustness of the algorithm. The improved rime algorithm is used as the search method, and the Kapur entropy is used as the fitness function to obtain the best segmentation threshold combination for multi-threshold segmentation, which improves the segmentation accuracy and successfully achieves accurate segmentation of the lesion area.
[0139] The above is a method for determining a medical image segmentation threshold provided by one or more embodiments of the present invention. Based on the same idea, the present invention also provides a corresponding method as follows: Figure 5 The device for determining the medical image segmentation threshold shown includes:
[0140] The data acquisition module is used to obtain a two-dimensional histogram of the medical image to be segmented.
[0141] A threshold optimization module is used to use the improved rime algorithm to search for a set of optimal segmentation thresholds as medical image segmentation thresholds in a two-dimensional histogram; a set of optimal segmentation thresholds is the segmentation threshold that makes the pixels segmented into the same class in the segmented medical image have the maximum consistent characteristic value; the improved rime algorithm includes: adding a frost diffusion strategy in the early optimization stage of the original rime algorithm, and executing a covariance matrix adaptive evolution strategy in the later optimization stage; the frost diffusion strategy introduces a diffusion coefficient to reduce the probability of population individuals concentrating or converging to a local optimal solution in advance, and the diffusion coefficient is used to control the diffusion range of individuals carrying segmentation threshold information in the search space; the covariance matrix adaptive evolution strategy dynamically adjusts the variation direction and variation scale of individuals carrying segmentation threshold information in the search space in the population to narrow the search range to around the individuals carrying the optimal segmentation threshold information.
[0142] The specific definition of the device for determining the medical image segmentation threshold can be found in the definition of the method for determining the medical image segmentation threshold in the above text, and will not be repeated here. Each module in the above-mentioned device for determining the medical image segmentation threshold can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0143] The present invention also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A method for determining a threshold for medical image segmentation is provided.
[0144] The present invention also provides a computer device structure. At the hardware level, the computer device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 A method for determining a threshold for medical image segmentation is provided.
[0145] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0146] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.
Claims
1. A method for determining a medical image segmentation threshold, characterized in that: include: Obtaining a two-dimensional histogram of the medical image to be segmented; An improved rime algorithm is used to search for a set of optimal segmentation thresholds in a two-dimensional histogram as medical image segmentation thresholds; The set of optimal segmentation thresholds is the segmentation thresholds that make the pixels segmented into the same class in the segmented medical image have the maximum consistent degree feature value; The improved rime algorithm includes: adding a frost diffusion strategy in the early optimization stage of the original rime algorithm, and executing a covariance matrix adaptive evolution strategy in the later optimization stage; The frost diffusion strategy introduces a diffusion coefficient to reduce the probability of population individuals concentrating or converging to a local optimal solution in advance. The diffusion coefficient is used to control the diffusion range of individuals carrying segmentation threshold information in the search space. The covariance matrix adaptive evolution strategy dynamically adjusts the variation direction and variation scale of individuals carrying segmentation threshold information in the population within the search space to narrow the search range to around individuals carrying optimal segmentation threshold information; The method of using the improved rime algorithm to search for a set of optimal segmentation thresholds in a two-dimensional histogram as medical image segmentation thresholds specifically includes: Set L-1 initial thresholds, perform non-local mean filtering on the L-1 initial thresholds, and combine the results of the L-1 initial thresholds and non-local mean filtering into a set U: U={(s1,t1),(s2,t2),...,(s L-1 ,t L-1 )} Among them, s1~s L-1 There are L-1 initial thresholds respectively; t1~t L-1 They are s1~s L-1 The result obtained after the non-local mean filtering operation; Use L-1 initial thresholds to segment the medical grayscale image into L-1 different regions: {S1, ..., S L-1 }, Kapur entropy is used to represent the consistent feature value of pixels in the same class in the segmented medical image, and L-1 different regions {S1, ..., S L-1 The corresponding Kapur entropy sum H is: H{(s1,t1),(s2,t2),...,(s L-1 ,t L-1 )}=H1+H2+…+H L-1 Among them, H1~H L-1 They are areas S1 to S L-1 Kapur entropy; Use the improved rime algorithm to obtain the threshold set U* that maximizes H: U*=argmax(H) Among them, argmax() means finding a set of U* that maximizes H; Take the gray value s1*~s in U* L-1 * as the optimal segmentation threshold; The method of using the improved rime algorithm to obtain the threshold set U* that maximizes H specifically includes: I: Initialization parameters, including the rime population size N and the maximum number of evaluations MaxFEs; where the population size N represents the N segmentation threshold sets; II: Take the Kapur entropy of all rime individuals in the rime population as the fitness value and find the optimal individual X best and the best fitness value bestfitness; III: Determine whether the current evaluation times FEs is not less than 2 / 3MaxFEs. If so, execute step IV; otherwise, execute step V; IV: Adopting the covariance matrix adaptive evolution strategy to update the population position; V: Generates a random number rand1 in the interval [0, 1], if Then the soft rime strategy is adopted to update the rime individual; otherwise, step VI is executed; VI: Generate a random number rand2 in the interval [0, 1]. If rand2 < F normr (f(X i )), the hard puncture strategy is used to update the rime individuals, where F normr (f(X i )) represents the current individual fitness f(X i ) is the normalized value; otherwise, execute step VII; VII: Adopting frost diffusion strategy to update rime individuals; VIII: Determine whether f(X new )<bestfitness, where f(X new ) is the fitness value of the updated individual. If yes, the greedy selection mechanism is used to update the optimal individual X best and the best fitness value bestfitness; otherwise, execute step VIIII; VIIII: Check whether FEs<MaxFEs is satisfied. If so, return the best rime position and the best fitness value carrying the optimal segmentation threshold information; otherwise, return to step III.
2. The method for determining a medical image segmentation threshold according to claim 1, wherein: The method of updating the population position by using the covariance matrix adaptive evolution strategy specifically includes: Generate candidate solutions: in, The kth candidate solution generated for the t+1th iteration; m t is the search mean of the tth iteration; σ t is the step size factor of the tth iteration; is the number of samples from the multivariate normal distribution N(0, C t ) is the vector obtained by sampling, C t is the covariance matrix of the t-th iteration; Sort the generated candidate solutions and use the top candidate solutions to update the covariance matrix: Among them, m t+1 is the search mean of the t+1th iteration after update; X t+1 Generate candidate solutions for the t+1th iteration; μ is the number of top-ranked candidate solutions; w i is the weight of the i-th candidate solution, and the weight satisfies σ t+1 is the step size factor of the t+1th iteration after update; c σ is the learning rate of the step-size control path; d σ is the damping factor for step size control; Represents the expected length of a random variable under the standard normal distribution; is the step length control path of the t+1th iteration after the update; is the step length control path of the tth iteration; μ eff is the effective sample size; C t+1 is the covariance matrix of the t+1th iteration after the update; c1 is the main learning rate for the covariance matrix update; c μ It represents the secondary learning rate of the covariance matrix update; the superscript T represents the transpose; Update the population positions based on the updated covariance matrix.
3. The method for determining a medical image segmentation threshold according to claim 1, wherein: The frost diffusion strategy is used to update the rime individuals, specifically including: in, and are the i-th candidate solutions generated for the t+1th iteration and the tth iteration respectively; θ is the diffusion coefficient; are two random individuals in the tth iteration and distance; rand is a random number between [0, 1]; FEs is the current number of evaluations; MaxFEs is the maximum number of evaluations; γ is a constant: Used to determine whether to execute the frost diffusion strategy in the tth iteration; The meaning of the above formula is that in the early optimization stage of the original rime algorithm, the value of ε is reduced as the iteration proceeds to increase the probability of executing the frost diffusion strategy, prompting individuals to diffuse over a larger range, thereby jumping out of the local optimum.
4. The method for determining a medical image segmentation threshold according to claim 1, wherein: The non-local mean filtering operation is performed on the L-1 initial thresholds, specifically comprising: Where NM(f) is the gray value of pixel f in the medical gray image to be segmented after denoising by non-local mean filtering, w(e, f) refers to the corresponding weights of pixel e and pixel f; g(f) is the gray value of pixel f; U represents the normalization coefficient, h U refers to the control parameter, v(e) and v(f) are the local means of pixel e and pixel f; B(e) refers to the pixel block with a scale of k×k around pixel e, g(p) represents the grayscale value of pixel p; B(f) refers to the pixel block with a scale of k×k around pixel f, g(q) represents the grayscale value of pixel q.
5. A device for determining a medical image segmentation threshold, characterized in that: include: A data acquisition module, used for obtaining a two-dimensional histogram of the medical image to be segmented; A threshold optimization module is used to use an improved rime algorithm to search for a set of optimal segmentation thresholds in a two-dimensional histogram as medical image segmentation thresholds; the set of optimal segmentation thresholds is a segmentation threshold that enables pixels segmented into the same class in the segmented medical image to have a maximum degree of consistency feature value; The improved rime algorithm includes: adding a frost diffusion strategy in the early optimization stage of the original rime algorithm, and executing a covariance matrix adaptive evolution strategy in the later optimization stage; The frost diffusion strategy introduces a diffusion coefficient to reduce the probability of population individuals concentrating or converging to a local optimal solution in advance. The diffusion coefficient is used to control the diffusion range of individuals carrying segmentation threshold information in the search space. The covariance matrix adaptive evolution strategy dynamically adjusts the variation direction and variation scale of individuals carrying segmentation threshold information in the population within the search space to narrow the search range to around individuals carrying optimal segmentation threshold information; The method of using the improved rime algorithm to search for a set of optimal segmentation thresholds in a two-dimensional histogram as medical image segmentation thresholds specifically includes: Set L-1 initial thresholds, perform non-local mean filtering on the L-1 initial thresholds, and combine the results of the L-1 initial thresholds and non-local mean filtering into a set U: U={(s1,t1),(s2,t2),...,(s L-1 ,t L-1 )} Among them, s1~s L-1 There are L-1 initial thresholds respectively; t1~t L-1 They are s1~s L-1 The result obtained after the non-local mean filtering operation; Use L-1 initial thresholds to segment the medical grayscale image into L-1 different regions: {S1, ..., S L-1 }, Kapur entropy is used to represent the consistent feature value of pixels in the same class in the segmented medical image, and L-1 different regions {S1, ..., S L-1 The corresponding Kapur entropy sum H is: H{(s1,t1),(s2,t2),…,(s L-1 ,t L-1 )}=H1+H2+…+H L-1 Among them, H1~H L-1 They are areas S1 to S L-1 Kapur entropy; Use the improved rime algorithm to obtain the threshold set U* that maximizes H: U*=argmax(H) Among them, argmax() means finding a set of U* that maximizes H; Take the gray value s1*~s in U* L-1 * as the optimal segmentation threshold; The method of using the improved rime algorithm to obtain the threshold set U* that maximizes H specifically includes: I: Initialization parameters, including the rime population size N and the maximum number of evaluations MaxFEs; where the population size N represents the N segmentation threshold sets; II: Take the Kapur entropy of all rime individuals in the rime population as the fitness value and find the optimal individual X best and the best fitness value bestfitness; III: Determine whether the current evaluation times FEs is not less than 2 / 3MaxFEs. If so, execute step IV; otherwise, execute step V; IV: Adopting the covariance matrix adaptive evolution strategy to update the population position; V: Generates a random number rand1 in the interval [0, 1], if Then the soft rime strategy is adopted to update the rime individual; otherwise, step VI is executed; VI: Generate a random number rand2 in the interval [0, 1]. If rand2 < F normr (f(X i )), the hard puncture strategy is used to update the rime individuals, where F normr (f(X i )) represents the current individual fitness f(X i ) is the normalized value; otherwise, execute step VII; VII: Adopting frost diffusion strategy to update rime individuals; VIII: Determine whether f(X new )<bestfitness, where f(X new ) is the fitness value of the updated individual. If yes, the greedy selection mechanism is used to update the optimal individual X best and the best fitness value bestfitness; otherwise, execute step VIIII; VIIII: Check whether FEs<MaxFEs is satisfied. If so, return the best rime position and the best fitness value carrying the optimal segmentation threshold information; otherwise, return to step III.
6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
7. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Marine rescue flying wing control optimization method based on improved rime optimization algorithm
CN116400585A
Multi-threshold image segmentation method based on entropy
CN117455941A