A hybrid level set model for image segmentation

Active contour models driven by local binary fitting energy can segment images with inhomogeneous intensity, while being prone to falling into a local minima. However, the segmentation result largely depends on the location of the initial contour. We propose an active contour model with global and local image information. The local information of the model is obtained by bilateral filters, which can also enhance the edge information while smoothing the image. The local fitting centers are calculated before the contour evolution, which can alleviate the iterative process and achieve fast image segmentation. The global information of the model is obtained by simplifying the C-V model, which can assist contour evolution, thereby increasing accuracy. Experimental results show that our algorithm is insensitive to the initial contour position, and has higher precision and speed.


Introduction
With the development of electronic computers, as well as the extensive practical needs in military, industry, and medicine, the field of digital image processing has emerged [1][2][3][4]. People use computers to process graphics and images, and segment the target Region of Interest (RoI) in digital images. Image segmentation has a direct impact on subsequent operations, such as image recognition, analysis and understanding [5][6][7].
Among existing segmentation methods, the active contour model (ACM) [8] has unique advantages. This technique minimizes an energy function to drive the initial contour to reach the boundary of the target region, to extract the RoIs. According to the different contour construction modes, it can be divided into parametric active contour model [8][9][10][11][12][13] and geometric active contour model .
In 1998, Osher [36] proposed the level set method, which presents the closed contour in an implicit way. This avoids tracking the contour evolution process, transforms the contour evolution into a pure partial differential equation (PDE) solution, and solves the problem of splitting and merging of contours. However, the level set method is numerically unstable after contour model driven by local and global intensity fitting energy (LGIF) [28]. In Section 2, we describe the structure of the proposed model in detail. Experimental results and analysis are given in Section 3. Finally, concluding remarks are given in Section 4.

C-V model
Chan and Vese [24] proposed the famous borderless active contour model. Assuming that the gray level of an individual region of an image is homogeneous, for a given image I 0 (x, y), (x, y) 2 O, is divided by a closed contour C into internal and external area, namely O 1 and O 2 , respectively. Henceforth, c 1 , c 2 are the average grey values of O 1 , O 2 , then the energy functional structure of C-V model in the form of a level set function ϕ is defined as: where μ � 0, λ 1 > 0, λ 2 > 0, the ϕ is defined as the distance function below: H ε (ϕ) is the heaviside function of ϕ in the numeric implementation, and the Dirac function δ ε is the first derivative of H ε (ϕ): Taking the partial derivative of the energy E with respect to c 1 and c 2 , and setting them to 0, we get the average gray values of c 1 , and c 2 as: According to the variational principle, the partial differential equation for ϕ is: The C-V model performs well in images with simple geometric structure and the grayscale equalized image. Also, it is able to segment the image without a gradient defined boundary.
While it behaves poorly for uneven gray scale and more complex images, such as the case of target crossings and object occlusion. In addition, the level set function needs to be re-initialized after certain contour updates, which requires a large amount of computation time.

LBF model
In view of the poor performance in images with intensity inhomogeneity for C-V model, Li et al. [26] proposed a local strength fitting energy function: In (6), the kernel function K σ is defined as: f 1 , f 2 are two numbers of local intensities, which is calculated as: Because of the localization and characterization kernel function K σ , the fitting center f 1 and f 2 are only affected by the points within a certain range, which is essentially different from c 1 and c 2 in the C-V model. The LBF model solves the problem of the C-V model not being able to segment grayscale non-uniform images. However, because of the gaussian kernel, the energy can easily fall into a local optimal. Thus, the segmentation results depend on the settings of the initial contour. Besides, in the actual calculation, the convolution operation (8) is time consuming.

LIF model
Zhang et al. [27] proposed the Local Image Fitting (LIF) model, with the energy function defined as: where E LIF is defined as: where m 1 (x) and m 2 (x) can be regarded as the average of the image intensity in the window

PLOS ONE
W k (x). Therefore, m 1 (x) and m 2 (x) are equivalent to f 1 and f 2 in the LBF model. Utilizing local image information, the LIF model is able to segment images with uneven intensity and only employ half of the convolution operations compared to the LBF model. However, it is still sensitive to initialization, like the LBF model.

LGIF model
Based on the predecessors, Wang et al. [28] introduced the global fitting energy of the C-V model into LBF and proposed a hybrid model in which global and local information working together; with the energy function defined as: where E GIF is the global fitting energy, consistent with the fitting item in the C-V model, and ω is the weight coefficient: LGIF improves the segmentation accuracy of LBF and adds robustness, to introduce a new way to segment images. However, its weights are set manually, which makes it weaker for applications.

Proposed method
Enlightened by the previous work above, a hybrid model based on level sets is proposed, with the energy function defined as: In (13), E G is the global and E L the local fitting components, and E R is the regularization term. ω 2 [0, 1] controls the significance of the global vs. local components during contour evolution. ω can be tuned according to the degree of gray scale inhomogeneity. The more homogenous the image is, the greater the value of ω is; i.e., the more dominant the global driving is. On the contrary, the higher the degree of gray scale imbalance, the less the value of omega is; i.e., the more dominant the local driving is.
Herein, the simplified form of fitting in the C-V model serves as E G . [32] pointed out that the numerical calculation of (5) is unstable, which led to complex implementation. Thus, we derive a simplified form of (5). As shown in [20], the main forces driving the evolution of the level set are −λ 1 (I 0 − c 1 ) 2 + λ 2 (I 0 − c 2 ) 2 . Therefore, we set λ 1 = λ 2 = 1, and convert it to 2ðc 1 À c 2 Þ I 0 À c 1 þc 2 2 À � by using the squared difference. Furthermore [37], pointed out that in the process of level set evolution, the hard threshold c 1 þc 2 2 determines each pixel on the change of the level set function ϕ. Thus, 2(c 1 − c 2 ) can be set to a constant. To facilitate the global fitting term, we set 2(c 1 − c 2 ) = 1, then put it into the energy function to obtain the reduced global fitting as: When solving (14), a Hamilton-Jacobi differential equation can be obtained, whose speed is I 0 À c 1 þc 2 2 . According to the evolution law of Hamilton-Jacobi differential equation, when the velocity is greater than zero, the contour moves along the direction opposite to the normal; otherwise, it moves along the normal direction. The driving force of the contour is simple, which can accelerate the evolution of the contour, and has a good segmentation effect for simple homogeneous images. Fig 1 shows the results of the simplified model on the segmentation of the synthesized simple image. However, when the image is not uniform, the target cannot be obtained correctly, as shown in Fig 2. Next, we define the local fitting term: where G σ refers to the weighted Gaussian function on gray scale and distance, namely weighted bilateral filtering [38], shown as follows:

PLOS ONE
This function takes into account both spatial distance and image value differences, so that a point far away from the edge will only slightly affect pixel values on edges. As a result, it helps suppress noise and retain boundaries as well. Take the composite image in O k of window size k is the neighborhood of (x i , y i ), we have where

PLOS ONE
According to Eqs (17) and (18), for a given square O k , once k m is calculated directly, the area O is split into two parts; i.e. O s and O l , in the light of the gray value in relation to k m . This is shown in Fig 4. In addition, in order to keep the equation stable during evolution and avoid reinitialization, a regularization term is added: To sum up, for a given image I 0 2 R 2 (O), the ultimate energy function of level set is formulated as: where ω 2 [0, 1]. When ω = 1, the model has no local fitting term and degenerates into the simplified form of C-V model with a regularization term. Minimizing the function E, the

PLOS ONE
evolution equation can be computed as: where δ ε is defined in (3), e c , e s and e l are presented as: Applying the finite difference method to discretize: (21): where A i,j , B i,j and C i,j are calculated as: where Δt is the iteration step. The segmentation procedure of the proposed method can be summarized as: Step 1: Set parameters, to define the initial contour C, initialize ϕ 0 .
Step 2: Calculate c 1 and c 2 via (4), and calculate k s and k l via (17).
Step 3: Update the level set function via (21).
Step 4: Judge whether convergence is achieved. If the stability condition is reached, stop iteration and obtain the segmentation result. If not, go to Step 2.

Experimental results and analysis
In order to verify the effectiveness of the proposed algorithm, this section presents experimental results and comparisons to related methods. The experimental environment include: CPU i5 Gen, 8GB running memory, Windows 10 64-bit operating system, MATLAB R2016a. In the experiments, the initial level set function ϕ 0 is set to a small constant function ϕ 0 = c 0 . If there is no special explanation, the parameters are set as: c 0 = 2, μ = 0.01 × 255 2 , v = 2, ε = 2, Δt = 0.1, k = 13 and σ = 2. The weight coefficient ω is adjusted according to the complexity of the image. For images with high noise and contrast, ω is greater than 0.5 to ensure the evolution rate of the image. For low-contrast images, the ω is less than 0.5. Fig 5 shows the segmentation process and results for different images.
In Fig 5, the first row shows composite images, with heavy shadows. The second row shows salpingography images, with low contrast. The third row shows real images of blood vessels, with inhomogeneous intensities. The fourth row shows images of birds with uneven gray scales. The fifth and sixth rows are composite images with noises. The seventh row displays the composite noisy image with uneven illumination. The images in the last row are of a real heart. These images are characterized by low contrast, high noise and blurred edges. It is clear

PLOS ONE
that the algorithm proposed extract exact boundaries, which are in line with visual judgements. Some parameters are listed in Table 1. Others are default values mentioned above.
In Fig 6, under the premise of initial contour outlined in first row, the results of LBF, LIF, LGIF and the proposed method are close, while the results of C-V and GLSE are not ideal. In the case of three different initial contours, The three results are not very different in the LIF, LOGF model and the proposed method, that indicate these three models are insensitive to the position of the initial contour. In contrast, C-V, LBF, LGIF and GLSE obtained different results under the three initial contours, indicating that the results are easily affected by the initial contour. Fig 7 is a real blood vessel image with low contrast. Similarly, after adjusting the parameters with the initial contour I 1 , each model achieved its best segmentation results. When other parameters are unchanged, only the initial contour is changed, and the segmentation results are changed accordingly. However, GLSE and our model does not have such a problem.

PLOS ONE
LIF models split the target only under contour I 1 , However, no matter how LOGF and GLSE model adjust parameters, the target is not segmented. Fig 9 is a composite image with inhomogeneous gray scales. Both the LOGF model and the model presented in this paper obtain satisfactory results under three initial contours, while the LBF, LGIF, GLSE model only gets correct results under the initial contour I 1 .
Through experimental results comparison with other models in Figs 7-9, the proposed algorithm prevails in different scenarios under the premise of any initial contours. in other models, the change of the initial contour will lead to the error of segmentation results. some of the parameters, such as scale parameter and length term coefficient, must be adjusted in order to get the correct result, and this is a complex process.
In Table 2, under the condition of the first initial profile, iterations and execution times are listed. Note that we only list the time and number of iterations in the case of the initial contour I 1 , because from the visual point of view, the segmentation result of the first initial contour is the best. The GLSE model has the longest segmentation time, because it needs to calculate Note that only the proposed algorithm successfully extracts fine boundaries.
Naturally, Jaccard similarity coefficient (JSC) and Dice similarity coefficient (DSC) [39] are popular to quantitatively evaluate the performance of segmentation results. These are defined below: where S g represents the ground truth, and S m represents the segmented regions. When the JSC

PLOS ONE
and DSC are closer to 1, the image segmentation is better. Specifically JSC = DSC = 1, means that the detected region is identical to the ground truth. Table 3 demonstrates the JSC and DSC of Figs 6-9. The JSC and DSC is in the case of the initial contour I 1 , The ground truth are obtained by manual segmentation, see Fig 10. Table 4 shows the JSC and DSC coefficients of Fig 11, whose images are taken from the Weizmann database [40]. In addition, JSC and DSC in Tables 3 and 4 are represented by broken line graphs, As shown in Figs 12 and 13.
As can be seen from Figs 12 and 13, the C-V model with global information has the worst segmentation results for Figs 6-11. However, the segmentation results of LIF model, LGIF model and the proposed model is relatively stable. The segmentation results of LBF model, LOGF model and GLSE model fluctuate greatly.
To sum up, in comparison with the other six models, our method can better balance segmentation accuracy and efficiency. It requires less time and iterations; it is not sensitive to the initial contour; and it improves the C-V, LBF and LGIF models and substantially enhances their accuracy and efficiency.

Conclusion
For accurate segmentation in inhomogeneous images and fast evolution iterations, we proposed an improved active contour model. According to the curve evolution theory, the C-V model is simplified. At the same time, new local and global fitting term are incorporated to build a new energy function, which helps in image segmentation for sophisticated applications. Furthermore, our method is simple to initialize, takes less time to calculate, converges faster iteratively, and is more robust to pixel perturbations. Experiments and subjective assessment indices proved the effectiveness and efficiency of our approach.