Image segmentation method, device, computer equipment and storage medium

By constructing a two-dimensional histogram of medical images and using Renyi entropy to determine the threshold, combined with the improved bat algorithm for iterative optimization, the problem of difficulty in finding the optimal solution to the segmentation threshold in the prior art is solved, and more accurate medical image segmentation is achieved.

CN119251245BActive Publication Date: 2025-03-11BIG DATA & INFORMATION TECH RES INST OF WENZHOU UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411774098.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-11
Estimated Expiration
2044-12-05

Smart Images

  • Figure CN119251245B_ABST
    Figure CN119251245B_ABST
Patent Text Reader

Abstract

The present invention provides an image segmentation method, device, computer equipment and storage medium, belonging to the field of image processing, the method comprising: obtaining a target medical image to be segmented, and determining a two-dimensional histogram of the target medical image; characterizing the Renyi entropy of the target medical image by multiple grayscale thresholds in the two-dimensional histogram; introducing phased enhancement in the bat algorithm, respectively enhancing the exploration capability and algorithm development capability of the bat algorithm, and obtaining an improved bat algorithm; with the goal of maximizing the Renyi entropy, iteratively optimizing multiple grayscale thresholds through the improved bat algorithm, obtaining an optimal threshold set; segmenting the target medical image based on the optimal threshold set, and obtaining a segmentation result. In this way, the Renyi entropy is introduced to preliminarily quantify the quality of image segmentation, with the goal of maximizing the Renyi entropy, iterating through the improved bat algorithm, effectively finding the optimal solution of the grayscale threshold, and finally segmenting through the optimal solution, so that the segmented image provides better information retention and discrimination.
Need to check novelty before this filing date? Find Prior Art

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:

[0007] First, an image segmentation method is provided, the method comprising:

[0008] 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;

[0009] 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;

[0010] 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.

[0011] 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.

[0012] The target medical image is segmented based on the optimal threshold set to obtain the segmentation result.

[0013] Optionally, constructing a two-dimensional histogram based on the non-local mean filtered image and the grayscale image of the target medical image includes:

[0014] Performing grayscale processing on the target medical image to obtain a corresponding grayscale image, and determining the grayscale value of the target medical image;

[0015] 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;

[0016] 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 P(x,y) of the two-dimensional histogram is determined as:

[0017]

[0018] Where C(x,y) is the number of times pixel (x,y) appears, P(x,y) represents the probability density of C(x,y), and m×n represents the size of the target medical image.

[0019] Optionally, characterizing the Renyi entropy of the target medical image by using multiple grayscale thresholds in a two-dimensional histogram includes:

[0020] 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:

[0021]

[0022] Among them, P A1 is the probability density of pixel grayscale combinations in the background area, P A2is the probability density of the grayscale combination of pixels in the target area, q is the grayscale value of the segmented target area and the background area, w is the result of q after the non-local mean; V is the maximum grayscale value in the target medical image to be segmented, i and j are two different pixels, and P(i,j) is the probability density of the grayscale combination of pixel i and pixel j;

[0023] The Renyi entropy of the target area and the background area is characterized according to the probability density, and the specific formula is:

[0024]

[0025] Where α is the order of Renyi entropy.

[0026] Optionally, the step of introducing phased reinforcement into the bat algorithm includes:

[0027] Phase 1:

[0028]

[0029] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, η i,j Here is an exploration operator, β is a restriction η i,j The step coefficient, rand is a uniformly distributed random number between 0 and 1, R i,j is a parameter that limits the exploration search range, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε is a very small value to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, is the value of a random individual in the tth generation on the jth dimension, dim is the dimension of the target to be optimized, t is the current iteration number, and T is the total number of iterations;

[0030] Phase 2:

[0031]

[0032] r3∈[1,-1];

[0033] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, rand is a uniformly distributed random number between 0 and 1, In the tth generation, a random individual has a value in the jth dimension, Es is a probability ratio, and its value decreases randomly between 2 and -2, r3 is a parameter to determine the positive and negative signs, t is the current iteration number, and T is the total number of iterations;

[0034] Phase 3:

[0035]

[0036] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, rand is a uniformly distributed random number between 0 and 1, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε prevents the denominator from being a very small value of 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the j-th dimension in the t-th generation, dim is the dimension of the target to be optimized, t is the current iteration number, and T is the total number of iterations;

[0037] Phase 4:

[0038]

[0039]

[0040] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, η i,j Here is a development operator, rand is a uniformly distributed random number between 0 and 1, R i,j is a parameter that limits the scope of development search, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε is a very small value to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, is the value of a random individual in the tth generation on the jth dimension, dim is the dimension of the target to be optimized, t is the current number of iterations, and T is the total number of iterations.

[0041] Optionally, after the bat algorithm is periodically strengthened, a greedy selection model is also added, including:

[0042] After the staged reinforcement is completed, a greedy selection strategy is added, where the greedy selection process is as follows:

[0043]

[0044] in, is the i-th individual in the t+1th generation, Xnew i The i-th candidate solution, Fnew i Xnew i The fitness value, F i for The fitness value of is the i-th individual in the t-th generation.

[0045] Secondly, an image segmentation device is also provided, the device comprising:

[0046] An acquisition module, used for acquiring a target medical image to be segmented and determining a two-dimensional histogram of the target medical image;

[0047] 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;

[0048] 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;

[0049] The segmentation module is used to segment the target medical image based on the optimal threshold set to obtain a segmentation result.

[0050] 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.

[0051] 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.

[0052] The image segmentation method provided by the present invention has the following beneficial effects:

[0053] 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

[0054] 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.

[0055] Figure 1 The figure is a flowchart of an image segmentation method provided by the present invention according to an exemplary embodiment.

[0056] Figure 2 A multi-model performance indicator data diagram based on FSIM provided according to an exemplary embodiment of the present invention.

[0057] Figure 3 A diagram of multi-model performance indicator data based on PSNR provided according to an exemplary embodiment of the present invention.

[0058] Figure 4 A multi-model performance indicator data graph based on SSIM is provided according to an exemplary embodiment of the present invention.

[0059] Figure 5 The present invention is a block diagram of an image segmentation device provided according to an exemplary embodiment. DETAILED DESCRIPTION

[0060] 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.

[0061] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0062] 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:

[0063] 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.

[0064] 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.

[0065] 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:

[0066] Obtain an adenocarcinoma image to be segmented Ia of size m×n; convert the lung adenocarcinoma image to be segmented Ia into a grayscale image of lung adenocarcinoma to be segmented with a grayscale value range of [0,1,...,V-1], where V represents the maximum grayscale value in the lung adenocarcinoma image to be segmented;

[0067] Perform non-local mean operation on the grayscale image of lung adenocarcinoma to be segmented to obtain a non-local mean filtered image:

[0068]

[0069]

[0070] Where NLM(i) is the predicted value obtained by the non-local mean; Ia(i) and Ia(j) are the grayscale values ​​of pixel i and pixel j respectively; d(i) and d(j) are the local means of pixel i and pixel j respectively; V(i) and V(j) are the k×k pixel matrices centered on pixel i and pixel j respectively, and ω(i,j) is the weight for weighted averaging.

[0071] 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. Then, the z-axis P(x,y) of the two-dimensional histogram is determined as:

[0072]

[0073] Among them, C(x,y) is the number of times the pixel (x,y) appears, and P(x,y) represents the probability density of C(x,y).

[0074] S102 , characterizing the Renyi entropy of the target medical image by using multiple grayscale thresholds in a two-dimensional histogram.

[0075] The grayscale threshold is a pixel grayscale combination for segmenting the background area and the target area.

[0076] 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.

[0077] 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:

[0078]

[0079] Among them, A1 and A2 represent the background area and the target area respectively, P A1 is the probability density of pixel grayscale combinations in the background area, P A2 is the probability density of the grayscale combination of pixels in the target area, q is the grayscale value of the target area and the background area, w is the result of q after the non-local mean, and the combination of w and q (q, w) is the grayscale threshold; V is the maximum grayscale value in the target medical image to be segmented, i and j are two different pixels, and P(i, j) is the probability density of the grayscale combination of pixel i and pixel j; according to the probability density, the Renyi entropy of the target area and the background area are respectively characterized, and the specific formula is:

[0080]

[0081] Among them, α is the order of Renyi entropy, which is 0.5 here.

[0082] S103, performing phased enhancement on the bat algorithm to obtain an improved bat algorithm.

[0083] 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.

[0084] 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.

[0085] 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.

[0086] 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.

[0087] In one embodiment, a bat algorithm is first constructed, and its mathematical model is as follows:

[0088] Q=Q min +(Q max -Q min )×rand;

[0089]

[0090] Among them, Q is the frequency of the sound waves emitted by the bat, Q min The lower limit of the frequency is 0 in the invention, Q max The upper limit of the frequency is 2 in the present invention, and rand represents a random number uniformly distributed between 0 and 1. is the velocity of the ith individual in the tth generation in the jth dimension, is the velocity of the ith individual in the jth dimension in the t+1th generation, is the value of the i-th individual in the j-th dimension in the t-th generation, is the value of the current optimal individual in the jth dimension, Xnew i,j is the value of the i-th candidate solution in the j-th dimension.

[0091]

[0092] A 0 ∈U(1,2);

[0093]

[0094] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, σ is a random number whose value follows the standard normal distribution and can adjust A t , A t is the average loudness of the bat population in the tth generation, A 0 A t The initial value of , U(1,2) represents a uniformly distributed random number between 1 and 2, is the value of the current optimal individual in the jth dimension. This formula will be executed when the condition is met. In the condition, rand is a uniformly distributed random number between 0 and 1. represents the pulse frequency of the i-th bat in the t-th generation, for The initial value of , U(0,1) represents a uniformly distributed random number between 0 and 1. and The update method is as follows:

[0095]

[0096] in, represents the pulse frequency of the i-th bat in the t+1th generation, represents the pulse frequency of the i-th bat in the t-th generation, γ represents the pulse enhancement coefficient and its value is 0.9, t represents the current number of iterations, is the average loudness of the bat population in the t+1th generation, A t is the average loudness of the bat population in the tth generation, and the μ sound wave loudness attenuation coefficient is 0.9. is the i-th individual in the t+1th generation, Xnew i The i-th candidate solution. Fnew i Xnew i The fitness value, F i for The fitness value of is the i-th individual in the t-th generation.

[0097] 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:

[0098] Phase 1:

[0099]

[0100] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, η i,j Here is an exploration operator, β is a restriction η i,j The step coefficient is 0.1, rand is a uniformly distributed random number between 0 and 1, R i,j is a parameter that limits the exploration search range, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter that determines the accuracy of exploration and its value is 0.1, ε prevents the denominator from being a very small value of 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, In the tth generation, a random individual is evaluated on the jth dimension, dim is the dimension of the target to be optimized, in the conditional judgment, t is the current iteration number, and T is the total iteration number.

[0101] Phase 2:

[0102]

[0103]

[0104] r3∈[1,-1];

[0105] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, rand is a uniformly distributed random number between 0 and 1, In the tth generation, a random individual has a value in the jth dimension. Es is a probability ratio whose value decreases randomly between 2 and -2. r3 is a parameter that determines the positive and negative signs. In the conditional judgment, t is the current iteration number and T is the total iteration number.

[0106] Phase 3:

[0107]

[0108] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, rand is a uniformly distributed random number between 0 and 1, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter that determines the accuracy of the development and its value is 0.1, ε prevents the denominator from being a very small value of 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, dim is the dimension of the target to be optimized, in the conditional judgment, t is the current iteration number, and T is the total number of iterations.

[0109] Phase 4:

[0110]

[0111] Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, η i,j Here is a development operator, rand is a uniformly distributed random number between 0 and 1, R i,j is a parameter that limits the scope of development search, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter that determines the accuracy of development and its value is 0.1, ε is a very small value, one is to ensure development and the other is to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, In the tth generation, a random individual is evaluated on the jth dimension, dim is the dimension of the target to be optimized, in the conditional judgment, t is the current iteration number, and T is the total iteration number.

[0112] 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:

[0113]

[0114] in, is the i-th individual in the t+1th generation, Xnew i The i-th candidate solution. Fnew i Xnew i The fitness value, F i for The fitness value of is the i-th individual in the t-th generation.

[0115] 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.

[0116] In order to find the gray threshold (q, w) to segment the useful area as much as possible, ensure that areas A1 and A2 contain a lot of information, so that the total value of Re(A1) and Re(A2) entropy is maximized, that is:

[0117] Re(q,w)=Re(A1)+Re(A2);

[0118] Then the optimization objective can be expressed as, finding (q * ,w * ) satisfies the following formula, namely:

[0119] (q * ,w * )=argmax{Re(q,w)};

[0120] 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 expanding the single threshold segmentation to multi-threshold segmentation technology. Based on the basic principle of single threshold segmentation, the present invention introduces multiple thresholds (assuming X, where X>1), which subdivide the image into X+1 different areas. The present invention combines these thresholds into a set, represented by U, U={(q,w),…,(q w ,w X )}.

[0121] B is background, S1-S X represents the target, so the sum of the Renyi entropy of these regions is:

[0122] Re(U)-=Re(B)+Re(S1)+…+Re(S X );

[0123] Based on the idea of ​​maximum Renyi entropy, PRBA is used to find the gray threshold set U * Make Re(U * ) is as large as possible, so the mathematical expression of the optimization target solved by PRBA is:

[0124] U * = argmax(Re(U));

[0125] Based on the above optimization objectives, an improved bat algorithm is constructed as follows:

[0126] Initialization algorithm configuration: population size N, target to be optimized U * The dimension dim of , the maximum number of iterations T.

[0127] Step 2: Initialize population X i,j (i=1,2,...,N;j=1,2,...,dim), and calculate the fitness value (Renyi entropy) of each individual.

[0128] Step 3: Execute the bat algorithm process, that is, the mathematical model of the bat algorithm in the above steps.

[0129] Step 4: Execute the phased reinforcement part, that is, the specific mathematical model of the improved bat algorithm in the above steps.

[0130] Step 5: Update individual X b and t and other parameters.

[0131] Step 6: Repeat steps 2 to 5 until t>T.

[0132] Step 7: Output the optimal threshold combination, i.e. X b .

[0133] S105. Segment the target medical image based on the optimal threshold set to obtain a segmentation result.

[0134] 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 experiment is conducted at low threshold levels (5, 6, 7 and 8) and high threshold levels (10, 15, 20 and 25), as shown in Figure 2. Figure 2-4It 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.

[0135] 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.

[0136] Secondly, the present invention also provides an image segmentation device, such as Figure 5 As shown, including:

[0137] 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.

[0138] 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.

[0139] 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.

[0140] The segmentation module 504 is used to segment the target medical image based on the optimal threshold set to obtain a segmentation result.

[0141] 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.

[0142] 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.

[0143] 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.

[0144] 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.

[0145] 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.

[0146] 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.

[0147] 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.

[0148] It should be noted that the above specific implementation method can enable those skilled in the art to more fully understand the invention, but does not limit the invention in any way. Therefore, although the 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. Segment the target medical image based on the optimal threshold set to obtain a segmentation result; The phased enhancement of the bat algorithm includes: Phase 1: Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, η i,j Here is an exploration operator, β is a restriction η i,j The step coefficient, rand is a uniformly distributed random number between 0 and 1, R i,j is a parameter that limits the exploration search range, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε is a very small value to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, is the value of a random individual in the tth generation on the jth dimension, dim is the dimension of the target to be optimized, t is the current iteration number, and T is the total number of iterations; Phase 2: r3∈[1,-1]; Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, rand is a uniformly distributed random number between 0 and 1, In the tth generation, a random individual has a value in the jth dimension, Es is a probability ratio, and its value decreases randomly between 2 and -2, r3 is a parameter to determine the positive and negative signs, t is the current iteration number, and T is the total number of iterations; Phase 3: Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, rand is a uniformly distributed random number between 0 and 1, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε is a very small value to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the j-th dimension in the t-th generation, dim is the dimension of the target to be optimized, t is the current iteration number, and T is the total number of iterations; Phase 4: Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, η i,j Here is a development operator, rand is a uniformly distributed random number between 0 and 1, R i,j is a parameter that limits the scope of development search, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε is a very small value to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, is the value of a random individual in the tth generation on the jth dimension, dim is the dimension of the target to be optimized, t is the current number of iterations, and T is the total number of iterations.

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 P(x,y) of the two-dimensional histogram is determined as: Where C(x,y) is the number of times pixel (x,y) appears, P(x,y) represents the probability density of C(x,y), and m×n represents 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: Among them, P A1 is the probability density of pixel grayscale combinations in the background area, P A2 is the probability density of the grayscale combination of pixels in the target area, q is the grayscale value of the segmented target area and the background area, w is the result of q after the non-local mean; V is the maximum grayscale value in the target medical image to be segmented, i and j are two different pixels, and P(i,j) 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: Where α is the order of Renyi entropy.

4. The image segmentation method according to claim 1, 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, is the i-th individual in the t+1th generation, Xnew i The i-th candidate solution, Fnew i Xnew i The fitness value, F i for The fitness value of is the i-th individual in the t-th generation.

5. 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 used to characterize the Renyi entropy of a target medical image through multiple grayscale thresholds in a two-dimensional histogram; the grayscale threshold is a pixel grayscale combination for segmenting a background area and a target area; the bat algorithm is strengthened in stages, and the search range of the bat algorithm for pixel grayscale combinations is expanded by using an optimal individual, multiple random individuals within a population, and multiple random parameters, and the optimal individual is adjusted by a multiple by using population information and 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; A segmentation module, used for segmenting the target medical image based on an optimal threshold set to obtain a segmentation result; The building blocks are used to perform phased enhancements on the bat algorithm, including: Phase 1: Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, η i,j Here is an exploration operator, β is a restriction η i,j The step coefficient, rand is a uniformly distributed random number between 0 and 1, R i,j is a parameter that limits the exploration search range, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε is a very small value to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, is the value of a random individual in the tth generation on the jth dimension, dim is the dimension of the target to be optimized, t is the current iteration number, and T is the total number of iterations; Phase 2: r3∈[1,-1]; Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, rand is a uniformly distributed random number between 0 and 1, In the tth generation, a random individual has a value in the jth dimension, Es is a probability ratio, and its value decreases randomly between 2 and -2, r3 is a parameter to determine the positive and negative signs, t is the current iteration number, and T is the total number of iterations; Phase 3: Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, rand is a uniformly distributed random number between 0 and 1, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε is a very small value to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the j-th dimension in the t-th generation, dim is the dimension of the target to be optimized, t is the current iteration number, and T is the total number of iterations; Phase 4: Among them, Xnew i,j is the value of the i-th candidate solution in the j-th dimension, is the value of the current optimal individual in the jth dimension, η i,j Here is a development operator, rand is a uniformly distributed random number between 0 and 1, R i,j is a parameter that limits the scope of development search, P i,j Adjustment The parameters of Mx are The mean value in all dimensions, γ is a sensitive parameter, ε is a very small value to prevent the denominator from being 0, ub j and lb j Respectively represent the upper and lower limits of the target to be optimized in the jth dimension, is the value of the i-th individual in the t-th generation on the j-th dimension, is the value of a random individual in the tth generation on the jth dimension, dim is the dimension of the target to be optimized, t is the current number of iterations, and T is the total number of iterations.

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 the processor implements the method according to any one of claims 1 to 4 when executing the program.

Citation Information

Patent Citations

  • Lupus nephritis image segmentation method, lupus nephritis image segmentation device, medium and equipment

    CN118941581A