1. Introduction {#sec1}
===============

Retinal vessel segmentation plays an important role in medical image processing. It can provide much help for the detection of eye diseases and other medical diagnosis. A large number of methods for retinal vessel segmentation have been proposed. A survey on retinal vessel segmentation methods is presented in the literature \[[@B1]\]. According to the image processing methodologies and algorithms, these retinal vessel segmentation approaches can be categorized into pattern recognition techniques, matched filtering, vessel tracking, mathematical morphology, multiscale approaches, and model-based approaches.

The algorithm based on pattern recognition can detect or classify the retinal blood vessel features and the background. This group of algorithms can be divided into two categories: supervised and unsupervised approaches. In supervised methods, the prior labeling information is used to decide whether a pixel belongs to a vessel or not. In \[[@B2]\], a ridge-based vessel segmentation methodology has been proposed. In \[[@B3]\], a method which combines the radial projection and the support vector machines classifier has been introduced for vessel segmentation. A supervised method which is based on neural network has been presented in \[[@B4]\]. The Gaussian matched filter and the k-nearest neighbor algorithm are used for vessel segmentation \[[@B5]\]. In \[[@B6]\], a 2D Gabor wavelet has been applied for vessel segmentation. The unsupervised methods perform the vessel segmentation without any prior labeling knowledge. In \[[@B7]\], a spatially weighted fuzzy C-means clustering method has been used for vessel segmentation. In \[[@B8]\], a vessel detection system based on a maximum likelihood estimation has been developed.

The matched filtering approaches \[[@B9]--[@B11]\] are also popular methods to detect and measure blood vessels. In \[[@B9]\], a method which combines local and region-based properties of retinal blood vessels has been described. In \[[@B10]\], a modified second-order Gaussian filter has been used for retinal vessel detection. In \[[@B11]\], the zero-mean Gaussian filter and the first-order derivative of the Gaussian have been applied to detect vessels.

In the vessel tracking-based method framework \[[@B12]--[@B14]\], several seed pixels are chosen on the boundaries and the centerlines of vessels, and then we detect vessels from these seeded pixels. In \[[@B13]\], the Bayesian method with the maximum a posteriori (MAP) probability criterion has been used to identify the vessel\'s boundary points. In \[[@B12], [@B14]\], a probabilistic tracking method has been used to detect the vessel edge points by using local grey level statistics and vessel\'s continuity properties.

The mathematical morphology-based methods extract image components which are useful in the representation and description of region shapes such as features, boundaries, skeletons, and convex hulls. In \[[@B15]\], a unique combination of vessel centerlines detection and morphological bit plane slicing has been introduced to extract the blood vessel tree form the retinal images. The fast discrete curvelet transforms and multistructure mathematical morphology have been employed for vessel detection \[[@B16]\]. In \[[@B17]\], the combination of morphological filters and cross-curvature evaluation have been used to segment vessel-like patterns. A difference of offset gaussian filter \[[@B18]\] has been utilized for retinal vasculature extraction. A general framework of locally adaptive thresholding method for retinal vessel segmentation has been introduced in \[[@B19]\].

Multiscale approaches are to separate out information related to the blood vessel having varying width at different scales. A scale space segmentation algorithm has been proposed in \[[@B20]\], which has been used to measure and quantify geometrical and topological properties of the retinal vascular tree. Two extensions of this scale space algorithm have been demonstrated in \[[@B21], [@B22]\]. A multi-scale line tracking for vasculature segmentation has been presented in \[[@B23]\].

The model-based approaches are very popular techniques for image segmentation and have been used for retinal vessel segmentation. Active contour models which are based on curve evolution are very commonly used for image segmentation. The main advantage is their great performance. Recently, they have been used to detect boundaries of vessels in retinal images \[[@B24]--[@B28]\]. The classical snake in combination with blood vessel topological properties has been used to extract the vasculature from retinal image \[[@B29]\]. A methodology based on nonlinear projections has been proposed for vessel segmentation \[[@B30]\]. Level set method is a very good approach to deal with topological changes \[[@B31]\] and has been successfully used for vessel segmentation of retinal images \[[@B32], [@B33]\]. Graph-based approach is very popular and interesting method for image segmentation and also has been applied to vessel boundary detection \[[@B34]\].

The above methods \[[@B12]--[@B14]\] are based on the Bayesian model. However, the main disadvantage of these approaches is that the pixels are assumed to be independent. Spatial dependence is very important to guarantee connectedness of the vessel structure. To take into account the dependence in the spatial space, Markov random field (MRF) models have been widely used for solving the image segmentation problem \[[@B35]--[@B37]\]. However, one of the drawbacks of the MRF-based methods is that the computational cost is quite high.

In this paper, we present a novel Bayesian segmentation method for vessel segmentation. The proposed method takes the spatial information into account. We found that maximizing log-likelihood function is equivalent to energy function minimization. The parameters of the model can be estimated via energy minimization. In order to detect the boundaries of the blood vessels, the modified level set approach is used for solving the energy function minimization problem. The method was evaluated on two publicly available databases, the DRIVE database \[[@B38]\] and the STARE database \[[@B39]\]. Results of the proposed method are compared to those from other methods, leading to the conclusion that our approach outperforms other techniques.

The remainder of this paper is organized as follows. In Sections [2](#sec2){ref-type="sec"} and [3](#sec3){ref-type="sec"}, we describe the details of the proposed model and the modified level set algorithm. In [Section 4](#sec4){ref-type="sec"}, we show the experimental results and conclude with a discussion in [Section 5](#sec5){ref-type="sec"}.

2. Proposed Model {#sec2}
=================

2.1. Image Segmentation {#sec2.1}
-----------------------

Let *𝒳* = {*x* ~*i*~, *i* ∈ *Ω*} denote an observed image, where *x* ~*i*~ is the observation of pixel *i* and *Ω* is image domain. Let *𝒦* = {1,2,..., *K*} denote a label set, and *K* is the total number of classes. Let *𝒴* = {*y* ~*i*~ ∈ *𝒦*, *i* ∈ *Ω*} be an image of labels. The aim of labeling is to assign a label *y* ~*i*~ ∈ *𝒦* to each pixel *i* ∈ *Ω*, based on *x* ~*i*~. The goal of segmentation is to separate the image domain *Ω* into disjoint regions *Ω* ~1~,..., *Ω* ~*K*~ and ensure smooth inside each region *Ω* ~*k*~. Notice that, given a labeling *𝒴*, the collection *Ω* ~*k*~ = {*i* ∈ *Ω* \| *y* ~*i*~ = *k*} for *k* ∈ *𝒦* is one of these regions. Also, given the segmentation *Ω* ~*k*~ for *k* ∈ *𝒦*, the image {*y* ~*i*~ \| *y* ~*i*~ = *k*  if  *i* ∈ *Ω* ~*k*~, *i* ∈ *Ω*} is a labeling. It is a one-to-one relationship between the labeling and the segmentation. Thus, the image segmentation problem can be considered as a labeling problem.

2.2. Bayesian Model with Spatial Constraint {#sec2.2}
-------------------------------------------

In Bayesian framework, inference is often carried out by maximizing the posterior distribution $$\begin{matrix}
{P\left( {\mathcal{Y}\, \mid \,\mathcal{X}} \right) \propto P\left( {\mathcal{X}\, \mid \,\mathcal{Y}} \right)P\left( \mathcal{Y} \right),} \\
\end{matrix}$$ where *P*(*𝒳* \| *𝒴*) is the likelihood function and *P*(*𝒴*) is the prior distribution.

When the pixels are considered independent of each other, the likelihood function can be written as $$\begin{matrix}
{P\left( {\mathcal{X}\, \mid \,\mathcal{Y}} \right) = \prod\limits_{i \in \Omega}P\left( {x_{i}\, \mid \, y_{i}} \right)} \\
{= \prod\limits_{k = 1}^{K}\,\prod\limits_{i \in \Omega_{k}}P\left( {x_{i}\, \mid \, y_{i} = k} \right).} \\
\end{matrix}$$

However, the spatial relationships between neighboring pixels are not taken into account. To improve the accuracy of the segmented results, the spatial dependencies should be taken into account.

In this paper, we use a modeling strategy for the spatial dependencies between the conditional probabilities. The conditional probability *P*(*x* ~*i*~ \| *y* ~*i*~) is defined as a mixture distribution over the conditional probabilities of neighboring pixels *j*, *j* ∈ *𝒩* ~*i*~, that is, $$\begin{matrix}
{P\left( {x_{i}\, \mid \, y_{i}} \right) = \prod\limits_{j \in \mathcal{N}_{i}}\lambda_{ij}P\left( {x_{j}\, \mid \, y_{j}} \right),} \\
\end{matrix}$$ where *λ* ~*ij*~ are fixed positive weights and for each *i* holds ∑~*j*~ *λ* ~*ij*~ = 1. The mixing weight *λ* ~*ij*~ depends on the geometric closeness between the pixels *i* and *j*. Thus, the above likelihood function can be expressed as $$\begin{matrix}
{P\left( {\mathcal{X}\, \mid \,\mathcal{Y}} \right) = {\prod\limits_{i \in \Omega}{\prod\limits_{j \in \mathcal{N}_{i}}{\lambda_{ij}P\left( x_{j}\, \mid \, y_{j} \right)}}}} \\
{= {\prod\limits_{i \in \Omega}{\,{\prod\limits_{k = 1}^{K}{\prod\limits_{j \in \mathcal{N}_{i}\bigcap\Omega_{k}}{\lambda_{ij}P\left( {x_{j}\, \mid \, y_{j} = k} \right).}}}}}} \\
\end{matrix}$$

Let *P*(*x* ~*i*~ \| *θ* ~*k*~) be the parameter form of the *P*(*x* ~*i*~ \| *y* ~*i*~ = *k*). Usually, it is assumed to be Gaussian distribution $$\begin{matrix}
{P\left( {x_{i}\, \mid \,\theta_{k}} \right) = \frac{1}{\sqrt{2\pi\sigma_{k}^{2}}}\exp\left( {- \frac{\left( {x_{i} - \mu_{k}} \right)^{2}}{2\sigma_{k}^{2}}} \right).} \\
\end{matrix}$$

The log-likelihood function of Bayesian model ([4](#EEq4){ref-type="disp-formula"}) is given by $$\begin{matrix}
{\mathcal{L}\left( {\mu,\sigma} \right)} \\
{\quad = {\sum\limits_{i \in \Omega}{\,{\sum\limits_{k = 1}^{K}{\sum\limits_{j \in \mathcal{N}_{i}\bigcap\Omega_{k}}{\log\left( {\lambda_{ij}P\left( {x_{j}\, \mid \,\theta_{k}} \right)} \right)}}}}}\,} \\
{\quad = {\sum\limits_{i \in \Omega}{\,{\sum\limits_{k = 1}^{K}{\sum\limits_{j \in \mathcal{N}_{i}\bigcap\Omega_{k}}\left\lbrack {\log\lambda_{ij} + \log P\left( {x_{j}\, \mid \,\theta_{k}} \right)} \right\rbrack}}}}\,} \\
{\quad = {\sum\limits_{i \in \Omega}{\,{\sum\limits_{k = 1}^{K}{\sum\limits_{j \in \mathcal{N}_{i}\bigcap\Omega_{k}}\left\lbrack {\log\lambda_{ij} - \frac{1}{2}\log\left( {2\pi\sigma_{k}^{2}} \right) - \frac{\left( {x_{j} - \mu_{k}} \right)^{2}}{2\sigma_{k}^{2}}} \right\rbrack}}}},} \\
\end{matrix}$$ where *λ* ~*ij*~ are fixed positive weights and for each *i* it holds ∑~*j*~ *λ* ~*ij*~ = 1. The mixing weight *λ* ~*ij*~ depends on the geometric closeness between the pixels *i* and *j* \[[@B40]\].

The geometric closeness *h* ~*ij*~ is a Gaussian function of the magnitude of the relative position vector of pixel *j* from pixel *i*, \|\|*u* ~*i*~ − *u* ~*j*~\|\|. The geometric closeness function is given as a decreasing function when the distance \|\|*u* ~*i*~ − *u* ~*j*~\|\| increases as $$\begin{matrix}
{h_{ij} = \exp\left( \frac{- \left. ||{u_{i} - u_{j}} \right.||^{2}}{2\sigma_{g}^{2}} \right),} \\
\end{matrix}$$ where *σ* ~*g*~ is parameter, which defines the desired structural locality between neighboring pixels, and *u* ~*i*~ and *u* ~*j*~ are the location of the pixel *i* and *j*, respectively. We use a 3 × 3 neighborhood window and we suggest *σ* ~*g*~ ^2^ = 10.

We define the mixing weight *λ* ~*ij*~ as follows: $$\begin{matrix}
{\lambda_{ij} = \frac{h_{ij}}{\sum_{j \in N(i)}^{}h_{ij}}.} \\
\end{matrix}$$

Note that *λ* ~*ij*~ are fixed constants, and we can drop the term that depends only on *λ* ~*ij*~. Image segmentation can be performed by maximizing log-likelihood function *ℒ*(*μ*, *σ*) ([6](#EEq6){ref-type="disp-formula"}) with respect to the parameter *μ*, *σ* as $$\begin{matrix}
{\arg\underset{\mu,\sigma}{\max\,}\mathcal{L}\left( {\mu,\sigma} \right)} \\
\left. {}{}\quad\Leftrightarrow\arg\underset{\mu,\sigma}{\max} - \frac{1}{2}{\sum\limits_{i \in \Omega}{\,{\sum\limits_{k = 1}^{K}{\sum\limits_{j \in \mathcal{N}_{i}\bigcap\Omega_{k}}\left\lbrack {\log\left( {2\pi\sigma_{k}^{2}} \right)} \right.}}}} \right. \\
{\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad  \quad\quad\quad  \quad\quad\quad  \left. {+ \frac{\left( {x_{j} - \mu_{k}} \right)^{2}}{\sigma_{k}^{2}}} \right\rbrack.} \\
\end{matrix}$$

2.3. Energy Minimization {#sec2.3}
------------------------

Since the logarithm is a monotonically increasing function, it it more convenient to consider the negative likelihood function as an energy function as $$\begin{matrix}
{\mathcal{E}\left( {\mu,\sigma} \right) = \frac{1}{2}\sum\limits_{i \in \Omega}\,\sum\limits_{k = 1}^{K}\sum\limits_{j \in \mathcal{N}_{i}\bigcap\Omega_{k}}\left\lbrack {\log\left( {2\pi\sigma_{k}^{2}} \right) + \frac{\left( {x_{j} - \mu_{k}} \right)^{2}}{\sigma_{k}^{2}}} \right\rbrack.} \\
\end{matrix}$$ Thus, image segmentation problem can be solved by minimizing energy *ℰ*(*μ*, *σ*) ([10](#EEq10){ref-type="disp-formula"}) with respect to the parameter *μ*, *σ*.

We assume that the variance of the proposed energy ([10](#EEq10){ref-type="disp-formula"}) has the common form *σ*. Thus, the functional for the proposed energy ([10](#EEq10){ref-type="disp-formula"}) can be written as $$\begin{matrix}
{\mathcal{F}\left( \mu \right) = {\sum\limits_{i \in \Omega}{\,{\sum\limits_{k = 1}^{K}{\sum\limits_{j \in \mathcal{N}_{i}\bigcap\Omega_{k}}\left( {x_{j} - \mu_{k}} \right)^{2}}}}}.} \\
\end{matrix}$$ We introduce kernel function *ρ*(*x* ~*i*~, *x* ~*j*~) as a nonnegative window function $$\begin{matrix}
{\rho\left( {x_{i},x_{j}} \right) = \begin{cases}
{1,} & {\text{if}\,\, j \in \mathcal{N}_{i},} \\
{0,} & {\text{if}\,\,\text{otherwise}.} \\
\end{cases}} \\
\end{matrix}$$ With the window function, the energy function ([11](#EEq11){ref-type="disp-formula"}) can be rewritten as $$\begin{matrix}
{\mathcal{F}\left( \mu \right) = {\sum\limits_{i \in \Omega}{\,{\sum\limits_{k = 1}^{K}{\sum\limits_{j \in \Omega_{k}}{\rho\left( {x_{i},x_{j}} \right)\left( {x_{j} - \mu_{k}} \right)^{2}}}}}}.} \\
\end{matrix}$$ By exchanging the order of sum, we have $$\begin{matrix}
{\mathcal{F}\left( \mu \right) = {\sum\limits_{k = 1}^{K}{\,{\sum\limits_{j \in \Omega_{k}}{\sum\limits_{i \in \Omega}{\rho\left( {x_{i},x_{j}} \right)\left( {x_{j} - \mu_{k}} \right)^{2}}}}}}.} \\
\end{matrix}$$ For convenience, we can rewrite the above energy functional *ℱ*(*μ*) in the following form: $$\begin{matrix}
{\mathcal{F}\left( \mu \right) = {\sum\limits_{k = 1}^{K}{\,{\sum\limits_{j \in \Omega_{k}}{e_{k}\left( x_{j} \right)}}}},} \\
\end{matrix}$$ where *e* ~*k*~(*x* ~*j*~) is the function defined by $$\begin{matrix}
{e_{k}\left( x_{j} \right) = {\sum\limits_{i \in \Omega}{\rho\left( {x_{i},x_{j}} \right)\left( {x_{j} - \mu_{k}} \right)^{2}}}.} \\
\end{matrix}$$

We minimize the above proposed energy functional *ℱ*(*μ*) using the modified level set approach.

3. Algorithm {#sec3}
============

In this section, the energy ([10](#EEq10){ref-type="disp-formula"}) is converted to a level set formulation by representing the disjoint regions *Ω* ~1~,..., *Ω* ~*K*~ with a number of level set functions, with a regularization term on these level set functions.

We consider the two-phase level set formulation. The image domain *𝒳* is segmented into two disjoint regions *Ω* ~1~ and *Ω* ~2~. In level set methods, a level set function is a function that takes positive and negative signs. We use level set function to represent a partition of the domain *𝒳* into two disjoint regions *Ω* ~1~ and *Ω* ~2~ as $$\begin{matrix}
{\Omega_{1} = \left\{ {x_{i},\,\phi\left( x_{i} \right) > 0} \right\},\quad\quad\Omega_{2} = \left\{ {x_{i},\,\phi\left( x_{i} \right) < 0} \right\}.} \\
\end{matrix}$$

The regions *Ω* ~1~ and *Ω* ~2~ can be represented with their membership functions defined by the Heaviside function *H*(*ϕ*) as $$\begin{matrix}
{H\left( \phi \right) = \begin{cases}
{1,} & {\text{if}\,\,\phi \geq 0,} \\
{0,} & {\text{if}\,\,\phi < 0,} \\
\end{cases}} \\
{\delta\left( \phi \right) = \frac{d}{d\phi}H\left( \phi \right).} \\
\end{matrix}$$

Thus, the energy ([15](#EEq15){ref-type="disp-formula"}) can be expressed as the following level set formulation: $$\begin{matrix}
{\mathcal{F}\left( \mu \right) = {\sum\limits_{j \in \Omega_{1}}{e_{1}\left( x_{j} \right)H\left( {\phi\left( x_{j} \right)} \right)}}} \\
{+ {\sum\limits_{j \in \Omega_{2}}{e_{2}\left( x_{j} \right)\left( {1 - H\left( {\phi\left( x_{j} \right)} \right)} \right)}},} \\
\end{matrix}$$ where *e* ~*k*~(*x* ~*j*~) is defined in ([16](#EEq16){ref-type="disp-formula"}). The level set function *ϕ* and the parameters *μ* are the variables of the energy *ℱ* ([19](#EEq19){ref-type="disp-formula"}).

Let *ℒ*(*ϕ*) and *ℛ*(*ϕ*) denote the regularization terms of level set function *ϕ*. The energy term *ℒ*(*ϕ*) is defined by \[[@B41]\] $$\begin{matrix}
{\mathcal{L}\left( \phi \right) = {\sum\limits_{i \in \Omega}\left| {\nabla H\left( {\phi\left( x_{i} \right)} \right)} \right|}} \\
{= {\sum\limits_{i \in \Omega}{\delta\left( {\phi\left( x_{i} \right)} \right)\left| {\nabla\phi\left( x_{i} \right)} \right|}},} \\
\end{matrix}$$ which computes the arc length of the zero level contour of *ϕ* and serves to smooth the contour \[[@B41]\]. The energy term *ℛ*(*ϕ*) is defined by \[[@B42]\] $$\begin{matrix}
{\mathcal{R}\left( \phi \right) = {\sum\limits_{i \in \Omega}{\frac{1}{2}\left( {\left| {\nabla\phi\left( x_{i} \right)} \right| - 1} \right)^{2}}},} \\
\end{matrix}$$ where function *ℛ* is an energy density function, which is called a distance regularization term \[[@B42]\].

Therefore, combining these two energy terms with the energy *ℱ* ([19](#EEq19){ref-type="disp-formula"}), the total energy functional becomes $$\begin{matrix}
{\mathcal{F}\left( {\phi,\mu} \right) = \mathcal{F}\left( {\phi,\mu} \right) + \alpha\mathcal{L}\left( \phi \right) + \beta\mathcal{R}\left( \phi \right)} \\
{= {\sum\limits_{j \in \Omega_{1}}{e_{1}\left( x_{j} \right)H\left( {\phi\left( x_{j} \right)} \right)}}} \\
{+ {\sum\limits_{j \in \Omega_{2}}{e_{2}\left( x_{j} \right)\left( {1 - H\left( {\phi\left( x_{j} \right)} \right)} \right)}}} \\
{+ \alpha{\sum\limits_{i \in \Omega}{\delta\left( {\phi\left( x_{i} \right)} \right)\left| {\nabla\phi\left( x_{i} \right)} \right|}}} \\
{+ \beta{\sum\limits_{i \in \Omega}{\frac{1}{2}\left( {\left| {\nabla\phi\left( x_{i} \right)} \right| - 1} \right)^{2}}}.} \\
\end{matrix}$$

By minimizing the above energy, we obtain the result of image segmentation given by the level set function *ϕ* and the estimation of the parameters *μ*. The details of the algorithm for minimizing the energy ([22](#EEq22){ref-type="disp-formula"}) are given in the next section.

3.1. Modified Level Set Algorithm {#sec3.1}
---------------------------------

The energy minimization is achieved by an iterative process: in each iteration, we minimize the energy *ℱ*(*ϕ*, *μ*) ([22](#EEq22){ref-type="disp-formula"}) with respect to each of its variables *ϕ*, *μ*, given the other two updated in previous iteration. We give the solution to the energy minimization with respect to each variable as follows.

Keeping *μ* fixed and minimizing *ℱ*(*ϕ*, *μ*) ([22](#EEq22){ref-type="disp-formula"}) with respect to *ϕ*, we use the gradient descent method to solve the gradient flow equation as $$\begin{matrix}
{\frac{\partial\phi}{\partial t} = - \frac{\partial\mathcal{F}}{\partial\phi},} \\
\end{matrix}$$ where ∂*ℱ*/∂*ϕ* is the Gâteaux derivative \[[@B41]\] of the energy *ℱ*.

We compute the Gâteaux derivative ∂*ℱ*/∂*ϕ* and the corresponding gradient flow equation is $$\begin{matrix}
{\frac{\partial\phi}{\partial t} = \delta\left( \phi \right)\left( {e_{2} - e_{1}} \right) + \alpha\delta\left( \phi \right){div}\left( \frac{\nabla\phi}{\left| {\nabla\phi} \right|} \right)} \\
{+ \beta{div}\left( {\left( {1 - \frac{1}{\left| {\nabla\phi} \right|}} \right)\nabla\phi} \right).} \\
\end{matrix}$$

During the evolution of the level set function according to ([24](#EEq24){ref-type="disp-formula"}), the variables *μ* are updated by minimizing the energy *ℱ*(*ϕ*, *μ*) ([22](#EEq22){ref-type="disp-formula"}) with respect to *μ*.

Keeping *ϕ* fixed and minimizing *ℱ*(*ϕ*, *μ*) ([22](#EEq22){ref-type="disp-formula"}) with respect to *μ*, the variable *μ* can be expressed as $$\begin{matrix}
{\mu_{1} = \frac{{\sum_{i \in \Omega}{\sum_{j \in \mathcal{N}_{i}}{x_{j}H\left( {\phi\left( x_{j} \right)} \right)}}}‍{\,\,}‍}{\sum_{i \in \Omega}{\sum_{j \in \mathcal{N}_{i}}{H\left( {\phi\left( x_{j} \right)} \right)}}},} \\
{\mu_{2} = \frac{\sum_{i \in \Omega}{\sum_{j \in \mathcal{N}_{i}}{x_{j}\left( {1 - H\left( {\phi\left( x_{j} \right)} \right)} \right)}}}{\sum_{i \in \Omega}{\sum_{j \in \mathcal{N}_{i}}\left( {1 - H\left( {\phi\left( x_{j} \right)} \right)} \right)}}.} \\
\end{matrix}$$

Finally, the principal steps of the algorithm are as follows.Initialize *ϕ* ^*n*^, *n* = 0.Compute *μ* ~*k*~ ^*n*^, *k* = 1,2 by ([25](#EEq25){ref-type="disp-formula"}).Solve the PDE ∂*ϕ*/∂*t* = 0 where ∂*ϕ*/∂*t* is defined in ([24](#EEq24){ref-type="disp-formula"}) to obtain *ϕ* ^*n*+1^.Check whether the solution is stationary. If not, let *n* = *n* + 1 and repeat.

3.2. Numerical Approximation {#sec3.2}
----------------------------

In numerical implementation, in order to compute the unknown function *ϕ*, we consider the slightly regularized version of the Heaviside function *H*, denoted here by *H* ~*ε*~, which is computed by \[[@B41]\] $$\begin{matrix}
{H_{\varepsilon}\left( z \right) = \frac{1}{2}\left\lbrack {1 + \frac{2}{\pi}\arctan\left( \frac{z}{\varepsilon} \right)} \right\rbrack.} \\
\end{matrix}$$ Accordingly, the dirac delta function *δ*, which is the derivative of the Heaviside function, is replaced by the derivative of approximation Heaviside function *H* ~*ε*~. The dirac delta function *δ* is given by $$\begin{matrix}
{\delta_{\varepsilon}\left( z \right) = \frac{1}{\pi}\frac{\varepsilon}{\varepsilon^{2} + z^{2}}.} \\
\end{matrix}$$

Since the energy is nonconvex, the solution may be the local minima. With the Heaviside function *H* ~*ε*~ and the dirac delta function *δ* ~*ε*~, the algorithm has the tendency to compute the global minimizer. Thus, the algorithm is not sensitive to the position of the initial curve.

4. Experiments {#sec4}
==============

In this section, we have evaluated and compared the proposed method for the segmentation of retinal images. The retinal images are obtained from two publicly available databases the DRIVE database \[[@B38]\] and the STARE database \[[@B39]\]. In the experiments, we generally choose the parameters as follows: *α* = 1.0 and the time step Δ*t* = 0.1. After many experiments on a small number of example images, we have found that, when *β* = 0.001 × 255^2^, the performance is very good. In all the following experiments, the values of the parameters are same.

The images of the DRIVE database are with 565 × 584 pixels and 8 bits per color channel. The database includes binary images with the results of manual segmentation, which have been used as ground truth to evaluate the performance of the vessel segmentation methods. The retinal images of the STARE database are digitized to 700 × 605 pixels, 8 bits per RGB channel. The STARE database contains 20 images for blood vessel segmentation: 10 normal images and 10 abnormal images. Binary images with manual segmentations are also available for each image of this database.

Evaluation of the developed method is done on the DRIVE and STARE databases. Experimental results are compared to those obtained using other vessel segmentation methods. To facilitate the comparison with other retinal vessel segmentation methods, the segmentation accuracy has been selected as performance measure. The segmentation accuracy has been defined by the ratio of the total number of correctly classified pixels by the number of pixels in the field of view (FOV). It contains values in the range \[0,1\], with values closer to 1 indicating a good result. Other important measures are sensitivity and specificity. In this paper, the sensitivity is estimated by the percentage of pixels correctly classified as vessel pixels. The specificity stands for the fraction of pixels erroneously classified as vessel pixels. The ground truth for evaluating the performance measures was a manual segmentation result which is provided together with each database image.

A majority of the pixels are often easy to be classified by the previous methods; however, some of the pixels, such as those on the boundary of a vessel, those for small vessels, and those for vessels near pathology, are difficult to be classified. The proposed method provides a novel way to account for spatial dependence between image pixels. Thus, it can reduce the sensitivity of the segmented results and guarantee connectedness of the vessel structure.

In the first experiment, the proposed method is done on retinal vessel images of DRIVE database. Image in [Figure 1(a)](#fig1){ref-type="fig"} shows the original retinal vessel images. The ground truth of the original retinal image is presented in [Figure 1(b)](#fig1){ref-type="fig"}. The segmentation result obtained by using the proposed method is illustrated in [Figure 1(c)](#fig1){ref-type="fig"}. It can observed that the proposed method obtains good results.

In order to test the accuracy and determine the efficiency of the proposed method, we do experiment on another retinal vessel image of the DRIVE database and compare the result with those obtained by other methods. [Figure 2(a)](#fig2){ref-type="fig"} shows a retinal image of the DRIVE database. The image in [Figure 2(b)](#fig2){ref-type="fig"} is the ground truth. Figures [2(c)](#fig2){ref-type="fig"}--[2(f)](#fig2){ref-type="fig"} present the segmentation results obtained by Niemeijer et al.\'s method \[[@B5]\], Staal et al.\'s method \[[@B2]\], Mendonça and Campilho (green intensity) method \[[@B18]\], and the proposed method, respectively. For visual inspection of the results, the proposed method produces a very good segmentation result.

To facilitate the comparison of our results to those presented by other authors in their original papers, the results have been calculated for the images of the DRIVE database. The value results of the proposed method are shown in [Table 1](#tab1){ref-type="table"}. The other vessel segmentation methods which are reported in their published papers are also presented in [Table 1](#tab1){ref-type="table"}. The performance measures of the proposed method in [Table 1](#tab1){ref-type="table"} are the average values for all the images of DRIVE database. We can view that the proposed method can capture more correctly classified vessel pixels and less erroneously classified vessel pixels than the other methods. The average accuracy of the proposed method is better than the other techniques.

In order to further test the accuracy and determine the efficiency of the proposed method, the proposed method has been tested on the images of the STARE database. Figures [3(a)](#fig3){ref-type="fig"} and [3(d)](#fig3){ref-type="fig"} show two retinal images of STARE database. Figures [3(b)](#fig3){ref-type="fig"} and [3(e)](#fig3){ref-type="fig"} present the ground truth, respectively. The results obtained by using the proposed method are shown in Figures [3(c)](#fig3){ref-type="fig"} and [3(f)](#fig3){ref-type="fig"}, respectively. For visual inspection, it can be seen that the proposed method can obtain very good results.

To compare our results to those reported in other published papers, we give the performance measures in [Table 2](#tab2){ref-type="table"}. The average accuracy, sensitivity, and specificity are used to measure the performance. We can note that the proposed method performs better than the other techniques.

The execution time of the proposed method depends on many parameters. For the images of the STARE database, one iteration time of the proposed method is less than 10 seconds. Convergence of the proposed algorithm may be achieved in less than 10 iterations.

5. Conclusion {#sec5}
=============

The accurate extraction of the retinal blood vessel can provide much help for diagnosis of cardiovascular and ophthalmologic diseases. Even though many techniques and algorithms have been developed, there is still room for improvement in blood vessel segmentation methodologies. In this paper, we have presented a novel Bayesian model for vessel segmentation. To overcome the drawback that the spatial information is not taken into account, the proposed model exploits the spatial information. To obtain the boundaries of the blood vessels, the modified level set approach is employed for minimizing the proposed energy function. The proposed method has been tested on real retinal image databases and the experimental results have been compared with those of other methods. Since the developed method takes the spatial information into account, it can result in very good performance in the detection of narrow and low contrast vessels and guarantee connectedness of the vessel structure. The comparison demonstrates that the proposed method outperforms other methods. In future work, we will compare the proposed method to other algorithms. Most of the techniques in the literature and the proposed method are evaluated on a limited range of databases (DRIVE and STARE). We will do more experiments on larger database and compare to more techniques in future.

![Experiment on two retinal images of DRIVE database. (a) Original retinal images. (b) Ground truth. (c) Segmentation results obtained by the proposed method.](CMMM2013-401413.001){#fig1}

![Experiment on retinal image of DRIVE database. (a) Original retinal image. (b) Ground truth. (c)--(f) Segmentation result obtained by Niemeijer et al.\'s method \[[@B5]\], Staal et al.\'s method \[[@B2]\], Mendonça and Campilho (green intensity) method \[[@B18]\], and the proposed method, respectively.](CMMM2013-401413.002){#fig2}

![Experiment on retinal images of STARE database. (a), (d) Original retinal images. (b), (e) Ground truth. (c), (f) Segmentation results obtained by the proposed method.](CMMM2013-401413.003){#fig3}

###### 

Performance of vessel segmentation methods (DRIVE images).

  Method                             Average accuracy   Sensitivity   Specificity
  ---------------------------------- ------------------ ------------- -------------
  Staal et al. \[[@B2]\]             0.9442             0.7194        0.9773
  You et al. \[[@B3]\]               0.9434             0.7410        0.9751
  Marín et al. \[[@B4]\]             0.9452             0.7067        0.9801
  Niemeijer et al. \[[@B5]\]         0.9417             0.6898        0.9696
  Zhang et al. \[[@B11]\]            0.9382             0.7120        0.9724
  Yin et al. \[[@B12]\]              0.9267             0.6252        0.9710
  Fraz et al. \[[@B15]\]             0.9430             0.7152        0.9769
  Miri and Mahloojifar \[[@B16]\]    0.9458             0.7352        0.9795
  Mendonça and Campilho \[[@B18]\]   0.9452             0.7344        0.9764
  Martinez-Perez et al. \[[@B21]\]   0.9344             0.7246        0.9655
  Martinez-Perez et al. \[[@B22]\]   0.9220             0.6602        0.9612
  Vlachos and Dermatas \[[@B23]\]    0.9291             0.7472        0.9550
  Espona et al. \[[@B29]\]           0.9352             0.7436        0.9615
  Proposed Method                    0.9529             0.7513        0.9792

###### 

Performance of vessel segmentation methods (STARE images).

  Method                             Average accuracy   Sensitivity   Specificity
  ---------------------------------- ------------------ ------------- -------------
  Staal et al. \[[@B2]\]             0.9442             0.7194        0.9773
  Soares et al. \[[@B6]\]            0.9454             0.7212        0.9730
  Hoover et al. \[[@B9]\]            0.9267             0.6751        0.9567
  Yin et al. \[[@B12]\]              0.9413             0.7249        0.9666
  Fraz et al. \[[@B15]\]             0.9442             0.7311        0.9680
  Mendonça and Campilho \[[@B18]\]   0.9440             0.6996        0.9730
  Martinez-Perez et al. \[[@B21]\]   0.9410             0.7506        0.9569
  Martinez-Perez et al. \[[@B22]\]   0.9240             0.7790        0.9409
  Zhang et al. \[[@B30]\]            0.9087             0.7373        0.9736
  Proposed Method                    0.9476             0.7147        0.9735

[^1]: Academic Editor: William Crum
