A variational level set image segmentation method and system based on KL divergence

Through the variational horizontal set image segmentation method based on KL divergence, the problems of uneven grayscale and unsatisfactory noise image segmentation effect are solved, and higher segmentation accuracy and robustness are achieved, and calculation time is reduced.

CN116824136BActive Publication Date: 2025-08-01SUZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310611012.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2025-08-01
Estimated Expiration
2043-05-29

AI Technical Summary

Technical Problem

The prior art has poor effect in grayscale image segmentation, especially in cases where grayscale uneven image and noise are present, it is difficult to take into account both the segmentation accuracy and speed.

Method used

The variable level set image segmentation method based on KL divergence is adopted. By constructing an energy function based on KL divergence and introducing a variable level set as a variable, combining Gaussian truncation function and length term, the iterative process is optimized to improve segmentation accuracy and robustness.

Benefits of technology

It improves the accuracy and robustness of grayscale image segmentation, reduces iterative calculation time, enhances the robustness of the initial contour, and can effectively deal with grayscale unevenness and noisy images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116824136B_ABST
    Figure CN116824136B_ABST
Patent Text Reader

Abstract

The present invention relates to a variational level set image segmentation method and system based on KL divergence. The method includes: Step S1: Obtain an image and convert the image into a grayscale image; Step S2: Based on the target to be segmented in the grayscale image, construct an energy function based on KL divergence; Step S3: Add the variational level set as a variable to the energy function based on KL divergence; Step S4: Solve the minimum value of the energy function to obtain the boundary of the target to be segmented in the grayscale image. The present invention can effectively segment the target of the grayscale image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image segmentation, and in particular to a variational level set image segmentation method and system based on KL divergence. Background Art

[0002] Image segmentation is an important research content in the fields of computer vision and image processing. The existing active contour models can be roughly divided into two categories: edge-based models and region-based models. In 1988, Osher and Sethian proposed the level set method based on geometric deformation models. Subsequently, some researchers improved the level set method. In order to keep the level set function approximately a signed distance function during the evolution process, it is necessary to re-initialize the level set function periodically. The initialization process is not only time-consuming but also prone to numerical errors. A typical improvement is that Kimmel considered the boundary gradient information of the image and proposed the idea of combining the CV model and the GAC model to achieve good segmentation of weak boundary images; Li et al. proposed the concept of a distance regularization term to avoid re-initialization of the level set during the level set evolution process, and then proposed the distance regularized level set model (DRLSE). DRLSE is based on the combination of distance regularization and gradient information. The model solves the problem that traditional geometric contour models need to be continuously re-initialized, but there is no way to select the direction of motion.

[0003] Region-based active contour models guide the curve to converge to the target contour based on the average image gray value. Therefore, better segmentation results can be obtained when segmenting blurred and noisy images. In 1989, Mumford and Shah proposed the MS model, which approximates the image with a piecewise smooth function and then optimizes the level set energy function. This energy function is non-convex, so the gradient descent method cannot be used to minimize the energy function. In 2001, Chan and Vese proposed the CV model based on MS. This model replaces the piecewise smooth function in the MS model with a piecewise constant function and adds a length term and an area term to control the evolution of the curve. Since the piecewise function represents the average gray values of the regions inside and outside the contour line and does not consider the local gray value changes, the application scope of the CV model is limited to images with uniform gray values. Li et al. proposed the Region Scalable Fitting (RSF) model in 2008. In the RSF model, the Gaussian kernel function embedded in the energy function provides a suitable local window, in which the local gray value information of the image is represented. Therefore, this model can overcome the influence of uneven gray values and correctly segment the target in the image. However, due to the introduction of the Gaussian kernel function, the curve evolution requires four convolution calculations in each iteration update, so the time of curve evolution is increased. In addition, the RSF model has extremely high requirements for the setting of the initial contour. A slight change in the initial contour easily makes the RSF energy function fall into a local minimum, thus affecting the result of curve evolution. In 2017, to solve the problems existing in the RSF model, Ding et al. proposed the Region Scalable Fitting and Optimized Laplacian of Gaussian (RSF&LOG) model. In the RSF&LOG model, the LOG energy is embedded in the RSF energy term to drive the contour line to evolve towards the boundary. The added LOG energy enhances the edge information of the image while reducing the sensitivity of the model to the initial contour line. However, the problem of slow RSF segmentation speed has not been solved yet. To improve the segmentation efficiency, Ding et al. proposed the Local Pre-Fitting (LPF) model in 2018. This model calculates the average gray values of the foreground and background in the local region before iteration, reducing the time consumed by the gray value mean fitting constant in the iterative update during the calculation. In 2019, Jin proposed the Adaptive functions and fuzzy c-means energy (AF&FCME) model, which establishes an energy equation by combining the adaptive function and the fuzzy c-means energy. The adaptive function effectively solves the problems of slow iterative convergence speed and edge leakage during the curve evolution process, improving both the target segmentation speed and the robustness of the initial contour.

[0004] The edge-based model has low computational complexity and fast target edge positioning speed. Among the region-based models, the model established based on global information has good robustness and fast speed, but it cannot process images with uneven gray levels. The model established based on local information has good effect in processing images with uneven gray levels and good noise robustness, but it is slow. Summary of the Invention

[0005] Therefore, the technical problem to be solved by the present invention is to overcome the technical problem of unsatisfactory gray image segmentation effect in the prior art.

[0006] To solve the above technical problem, the present invention provides a variational level set image segmentation method based on KL divergence, including:

[0007] Step S1: Obtain an image and convert the image into a grayscale image;

[0008] Step S2: Based on the target to be segmented in the grayscale image, construct an energy function based on KL divergence;

[0009] Step S3: Add the variational level set as a variable to the energy function based on KL divergence;

[0010] Step S4: Solve the minimum value of the energy function to obtain the boundary of the target to be segmented in the grayscale image.

[0011] In an embodiment of the present invention, when constructing the energy function based on KL divergence in step S2, it further includes improving the KL divergence, specifically:

[0012] Construct the KL divergence formula: where P(x) is the true distribution and Q(x) is the fitting distribution;

[0013] Set the grayscale image I as I = P, let i(x) = logI(x), and the fitting function is defined as q = logQ, then log(P(x) / Q(x)) in the KL divergence formula D(P||Q) = i(x) - q(x);

[0014] Construct a circular neighborhood O centered at point y with a radius of w y , and the formula is: O y ≈ {x|x - y ≤ w}, y ∈ Ω; where Ω represents the image domain of the grayscale image;

[0015] Assume that q(x) changes slowly, then within the circular neighborhood O y , q(x) ≈ q(y)|x ∈ O y , and update the KL divergence formula D(P||Q) to:

[0016] In one embodiment of the present invention, the energy function based on KL divergence is constructed in step S2, and the method includes:

[0017] Based on the image domain Ω of the grayscale image, the partition of the image domain Ω is Will induce the neighborhood O y Forming a local area

[0018] The local area Convert to: O y ∩C out , O y ∩C int , where C out , C int are the areas outside and inside the dividing line respectively, and the formula D y Updated to:

[0019] Define the Gaussian truncation function, the formula is: Where a is the normalization constant, σ is the standard deviation of the Gaussian cutoff function, and w is the circular neighborhood O. y The radius of w = 2σ;

[0020] The Gaussian truncation function is used to describe the circular neighborhood O y , then the circular neighborhood O y The updated formula D is zero outside the region. y Updated again to:

[0021] For all y in the image domain Ω, calculate D after updating again y The integral of , and use it as the energy function based on KL divergence, the formula is:

[0022] In one embodiment of the present invention, in step S3, the variational level set is added as a variable to the KL divergence-based energy function, and the method includes:

[0023] Construct the variational level set function φ, the formula is: Among them, Ω2 is a subset of the image domain Ω, is the boundary of Ω2, c0 represents the constant 1, and Ω2 is defined as M int (φ)=c0-φ(x);

[0024] Let r(y)=(i(x)-q(y))|x∈O y , since r(y) has a second-order differential characteristic near the target boundary, through M int (φ) approximates r(y), solving for M int(φ)-r(y) is minimized optimally, then the variational level set function φ is incorporated into the KL-divergence-based energy function, and the formula is: E(φ,q) = c·∫(∫G σ (x,y)|M int (φ)-(i(x)-q(y))|dy)·I(x)dx, where c is the target object symbol, c = 1 when segmenting the white target object, and vice versa c = -1.

[0025] In an embodiment of the present invention, solving for the minimum value of the energy function in step S4 includes:

[0026] Minimize the formula E(φ,q). For a fixed variational level set function φ, if the energy is minimized optimally, then q is expressed as: where * is convolution, and G σ *1 = ∫G σ (x,y)dy, is the best fitting function within the circular neighborhood O y ;

[0027] Update the formula E(φ,q) to:

[0028] And calculate the minimum value of the formula E KLD (φ);

[0029] When minimizing the formula E KLD (φ), the Euler-Lagrange equation is obtained. Using the standard gradient descent method, the equation is obtained and the value range fluctuation of is normalized.

[0030] In an embodiment of the present invention, normalizing the value range fluctuation of specifically includes:

[0031] Update the equation to obtain: where α is a constant, and τ = mean(I(x)).

[0032] In an embodiment of the present invention, when solving for the minimum value of the energy function in step S4, the calculation result is corrected by a regularization term and a length term.

[0033] In an embodiment of the present invention, the regularization term formula is: φ R = c0stretch(7·φ n );

[0034] In an embodiment of the present invention, the length term is constructed based on the regularization term, and the formula is: φL f(x) = A(y - x) * φ R f(y), y ∈ Ω x where Ω x represents a circular region centered at x with a radius of k

[0035] To solve the above technical problems, the present invention provides a variational level set image segmentation system based on KL divergence, including:

[0036] Conversion module: used to obtain an image and convert the image into a grayscale image;

[0037] Construction module: used to construct an energy function based on KL divergence based on the target to be segmented in the grayscale image;

[0038] Variable addition module: used to add the variational level set as a variable to the energy function based on KL divergence;

[0039] Solution module: used to solve the minimum value of the energy function to obtain the boundary of the target to be segmented in the grayscale image.

[0040] The above technical solutions of the present invention have the following advantages compared with the prior art:

[0041] The present invention creatively uses the Kullback–Leibler divergence to measure the degree of deviation of image points in a local area, and more correctly expresses the degree of deviation between the image point intensity and the fitting intensity. It improves the segmentation accuracy and at the same time improves the robustness of the system;

[0042] The present invention introduces a variational level set function into the energy function to directly approximate the reflection image function, which can accelerate the iteration process and improve the accuracy of image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to make the content of the present invention easier to be clearly understood, the present invention will be further described in detail below according to the specific embodiments of the present invention and in conjunction with the accompanying drawings.

[0044] Figure 1 is the flowchart of the method of the present invention;

[0045] Figure 2 is the experimental graph of the robustness of the initial contour line in the embodiment of the present invention;

[0046] Figure 3 is the experimental effect graph of the robustness of the length term of the present invention;

[0047] Figure 4 is the experimental effect graph of the robustness of the speed coefficient of the present invention;

[0048] Figure 5 It is the experimental effect diagram of the robustness of the local area parameters of the present invention;

[0049] Figure 6 It is the experimental effect diagram of the noise of the present invention;

[0050] Figure 7 It is the experimental comparison diagram of the model effect of the present invention. Specific implementation manners

[0051] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the exemplified embodiments are not intended to limit the present invention.

[0052] Embodiment 1

[0053] Refer to Figure 1 As shown, the present invention relates to a variational level set image segmentation method based on KL divergence, including:

[0054] Step S1: Obtain an image and convert the image into a grayscale image;

[0055] Step S2: Based on the target to be segmented in the grayscale image, construct an energy function based on KL divergence;

[0056] Step S3: Add the variational level set as a variable to the energy function based on KL divergence;

[0057] Step S4: Solve the minimum value of the energy function to obtain the boundary of the target to be segmented in the grayscale image.

[0058] The present invention will be introduced in detail below:

[0059] (1) KLD

[0060] Relative entropy, also known as Kullback–Leibler divergence, abbreviated as KLD, measures the energy loss (the difference between distributions) of the true distribution P(x) and the fitted distribution Q(x), that is, how much information is lost after fitting. In this embodiment, D(P||Q) is used to represent KLD, and the calculation formula is as follows:

[0061]

[0062] In the image segmentation, the calculation method of KLD is introduced. The real image is set as P = I, let i(x) = logI(x), and the fitting function is defined as q = logQ. log(P(x) / Q(x)) in formula (1) = i(x) - q(x), which is expressed as follows:

[0063] r(x) = i(x) - q(x) (2)

[0064] If r(x) in formula (2) can be understood as the reflectance of the image, and if it is assumed that the interference caused by environmental factors and the like is slowly varying, then q(x) can be understood as the non-uniformity function in the image.

[0065] To satisfy that the function q(x) is slowly varying, a local small region O can be introduced in this embodiment y , O y is a circular neighborhood centered at point y with a radius of w, and its definition is: O y ≈ {x|x - y ≤ w}, y ∈ Ω. The above assumes that the function q(x) is slowly varying, so it can be considered that within its local region, q(x) ≈ q(y)|x ∈ O y . The KLD formula within the central point of the local neighborhood in formula (1) is rewritten as:

[0066]

[0067] (II) Expression method of the local region

[0068] The result of image segmentation is an effective set of sub-regions of the image, and each pixel in the sub-region has similarity under a certain characteristic measurement. Adjacent regions are very different under a certain characteristic measurement. Then, the partition of the entire image domain Ω will induce the neighborhood O y , forming

[0069] The object of study in this embodiment is the two-phase gray-scale image segmentation, that is, to segment the bright (or dark) target object. Assuming that the segmentation target is bright, when the segmentation line encloses the target object, it is actually calculating the area of the integral of the region function within the segmentation line, and this method is the same as the aforementioned GAC model. If the segmentation target is dark, to maintain the consistency of the model, the image is complemented and inverted. The segmentation of the image target can be divided into two types. One type of target object has a bright value (higher than the background), and the other has a dark value (lower than the background). The calculation processes of these two methods are exactly opposite, and this problem can be solved by complementing and inverting the gray-scale image. The above two partitions can be expressed as: O y ∩C out , O y ∩C int . Among them, C out , C int are the regions outside and inside the segmentation line respectively. Formula (3) is rewritten as:

[0070]

[0071] Here, in this embodiment, a Gaussian truncation function is defined as follows:

[0072]

[0073] where a is a normalization constant, σ is the standard deviation (or scale parameter) of the Gaussian truncation function, and w is the radius of the circular neighborhood O y and generally w = 2σ is adopted.

[0074] The circular neighborhood O can be described by the Gaussian truncation function, y and the key is to calculate r(y) = (i(x) - q(y))|x∈O y where it is zero outside the region O y Thus, formula (4) is rewritten as follows:

[0075]

[0076] For all y in the image domain Ω, calculate the integral of D y and an energy function based on the KL divergence can be defined as follows:

[0077]

[0078] (III) Variational level set model

[0079] In the level set method, a contour C is represented by the zero level set through a Lipschitz function φ, and φ is a function of the signed distance function that represents the partition of two non - overlapping regions Ω1(C out ) and Ω2(C int ) of the region Ω. The aforementioned dividing line is the zero level set, and the variational level set function φ is defined as follows:

[0080]

[0081] where Ω2 is a subset of the image domain Ω, is the boundary of Ω2, and c0 represents the constant 1.

[0082] The partitions Ω1 and Ω2 can be defined as M out (φ) = c0 + φ(x) and M int (φ) = c0 - φ(x) respectively.

[0083] Analyzing formula (7), when the image point y is near the target boundary, r(y) = (i(x) - q(y))|x∈O yThere are drastic changes. Point y is outside the target boundary, r(y) < 0. Conversely, r(y) > 0. Point y is on the target boundary, r(y) ≈ 0. Point y is far from the boundary region, r(y) ≈ 0. r(y) has second-order differential characteristics near the boundary. Therefore, in this embodiment, the characteristics of r(y) can be utilized to directly introduce M int to approximate r(y), that is, to solve the optimum of minimizing M int (φ) - r(y). By exchanging the integral, the specific variational level set energy function is defined as follows:

[0084] E(φ, q) = c·∫(∫G σ (x, y)|M int (φ) - (i(x) - q(y))|dy)·I(x)dx (9)<{

[0085] where c is the target object symbol, for segmenting the white target object c = 1. Conversely, c = -1.

[0086] [[ID = 17]]Minimizing formula (9), for a fixed φ, the optimum that minimizes the energy, q is expressed as:

[0087]

[0088] In formula (10), * is convolution, G σ *1 = ∫G σ (x, y)dy, is the best fitting function within the region O y Based on the energy formula of the variational level set function, it is rewritten as follows:

[0089]

[0090] Minimizing formula (11), the Euler - Lagrange equation can be obtained. By using the standard gradient descent method, the following equation can be obtained:

[0091]

[0092] Due to the diversity and difference of images, in formula (12), the value range varies greatly, which will increase the difficulty of the experiment and the robustness of the system. Therefore, in this embodiment, a function is designed to standardize the fluctuation of the value range and improve the sensitivity at its zero-crossing point. By rewriting formula (12), the variational level set method of KL divergence is as follows:

[0093]

[0094]

[0095] where α is a constant, τ = mean(I(x)).

[0096] There is only one energy term in Equation (13), without the length term and the regularization term in the traditional model.

[0097] The level set evolution formula is as follows:

[0098]

[0099] In Equation (15), Δt is the iteration step size, which is the data-driven term.

[0100] (IV) Regularization

[0101] During the evolution of the level set function, if it moves in a certain direction for a long time, for example tends to the negative value region, the contour line expands outward, the distance rule inside and outside the original contour line becomes weak or disappears, and the model shows oscillation phenomena. To ensure the robustness of the model, during the iteration, the distance rule of the level set function is ensured.

[0102] The present invention adopts a non-linear stretching after each iteration. The purpose is to increase the slope of the small region of the zero-crossing point, strengthen the distance rule of the level set function, and at the same time, smooth the slopes on both sides of the level set function, limit the output value range, and complete the regularization of the level set function. The formula is defined as follows:

[0103] φ R = c0stretch(7·φ n ) (16)

[0104] (V) Length term function

[0105] Due to the existence of noise, the evolution speed and direction are different, and the contour line will split into many closed small regions during the evolution process. At the same time, the contour line becomes uneven. The present invention proposes a solution. The length term function adopts a circular neighborhood mean truncation function, which is defined as follows:

[0106] φ L (x) = A(y - x) * φ R (y), y ∈ Ω x (17)

[0107] where Ω x represents a circular region centered at x with a radius of k, and A(y - x) is defined as follows:

[0108]

[0109] The circular neighborhood mean truncation function can effectively filter out the noise targets generated during the evolution. At the same time, it can smooth the contour line, the function parameters are relatively stable, realizing the function of the length term, and solving the shortcoming of the weak robustness of the traditional length term.

[0110] Experimental description:

[0111] (1) Robustness of the initial contour line of the KLD model

[0112] The robustness of the initial contour line is an important indicator of the model. Four different interference images are selected for the initial contour line experiment, as Figure 2 shown. The experiments show that the present invention has good robustness. Of course, due to different positions, it will affect the iteration speed.

[0113] (2) Robustness of the length term

[0114] The length term function defined by formula (17) can effectively filter out small-area noises. At the same time, it can effectively smooth the zero-level contour line. Generally, the coefficient size should be set according to the characteristics of the segmentation object to better obtain a satisfactory segmentation effect. For example, when segmenting right angles or small targets, the coefficient should be selected to be smaller. The experimental results are as Figure 3 shown. The experiments show that the parameters of the present invention show stable segmentation effects when k = 2 - 6, but it will affect the operation speed.

[0115] (3) Robustness of the α coefficient

[0116] The purpose of setting the α coefficient is to effectively control the iteration speed. The size of the speed is related to the clarity of the boundary. If the boundary is blurred, the speed must be reduced. On the contrary, the speed can be increased, but this parameter must ensure robustness. The robustness experiment of the speed parameter is as Figure 4 shown. The experiments show that within a certain range, by adjusting the α coefficient, while improving the operation speed, good robustness can be maintained.

[0117] (4) Robustness of the σ coefficient

[0118] The σ coefficient determines the size of the local area and the kernel parameter. The area size is (4σ + 1) × (4σ + 1). The setting of the σ coefficient will affect the boundary segmentation, especially for non-uniform images. In order to ensure accurate segmentation of the target, the σ coefficient should be set within a reasonable range. As Figure 5 shown. The experiments show that within a certain range, the robustness of the present invention can be ensured.

[0119] (5) Noise resistance ability

[0120] The noise experiment is an important part of the model robustness. In this paper, Gaussian noise with a mean m = 0 and a variance var = 0.05 (σ ≈ 57) is artificially added to grayscale images, and the following eight images are subjected to the noise experiment. As Figure 6 shown, the experiment shows that within a certain range, the robustness of the present invention can be guaranteed.

[0121] (6) Model comparison

[0122] The basic algorithm of the RSF&LoG model is to use the optimized image edge characteristics (Laplace of Guassian) combined with the local region fitting data in the RSF model, aiming to improve the segmentation accuracy and the robustness of the system, but it will increase the computational cost.

[0123] LPF&FCM is an edge level set model. The feature of the model is that before iteration, based on the fuzzy C-means clustering principle of the local region, two fuzzy central points inside and outside the contour line are fitted in advance, and an adaptive edge indicator function is constructed, which solves the one-way movement problem of the edge level set model.

[0124] The PBC model is a non-uniformity bias field correction model. Using the fuzzy C-means clustering principle of the local region, the fitting function of the non-uniformity bias field of the model is calculated in advance. This model has a high segmentation accuracy and the robustness of the system is also stable.

[0125] The LGJD model is a hybrid calculation method that uses the CV model in the early stage and switches to the RSF model in the later stage. The Jeffreys divergence principle is used to measure the difference between the model fitting function and the image, and the zero level set function is driven to the target boundary to complete the segmentation.

[0126] Figure 7 It is to compare the regional model, edge model, bias field correction model, hybrid active contour model and second-order differential feature model (RSF&LoG, LPF&FCM, PBC, LGJD, OSF) published in top journals in the past four years with the method of the present invention in terms of speed and accuracy, and their parameter settings refer to the literature. The experimental results are as Figure 7 and Table 1 show. The experiment shows that the KLD model has obvious advantages over other models, especially in terms of running speed.

[0127] Table 1 Experimental comparison table

[0128] RSF&LoG LPF&FCM PBC LDJD RKLD I(481*321) 0.809 / 14 0.522 / 31 0.778 / 10 0.770 / 7.0 0.812 / 3.6 J(321*481) 0.810 / 24 0.820 / 21 0.938 / 3.5 0.812 / 10 0.922 / 2.6 K(481*321) 0.850 / 18 0.862 / 2.7 0.823 / 2.8 0.814 / 9.8 0.931 / 1.4

[0129] The calculation accuracy is measured by the intersection over union (IOU), that is, the Jaccard Similarity Coefficient (JSC) formula is as follows:

[0130]

[0131] Among them, A s represents the model segmentation area, and B s represents the evaluation database area, and calculates the target intersection over union of the segmentation object.

[0132] Embodiment 2

[0133] This embodiment provides a variational level set image segmentation system based on KL divergence, including:

[0134] Conversion module: used to obtain an image and convert the image into a grayscale image;

[0135] Construction module: used to construct an energy function based on KL divergence based on the target to be segmented in the grayscale image;

[0136] Variable addition module: used to add the variational level set as a variable to the energy function based on KL divergence;

[0137] Solution module: used to solve the minimum value of the energy function to obtain the boundary of the target to be segmented in the grayscale image.

[0138] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0139] Obviously, the above embodiments are merely examples given for clear illustration and are not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or variations can be made based on the above description. It is not necessary and impossible to enumerate all the implementation manners here. And the obvious changes or variations derived therefrom still fall within the protection scope of the present invention.

Claims

1. A variational level set image segmentation method based on KL divergence, characterized in that: Including: Step S1: Obtain an image and convert the image into a grayscale image; Step S2: Based on the target to be segmented in the grayscale image, construct an energy function based on the KL divergence; When constructing the energy function based on the KL divergence in Step S2, it further includes improving the KL divergence, specifically: Construct the KL divergence formula: where P(x) is the true distribution and Q(x) is the fitted distribution; Set the grayscale image I as I = P, let i(x) = logI(x), and the fitting function is defined as q = logQ, then log(P(x) / Q(x)) in the KL divergence formula D(P||Q) = i(x) - q(x); Construct a circular neighborhood O centered at point y with a radius of w y , and the formula is: O y ≈ {x|x - y ≤ w}, y ∈ Ω; where Ω represents the image domain of the grayscale image; Let \(q(x)\) be slowly varying. Then, within the circular neighborhood \(O\) y , \(q(x)\approx q(y)\) for \(x\in O\) y , and update the KL divergence formula \(D(P||Q)\) to: In Step S2, the method for constructing the energy function based on the KL divergence includes: Based on the image domain Ω of the grayscale image, the partitioning of the image domain Ω will induce a neighborhood O y to form a local region Convert the local area to: O y ∩C out 、O y ∩C int , where C out , C int are the outer and inner regions outside the dividing line respectively. Update the formula D y to: Define the Gaussian truncation function, with the formula: where a is the normalization constant, σ is the standard deviation of the Gaussian truncation function, and w is the radius of the circular neighborhood O y and w = 2σ; Describe the circular neighborhood O with the Gaussian truncation function y , then outside the region of the circular neighborhood O y is zero, and update the updated formula D y again to: For all y in the image domain Ω, compute the integral of D after the re-update and use it as the energy function based on the KL divergence, with the formula: y ​ Step S3: Add the variational level set as a variable to the energy function based on the KL divergence; When adding the variational level set as a variable to the energy function based on the KL divergence in Step S3, the method includes: Construct a variational level set function φ with the formula: where Ω2 is a subset of the image domain Ω, is the boundary of Ω2, c0 represents the constant 1, and Ω2 is defined as M int (φ) = c0 - φ(x); Let \(r(y)=(i(x)-q(y))|_{x\in O}\) y , since \(r(y)\) has second-order differential characteristics near the target boundary, approximate \(r(y)\) by \(M\) int (\varphi)\), solve the optimum of minimizing \(M\) int (\varphi)-r(y)\), then incorporate the variational level set function \(\varphi\) into the KL-divergence-based energy function, and the formula is: \(E(\varphi,q)=c\cdot\int(\int G\) σ (x,y)|M int (\varphi)-(i(x)-q(y))|dy)\cdot I(x)dx\), where \(c\) is the target object symbol, \(c = 1\) when segmenting a white target object, and vice versa \(c=-1\); Step S4: Solve the minimum value of the energy function to obtain the boundary of the target to be segmented in the grayscale image; When solving the minimum value of the energy function in Step S4, it includes: Minimize the formula E(φ,q). For a fixed variational level set function φ, the optimal one that minimizes the energy, then q is expressed as: where * is convolution, and G σ *1 = ∫G σ (x,y)dy, is the best fitting function within the circular neighborhood O y ; Update the formula E(φ,q) to: and calculate the minimum value of the formula E KLD (φ); When minimizing the formula E KLD (φ), the Euler - Lagrange equation is obtained. Using the standard gradient descent method, the equation is obtained and the fluctuations in the value range generated are normalized.

2. The variational level set image segmentation method based on KL divergence according to claim 1, characterized in that: The pair of The generated value range fluctuations are regulated, specifically as follows: Update the equation to obtain: where α is a constant and τ = mean(I(x)).

3. The variational level set image segmentation method based on KL divergence according to claim 2, characterized in that: When solving the minimum value of the energy function in Step S4, correct the calculation result through a regularization term and a length term.

4. The variational level set image segmentation method based on KL divergence according to claim 3, characterized in that: The regular term formula is: φ R = c0stretch(7·φ n ).

5. The variational level set image segmentation method based on KL divergence according to claim 4, wherein: The length term is constructed based on the regular term, and the formula is: φ L (x) = A(y - x) * φ R (y), y ∈ Ω x , where Ω x represents a circular region centered at x with a radius of k, 6. A variational level set image segmentation system based on KL divergence, which is used to implement the variational level set image segmentation method based on KL divergence according to any one of claims 1 to 5, characterized in that: Including: Conversion module: Used to obtain an image and convert the image into a grayscale image; Construction module: Used to construct an energy function based on the KL divergence based on the target to be segmented in the grayscale image; Variable addition module: Used to add the variational level set as a variable to the energy function based on the KL divergence; Solution module: Used to solve the minimum value of the energy function to obtain the boundary of the target to be segmented in the grayscale image.

Citation Information

Patent Citations

  • Method for segmenting object from image data set, involves providing implicit form model for segmenting object from training data records

    DE102008036812A1

  • Image Processing Method and Apparatus, Computer Device, Storage Medium, and Program Product

    US20230051411A1