Image segmentation method and device, computer equipment and storage medium
By constructing a two-dimensional histogram of medical images and introducing Renyi entropy characterization, combined with the improved phased enhancement of the bat algorithm, the problem of difficult-to-find optimal solution in multi-threshold image segmentation is solved, and more accurate medical image segmentation is achieved, improving Information retention and distinction of segmentation effects.
Patent Information
- Application Number
- CN202411774098.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-12-05
AI Technical Summary
In the prior art, multi-threshold image segmentation method is difficult to find the optimal solution, resulting in the inaccurate medical image segmentation and the inability to effectively cut the target area that needs attention.
By constructing a two-dimensional histogram of medical images, using Renyi entropy to characterize the grayscale threshold of the image, and introducing phased enhancement in the bat algorithm, expanding the search range and adjusting the step length coefficient, and improving the algorithm to maximize Renyi entropy to find the best Threshold sets are segmented.
The information retention and discrimination of image segmentation are improved, and the optimal solution to the grayscale threshold can be found more effectively. The improved bat algorithm has improved global and local search capabilities, significantly improving the segmentation effect.
Smart Images

Figure CN119251245A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing, and in particular relates to an image segmentation method, device, computer equipment and storage medium. Background Art
[0002] Medical image processing plays a vital role in clinical diagnosis. It can present the complex internal structure of the human body in the form of clear and intuitive images, providing doctors with valuable visual information, helping to more accurately discover diseases, assess conditions, and formulate treatment plans. Among the many links in medical image processing, image segmentation is a key step. Image segmentation can accurately divide different tissues, organs, or lesion areas in medical images, allowing doctors to analyze and measure specific targets more accurately, providing a basis for subsequent quantitative analysis, feature extraction, and computer-aided diagnosis, greatly improving the accuracy and reliability of medical image processing in clinical diagnosis.
[0003] At present, in the field of image segmentation, a consensus has been formed on its general rules, and a considerable number of research results and multiple methods have emerged. Among them, multi-threshold image segmentation is a widely used image segmentation method, which can divide the image into multiple regions according to different thresholds. Therefore, the core of multi-threshold image segmentation is to find a set of the most discriminative threshold combinations. Therefore, this method is a complex combinatorial optimization method, but it is difficult to get the optimal solution for the target to be optimized in this problem. Therefore, many scholars use meta-heuristic algorithms to solve the threshold selection problem in multi-threshold image segmentation. However, the original meta-heuristic algorithm was not designed for this problem, which makes it impossible for the meta-heuristic algorithm to solve all practical problems well.
[0004] Therefore, it is difficult to find the optimal solution for determining the segmentation threshold in the prior art, resulting in the inability to accurately cut out the main targets that require attention in the medical image. Summary of the invention
[0005] In order to solve the problem that it is difficult to determine the optimal solution for the segmentation threshold, the present invention provides an image segmentation method, apparatus, computer equipment and storage medium.
[0006] In order to achieve the above object, the present invention provides the following technical solutions: First, an image segmentation method is provided, the method comprising: Acquire a target medical image to be segmented, and construct a two-dimensional histogram based on a non-local mean filtered image and a grayscale image of the target medical image; The Renyi entropy of the target medical image is characterized by multiple grayscale thresholds in a two-dimensional histogram; the grayscale threshold is a pixel grayscale combination for segmenting the background area and the target area; The bat algorithm is strengthened in stages, and the optimal individual, multiple random individuals in the population, and multiple random parameters are used to expand the search range of the bat algorithm for pixel grayscale combinations. The optimal individual is adjusted by multiples through population information and random parameters, and finally the step size coefficient is reduced to obtain an improved bat algorithm. With the goal of maximizing Renyi entropy, the improved bat algorithm is used to iteratively optimize multiple grayscale thresholds to obtain the optimal threshold set. The target medical image is segmented based on the optimal threshold set to obtain the segmentation result.
[0007] Optionally, constructing a two-dimensional histogram based on the non-local mean filtered image and the grayscale image of the target medical image includes: Performing grayscale processing on the target medical image to obtain a corresponding grayscale image, and determining the grayscale value of the target medical image; Performing a non-local mean operation on the grayscale image to obtain a non-local mean filtered image, and determining the grayscale value of the non-local mean filtered image; The grayscale value of the target medical image and the grayscale value of the non-local mean filtered image are used as the x-axis and y-axis to construct a two-dimensional histogram, and the z-axis of the two-dimensional histogram is determined. for: ; in, It's pixels The number of occurrences, express The probability density of Indicates the size of the target medical image.
[0008] Optionally, characterizing the Renyi entropy of the target medical image by using multiple grayscale thresholds in a two-dimensional histogram includes: The probability density of the pixel combination in the target area and the background area is determined according to the grayscale threshold, and the specific formula is: ; ; in, is the probability density of pixel grayscale combinations in the background area, is the probability density of pixel grayscale combinations in the target area, is the gray value of the segmented target area and background area, for The result after non-local means; is the maximum gray value in the target medical image to be segmented, i and j are two different pixels, is the grayscale combination probability density of pixel i and pixel j; The Renyi entropy of the target area and the background area is characterized according to the probability density, and the specific formula is: ; ; in, is the order of Renyi entropy.
[0009] Optionally, the step of introducing phased reinforcement into the bat algorithm includes: Phase 1: ; ; ; ; ; in, is the i-th candidate solution in The value of the dimension, is the value of the current optimal individual in the jth dimension, Here is an exploration operator, For a restriction The step size coefficient, is a uniformly distributed random number between 0 and 1. is a parameter that limits the exploration search range, Adjustment Parameters, for The mean value in all dimensions, is a sensitive parameter, To prevent the denominator from being a very small value of 0, and Respectively represent the upper and lower limits of the target to be optimized in The value of the dimension, For the Daizhongdi The individual in Dimensional value, For the A random individual in generation The value of the dimension, To be optimized The target dimension, is the current iteration number, is the total number of iterations; Phase 2: ; ; ; in, is the i-th candidate solution in The value of the dimension, is the value of the current optimal individual in the jth dimension, is a uniformly distributed random number between 0 and 1. In the A random individual in generation Dimensional value, is a probability ratio whose value decreases randomly between 2 and -2. To determine the sign of the parameter, is the current iteration number, is the total number of iterations; Phase 3: ; ; ; in, is the i-th candidate solution in The value of the dimension, is the value of the current optimal individual in the jth dimension, is a uniformly distributed random number between 0 and 1. Adjustment Parameters, for The mean value in all dimensions, is a sensitive parameter, To prevent the denominator from being a very small value of 0, and Respectively represent the upper and lower limits of the target to be optimized in The value of the dimension, For the Daizhongdi The individual in The value of the dimension, To be optimized The target dimension, is the current iteration number, is the total number of iterations; Phase 4: ; ; ; ; ; in, is the i-th candidate solution in The value of the dimension, is the value of the current optimal individual in the jth dimension, Here is a development operator. is a uniformly distributed random number between 0 and 1. is a parameter that limits the scope of the development search. Adjustment Parameters, for The mean value in all dimensions, is a sensitive parameter, To prevent the denominator from being a very small value of 0, and Respectively represent the upper and lower limits of the target to be optimized in The value of the dimension, For the Daizhongdi The individual in Dimensional value, For the A random individual in generation The value of the dimension, is the dimension of the target to be optimized, is the current iteration number, is the total number of iterations.
[0010] Optionally, the step of introducing phased reinforcement into the bat algorithm further includes: After the staged reinforcement is completed, a greedy selection strategy is added, where the greedy selection process is as follows: ; in, For the Daizhongdi Individuals, No. Candidate solutions, for The fitness value of for The fitness value of For the Daizhongdi Individual.
[0011] Secondly, an image segmentation device is also provided, the device comprising: An acquisition module, used for acquiring a target medical image to be segmented and determining a two-dimensional histogram of the target medical image; A construction module is provided, which is used to characterize the Renyi entropy of the target medical image through multiple grayscale thresholds in a two-dimensional histogram; the grayscale threshold is a pixel grayscale combination for segmenting the background area and the target area; a phased enhancement is introduced into the bat algorithm, and the search range of the bat algorithm for the pixel grayscale combination is expanded by using the optimal individual, multiple random individuals in the population, and multiple random parameters, and the optimal individual is adjusted by a multiple by using the population information and the random parameters, and finally the step size coefficient is reduced to obtain an improved bat algorithm; The optimization module is used to maximize the Renyi entropy and iteratively optimize multiple grayscale thresholds through the improved bat algorithm to obtain the optimal threshold set; The segmentation module is used to segment the target medical image based on the optimal threshold set to obtain a segmentation result.
[0012] In addition, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned image segmentation method is implemented.
[0013] Finally, a computer device is provided, 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 image segmentation method when executing the program.
[0014] The image segmentation method provided by the present invention has the following beneficial effects: Firstly, the two-dimensional histogram of the target medical image is determined, which provides an important basis for the subsequent threshold selection and Renyi entropy calculation. Secondly, the Renyi entropy is introduced to determine the grayscale threshold of the target medical image. The Renyi entropy can be used to evaluate the quality of image segmentation and quantitatively evaluate the effect of image segmentation under different grayscale thresholds, which provides an objective function for subsequent optimization. Then, an improved bat algorithm is constructed, and phased enhancement is introduced into the bat algorithm to enhance the exploration ability and algorithm development ability of the bat algorithm respectively, so that the algorithm has been improved in global search ability and local search ability. With the goal of maximizing Renyi entropy, the improved bat algorithm is iterated to more effectively find the optimal solution of the grayscale threshold. Finally, segmentation is performed through the optimal solution, so that the segmented image can provide better information retention and discrimination. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiment of the present invention and its design scheme, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1The figure is a flowchart of an image segmentation method provided by the present invention according to an exemplary embodiment.
[0017] Figure 2 A multi-model performance indicator data diagram based on FSIM provided according to an exemplary embodiment of the present invention.
[0018] Figure 3 A diagram of multi-model performance indicator data based on PSNR provided according to an exemplary embodiment of the present invention.
[0019] Figure 4 A multi-model performance indicator data graph based on SSIM is provided according to an exemplary embodiment of the present invention.
[0020] Figure 5 The present invention is a block diagram of an image segmentation device provided according to an exemplary embodiment. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solution of the present invention and implement it, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of protection of the present invention.
[0022] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0023] First, the present invention provides an image segmentation method, which is applied to the field of medical image processing. Figure 1 As shown, the following steps are included: S101 . Obtain a target medical image to be segmented, and construct a two-dimensional histogram of the target medical image based on a non-local mean filtered image and a grayscale image of the target medical image.
[0024] Specifically, the target medical image is grayed to obtain a corresponding gray image, and the gray value of the target medical image is determined; a non-local mean operation is performed on the gray image to obtain a non-local mean filtered image, and the gray value of the non-local mean filtered image is determined; and a two-dimensional histogram is constructed using the gray value of the target medical image and the gray value of the non-local mean filtered image as the x-axis and y-axis, respectively.
[0025] For example, a corresponding two-dimensional histogram is constructed according to the grayscale image and the non-local mean filtered image. Taking the lung adenocarcinoma image to be segmented as an example, the detailed steps are as follows: Get the size Adenocarcinoma image to be segmented ; The lung adenocarcinoma image to be segmented Converted to grayscale value range The grayscale image of lung adenocarcinoma to be segmented, where Represents the maximum grayscale value in the lung adenocarcinoma image to be segmented; Perform non-local mean operation on the grayscale image of lung adenocarcinoma to be segmented to obtain a non-local mean filtered image: ; ; ; ; in, is the predicted value obtained by the non-local mean; and Pixels and pixels Gray value of and Pixels and pixels The local mean of and Pixels and pixels centered Pixel matrix, is the weight for weighted averaging.
[0026] A two-dimensional histogram is constructed based on the non-local mean filter image and the grayscale image. The x-axis of the two-dimensional histogram represents the grayscale value of the grayscale image of lung adenocarcinoma to be segmented, and the y-axis represents the grayscale value of the non-local mean filter image, thereby determining the z-axis of the two-dimensional histogram. for: ; in, It's pixels The number of occurrences, express The probability density of .
[0027] S102 , characterizing the Renyi entropy of the target medical image by using multiple grayscale thresholds in a two-dimensional histogram.
[0028] The grayscale threshold is a pixel grayscale combination for segmenting the background area and the target area.
[0029] The present invention uses Renyi entropy as the objective function. Renyi entropy is an information measurement method that can evaluate the degree of confusion or uncertainty of a data set. Specifically, the two-dimensional histogram obtained by the above steps constructs a grayscale threshold, and the Renyi entropy of the target medical image is characterized by the grayscale threshold. By optimizing the Renyi entropy, the present invention can find the grayscale threshold that makes the image segmentation result most discriminative.
[0030] First, the probability density of the pixels in the target area and the background area is determined according to the grayscale threshold. The specific formula is: ; ; in, and Represent the background area and the target area respectively. is the probability density of pixel grayscale combinations in the background area, is the probability density of pixel grayscale combinations in the target area, is the gray value of the segmented target area and background area, for The result after non-local means is: and Combination of That is the grayscale threshold; is the maximum gray value in the target medical image to be segmented, i and j are two different pixel points, is the probability density of the grayscale combination of pixel i and pixel j; the Renyi entropy of the target area and the background area is characterized according to the probability density, and the specific formula is: ; ; in, is the order of Renyi entropy, which is 0.5 here.
[0031] S103, performing phased enhancement on the bat algorithm to obtain an improved bat algorithm.
[0032] Specifically, the bat algorithm is strengthened in stages, and the optimal individual, multiple random individuals within the population, and multiple random parameters are used to expand the search range of the bat algorithm for pixel grayscale combinations. The optimal individual is adjusted by multiples through population information and random parameters, and finally the step size coefficient is reduced to complete the strengthening of the bat algorithm.
[0033] In the Bat Algorithm, as in other algorithms, there is the problem of imbalance between development and exploration. The importance of exploration and development is reflected in every stage of the algorithm.
[0034] First, in the early stages of the algorithm, if there is a better exploration capability, it can help the algorithm to explore a wider space. In the present invention, it allows the algorithm to find more potential threshold combination areas to prepare for further search. This corresponds to the stage one and stage two of the phased enhancement of the present invention. In stage one, the present invention uses the current optimal individual, multiple random individuals in the population, a large number of random parameters and a larger step coefficient. This allows for greater randomness and a larger step size in the stage one enhancement, which can better explore other areas of the solution space. Stage two, compared to stage one, changes are made in the selection of random individuals and random parameters, but it is also full of great randomness, allowing the algorithm to explore other areas of the solution space in different ways, providing another way to explore the solution space.
[0035] Secondly, in the later stages of the algorithm, if there is a better development capability, it can help further improve the convergence accuracy of the algorithm and further optimize the threshold combination. This corresponds to the stage three and stage four of the phased enhancement of the present invention. In stage three, the present invention uses population information and random parameters to increase or decrease the optimal individual by multiples, which is to further utilize the optimal individual for development. Stage four is also the development of the optimal individual. Its mathematical model is similar to that of stage one. The difference is that it has parameters to control the development step length, and develops the area near the optimal individual with a smaller step length to achieve the purpose of development.
[0036] In one embodiment, a bat algorithm is first constructed, and its mathematical model is as follows: ; ; ; in, The frequency of the sound waves emitted by bats, The lower limit of the frequency is 0 in the invention, The upper limit of the frequency is 2 in the present invention. Represents a random number uniformly distributed between 0 and 1. For the Daizhongdi The individual in The speed in dimension, For the Daizhongdi The individual in The speed in dimension, For the Daizhongdi The individual in The value of the dimension, is the current optimal individual in The value of the dimension, For the The candidate solution is The value of the dimension.
[0037] ; ; ; in, For the The candidate solution is The value of the dimension, is a random number whose value follows a standard normal distribution and can be adjusted , For the The average loudness of the bat population in the generation, for The initial value of represents a uniformly distributed random number between 1 and 2, is the current optimal individual in The value on the dimension. When the condition is met, this formula will be executed. In the condition, is a uniformly distributed random number between 0 and 1. Indicates Daizhongdi The pulse frequency of a bat, for The initial value of Represents a uniformly distributed random number between 0 and 1. and The update method is as follows: ; in, Indicates Daizhongdi The pulse frequency of a bat, Indicates Daizhongdi The pulse frequency of a bat, It indicates that the pulse enhancement factor is 0.9. Indicates the current iteration number, For the The average loudness of the bat population in the generation, For the The average loudness of the bat population in the generation, The sound wave loudness attenuation coefficient is 0.9. For the Daizhongdi Individuals, No. A candidate solution. for The fitness value of for The fitness value of For the Daizhongdi Individual.
[0038] Then the bat algorithm is strengthened in stages. The staged strengthening is divided into four stages, based on the number of iterations. The first stage is the first quarter of the total number of iterations, the second stage is the quarter immediately following the first stage, and so on. The fourth stage is the last quarter of the total number of iterations. The first two stages strengthen the exploration ability of the bat algorithm, and the last two stages strengthen the algorithm development ability. The specific mathematical model of the improved bat algorithm is as follows: Phase 1: ; ; ; ; ; in, For the The candidate solution is The value of the dimension, is the current optimal individual in The value of the dimension, Here is an exploration operator, For a restriction The step size coefficient is 0.1. is a uniformly distributed random number between 0 and 1. is a parameter that limits the exploration search range, Adjustment Parameters, for The mean value in all dimensions, It is a sensitive parameter that determines the accuracy of exploration and its value is 0.1. To prevent the denominator from being a very small value of 0, and Respectively indicate to be optimized The upper and lower limits of the target are The value of the dimension, For the Daizhongdi The individual in Dimensional value, In the A random individual in generation Dimensional value, To be optimized The target dimension, in conditional judgment, is the current iteration number, is the total number of iterations.
[0039] Phase 2: ; ; ; in, For the The candidate solution is The value of the dimension, is the current optimal individual in The value of the dimension, is a uniformly distributed random number between 0 and 1. In the A random individual in generation Dimensional value, is a probability ratio whose value decreases randomly between 2 and -2. To determine the positive and negative signs of the parameters. In conditional judgment, is the current iteration number, is the total number of iterations.
[0040] Phase 3: ; ; ; in, For the The candidate solution is The value of the dimension, is the current optimal individual in The value of the dimension, is a uniformly distributed random number between 0 and 1. Adjustment Parameters, for The mean value in all dimensions, The precision developed for a sensitive parameter is 0.1. To prevent the denominator from being a very small value of 0, and Respectively represent the upper and lower limits of the target to be optimized in The value of the dimension, For the Daizhongdi The individual in Dimensional value, To be optimized The target dimension, in conditional judgment, is the current iteration number, is the total number of iterations.
[0041] Phase 4: ; ; ; ; ; in, For the The candidate solution is The value of the dimension, is the current optimal individual in The value of the dimension, Here is a development operator. is a uniformly distributed random number between 0 and 1. is a parameter that limits the scope of the development search. Adjustment Parameters, for The mean value in all dimensions, The precision developed for a sensitive parameter is 0.1. A very small value is used to ensure development and prevent the denominator from being zero. and Respectively indicate to be optimized The upper and lower limits of the target are The value of the dimension, For the Daizhongdi The individual in Dimensional value, In the A random individual in generation Dimensional value, To be optimized The target dimension, in conditional judgment, is the current iteration number, is the total number of iterations.
[0042] Based on the above mathematical model, after the staged reinforcement is completed, the greedy selection strategy is added. The greedy selection process is as follows: ; in, For the Daizhongdi Individuals, No. A candidate solution. for The fitness value of for The fitness value of For the Daizhongdi Individual.
[0043] S104, with the goal of maximizing Renyi entropy, multiple grayscale thresholds are iteratively optimized through the improved bat algorithm to obtain an optimal threshold set.
[0044] In order to find the grayscale threshold Divide the useful areas as much as possible to ensure that areas A1 and A2 contain a lot of information. and The total value of entropy is the largest, that is: ; To be optimized The label can be expressed as, looking for Satisfies the following formula, namely: ; Since the single threshold segmentation method often has limitations in practical applications and cannot meet the needs of complex image segmentation, the present invention considers extending the single threshold segmentation to the multi-threshold segmentation technology. Based on the basic principle of single threshold segmentation, the present invention introduces multiple thresholds (assuming , among which ), these thresholds subdivide the image into The present invention combines these thresholds into a set and uses To express, .
[0045] B is the background, represents the target, so the sum of the Renyi entropy of these regions is: ; Based on the idea of maximum Renyi entropy, PRBA is used to find the gray threshold set Make As large as possible, so the problem to be optimized by using PRBA The mathematical expression of the target is: ; Based on the above optimization The improved bat algorithm is constructed as follows: Initialize algorithm configuration: population size , the target to be optimized Dimensions , maximum number of iterations .
[0046] Step 2: Initialize the population , and calculate the fitness value (Renyi entropy) of each individual.
[0047] Step 3: Execute the bat algorithm process, that is, the mathematical model of the bat algorithm in the above steps.
[0048] Step 4: Execute the phased reinforcement part, that is, the specific mathematical model of the improved bat algorithm in the above steps.
[0049] Step 5: Update the individual and And other parameters.
[0050] Step 6: Repeat steps 2 to 5 until .
[0051] Step 7: Output the optimal threshold combination .
[0052] S105. Segment the target medical image based on the optimal threshold set to obtain a segmentation result.
[0053] For example, the present invention performs multi-threshold segmentation on 30 lung adenocarcinoma images, each algorithm is run independently 6 times, and the Friedman test is used to analyze the feature similarity (FSIM), structural similarity (SSIM) and peak signal-to-noise ratio (PSNR). In order to further prove the effectiveness of PRBA, the experiments are conducted at low threshold levels (5, 6, 7 and 8) and high threshold levels (10, 15, 20 and 25), respectively. Figure 2-4 It can be seen that compared with other advanced algorithms, such as moth-to-flame algorithm (MFO), differential evolution algorithm (DE), grey wolf algorithm (GWO), cuckoo algorithm (CS), improved particle swarm optimization algorithm (BLPSO), comprehensive learning particle swarm optimization algorithm (CLPSO), improved sine-cosine algorithm (m_SCA), improved grey wolf algorithm (IGWO), PRBA has the best overall performance under different indicators and different threshold levels.
[0054] Using the above method, we first determine the two-dimensional histogram of the target medical image, which provides an important basis for the subsequent threshold selection and Renyi entropy calculation. Secondly, we introduce Renyi entropy to determine the grayscale threshold of the target medical image. Renyi entropy can be used to evaluate the quality of image segmentation, and quantitatively evaluate the effect of image segmentation under different grayscale thresholds, which provides an objective function for subsequent optimization. Then, we construct an improved bat algorithm, introduce phased enhancement into the bat algorithm, and enhance the exploration ability and algorithm development ability of the bat algorithm respectively, so that the algorithm has been improved in global search ability and local search ability. With the goal of maximizing Renyi entropy, we iterate the improved bat algorithm to more effectively find the optimal solution of the grayscale threshold, and finally segment the image through the optimal solution. In this way, the segmented image can provide better information retention and discrimination.
[0055] Secondly, the present invention also provides an image segmentation device, such as Figure 5 As shown, including: The acquisition module 501 is used to acquire a target medical image to be segmented and determine a two-dimensional histogram of the target medical image.
[0056] Construction module 502 is used to characterize the Renyi entropy of the target medical image through multiple grayscale thresholds in a two-dimensional histogram; the grayscale threshold is a pixel grayscale combination for segmenting the background area and the target area; the bat algorithm is periodically enhanced, and the search range of the bat algorithm for pixel grayscale combinations is expanded using the optimal individual, multiple random individuals within the population, and multiple random parameters, and the optimal individual is adjusted by a multiple through population information and random parameters, and finally the step size coefficient is reduced to obtain an improved bat algorithm.
[0057] The optimization module 503 is used to iteratively optimize multiple grayscale thresholds through the improved bat algorithm with the goal of maximizing Renyi entropy to obtain an optimal threshold set.
[0058] The segmentation module 504 is used to segment the target medical image based on the optimal threshold set to obtain a segmentation result.
[0059] Using the above device, firstly, the two-dimensional histogram of the target medical image is determined, which provides an important basis for the subsequent threshold selection and Renyi entropy calculation. Secondly, the Renyi entropy is introduced to determine the grayscale threshold of the target medical image. The Renyi entropy can be used to evaluate the quality of image segmentation, and the effect of image segmentation under different grayscale thresholds can be quantitatively evaluated, which provides an objective function for subsequent optimization. Then, an improved bat algorithm is constructed, and staged enhancement is introduced into the bat algorithm to enhance the exploration ability and algorithm development ability of the bat algorithm respectively, so that the algorithm has been improved in global search ability and local search ability. With the goal of maximizing Renyi entropy, the improved bat algorithm is iterated to more effectively find the optimal solution of the grayscale threshold. Finally, segmentation is performed through the optimal solution, so that the segmented image can provide better information retention and discrimination.
[0060] 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 The steps of the image segmentation method are provided.
[0061] The present invention also provides a computer device. 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 hardware required for other services. 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 The steps of the image segmentation method are provided.
[0062] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented 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.
[0063] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0064] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0065] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0066] It should be noted that the above specific implementation method can enable those skilled in the art to understand the invention more comprehensively, but does not limit the invention in any way. Therefore, although the present invention has been described in detail in this specification, those skilled in the art should understand that the invention can still be modified or replaced by equivalents; and all technical solutions and improvements that do not deviate from the spirit and scope of the invention are included in the protection scope of the patent for the invention. Any figure mark in the claims should not be regarded as limiting the claims involved.
Claims
1. An image segmentation method, characterized in that: The method comprises: Acquire a target medical image to be segmented, and construct a two-dimensional histogram based on a non-local mean filtered image and a grayscale image of the target medical image; The Renyi entropy of the target medical image is characterized by multiple grayscale thresholds in a two-dimensional histogram; the grayscale threshold is a pixel grayscale combination for segmenting the background area and the target area; The bat algorithm is strengthened in stages, and the optimal individual, multiple random individuals in the population, and multiple random parameters are used to expand the search range of the bat algorithm for pixel grayscale combinations. The optimal individual is adjusted by multiples through population information and random parameters, and finally the step size coefficient is reduced to obtain an improved bat algorithm. With the goal of maximizing Renyi entropy, the improved bat algorithm is used to iteratively optimize multiple grayscale thresholds to obtain the optimal threshold set. The target medical image is segmented based on the optimal threshold set to obtain the segmentation result.
2. An image segmentation method according to claim 1, characterized in that: The constructing a two-dimensional histogram based on the non-local mean filtering image and the grayscale image of the target medical image comprises: Performing grayscale processing on the target medical image to obtain a corresponding grayscale image, and determining the grayscale value of the target medical image; Performing a non-local mean operation on the grayscale image to obtain a non-local mean filtered image, and determining the grayscale value of the non-local mean filtered image; The grayscale value of the target medical image and the grayscale value of the non-local mean filtered image are used as the x-axis and y-axis to construct a two-dimensional histogram, and the z-axis of the two-dimensional histogram is determined. for: ; in, It's pixels The number of occurrences, express The probability density of Indicates the size of the target medical image.
3. An image segmentation method according to claim 2, characterized in that: The Renyi entropy of the target medical image characterized by the grayscale threshold in the two-dimensional histogram includes: The probability density of the pixel combination in the target area and the background area is determined according to the grayscale threshold, and the specific formula is: ; ; in, is the probability density of pixel grayscale combinations in the background area, is the probability density of pixel grayscale combinations in the target area, is the gray value of the segmented target area and background area, for The result after non-local means; is the maximum gray value in the target medical image to be segmented, i and j are two different pixels, is the grayscale combination probability density of pixel i and pixel j; The Renyi entropy of the target area and the background area is characterized according to the probability density, and the specific formula is: ; ; in, is the order of Renyi entropy.
4. The image segmentation method according to claim 1, characterized in that: The phased enhancement of the bat algorithm includes: Phase 1: ; ; ; ; ; in, is the i-th candidate solution in The value of the dimension, is the value of the current optimal individual in the jth dimension, Here is an exploration operator, For a restriction The step size coefficient, is a uniformly distributed random number between 0 and 1. is a parameter that limits the exploration search range, Adjustment Parameters, for The mean value in all dimensions, is a sensitive parameter, To prevent the denominator from being a very small value of 0, and Respectively represent the upper and lower limits of the target to be optimized in The value of the dimension, For the Daizhongdi The individual in Dimensional value, For the A random individual in generation The value of the dimension, is the dimension of the target to be optimized, is the current iteration number, is the total number of iterations; Phase 2: ; ; ; in, is the i-th candidate solution in The value of the dimension, is the value of the current optimal individual in the jth dimension, is a uniformly distributed random number between 0 and 1. In the A random individual in generation Dimensional value, is a probability ratio whose value decreases randomly between 2 and -2. To determine the sign of the parameter, is the current iteration number, is the total number of iterations; Phase 3: ; ; ; in, is the i-th candidate solution in The value of the dimension, is the value of the current optimal individual in the jth dimension, is a uniformly distributed random number between 0 and 1. Adjustment Parameters, for The mean value in all dimensions, is a sensitive parameter, To prevent the denominator from being a very small value of 0, and Respectively represent the upper and lower limits of the target to be optimized in The value of the dimension, For the Daizhongdi The individual in The value of the dimension, To be optimized The target dimension, is the current iteration number, is the total number of iterations; Phase 4: ; ; ; ; ; in, is the i-th candidate solution in The value of the dimension, is the value of the current optimal individual in the jth dimension, Here is a development operator. is a uniformly distributed random number between 0 and 1. is a parameter that limits the scope of the development search. Adjustment Parameters, for The mean value in all dimensions, is a sensitive parameter, To prevent the denominator from being a very small value of 0, and Respectively represent the upper and lower limits of the target to be optimized in The value of the dimension, For the Daizhongdi The individual in Dimensional value, For the A random individual in generation The value of the dimension, To be optimized The target dimension, is the current iteration number, is the total number of iterations.
5. An image segmentation method according to claim 4, characterized in that: After the bat algorithm is strengthened in stages, a greedy selection model is added, including: After the staged reinforcement is completed, a greedy selection strategy is added, where the greedy selection process is as follows: ; in, For the Daizhongdi Individuals, No. Candidate solutions, for The fitness value of for The fitness value of For the Daizhongdi Individual.
6. An image segmentation device, characterized in that: The device comprises: An acquisition module, used for acquiring a target medical image to be segmented and determining a two-dimensional histogram of the target medical image; A construction module is provided, which is used to characterize the Renyi entropy of the target medical image through multiple grayscale thresholds in a two-dimensional histogram; the grayscale threshold is a pixel grayscale combination for segmenting the background area and the target area; a phased enhancement is introduced into the bat algorithm, and the search range of the bat algorithm for the pixel grayscale combination is expanded by using the optimal individual, multiple random individuals in the population, and multiple random parameters, and the optimal individual is adjusted by a multiple by using the population information and the random parameters, and finally the step size coefficient is reduced to obtain an improved bat algorithm; The optimization module is used to maximize the Renyi entropy and iteratively optimize multiple grayscale thresholds through the improved bat algorithm to obtain the optimal threshold set; The segmentation module is used to segment the target medical image based on the optimal threshold set to obtain a segmentation result.
7. 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 5 is implemented.
8. 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 the processor implements the method according to any one of claims 1 to 5 when executing the program.
Citation Information
Patent Citations
Two-dimensional Renyi entropic threshold segmentation method for grayscale images
CN102831604A
Two-dimensional information entropy power equipment ultraviolet image threshold segmentation method based on bat algorithm
CN113284091A
Multi-threshold medical image segmentation method based on improved multivariate universe optimization
CN115330814A
Two-dimensional segmentation device of multi-threshold image, storage medium and equipment
CN116612136A
Lupus nephritis image segmentation method, lupus nephritis image segmentation device, medium and equipment
CN118941581A
Cited By
Medical image segmentation method and system for chronic obstructive pulmonary disease
CN119904480A
Multi-threshold image segmentation method and device, computer equipment and storage medium
CN120510173A
Multi-threshold image segmentation method, device, computer equipment and storage medium
CN120510173B
Intracranial hemorrhage CT image segmentation method and device, medium and equipment
CN122048972A
