1 Introduction

Intensity heterogeneities, noise, and weak boundaries often occur in medical images due to various factors, such as imperfections of imaging devices and spatial variations in illumination, which brings a considerable challenge in image segmentation. In recent years, active contour models have become very popular for image segmentation purpose (Wang et al. 2017; Ali et al. 2016; Zhang et al. 2016). The region-based active contour models (Chan and Vese 2001; Lankton and Tannenbaum 2008; Li et al. 2008; Zhang and Zhang 2016; Liu et al. 2015) combining the level set functions are, in general, less sensitive to the initial contour curve placement and more robust to complex medical images. The basic idea is to minimize a given energy functional by using the level set method (Li et al. 2013) in order to drive the motion of evolving curves towards the boundaries of target objects.

Of the known region-based active contour models, the Chan-Vese (CV) model (Chan and Vese 2001) has achieved good performance for many image segmentation tasks. However, this model may fail to segment medical images with intensity heterogeneities due to the mere use of global intensity averages. Zhang and Zhou (2008) propose an improved ordinary differential equation (ODE) model based on the global fitting term of the CV model. The model retains the advantages of the CV model. Taking into account the characteristics of the ODE, both the computational complexity and the iteration time are reduced. Just like the CV model, the model in Zhang and Zhou (2008) is unable to deal with intensity heterogeneities.

To overcome the above problems, the local region-based active contour models are proposed. These models use the local information as constraints, which enable them to segment medical images with intensity heterogeneities. Lankton and Tannenbaum (2008) and Li et al. (2008) propose the classical local region-based active contour models by using local region-based (LRB) fitting energy and the local binary fitting (LBF) energy, respectively. The LRB model defines a local region, which results in a significant improvement in terms of accuracy for segmenting heterogeneous images. Because the local region is defined by the user, the LRB model is highly susceptible of the local location compared to global methods. The LBF model introduces a local binary fitting energy with a kernel function, which can segment images with heterogeneities well. But the convolution operations in the LBF model can increase the computational complexity. The local active contour models are very sensitive to image noise and weak boundaries, which is not suitable for medical images.

To combine the advantages of both global and local models while overcoming their shortcomings, Ali et al. (2016) propose a hybrid active contour model based on the multiplicative and difference images. However, it is very important that the appropriate method to process the segmented images is used before carrying out image segmentation. Mabood et al. (2015) add an absolute median deviation to the segmentation model, which is more accurate and efficient compared to the single model, but typically needs complicated estimation strategies. Wang et al. (2017) propose a hybrid segmentation method by integrating two local active contour models. The integrated model can be capable of segmenting synthetic and real images effectively. However, due to the lack of the global information, some important image information may be lost. In addition to all of the above, there exist more hybrid methods (Wang et al. 2014; Wang and Liu 2013) by defining the energy functional with other information, such as geometry information (Mylona et al. 2014), prior shape information (Gloger et al. 2017; Yang et al. 2014) and local patch (Wang et al. 2014). These methods can effectively extract the desirable objects, especially for medical images (Jayadevappa et al. 2011; Li et al. 2013). Because of the additional information, the computational complexity of the methods is increased.

In this study, a hybrid energy functional is constructed for medical image segmentation by leveraging the strength of both the global and local models. First, based on the statistical information of image pixels, we derive a clustering property in a neighborhood of each image pixel adaptively (Patel et al. 2017), and define a global fitting energy functional. The local energy functional is then integrated with respect to the neighborhood center to give a global criterion of image segmentation. This criterion defines the local energy functional in terms of the level set functions that correct the deviation of the actual boundaries and the evolving curve. The method in this paper is validated using a number of synthetic and medical images.

2 Background

2.1 Global active contour model

The CV model is a global segmentation method based on the assumption of image homogeneity. The input image \( I(x,y) \) is partitioned into two disjoint sub-regions (i.e. \( C_{in} \) and \( C_{out} \)) with an initial contour curve \( C \). The energy functional is described as follows:

$$ E^{CV} = \lambda_{1} \int_{{C_{in} }} {\left| {I\left( {x,y} \right) - c^{ + } } \right|}^{2} dxdy + \lambda_{2} \int_{{C_{out} }} {\left| {I\left( {x,y} \right) - c^{ - } } \right|}^{2} dxdy + \mu length\left( C \right) $$
(1)

where \( \lambda_{1} \), \( \lambda_{2} \) and \( \mu \) are the weighting parameters for the first two intensity fitting terms and the length penalty term \( length\left( C \right) \), respectively; \( c^{ + } \) and \( c^{ - } \) are constants used to approximate the average intensities for the regions \( C_{in} \) and \( C_{out} \). By minimizing this energy functional with respect to the level set function \( \phi \), the CV model is given as follows:

$$ \frac{\partial \phi }{\partial t}^{CV} = \delta (\phi )\left[ { - \lambda_{1} (I(x,y) - c^{ + } )^{2} + \lambda_{2} (I(x,y) - c^{ - } )^{2} + \mu div\left( {\frac{\nabla \phi }{|\nabla \phi |}} \right)} \right] $$
(2)

Here, the evolution of the curve is given by the zero-level curve at time \( t \); \( c^{ + } \) and \( c^{ - } \) are computed using the formulations below:

$$ \left\{ {\begin{array}{*{20}l} {c^{ + } = \frac{{\int {I\left( {x,y} \right)H\left( {\phi \left( {x,y} \right)} \right)dxdy} }}{{\int {H\left( {\phi \left( {x,y} \right)} \right)dxdy} }}} \\ {c^{ - } = \frac{{\int {I\left( {x,y} \right)\left( {1 - H\left( {\phi \left( {x,y} \right)} \right)} \right)dxdy} }}{{\int {\left( {1 - H\left( {\phi \left( {x,y} \right)} \right)} \right)dxdy} }}} \\ \end{array} } \right. $$
(3)

where \( H(\phi ) = \frac{1}{2}\left[ {1 + \frac{2}{\uppi}\arctan \left( {\frac{\phi }{\varepsilon }} \right)} \right] \) is the regularized Heaviside function with a small positive constant \( \varepsilon \) [in this paper, we set \( \varepsilon = 1 \) as proposed in Chan and Vese (2001)], and its derivative is the Dirac function \( \delta (\phi ) = H^{\prime}(\phi ) = \frac{1}{\uppi}\frac{\varepsilon }{{\varepsilon^{2} + \phi^{2} }} \). \( div\left( \cdot \right) \) and \( \nabla \) are the divergence and gradient operator, respectively.

According to the difference of two squares, Eq. (2) can then be expressed as (let \( \lambda_{1} = \lambda_{2} = 1 \)):

$$ \frac{\partial \phi }{\partial t}^{CV} = \delta \left( \phi \right)\left[ {2\left( {c^{ + } - c^{ - } } \right)\left( {I - \frac{{c^{ + } + c^{ - } }}{2}} \right) + \mu div\left( {\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}} \right)} \right] $$
(4)

In the process of evolution, the threshold \( \frac{{c^{ + } + c^{ - } }}{2} \) determines the change of the level set function \( \phi \) at each pixel point. Like the k-Means procedure for two clusters, \( c^{ + } \) and \( c^{ - } \) are two centers of mass, which are used to fit the image intensities in the regions \( C_{in} \) and \( C_{out} \), respectively. Such global fitting can drive the contour curve to the desired boundaries when image intensities in either \( C_{in} \) or \( C_{out} \) are homogeneous, as shown in the first row of Fig. 1; on the contrary, \( c^{ + } \) may be approximately equal to \( c^{ - } \) when image intensities are heterogeneous as shown in the second row of Fig. 1, thus the global CV model may get inadequate segmentation.

Fig. 1
figure 1

Synthetic images with noise, blurry boundaries (the first row) and heterogeneous intensity (the second row). a Initial contours. b Global region-based segmentation results. c Local region-based segmentation results

2.2 Local active contour model

To overcome the drawbacks of the global active contour models, the LRB model is proposed by introducing a local region \( \Re \): \( \Re \left( {x,y} \right) = \left\{ {\begin{array}{*{20}c} {1,{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} \left\| {x - y} \right\| < r} \\ {0,{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} otherwise} \\ \end{array} } \right. \), where \( r \) is a radius parameter. The energy functional of the LRB model is expressed as:

$$ E^{LRB} = \lambda_{1} \int_{{C_{in} }} {\Re \left( {x,y} \right)\left| {I\left( {x,y} \right) - m^{ + } } \right|^{2} dxdy} + \lambda_{2} \int_{{C_{out} }} {\Re \left( {x,y} \right)\left| {I\left( {x,y} \right) - m^{ - } } \right|^{2} dxdy} {\kern 1pt} + \mu length\left( C \right) $$
(5)

where \( m^{ + } \) and \( m^{ - } \) are two smooth functions that approximate the local image intensities inside and outside the contour, respectively:

$$ \left\{ {\begin{array}{*{20}l} {m^{ + } = \frac{{\Re * \left[ {H\left( {\phi \left( {x,y} \right)} \right)I\left( {x,y} \right)} \right]}}{{\Re * H\left( {\phi \left( {x,y} \right)} \right)}}} \hfill \\ {m^{ - } = \frac{{\Re * \left[ {\left( {1 - H\left( {\phi \left( {x,y} \right)} \right)} \right)I\left( {x,y} \right)} \right]}}{{\Re * \left( {1 - H\left( {\phi \left( {x,y} \right)} \right)} \right)}}} \hfill \\ \end{array} } \right. $$
(6)

The other symbols are the same as those used in the CV model. Similarly, the LBF model introduces a binary fitting energy in a local region specified by a Gaussian kernel \( {\rm K} \) and the smooth functions are defined as

$$\left\{ {\begin{array}{*{20}l} {m_{{LBF}}^{ + } = \frac{{{\rm K} * [H(\phi (x,y))I(x,y)]}}{{{\rm K} * H(\phi (x,y))}}} \hfill \\ {m_{{LBF}}^{ - } = \frac{{{\rm K} * [(1 - H(\phi (x,y)))I(x,y)]}}{{{\rm K} * (1 - H(\phi (x,y)))}}} \hfill \\ \end{array} } \right. $$
(7)

Similar to the CV model (let \( \lambda_{1} = \lambda_{2} = 1 \)), the evolution equation of the local active contour model can be obtained:

$$ \frac{\partial \phi }{\partial t}^{Local} = \delta (\phi )\left[ {2(m^{ + } - m^{ - } )\left( {I - \frac{{m^{ + } + m^{ - } }}{2}} \right) + \mu div\left( {\frac{\nabla \phi }{|\nabla \phi |}} \right)} \right] $$
(8)

Here, \( m^{ + } \) and \( m^{ - } \) are two local mass centers. \( \frac{{m^{ + } + m^{ - } }}{2} \) is the local threshold. The local region model can segment images with the heterogeneous regions effectively by introducing local information. When images contain blurry boundaries or noise, the local model can easily fall into local minima and get inaccurate results, as shown in the first row of Fig. 1.

2.3 Other hybrid active contour models

To accurately segment medical images, Wang et al. (2017) construct a novel local hybrid image fitting (LHIF) energy by combining the LBF model and the local image fitting (LIF) model, which is defined as follows:

$$ \frac{\partial \phi }{\partial t}^{G\& L} = \delta \left( \phi \right)\left( {e_{1} + e_{2} } \right) $$
(9)

where

$$ \left\{ {\begin{array}{*{20}l} {e_{1} = \left( {m_{LBF}^{ + } - m_{LBF}^{ - } } \right)\left( {\frac{{I\left( {x,y} \right)}}{{I^{LFI} \left( {x,y} \right)}} - 1 - \log \frac{{I^{LFI} \left( {x,y} \right)}}{{I\left( {x,y} \right)}}} \right)} \hfill \\ {e_{2} = \left( {\left( {m_{LBF}^{ + } } \right)^{2} - \left( {m_{LBF}^{ - } } \right)^{2} } \right)\left( {\frac{{I^{2} \left( {x,y} \right)}}{{I^{SFI} \left( {x,y} \right)}} - 1 - \log \frac{{I^{SFI} \left( {x,y} \right)}}{{I^{2} \left( {x,y} \right)}}} \right)} \hfill \\ \end{array} } \right. $$
(10)

and

$$ \left\{ {\begin{array}{*{20}l} {I^{LFI} \left( {x,y} \right) = m_{LBF}^{ + } * H(\phi (x,y)) + m_{LBF}^{ - } * H(\phi (x,y))} \hfill \\ {I^{SFI} \left( {x,y} \right) = \left( {m_{LBF}^{ + } } \right)^{2} * H(\phi (x,y)) + \left( {m_{LBF}^{ - } } \right)^{2} * H(\phi (x,y))} \hfill \\ \end{array} } \right. . $$
(11)

The method in Wang et al. (2017) takes advantage of two local fitted images \( I^{LFI} \) and \( I^{SFI} \) quantified the image differences between the original image \( I\left( {x,y} \right) \) and its two approximated smooth functions, i.e., \( I^{LFI} \) and \( I^{SFI} \) in terms of Kullback–Leibler divergence. The idea is similar to the measure of K-means classification, which can enhance the accuracy of segmentation. Besides, in order to make full use of the characteristics of medical images, Zhao et al. (2015) use a scalable local regional information (SLRI) \( m^{ + } \) and \( m^{ - } \) for medical images segmentation. The method in Zhao et al. (2015) can avoid being confined locally in a homogeneous region by adopting the scalable window.

3 Proposed model

3.1 Introduction of the proposed model

To obtain reasonable segmentation results for heterogeneous medical images, a hybrid active contour model based on global and local information is proposed. According to Eqs. (4) and (7) introduced in Section II, the form of the two energy functional is approximate, which means that the two models can be combined together. In order to make full use of image information, the combined energy functional is expressed as:

$$ \frac{\partial \phi }{\partial t} = \delta \left( \phi \right)\left[ {2\underbrace {{\left( {\omega^{ + } c^{ + } - \omega^{ - } c^{ - } } \right)}}_{{E_{1} }}\underbrace {{\left( {I - \frac{{m^{ + } + m^{ - } }}{2}} \right)}}_{{E_{2} }} + \mu div\left( {\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}} \right)} \right] $$
(12)
  1. (1)

    The global term \( E_{1} \) is proposed by combining the global information \( c = \left\{ {c^{ + } ,c^{ - } } \right\} \) with the weight \( \omega = \left\{ {\omega^{ + } ,\omega^{ - } } \right\} \). \( \omega \) is constructed as follows:

The traditional energy functional equates the importance of the pixels around the evolving curve and other location. In view of the statistical property of each pixel in the segmented images, we assume that the pixels on two sides of the evolving curve are the most important and have the highest weight. The weights decrease gradually with the increase of the distance from the evolving curve, which meets the characteristics of Gaussian distribution (as shown in the blue curve of Fig. 2). Therefore, we use the discrete Gauss function to represent the weights of image pixels. Considering that the area distribution is 0.99 in the range of \( \left[ { - 2.58, + 2.58} \right] \) under the standard normal distribution (Hald 2015), the weights from near to distant are represented as follows:

$$ \omega {\text{ = }}\left\{ {\omega ^{{\text{ + }}} ;\omega ^{ - } } \right\} = \left\{ {\begin{array}{*{20}l} {\Theta \left( {n \times \frac{{2.58}}{n}} \right),\Theta \left( {\left( {n - 1} \right) \times \frac{{2.58}}{n}} \right), \ldots ,\Theta \left( {\frac{{2.58}}{n}} \right);} \hfill \\ {\Theta \left( {\frac{{2.58}}{n}} \right),\Theta \left( {2 \times \frac{{2.58}}{n}} \right), \ldots ,\Theta \left( {n \times \frac{{2.58}}{n}} \right)} \hfill \\ \end{array} } \right\} $$
(13)

where \( \varTheta \left( x \right) = \frac{1}{{\sqrt {2\pi } }}\exp \left( {\frac{{ - x^{2} }}{2}} \right) \), \( x \) and \( n \) represent a vector multiplication and the position of each pixel, respectively.

Fig. 2
figure 2

The weighted Gaussian distribution of the distance between pixels and the evolving curve

The global term \( E_{1} \) based on the weight \( \omega \) can represent more information of the pixels in the segmented image adaptively, which can deal with the heterogeneous regions more effectively. Besides, it gives weights to two clustering centers \( c = \left\{ {c^{i} } \right\} \)\( \left( {i \in \left\{ \pm \right\}} \right) \). So the evolving curve at different regions can have different evolving velocities.

  1. (2)

    The local term \( E_{2} \) contains the local threshold \( \frac{{m^{ + } + m^{ - } }}{2} \), which is used to correct the deviation of evolution (the level set function). The term \( E_{2} \) can differentiate between the original image \( I \) and its approximated local threshold, which has the advantages of the ODE. Besides, there is no need to satisfy a specific difference rule, and the balance parameters between the global and local terms need not be adjusted.

According to the evolution law of the level set function, the curve evolves along the normal when the local term \( E_{2} \le 0 \); Conversely, it evolves along the inverse normal. So we can get the conclusion that the evolving curve is the shrinking force and the expanding one when the evolving curve is outside and inside the target, respectively. The evolution curves are represented at all possible positions in Fig. 3, where the big and small circles represent the scalable global and local curves, respectively. The major role of the corresponding energy functional \( \left\{ {E_{1} ,E_{2} } \right\} \) is described in Table 1. Here, ‘√’ and ‘–’ represent equation hold or not.

Fig. 3
figure 3

The evolving curve \( \phi \) in different cases

Table 1 The corresponding energy functional in Fig. 3

For instance, if the global and local curves are both outside the object (case ‘a’ in Fig. 3), then \( c^{ + } \ne c^{ - } \), \( m^{ + } \approx m^{ - } \) and \( E_{1} \) plays a major role. If the curves are neither inside nor out (case ‘e’ in Fig. 3), then \( c^{ + } \ne c^{ - } \), \( m^{ + } \ne m^{ - } \) and \( \left\{ {E_{1} ,E_{2} } \right\} \) both play roles. Other cases can also be analyzed similarly. The energy functional \( E_{1} \) or \( E_{2} \) can play a greater role when the differences between the average intensities \( c^{ + } \left( {m^{ + } } \right) \) and \( c^{ - } \left( {m^{ - } } \right) \) are larger. As long as the adaptive global energy functional \( E_{1} \) provides consistent information with the local energy functional \( E_{2} \), the level set function \( \phi \) will change with the evolution of the Eq. (12).

3.2 Feasibility analysis of the proposed model

Theorem 1

The proposed combined energy functional (11) is uniformly bounded in the Sobolev space (Nezza et al. 2011) \( W^{lp} \left( \varOmega \right) \)(Sobolev space is a vector space of functions equipped with a norm that is a combination of\( l^{p} \)-norms of the function itself and its derivatives up to a given order).

Let \( \varOmega \) denote a bounded open subset in space \( R^{n} \), and \( \wp \) be the locally integrable function in Sobolev space \( W^{lp} \left( \varOmega \right) \). Theoretically, \( \varPsi = div\left( {\frac{\nabla \phi }{|\nabla \phi |}} \right) \) is uniformly bounded in the space \( W^{lp} \left( \varOmega \right) \). We set the model (11) as:

$$ \wp = \sup \left\{ {\int_{\varOmega } {\left. {\left( {E_{1} \left( \phi \right)E_{2} \left( \phi \right) + \varPsi } \right) \cdot \nabla \phi dx} \right|} \phi = \left( {\phi_{1} ,\phi_{2} , \ldots ,\phi_{N} } \right) \in W^{01} \left( \phi \right)^{N} ,|\phi |_{{W^{\infty } \left( \varOmega \right)}} < 1} \right\} $$
(14)

where \( dx \) is the Lebesgue measure \( x = \sup \{ x_{1} ,x_{2}\} \), \( \nabla \phi = \sum\limits_{i = 1}^{N} {\frac{{\partial \phi_{i} }}{{\partial x_{i} }}} \).

Let \( \zeta { = }E_{1} E_{2} \in W\left( \varOmega \right) \),\( \nabla \zeta \in W^{1} \left( \varOmega \right) \), then

$$ \int_{\varOmega } {\left( {\zeta { + }\varPsi } \right)} \nabla \phi dx = \int_{\varOmega } {\left( {\nabla \left( {\zeta { + }\varPsi } \right)} \right)} \phi dx, $$
(15)

and the bounded variation space \( BV\left( \varOmega \right) \) is defined as:

$$ BV\left( \varOmega \right){ = }\left\{ {\left. \phi \right|\phi \in W^{1} \left( \varOmega \right){\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} or{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} \wp \left( {E_{1} E_{2} + \varPsi } \right) < \infty } \right\}. $$
(16)

From the characteristics of the space BV, we can get that if \( \phi \in BV\left( \varOmega \right) \), then \( \wp \left( {E_{1} E_{2} + \varPsi } \right) = \int_{ - \infty }^{ + \infty } {W^{1} \left( {\partial \varOmega_{\sigma } } \right)} d\sigma \), where \( \partial \varOmega_{\sigma } \) denotes the boundary of the level set function \( \phi \), and \( W^{1} \left( {\partial \varOmega_{\sigma } } \right) \) is the length of \( \partial \varOmega_{\sigma } \).

Therefore, we get that the proposed model (12) is uniformly bounded. □

Theorem 2

The convergence value of the proposed combined energy functional (12) is the minimum.

Proof

Let image region \( \varOmega \) be in the Sobolev space \( W^{lp} \left( \varOmega \right) \). From Theorem 1, we can get that there exists a minimal sequence \( {\{ }I_{n} {\} } \in W^{lp} \left( \varOmega \right),n \in Z \).

By the properties of the Sobolev space, e.g., the uniform boundedness and the lower semicontinuous of the norm, we can obtain \( \mathop {\lim }\limits_{n \to \infty } \wp (I_{n} ) = \mathop {\inf }\limits_{{I \to W^{2} (\varOmega )}} \wp (I) \), and \( E_{2} \) is uniformly bounded in the BV space: \( E_{2} = \left( {I_{n} - \frac{{m^{ + } + m^{ - } }}{2}} \right) \le M_{1} \). Consider that the weight \( \omega \in \left[ {0,1} \right] \) and the average intensities \( c = \left\{ {c^{i} } \right\} \)\( \left( {i \in \left\{ \pm \right\}} \right) \) approximate to two constants, we get that \( E_{1} = \omega^{ + } c^{ + } - \omega^{ - } c^{ - } \le M_{2} \) must be bounded. In addition, \( \left| {\nabla \varphi } \right| \in \left[ {0,255\sqrt 2 } \right] \) and \( \mu \in \left[ { - 1,1} \right] \), so we can obtain \( \varPsi < M_{3} \), where \( M_{i} ,i = 1, \ldots ,3 \) are constants. In addition, BV space is compact, so \( \nabla \phi_{n} \) is convergent to \( \nabla \phi \).

By Fatou’s lemma (Feinberg et al. 2014), we can get: \( \wp (I) \le \mathop {\lim }\limits_{n \to \infty } \inf \wp (I_{n} ) \), and the proposed model (12) convergences and there exists a minimum. □

3.3 Implementation of the proposed model

The implementation of the proposed method is as follows:

Step 1:

Initialize the level set function \( \phi (x,y) = 0 \), and the input image \( I \);

Step 2:

Calculate the weight information \( \omega = \left\{ {\omega^{ + } ,\omega^{ - } } \right\} \) using Eq. (13);

Step 3:

Calculate the global information \( c = \left\{ {c^{ + } ,c^{ - } } \right\} \) and the local information \( m = \left\{ {m^{ + } ,m^{ - } } \right\} \) using Eqs. (3) and (6);

Step 4:

Calculate the global term \( E_{1} \) and the local term \( E_{2} \) using Eq. (12);

Step 5:

Use the finite difference method to update the level set function \( \varphi \): \( \phi^{t + 1} = \phi^{t} + \tau \left( {\delta (\phi )\left[ {2E_{1} E_{2} + \mu div\left( {\frac{\nabla \phi }{|\nabla \phi |}} \right)} \right]} \right) \). This linear system is solved by an iterative method, where \( \tau \) is iteration step (we set \( \tau = 0.1 \) in this paper).

Step 6:

Check if the energy values during the evolution process remain basically the same or in a smaller range. If yes, stop the iteration; otherwise, return to Step 2.

4 Experiments

To verify the performance of the proposed model, we apply it to segment both synthetic and medical images. The tests are conducted in MATLAB R2016b programming environment on a PC with 3.50 GHz Intel (R) Core (TM) system and 12.0 GB RAM.

4.1 Segmentation of synthetic and medical images

Figure 4 shows segmentation results of our method for both synthetic and medical images with heterogeneous intensity and complex background. The curve evolutions are depicted by showing the initial contours (in the left column, which is achieved with a single closed rectangle by hand), the intermediate contours (in the middle two columns) and the final contours (in the right column).

Fig. 4
figure 4

The segmentation results of the proposed model for both synthetic and medical images. Row 1 and row 2: synthetic images. Row 3–6: medical images

It can be seen that the proposed method is capable of effectively segmenting images from different initial curves. The first integral term \( E_{ 1} \) tends to segment the objects with different image characteristics including noise, weak boundaries, and intensity homogeneity; while the second term \( E_{ 2} \) highlights to some extent the differences of the evolving curve in local regions, consequently making it easy to extract the desired regions. Due to the existence of the adaptive global information, our method can effectively emphasize the intensity differences between foreground and background. Further, the constrained local information can correct the deviation of the process of evolution.

4.2 Parameters analysis and sensitivity to initialization

In the experimental process, we note that it is difficult to achieve an optimal local region scale \( \Re \). A larger or a smaller radius will result in incorrect results. The initializations are described in white solid line in the first column of Fig. 5. A more global final solution can be gotten with a larger radius (\( \Re = 70 \)) in the second column of Fig. 5. Similarly, very small objects are captured with a small localization radius (\( \Re = 30 \)) as shown in the third column of Fig. 5. In addition, energy statistics using different local radii is shown in the last column of Fig. 5. It is advisable that the segmentation results are accurate when the local region scale \( \Re \) is set about \( \frac{1}{10} \) of the average image length, as shown the fourth column of Fig. 5.

Fig. 5
figure 5

The segmentation results by different local region scales \( \Re \). Column 1: initializations; columns 2–4: segmentation results based on large, medium and small local radii, respectively. Column 5: energy statistics using different local radii

In essence, if the radius \( \Re \) grows larger, our method utilizes mainly the global statistics. In this case, the accurate performance of the model becomes weaker. On the other hand, if the proposed energy is evaluated with a very small radius, the statistics of the pixels are adjacent to a smaller local region, and the local performance loses some significance.

Further, to test the proposed method in terms of sensitivity to initial curve placements, we keep all the parameters same in Fig. 6 with different initial curves. The results demonstrate that the proposed method has nearly the same results for different initial curves, which means that our method is insensitive to initial curve placements.

Fig. 6
figure 6

The segmentation results based on different initial contour curves. Column 1 and 2: different initial rectangle contours; column 3: the final results. Column 4: the estimated level set functions

4.3 Comparative results

To show the performance of the proposed method and the improvements over the original global and local models, we compare the proposed method with the global CV model, the local LRB model, and the hybrid fitting LHIF (Wang et al. 2017) and SLRI (Zhao et al. 2015) models. Segmentation results are presented for different types of images in Fig. 7 (the same initial evolving curve and parameters are used in different methods). The second row shows that segmentation results for the global CV model cannot completely segment images with weak boundaries. The LRB model in the third row has an adequate power of segmenting the desirable objects but cannot extract target with noise and weak boundaries. In addition, the LRB model is more sensitive to initial contour throughout the experiment, and the contour can easily fall into the local minimum. The fourth and fifth rows show that the adaptive fitting LHIF and SLRI models are not a satisfactory segmentation model for images in some cases. Compared with the LHIF and SLRI models, our method can achieve satisfactory segmentation results at a faster speed. This is due to that our method introduces both the adaptive global term and local correction term. The results demonstrate the performance of our method in handling noise, weak boundaries, and intensity heterogeneities under complex image background.

Fig. 7
figure 7

Comparisons of the segmentation results on six images in different columns. Row 1: initialization; rows 2–6: results of the CV, the LRB, the LHIF, the SLRI model and the proposed model, respectively; row 7: ground truths

In addition, the performance of these models are quantitatively assessed by the Error Ratio (ER) (Fang et al. 2017) defined as: \( ER = (FP + FN)/N \times 100\% \), where FP and FN are the number of pixels incorrectly determined and missed out, respectively. N is the total number of the pixels counted in the ground truths. Note that the ground truths of the synthetic and medical images are manually created and constructed by the expert from Dalian Medical University, respectively. The lower of ER value is, the more accurate results are. The quantitative assessments as shown in Fig. 8 demonstrate that our model has the lowest values of ER, the CV model and the LRB model have the largest values due to the absence of local and global information, respectively. As for the LHIF and SLRI models, they are based on the global and local model, but the importance of each pixel is same. The lowest values of ER obtained by the proposed method demonstrate that the segmentation performance is better than other methods.

Fig. 8
figure 8

ER values of different methods in Fig. 7

The computational cost of the images in Fig. 7 is analyzed in Table 2. Due to the existence of the local information, our method needs more segmentation time than the global CV model. Compared with other methods, the proposed model need relatively less time to drive the contours to desirable boundaries.

Table 2 Iterations (Iter.) and CPU time (in s) of the images in Fig. 7

5 Conclusions

Medical images may suffer from limited segmentation performances due to the complex background such as intensity heterogeneities, noise, and weak boundaries. To solve these problems, a hybrid image segmentation model is proposed in this paper. The proposed model combines the adaptive global energy and the corrected local energy, which uses the level set function to guide the evolving curve towards the desired boundaries. The global term can be used for segmenting complex images; while the local one is capable of correcting the deviation of the level set function. Comparisons with several representative methods on synthetic and medical images demonstrate the effectiveness of the proposed method. Our method also enhances the contour’s convergence speed and reduces the computation time.