Journal of Electrical and Computer Engineering

Volume 2019, Article ID 9014217, 17 pages

https://doi.org/10.1155/2019/9014217

## Shape Prior Embedded Level Set Model for Image Segmentation

^{1}Aviation Maintenance School for NCO, Air Force Engineering University, Xinyang 464000, China^{2}School of Aeronautics and Astronautics, University of Electronic Science and Technology of China, Chengdu 611731, China^{3}Aircraft Swarm Intelligent Sensing and Cooperative Control Key Laboratory of Sichuan Province, Chengdu 611731, China

Correspondence should be addressed to Dengwei Wang; moc.621@iewgnedw

Received 16 March 2019; Revised 9 June 2019; Accepted 26 June 2019; Published 9 July 2019

Academic Editor: Maurizio Martina

Copyright © 2019 Wansuo Liu et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

This paper presents an optimized level set evolution (LSE) without reinitialization (LSEWR) model and a shape prior embedded level set model (LSM) for robust image segmentation. Firstly, by performing probability weighting and coefficient adaptive processing on the original LSEWR model, the optimized image energy term required by the proposed model is constructed. The purpose of the probability weighting is to introduce region information into the edge stop function to enhance the model’s ability to capture weak edges. The introduction of the adaptive coefficient enables the evolution process to automatically adjust its amplitude and direction according to the current image coordinate and local region information, thus completely solving the initialization sensitivity problem of the original LSEWR model. Secondly, a shape prior term driven by kernel density estimation (KDE) is additionally introduced into the optimized LSEWR model. The role of the KDE-driven shape prior term is to overcome the problem of image segmentation in the presence of geometric transformation and pattern interference. Even if there is obvious affine transformation in the shape prior and the target to be segmented, the target contour can still be reconstructed correctly. The extensive experiments on a large variety of synthetic and real images show that the proposed algorithm achieves excellent performance. In addition, several key factors affecting the performance of the proposed algorithm are analyzed in detail.

#### 1. Introduction

Image segmentation is an important intermediate step in the field of computer vision, which aims to partition a given image into a set of nonoverlapping regions where the internal pixels are homogeneous with respect to intensity, color, texture, motion, semantics, etc. Its output quality directly determines the success or failure of higher level visual tasks such as 3D reconstruction, motion analysis, pattern classification, and object recognition. Among various types of image segmentation theories, the LSMs are widely used because they are capable of outputting closed and smooth target contours and can naturally handle topology changes. The core idea of this type of method is constructed by Osher and Sethian [1], and its key is to implicitly represent contour as the zero level set of a higher dimensional level set function (LSF) and then compute a time-dependent equation to obtain a deforming surface.

According to the types and properties of image features (local features or global features) used by these models in building their energy functions (usually composed of external energy terms and internal energy terms), we can roughly divide the existing popular LSMs for image segmentation into the following three categories: edge-based methods [2–8], region-based methods [9–16], and hybrid fitting energy-based methods [17–21].

Edge-based methods usually rely on gradient information to construct their core energy items. When the edge features of the image are clear and the background noise level of the image is not high, they can achieve good segmentation results. However, when there is a certain amount of noise in the image or the edge of the target is very blurred (the corresponding gradient amplitude is very small), the evolution process of such models generally exhibits the following problems: falling into local minima (easy to be pulled by background noise information to the wrong location), edge leakage (unable to locate the blurred target edges), and sensitive to initialization (the final segmentation result is directly related to the position and shape of the initial contour).

For example, the image gradient-driven geodesic active contour (GAC) model proposed by Caselles et al. [2] does achieve good segmentation results on image data with significant gradient strength. However, when there is noise in the image or the gradient strength of the target is not obvious, its segmentation accuracy will drop sharply, and it will synchronously present the series of problems mentioned above. Li et al. [3] proposed a segmentation framework called level set evolution (LSE) without reinitialization (LSEWR), which is also based on the gradient information of the image. The framework does output good segmentation results on some high-quality images. However, it has two obvious drawbacks: one is that the speed of curve evolution cannot be adaptively changed with the change of local image characteristics, and the other is that its segmentation result is highly sensitive to initialization.

Region-based methods usually rely on the statistical information of the region (local region or global region) inside and outside the active contour to construct their dominant energy terms. The common regional information elements have intensity, color, texture, motion characteristics, etc. Compared with edge-based methods, such methods have significant performance improvements in terms of weak edge capture, background noise suppression, and insensitivity to initialization. However, this type of method also has obvious shortcomings, i.e., they sometimes cannot accurately locate the true target edge. For example, Chan and Vese (C-V) [9] constructed an energy functional based on global region information, which can effectively measure the difference between the current pixel value and the statistical mean of the region. Applying it to images without obvious edges or even without edges can usually achieve good segmentation results. However, in many cases, it cannot give high-precision edge location. Li et al. [14] constructed a region scalable fitting (RSF) energy model for inhomogeneous image segmentation based on the local statistical information (the local region mean in the Gaussian-weighted window) of the image. By using a Gaussian distribution with different local means and variances to describe the local image intensity, Wang et al. [15] constructed a LSM called local Gaussian distribution fitting (LGDF) energy model for image segmentation. Zhang et al. [16] presented an active contour model driven by local image fitting (LIF) energy model whose energy functional is defined by minimizing the difference between the fitted image and the original image. The previous three local region information-driven LSMs have achieved good segmentation on most images, but they all have an obvious drawback, i.e., their segmentation results are highly sensitive to the position and shape of the initial curve; that is to say, different initialization methods may correspond to different segmentation results. In Section 4.1, we will set up a section to study this problem.

In order to overcome the shortcomings of the above two types of methods and reasonably inherit the advantages of each type of method, the hybrid fitting models driven by the energy terms of hybrid nature were born. By integrating the energy elements of the edge-based and region-based models in different forms and supplemented by different forms of coupling coefficients, they show different superiority in different applications. However, such models sometimes have the following two problems: (1) the complexity of the numerical discretization process, i.e., the time complexity of the evolution process, is often very high and (2) it is easy to produce a situation where the regional terms and the edge terms are difficult to balance. At this time, the evolution process will lead to erroneous and strange driving forces, resulting in unexpected fluctuation in the evolution process. For example, Wang Li et al. [21] constructed a hybrid LSM called local and global intensity fitting (LGIF) energy model for image segmentation. It couples the energy functional components of the C-V model [9] and the LIF model [16] together through a constant coefficient. In some image data segmentation tasks, it does achieve good segmentation results. However, it just sets its coupling coefficient based on experience. Obviously, such an approach is unscientific and buries some unpredictable dangers to the turbulence of the evolution process.

The LSMs can output good segmentation results in most cases, however, due to the complexity and diversity of input data and image segmentation problems. In some cases, it is not enough to just use image data itself for segmentation, especially when there are unfavorable factors such as occlusion, clutter, and low contrast in the images. Under such circumstances, adding known shape information as a constraint to energy functional is an effective solution.

In view of this, this paper proposes a shape prior embedded LSM and applies it to the practice of segmentation of different kinds of images. Experimental results show that our method achieves very ideal segmentation performance. Firstly, we made a deep optimization of the edge stop function and the coefficient of weighted area term in the original LSEWR model constructed by Li et al. [3]. When optimizing the edge stop function, we introduce the thought of probability weighting. The existence of the statistical probability term makes the edge stop function contain region information. Therefore, our model has a stronger weak edge capture capability; when optimizing the coefficient of the weighted area term, we abandon the original constant coefficient because the constant-type coefficient makes the model only evolve in a single direction, which is obviously problematic in practical applications, and the most obvious phenomenon is that the segmentation result is highly related with the initialization. To overcome this limitation, we modify the constant weighting coefficient to a variable which is directly related to an image coordinate and local region information. The modified weighting coefficient can adaptively adjust the amplitude and speed of the evolution according to the position of the active contour; i.e., the final segmentation result is completely independent of initialization. Secondly, we embed the shape priors into the optimized LSEWR model. When constructing the shape prior-driven energy term, we adopt the KDE thought proposed by Cremers et al. [22], and the two cases of single prior and multiple priors are considered separately. Even if there is obvious affine transformation in the shape prior and the target to be segmented, the target contour can still be reconstructed correctly.

The remainder of this paper is organized as follows: In Section 2, we shall discuss the energy functional construction process of the proposed method in detail. Then, the numerical implementation strategies for the proposed model are presented in Section 3. Section 4 validates the proposed model by extensive experiments and discussions on a variety of images. Finally, some conclusive remarks are provided in Section 5.

#### 2. The Proposed Model

In order to improve the integrity of the segmentation results of the LSM in the presence of partial occlusion, low contrast, and strong background clutter, we embed the energy term with shape priors into the LSM based solely on image data. The expression of the proposed model is as follows:where *a* and *b* are the weight coefficients, both of which are located in the interval and , and and are the energy terms driven by the image data and shape prior, respectively. The organic combination of these two energy terms forms a new energy functional with shape prior information. comprehensively considers the edge and region information of the image, which is similar to the model of Li et al. [3] in terms of formula structure, but we use a different edge stop function and a different coefficient for the weighted area term, and it is defined as follows:where is the LSF, and are two control parameters, the function and are the one-dimensional Heaviside and Dirac function, respectively, is a variable coefficient parameter related to the pixel coordinates of the image, which will be described in detail later, and is a probability-weighted edge stop function, which is defined as follows:where is the image to be segmented, is the Gaussian filter kernel, “” is the convolution operator, and and are the posterior probabilities that the sample pixel belongs to the target and background, respectively. By using Bayes’ theorem, we can infer their expressions:

The prior probability in equation (4) can be assumed to be equal to 0.5 when it is unknown in advance, and further assuming that the conditional probability obeys the Gaussian distribution:where and are the mean and variance of the Gaussian distribution, respectively. Let , since , then , . Let , then . Obviously, this is a quadratic function. According to the extreme value condition of the quadratic function, it is easy to know that when , the product term will get its maximum value; accordingly, equation (1) will reach its minimum value. The physical meaning of is that the current pixel belongs to both the target and the background; i.e., the current pixel is located at the intersection of the target and the background—the contour of the target, that is, the evolution process will stop at the contour of the target; such a termination behavior is exactly what we need. Besides, the existence of the statistical probability term makes the edge stop function contain region information. Therefore, our model has a stronger weak edge capture capability.

In the above description, by introducing the region information into the edge stop function of the original LSEWR model, we have optimized and improved the model’s ability to capture weak target edges. Next, we will optimize the value of the coefficient in equation (2). According to the description of Li et al. [3], the value of is constant. After specifying its value, the curve will only evolve in one direction, which makes it not only lack sign and amplitude adaptability but also difficult to meet the variety of initialization forms. For example, when the initial curve only intersects a part of the target region, such a unidirectional evolution mode will not output the correct segmentation result. To overcome this defect, we introduce a variable weight coefficient; that is to say, its sign and amplitude are directly related to the pixel value of the current position. The variable weight coefficient has the following two general features: (1)it can automatically change its sign according to the current pixel value, and the resulting effect is that the active contour can choose its traveling direction adaptively, thus weakening its dependence on the initial position of the curve, and (2) it can adaptively change its amplitude according to the image gradient, and the resulting effect is that the active contour has a powerful ability of capturing multilayer contour, thus eliminating the phenomenon of edge leakage.

In order to match the above features, we propose the following weight coefficient:where “,” “,” and “” are the convolution operator, gradient operator, and Laplacian operator, respectively, is the sign function, and is a control constant.

Below, we give some further analysis:

(1) The second derivative of the image changes its sign after crossing the boundary; that is to say, the sign of the second derivative on both sides of the target boundary is opposite. In addition, we also know that the active contour is divided into two parts by the real target boundary, one is located in the target area and the other is outside the target area. Before the active contour eventually stops at the real boundary of the target, it needs some kind of driving force to continuously pull it; therefore, it is important to determine the direction of the driving force. For the active contour fragment within the target area, its second derivative is positive, that is, ; we further have and ; thus, the direction of the driving force at this time points to the outside; and the consequent evolutionary effect is that the active contour evolves toward the target contour in the form of expansion. For the active contour fragment outside the target area, its second derivative is negative, that is, ; we further have and ; thus, the direction of the driving force at this time points to the interior; and the consequent evolutionary effect is that the active contour evolves toward the target contour in the form of shrinkage. Based on the above analysis, we can draw the following conclusions: The active contour (the zero level set corresponding to the LSF) can adaptively determine its evolutionary direction based on the pixel properties, thus getting rid of its dependence on the initial position of the curve completely. As a result, we can place the initial curve anywhere in the image.

(2) The amplitude of the weight coefficient depends on the gradient amplitude of the image, so it can adaptively adjust its value according to the image information: when the active contour moves to the vicinity of the target contour, the gradient intensity is larger at this moment, resulting in a larger amplitude of . This coefficient adaptive phenomenon greatly improves the multilevel targets extraction ability of the active contour.

(3) In order to deal with different levels of segmentation needs, we specifically introduce a control constant . When the task flow needs to extract the contour of the target from multiple levels (from the weak contour to the strong contour), the value of can be appropriately increased. Conversely, we can appropriately lower the value of when the task flow only needs to extract the main target contours in the image plane.

In addition, to achieve accurate segmentation of image targets with slight or severe occlusion, we here construct the shape priori term in equation (1) based on Cremers et al.’s [22] thought. We need to consider the following two cases separately:(i)*Single shape prior*. In the case of single shape prior (only one target in the test image is similar to the object in the shape prior library), the shape prior energy is defined aswhere is the current LSF, is the result of affine transformation of shape prior according to the moment [23] of , and is the Heaviside function.(ii)*Multiple shape priors*. For the case of multiple shape priors (multiple targets in the test image are similar to the objects in the shape prior library), we first use the KDE method to estimate the probability density and then calculate its negative logarithm to form the required shape prior energy term:where is the result of affine transformation of the *i*-th shape prior according to the moment of , is the Euclidean distance of two LSFs, and is the width of kernel function under KDE framework, and we can calculate its value by using the following formula:

By minimizing equation (8) or (9), the current LSF will evolve toward a particular shape prior; that is, the constraint force exerted by the shape prior in the evolution process will make the current LSF more and more similar to the shape prior until it converges to the desired target form. In this way, even if there is a slight or severe occlusion phenomenon in the target to be segmented, the evolution process can reconstruct the desired target contour correctly according to the shape prior.

Minimizing the energy functional with respect to by using the calculus of variation and the steepest descent method, we can easily deduce the corresponding gradient descent flow aswhere is the Dirac function, and the expression of consists of the following two forms:where

#### 3. Numerical Implementation

In numerical implementation, the literature [3] uses a regularized Dirac function defined as follows:

The support domain of equation (13) is , which determines that the control ability of the evolution process is local. In order to expand its scope of action, this paper uses the following regularized Dirac function to replace in equation (2):

Since the support domain of function is , equation (10) will act on the entire LSF so that the global minimum of the energy functional can be obtained, which further improves the ability of the zero level set to detect multilayer contours and the ability to capture deeply concave regions and multiple target boundaries. We use the regularized Dirac with , for all the experiments in this paper.

In addition, the existence of the diffusion term in the proposed model makes it possible to use a simple finite difference scheme to discretize equation (10) defined in the continuous data domain, instead of adopting a complex upwind difference scheme [24] as in the traditional LSMs. Instead, all the spatial partial derivatives and are approximated by the central difference, and the temporal partial derivative is approximated by the forward difference. The approximation of equation (10) by the above difference scheme can be simply written aswhere is the approximation of the right-hand side of equation (10) by the above spatial difference scheme. The difference equation (15) can be expressed as the following iteration:

The computer programming implementation of the proposed algorithm is based on equation (16), and the procedures of the proposed algorithm are summarized in Algorithm 1.