Global Image Segmentation Method Based on Global Gaussian Distribution and Statistical Norm
By constructing an energy functional based on global Gaussian distribution and statistical norm, and updating the level set function using gradient descent method, the problem of lack of global features and noise sensitivity in the image segmentation method in the prior art is solved, and higher image segmentation accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202411179674.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2044-08-27
AI Technical Summary
The existing image segmentation methods lack global features when processing images with uneven intensity, resulting in high sensitivity to the initial position of the contour and poor segmentation accuracy in high noise environments.
The global image segmentation method based on global Gaussian distribution and statistical norm is adopted to construct an energy functional, and the level set function is iteratively updated by using the gradient descent method until the preset accuracy threshold is reached.
Improve image segmentation accuracy, reduce sensitivity to the initial position of the contour, and maintain good segmentation performance in high noise environments.
Smart Images

Figure CN119169034B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and applications, and particularly relates to a global image segmentation method based on global Gaussian distribution and statistical norm. Background Art
[0002] Images are one of the carriers for transmitting information in people's daily lives. At present, people's exploration of image technology has extended to all aspects and has been widely applied in fields such as target detection, medical image processing, industry, face recognition, and intelligent transportation. With the continuous progress of technology, image processing has become very important, and image segmentation is a very important field in image processing. Image segmentation mainly divides an image into several non-overlapping regions and segments the target regions in the image, providing a basis for subsequent image analysis and image understanding. Therefore, how to obtain better image segmentation results and improve the accuracy and efficiency of segmentation has become one of the key issues in image segmentation.
[0003] Currently, the commonly used image segmentation method is the segmentation method based on local level sets, which has good results in segmenting images with uneven intensities. Using local statistical features can improve the segmentation accuracy in the case of uneven intensities. However, since this method loses global features, it is highly sensitive to the initial position of the contour. At the same time, when the algorithm processes images with high noise, the existing solutions may also perform poorly because the noise will cause changes in local intensities, which may be miscaptured by the contour, resulting in incorrect segmentation. Therefore, the existing image segmentation solutions have poor accuracy in segmenting images. Summary of the Invention
[0004] In view of this, in order to address the above deficiencies, it is necessary to propose a global image segmentation method based on global Gaussian distribution and statistical norm to improve the accuracy of image segmentation.
[0005] In a first aspect, the present invention provides a global image segmentation method based on global Gaussian distribution and statistical norm, including:
[0006] Constructing an energy functional based on global Gaussian distribution and statistical norm; wherein, the energy functional contains a level set function for characterizing the image segmentation result;
[0007] Obtaining the pixel coordinates of the image to be segmented;
[0008] Inputting the pixel coordinates of the image to be segmented into the energy functional, and performing iterative operations on the level set function in the energy functional based on the gradient descent method until the difference between the energy functional value calculated in the current round of iteration and the energy functional value calculated in the previous round of iteration is less than a preset accuracy threshold, and ending the loop iterative calculation;
[0009] Output the final level set function of the image to be segmented;
[0010] Wherein, after each iterative calculation, if the condition for ending the iterative calculation of the loop is not reached, the current level set function is updated, and the updated level set function is used for the next round of iterative update.
[0011] Preferably, constructing the energy functional based on the global Gaussian distribution and the statistical norm includes: starting from the global information of the image, for each pixel in the image to be segmented, defining a global Gaussian distribution fitting energy with the global mean and variance as variables, and integrating the fitting energies of all pixel points to construct the energy functional.
[0012] Preferably, constructing the energy functional specifically includes:
[0013] Describing the fitting energy using global Gaussian distributions with different means and variances respectively from a statistical perspective, and constructing the following primary energy functional:
[0014]
[0015] Wherein, is the probability density function of the global region intensity defined as a Gaussian distribution, i = 1, 2, Ω1 and Ω2 are the internal region and the external region of the contour C of the image to be segmented respectively, then the following energy functional can be obtained:
[0016]
[0017] Wherein, represents the energy functional, φ is the level set function, x is the pixel coordinate in the image to be segmented I(x), μ i (x) is the global mean, is the global variance, is the degree of deviation between the gray value at x and the average intensity value μ i (x), λ(x) is the multiplier for adjusting the deviation from μ i (x), α1 and α2 are both fixed balance parameters, and H(φ(x)) is the Heaviside function.
[0018] Preferably, the iterative operation on the level set function in the energy functional based on the gradient descent method includes:
[0019] Step S31: Configure the initial iterative parameters; wherein, the iterative parameters include the initial energy functional value;
[0020] Step S32: Calculate the partial derivatives of the current energy functional with respect to μ i (x), λ(x) respectively;
[0021] Step S33: Set each calculated partial derivative to 0, and calculate the calculated values of μ i (x) and λ(x);
[0022] Step S34: Substitute the calculated values of μ i (x) and λ(x) into the current energy functional to obtain the energy functional value;
[0023] Step S35: Determine whether the difference between the currently calculated energy functional value and the energy functional value obtained from the previous iterative calculation is less than a preset precision threshold; if so, end the iterative operation; otherwise, update the level set function in the current energy functional and then return to step S32 for execution.
[0024] Preferably, in step S35, the updating of the level set function in the current energy functional includes:
[0025] Calculating the partial derivative of the current energy functional with respect to the level set function;
[0026] Updating the level set function in the current energy functional using the partial derivative of the current energy functional with respect to the level set function, and using the new energy functional formed after the update of the level set function as the energy functional for the next iterative operation.
[0027] Preferably, the updating of the level set function in the current energy functional using the partial derivative of the current energy functional with respect to the level set function includes:
[0028] Updating the level set function using the following calculation formula:
[0029]
[0030] where Δt is the time step.
[0031] Preferably, after constructing the energy functional, it further includes:
[0032] Using the following regularization term to correct the constructed energy functional to ensure the smoothness of the level set function during the curve evolution process;
[0033]
[0034] where p(φ(x)) is the regularization term, is the gradient of the level set function.
[0035] Preferably, the preset precision threshold is 10 -3 .
[0036] In a second aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is made to execute the method described in any one of the first aspect.
[0037] In a third aspect, the present invention provides a computing device, including a memory and a processor. An executable code is stored in the memory. When the processor executes the executable code, the method described in any one of the first aspect is implemented.
[0038] As can be seen from the above technical solutions, when segmenting a global image based on this solution, first, an energy functional is constructed based on the global Gaussian distribution and statistical norm. Then, after obtaining the pixel coordinates of the image to be segmented, they are input into the energy functional. Further, an iterative operation is performed on the level set function in the energy functional based on the gradient descent method until the difference between the energy functional value obtained by the current iterative calculation and the energy functional value obtained in the previous round is less than a preset precision threshold, and then the loop iterative calculation is terminated, and the final level set function of the image to be segmented is output. Thus, to solve the problem of being highly sensitive to the initial position of the contour and noise due to the lack of global features, this solution starts from the global information of the image and constructs an energy functional based on the probability density function of the global region intensity of the Gaussian distribution with statistical law characteristics. It can not only consider the characteristics of each pixel point of the image to be segmented with the global mean and variance as variables, but also measure the similarity between pixels through the statistical characteristics of the Gaussian distribution, so as to more accurately identify the boundary of the target region in a complex background. Therefore, this solution can improve the accuracy of image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flowchart of a global image segmentation method based on global Gaussian distribution and statistical norm provided by an embodiment of the present invention.
[0040] Figure 2 It is the comparison result of image segmentation with different initial contours.
[0041] Figure 3 It is the comparison result of image segmentation with different noise levels.
[0042] Figure 4 The comparison result of natural image segmentation. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0044] As Figure 1 shown, the present invention provides a global image segmentation method based on global Gaussian distribution and statistical norm, which may include the following steps:
[0045] Step 101: Construct an energy functional based on global Gaussian distribution and statistical norm; wherein, the energy functional contains a level set function for characterizing the image segmentation result;
[0046] Step 102: Obtain the pixel coordinates of the image to be segmented;
[0047] Step 103: Input the pixel coordinates of the image to be segmented into the energy functional, and perform iterative operations on the level set function in the energy functional based on the gradient descent method until the difference between the energy functional value obtained in the current round of iterative calculation and the energy functional value obtained in the previous round of iterative calculation is less than a preset precision threshold, and end the loop iterative calculation; wherein, after each iterative calculation, if the condition for ending the loop iterative calculation is not met, update the current level set function, and use the updated level set function for the next round of iterative update;
[0048] Step 104: Output the final level set function of the image to be segmented.
[0049] To solve the problem of being highly sensitive to the initial position of the contour and noise due to the lack of global features, the embodiments of this solution start from the global information of the image, and construct an energy functional based on the probability density function of the global region intensity of the Gaussian distribution with statistical law characteristics. It can not only consider the characteristics of each pixel point of the image to be segmented with the global mean and variance as variables, but also measure the similarity between pixels through the statistical characteristics of the Gaussian distribution, so as to more accurately identify the boundary of the target region in a complex background. Therefore, this solution can improve the accuracy of image segmentation.
[0050] For step 101, construct an energy functional based on global Gaussian distribution and statistical norm; wherein, the energy functional contains a level set function for characterizing the image segmentation result;
[0051] In this embodiment, to solve the problem of being highly sensitive to the initial position of the contour and noise due to the lack of global features, considering starting from the global information of the image, for each pixel in the image to be segmented, define a new global Gaussian distribution fitting energy with the global mean and variance as variables, and integrate the fitting energy of all pixel points to form the data term of the energy function, that is, the energy functional. Specifically, when constructing the energy functional, the fitting energy can be described by global Gaussian distributions with different means and variances from a statistical perspective, and the following primary energy functional can be constructed:
[0052]
[0053] Among them, p i , x(I(x), μ i (x), λ(x)) is the probability density function of the global region intensity defined as a Gaussian distribution, where Ω1 and Ω2 are the internal region and the external region of the contour C of the image to be segmented respectively. In this way, the following energy functional can be obtained:
[0054]
[0055] Among them, represents the energy functional, φ is the level set function, x is the pixel coordinate in the image I(x) to be segmented, μ i (x) is the global mean value, is the global variance, is the deviation degree between the gray value at x and the average intensity value μ i (x), λ(x) is the multiplier for adjusting the deviation from μ i (x), α1 and α2 are both fixed balance parameters, and H(φ(x)) is the Heaviside function.
[0056] For step 102, obtain the pixel coordinates of the image to be segmented;
[0057] In this step, first obtain the image to be segmented, then construct the pixel coordinate system of the image to be segmented, and then obtain the pixel coordinates of the image to be segmented. For example, establish a two-dimensional coordinate system u-v in pixels with the upper left corner of the image to be segmented as the origin. The abscissa u and the ordinate v of the pixel are respectively the column number and the row number in its image array. The unit of the pixel coordinate system u-v is pixel, which is the discrete image coordinate or pixel coordinate, and the origin is at the upper left corner of the picture.
[0058] For step 103, input the pixel coordinates of the image to be segmented into the energy functional, and perform iterative operations on the level set function in the energy functional based on the gradient descent method until the difference between the energy functional value obtained by the current round of iterative calculation and the energy functional value obtained by the previous round of iterative calculation is less than the preset precision threshold, and end the loop iterative calculation; step 104, output the final level set function of the image to be segmented;
[0059] In this step, the energy functional value obtained after each iteration operation is compared with the energy functional value obtained in the previous iteration calculation to determine whether the difference between the two is less than a preset precision threshold. If so, it means that as the iteration operation progresses, the energy functional no longer decreases, that is, the iteration operation has reached the precision requirement, and the output level set function can meet the segmentation precision requirement; if not, it means that the iteration operation has not reached the precision requirement, and then the iteration operation continues. Specifically, when step 103 performs iterative operations on the level set function in the energy functional based on the gradient descent method, it can be implemented in the following way:
[0060] Step S31: Configure initial iteration parameters; among them, the iteration parameters include the initial energy functional value;
[0061] Step S32: Calculate the partial derivatives of the current energy functional with respect to μ i (x), λ(x);
[0062] Step S33: Set the calculated partial derivatives to 0, and use the pixel coordinates of the image to be segmented to calculate the calculated values of μ i (x), λ(x);
[0063] Step S34: Substitute the calculated values of μ i (x), λ(x) into the current energy functional to obtain the energy functional value;
[0064] Step S35: Determine whether the difference between the currently calculated energy functional value and the energy functional value obtained in the previous iteration calculation is less than the preset precision value; if so, end the iteration operation; otherwise, after updating the level set function in the current energy functional, return to step S32 for execution.
[0065] In this embodiment, when performing iterative operations, first initialize each iteration parameter, such as giving an initial energy functional value, and then calculate the partial derivatives of the current energy functional with respect to μ i (x), λ(x). Specifically, the gradient descent flow is: where δ(φ(x)) is the derivative of H(φ(x)), that is In this formula, μ i (x), λ(x) are all unknown, so consider taking the partial derivative of the energy functional and setting the derivative equal to zero, then we can get:
[0066]
[0067]
[0068] Wherein:
[0069]
[0070] In this way, the calculated μ i (x), The calculated values of λ(x) are substituted into the current energy functional to obtain the current energy functional value; further, the magnitude relationship between the difference between the current energy functional value and the energy functional value obtained in the previous round and the preset precision value is determined. Of course, if it is the first iteration operation, the energy functional value in the previous round is the set initial energy functional value. If the difference in the energy functional value is less than the preset precision threshold, for example, the difference is less than 10 -3 , it means that the preset precision requirement is met. As the iteration operation progresses, the energy functional no longer evolves towards minimization. At this time, the level set function in the output energy functional is the final level set function of the image to be segmented, that is, the optimal segmentation curve of the image to be segmented is obtained. If the difference in the energy functional value is greater than the preset precision threshold, that is, the difference is greater than 10 -3 , it means that the precision requirement is not met, and the level set function is updated and then the iteration operation continues.
[0071] Furthermore, when step S35 updates the level set function in the current energy functional, it is considered to first calculate the partial derivative of the current energy functional with respect to the level set, and then use the partial derivative of the current energy functional with respect to the level set function to update the level set function in the current energy functional, and the new energy functional formed after updating the level set function is used as the energy functional for the next iteration operation. Specifically, when using the partial derivative of the current energy functional with respect to the level set function to update the level set function in the current energy functional, the level set function can be updated using the following calculation formula:
[0072]
[0073] where Δt is the time step.
[0074] In addition, in order to avoid the re-initialization problem and ensure that the curve remains smooth during the evolution process of the level set function, a regularization term can also be considered to correct the constructed energy functional. The specific regularization term can be obtained in the following way:
[0075]
[0076] where p(φ(x)) is the regularization term, is the gradient of the level set function.
[0077] Furthermore, when using the above regularization term to correct the energy functional, the following new energy functional can be obtained:
[0078]
[0079] In practice, the regularized corrected energy functional can be used for iterative operations to obtain a more accurate image segmentation result.
[0080] The following combines specific application examples to further illustrate the effect of this solution.
[0081] To verify the effectiveness of this solution for natural images, 6 natural images are selected from the BSDS500 dataset for experiments. The segmentation performance of this solution is measured according to the following 4 objective evaluation indicators, and the 4 objective evaluation indicators are: Jaccard index (JSC) rate, Dice similarity coefficient (DSC) rate, recall rate, and precision rate. Specifically, each evaluation indicator is as follows:
[0082]
[0083] Among the above four objective evaluation indicators, G s is the segmented image, G GT is the GT image, |·| represents the number of pixels in the region, TP represents true positive, FP represents false positive, and FN represents false negative.
[0084] (1) Verify the robustness to the initial contour
[0085] Experiments are carried out by setting initial contours of different sizes and shapes, and the segmentation results are as Figure 2 shown. As can be seen from Figure 2 , in (a0)-(a3), the green rectangle represents the initial contour, and the red represents the segmentation result; in (b0)-(b3), the green triangle represents the initial contour, and the red represents the segmentation result; in (c0)-(c3), the green circle represents the initial contour, and the red represents the segmentation result; in (d0)-(d3), the green trapezoid represents the initial contour, and the red represents the segmentation result. The entire segmentation result shows that regardless of whether the shape of the initial contour is a rectangle, a circle, a triangle or a trapezoid, or whether the initial contour contains one target region, two target regions, three target regions, or even no target region, this solution can accurately segment the image.
[0086] (2) Robustness to noise
[0087] To verify the robustness of this solution to noise, it is verified from two aspects: subjective evaluation and objective evaluation.
[0088] 1) Subjective evaluation
[0089] Set the initial contour as a circle, select real images, and successively add Gaussian noise with a mean of 0 and variances of 0.015, 0.02, 0.025, and 0.03, as well as salt-and-pepper noise with levels of 0.01, 0.012, 0.014, and 0.016 to the images. The segmentation results are as Figure 3 shown. Among them, (a0)-(a3) are the segmentation results of adding different levels of Gaussian noise to the images, and (b0)-(b3) are the segmentation results of adding different levels of salt-and-pepper noise to the images. From Figure 3 the segmentation results, it can be seen that this scheme can achieve image segmentation for different levels of Gaussian noise and different levels of salt-and-pepper noise, and has good robustness to Gaussian noise and salt-and-pepper noise.
[0090] As Figure 4 shown in the segmentation results of natural images, (a1)-(a6) are the segmentation results of six different scenarios without adding noise, and (b1)-(b6) are the segmentation results of six different scenarios with different noises added. From Figure 4 it can be found that this scheme can achieve the segmentation of natural images in different scenarios, and can also achieve the segmentation of natural images with noise in different scenarios. Thus, the feasibility and effectiveness of this scheme for natural image segmentation are verified.
[0091] 2) Objective evaluation
[0092] To better analyze the experimental results, the above Figure 4 is objectively evaluated through four objective evaluation indicators, and the evaluation results are shown in Table 1 below:
[0093] Table 1
[0094]
[0095] Table 1 is the objective evaluation result of this scheme for natural image segmentation. Among them, the value ranges of the four objective indicators are [0,1]. The closer the objective evaluation value is to 1, the better the segmentation effect, and the closer it is to 0, the worse the segmentation effect. It can be seen from Table 1 that for the DSC evaluation indicator, the segmentation accuracy rate is in the range of 97.79% - 99.48%; for the Precision indicator, the segmentation accuracy rate is in the range of 98.67% - 99.99%; for the Recall evaluation indicator, the segmentation accuracy rate is in the range of 97.16% - 99.36%; for the JSC indicator, the segmentation accuracy rate is in the range of 95.68% - 99.14%, thus further verifying the effectiveness of this scheme for image segmentation.
[0096] This specification also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed in a computer, it causes the computer to execute the method in any one of the embodiments in the specification.
[0097] The present specification also provides a computing device, including a memory and a processor. An executable code is stored in the memory. When the processor executes the executable code, the methods in any one of the embodiments in the specification are implemented.
[0098] The modules or units in the device according to the embodiments of the present invention may be combined, divided, and deleted according to actual needs. The foregoing disclosure is only a preferred embodiment of the present invention, and of course, it cannot be used to limit the scope of the rights of the present invention. Those of ordinary skill in the art can understand all or part of the processes of implementing the above embodiments, and the equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.
Claims
1. A global image segmentation method based on global Gaussian distribution and statistical norm, characterized in that: include: An energy functional is constructed based on a global Gaussian distribution and a statistical norm; wherein the energy functional includes a level set function for characterizing image segmentation results; Get the pixel coordinates of the image to be segmented; Inputting the pixel coordinates of the image to be segmented into the energy functional, and iteratively calculating the level set function in the energy functional based on the gradient descent method, until the difference between the energy functional value calculated in the current round of iteration and the energy functional value calculated in the previous round of iteration is less than a preset accuracy threshold, and then terminating the loop iterative calculation; Outputting the final level set function of the image to be segmented; Among them, after each iterative calculation, if the condition for ending the loop iterative calculation is not met, the current level set function is updated, and the updated level set function is used for the next round of iterative update; The energy functional is constructed based on the global Gaussian distribution and the statistical norm, including: starting from the global information of the image, for each pixel in the image to be segmented, a global Gaussian distribution fitting energy is defined by taking the global mean and variance as variables, and the fitting energy of all pixels is integrated to construct the energy functional; Constructing the energy functional specifically includes: From a statistical point of view, the fitting energy is described using global Gaussian distributions with different means and variances, and the following primary energy functional is constructed: Among them, p i,x (I(x),μ i (x),σ i 2 (x), λ(x)) is the probability density function of the global regional intensity defined as a Gaussian distribution, i = 1, 2, Ω1 and Ω2 are the inner and outer regions of the image contour C to be segmented, respectively, then the following energy functional can be obtained: in, represents the energy functional, φ is the level set function, x is the pixel coordinate in the image to be segmented I(x), μ i (x) is the global mean, is the global variance, is the gray value at x and the average intensity value μ i (x), λ(x) is the degree of deviation from μ i (x), α1 and α2 are fixed equilibrium parameters, and H(φ(x)) is the Heaviside function.
2. The global image segmentation method based on global Gaussian distribution and statistical norm according to claim 1, characterized in that: The iterative operation of the level set function in the energy functional based on the gradient descent method includes: Step S31: configuring initial iteration parameters; wherein the iteration parameters include initial energy functional values; Step S32: Calculate the current energy functional with respect to μ i (x), Partial derivatives of λ(x); Step S33: Set the calculated partial derivatives to 0, and use the pixel coordinates of the image to be segmented to calculate μ i (x), The calculated value of λ(x); Step S34: The calculated μ i (x), Substitute the calculated value of λ(x) into the current energy functional to obtain the energy functional value; Step S35: determine whether the difference between the energy functional value currently calculated and the energy functional value calculated in the previous iteration is less than a preset accuracy threshold; if so, end the iterative operation; otherwise, after updating the level set function in the current energy functional, return to step S32 for execution.
3. The global image segmentation method based on global Gaussian distribution and statistical norm according to claim 2, characterized in that: In step S35, the updating of the level set function in the current energy functional includes: Calculating the partial derivative of the current energy functional with respect to the level set function; The level set function in the current energy functional is updated using the partial derivative of the current energy functional with respect to the level set function, and the new energy functional formed after the level set function is updated is used as the energy functional for the next iterative operation.
4. The global image segmentation method based on global Gaussian distribution and statistical norm according to claim 3, characterized in that: The updating of the level set function in the current energy functional by using the partial derivative of the current energy functional with respect to the level set function comprises: The level set function is updated using the following calculation formula: Among them, Δt is the time step.
5. The global image segmentation method based on global Gaussian distribution and statistical norm according to claim 1, characterized in that: After constructing the energy functional, further comprising: The constructed energy functional is modified using the following regularization term to ensure the smoothness of the level set function during the curve evolution process; Where p(φ(x)) is the regularization term, is the gradient of the level set function.
6. The global image segmentation method based on global Gaussian distribution and statistical norm according to claim 1, characterized in that: The preset accuracy threshold is 10 -3 .
7. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 6.
8. A computing device, comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 6 is implemented.