Keywords

1 Introduction

Image segmentation is one of key tasks in image processing and computer vision. The target of image segmentation is to separate source image into several non-overlapping regions which have the same features such as intensity, color, tone, texture, etc. Many clustering-based methods have been proposed for image segmentation [2, 6, 11, 18, 23]. Compared with the other clustering methods, Fuzzy C-means (FCM) is one of the simplest and the most popular algorithms in field of image segmentation [2, 5, 10]. However, the performance of traditional FCM decreases very fast by the impact of noise, outliers and other image artifacts because in the algorithm, all of pixels in the images are regarded as individual points without any relationship [9].

To improve the performance of FCM algorithm, many modified FCM algorithms have been proposed [13, 20, 22]. Spatial relationship of neighborhood pixels, as a significant feature, is widely used in image segmentation [4, 19, 24], because the pixels in the immediate neighborhood usually have similar characteristics and have a high probability of belonging to the same cluster. Based on spatial information, Ahmed et al. [1] presented an FCM with spatial constraints (FCM_S) that the label of a pixel is influenced by labels in its neighborhood. Krinidis et al. [15] proposed a robust fuzzy local information c-means clustering algorithm (FLICM) by introducing a fuzzy factor, which works as a role to control noise tolerance and outlier resistance. Li and Qin [16] added \(L_p\) norm into FLICM named fuzzy local information \(L_p\) clustering (FLILp) and proposed a method of cluster center estimation, but it is hard to estimate accurately.

Markov random field model (MRF) [7, 17, 21] is a widely used tool to describe the mutual influences between data points, which is able to be extended to the image segmentation for representing the relationship between pixels. In [3], Chatzis applied hidden Markov random field into fuzzy clustering (HMRF-FCM) by taking Kullback-Leibler divergence information into fuzzy objective function. However, the procedure of the prior probability approximation and the potential parameter update in Markov model consume much time. In order to reduce the cost of time, Zhang [25] utilized mean template in distance function and prior probability. In [18], Liu et al. defined the dissimilarity function and prior probability function based on region-level information as well as pixel-level information to develop the robustness of the method.

In this paper, based on the HMRF-FCM algorithm, we propose a novel fuzzy clustering algorithm with local information and Markov random field for image segmentation with intense noise, which studies local information to remove the complex noise and preserve the details and edges. First, we take local spacial information and membership information into a new dissimilarity function to enhance the relationship of neighborhood. Second, in step of prior probability approximation in Markov model, the neighbor Euclidean distances and mean color level of neighborhood constitute a new weight in prior probability function. By using the new dissimilarity function and the prior function, the novel segmentation method considers more impacts of local information to produce a better result. In experiments, we compare our method with five other fuzzy c-means algorithms for image segmentation with intense noise environment to validate the proposed methods effectiveness and robustness.

2 Method

2.1 HMRF-FCM Algorithm

The HMRF-FCM Algorithm [3] was first introduced by Chatzis and Varvarigou. The algorithm is to segment image \(X=\{x_1,x_2,...,x_N\}\) into \(C(C\geqslant 2)\) classes. The HMRF-FCM illustrates the segmentation problem using hidden Markov random field model, and employs the posteriors and prior membership function to indicate the excellent modeling ability of Markov random field and the flexibility of fuzzy clustering [18]. The object function of HMRF-FCM is defined as follows:

$$\begin{aligned} Q_{\lambda } = \sum _{i=1}^{N}\sum _{k=1}^{C} r_{i,k}d_{i,k} + \lambda \sum _{i=1}^{N}\sum _{k=1}^{C} r_{i,k} \log \left( \frac{r_{i,k}}{\pi _{i,k}} \right) \end{aligned}$$
(1)

where \(r_{i,k}\), the membership degree in FCM algorithm, is the posteriors probability in HMRF model. \(\pi _{i,k}\) is the prior probabilities of the HMRF model, and the parameter \(\lambda \) is the fuzziness degree of the fuzzy membership values. \(d_{i,k}\) presents the dissimilarity between a pixel i and cluster centroids k. In HMRF-FCM, all observed data are emitted from multivariate Gaussian form, so we can obtain \(d_{i,k}\) from the negative log-posterior of a Gaussian distribution as:

$$\begin{aligned} d_{i,k} =\frac{1}{2}\left( Blog\left( 2\pi \right) +\left( x_i - \mu _k \right) '\Sigma _k ^{-1}\left( x_i - \mu _k \right) +\log \left( \left| \Sigma _k \right| \right) \right) \end{aligned}$$
(2)

where \(\mu _k\) and \(\Sigma _k\) are the mean and covariance matrix of the Gaussian distribution of the \(k^{th}\) class respectively. And B is the spectral number of image to be segmented.

In HMRF-FCM algorithm, \(\pi _{i,k}\) is the prior probabilities of the HMRF model, which is seen as the actual membership degree according to Kullback-Leibler divergence. The paper [3] gives a function of MRF \(\pi _{i,k}\) approximation as:

$$\begin{aligned} \pi _{i,k}=\frac{\exp \{\beta E_{i,k}\}}{\sum ^C_{l=1} \exp \{\beta E_{i,l}\}} \end{aligned}$$
(3)

where \(\beta \) is the parameter of clique potentials and \(E_{i,k}\) is the energy function, which counts the number of neighbor pixels whose label is k.

2.2 Proposed Method

In this paper, motivated by HMRF-FCM and FLICM, we proposed a new local spatial information incorporating Markov random field model based fuzzy C-means clustering, which is defined as:

$$\begin{aligned} Q_{\lambda } = \sum _{i=1}^{N}\sum _{k=1}^{C} r_{i,k}D_{i,k} + \lambda \sum _{i=1}^{N}\sum _{k=1}^{C} r_{i,k} \log \left( \frac{r_{i,k}}{\pi _{i,k}} \right) \end{aligned}$$
(4)

where \(D_{i,k}\) is a novel dissimilarity function different from the \(d_{i,k}\) in Eq. (1). We add a local neighborhood data \(d_{N_{i},k}\) into the dissimilarity measure to enhance the relationship between neighborhood pixels, which improves the robustness to noise.

$$\begin{aligned} D_{i,k}={d_{i,k}+(1-\pi _{i,k})^{m}d_{N_{i},k}} \end{aligned}$$
(5)

where \(d_{i,k}\) is the center-pixel distance as Eq. (2), m is the fuzzifier used in FCM, \(N_i\) is the set of the neighbors of data \(x_i\), and \(d_{N_i,k}\) is the neighbor-pixels distance to class k, given as:

$$\begin{aligned} d_{N_{i},k}=\frac{1}{{{Z}_{{{N}_{i}}}}}\sum _{j\in N_{i}}{\frac{1}{1+L_{ij}}d_{j,k}} \end{aligned}$$
(6)

where \({{{Z}_{{{N}_{i}}}}}\) is a normalized factor as \({{Z}_{{{N}_{i}}}}=\sum \nolimits _{j\in {{N}_{i}}}{{{(1+{{L}_{ij}})}^{-1}}}\). \(L_{ij}\) is the spatial Euclidean distance between pixels i and j. By using \(L_{ij}\), the influence of neighbor pixels on the center pixel, \({{(1+{{L}_{ij}})}^{-1}}\), can be determined automatically and decreases with Euclidean distance growing.

In the proposed method, the prior probability \(\pi _{i,k}\) is defined as a more simple and efficient form which removes time-consuming parameter \(\beta \) and energy term \(E_{i,k}\) in the Eq. (3).

$$\begin{aligned} \pi _{i,k}=\frac{(\sum _{j \in N _i}\omega _j r_{j,k})^\theta }{\sum ^C_{l=1}(\sum _{j \in N _i}\omega _j r_{j,l})^\theta } \end{aligned}$$
(7)

where \(\theta \) is the strength factor to control the performance, and \(\omega _j\) is the weighted parameter which determines the impact of the neighbor pixels on the central pixel, defined as

$$\begin{aligned} {{\omega }_{j}}=\frac{1}{1+{{L}_{ij}}\exp (\left| \overline{{{x}_{i}}}-\overline{{{x}_{j}}} \right| /T)} \end{aligned}$$
(8)

where \(\overline{{{x}_{i}}}\) is the local mean value of pixel i neighborhood, T presents the color level of the image. When the value of \(\overline{{{x}_{j}}}\) is close to \(\overline{{{x}_{i}}}\), it means that pixel i and j are homogeneous, otherwise, heterogeneous. By using \(\left| \overline{{{x}_{i}}}-\overline{{{x}_{j}}} \right| \) and \(L_{ij}\), the close and homogeneous pixels around would gain more weight and greater contribution to the prior probability approximation, while pixels far away and heterogeneous do less impact on the prior.

Applying Lagrange multiplier method to Eq. (4) with the constrain of \({{r}_{i,k}}\) (sum to one), \({r_{i,k}}\) is given as:

$$\begin{aligned} {{r}_{i,k}}=\frac{{{\pi }_{i,k}}\exp (-(1/\lambda ){{D}_{i,k}})}{\sum \limits _{l=1}^{C}{{{\pi }_{i,l}}\exp (-(1/\lambda ){{D}_{i,l}})}} \end{aligned}$$
(9)

The derivation of the mean \(\mu _k\) and the covariance matrix \(\Sigma _k\) is obtained from Lagrange function, given as

$$\begin{aligned} {{\mu }_{k}}=\frac{\sum \nolimits _{i=1}^{N}{{{r}_{i,k}}({{x}_{i}}+{{(1-{{\pi }_{i,k}})}^{m}}{{{\bar{x}}}_{i}})}}{\sum \nolimits _{i=1}^{N}{{{r}_{i,k}}(1+{{(1-{{\pi }_{i,k}})}^{m}})}} \end{aligned}$$
(10)
$$\begin{aligned} {{\Sigma }_{k}}=\frac{\sum \nolimits _{i=1}^{N}{ {{r}_{i,k}}(({{x}_{i}}-{{\mu }_{k}}){{({{x}_{i}}-{{\mu }_{k}})}^{T}}+{{(1-{{\pi }_{i,k}})}^{m}} ((\overline{{{x}_{i}}}-{{\mu }_{k}}){{(\overline{{{x}_{i}}}-{{\mu }_{k}})}^{T}}+{{\Sigma }_{\overline{{{x}_{i}}}}}) }}{\sum \nolimits _{i=1}^{N}{{{r}_{i,k}}(1+{{(1-{{\pi }_{i,k}})}^{m}})}} \end{aligned}$$
(11)

where \({{\Sigma }_{\overline{{{x}_{i}}}}}\) is local covariance matrix around pixel i.

The procedure of the proposed method can be summarized as Algorithm 1.

figure a

3 Experiment

To validate the effectiveness of the proposed algorithm, we compare it with five fuzzy clustering algorithms, i.e., FCM_S [1], HMRF-FCM [3], FLICM [15], FLILp [16] and Zhang’s method [25] which are extensively used in image segmentation. For all of the algorithms, we generally choose the parameters \(m=2\), \(\lambda =2\), \(\xi =0.001\), \(\theta =2\), \({{N}_{R}}=9\) (a \(3\times 3\) window centered around each pixel) in experiments. All parameters explained above are decided by reports of [16, 25] to perform better results.

We take the segmentation accuracy (SA) [12] to evaluate the six algorithms. It is defined as the sum of the correctly classified pixels divided by the sum of the total number of pixels.

$$\begin{aligned} \text {SA}=\underset{i=1}{\overset{C}{\mathop \sum }}\,\frac{{{A}_{i}}\mathop {\cap }^{}{{G}_{i}}}{\mathop {\sum }_{j=1}^{C}{{G}_{j}}} \end{aligned}$$
(12)

where \({{A}_{i}}\) represents the set of pixels belonging to the ith class by segmentation algorithm, while \({{G}_{i}}\) represents the set of pixels belonging to the ith class in ground truth.

3.1 Comparison Experiments on Synthetic Images

We apply the algorithms on a classification with four classes. Figure 1(a) is an image with four gray levels with different shapes. Figure 1(b) is an image of Fig. 1(a) contaminated with Gaussian noise (\(\delta =0.1\)). Figures 1(c–h) are the results of the six algorithms on Fig. 1(b). From these figures, we can see that FCM_S is sensitive to noise. The result of HMRF-FCM shows a rough segmentation image, even if the boundary is not clear enough. Due to improved spatial information employed, FLICM and FLILp are capable of removing a proportion of the noise, but still contain noise inside the area and fail to obtain good results. Since Zhang’s method and the proposed method combine the advantages of HMRF and FCM, their segmentation results are satisfactory. However, the edge of Zhang’s result is not as clear as that of the proposed.

Fig. 1.
figure 1

Clustering of a synthetic image with four classes. (a) Original image. (b) The original image with Gaussian (\(\delta =0.1\)). (c) Result of FCM_S. (d) Result of HMRF-FCM. (e) Result of FLICM. (f) Result of FLILp. (g) Result of Zhang’s method. (h) Result of proposed method

In order to further verify the robustness of the algorithm, all fuzzy clustering algorithms are implemented on Fig. 1(a) corrupted by 4 types of noise, i.e., Gaussian noise, ‘salt & pepper’ noise and two types of mixed noise. For the two types of mixed noise, one is that the variance of Gaussian noise is a constant while the noise intensity of ‘salt & pepper’ increases, while the other is the opposite.

Table 1 gives the segmentation accuracies of the six algorithms on Fig. 1(a) corrupted by 4 types of noise with different levels. It can be seen that the mean segmentation accuracy of our method (above \(97\%\)) is higher than that of the others. Besides, the accuracy of our method shows an expectable result in each item. Compared with Zhang’s algorithm, our method is able to obtain stable and robust performances on mixed noise, while the Zhang’s drops down very fast.

Table 1. Segmentation accuracy (%) of each algorithm on Fig. 1(a) corrupted by different noise with different levels. (Gaussian noise(G) and ‘Salt & Pepper’ noise(S))
Fig. 2.
figure 2

Clustering of a natural image. (a) Original image. (b) The original image with \(10\%\) ‘salt & pepper’ noise and Gaussian (\(\delta =0.2\)). (c) Result of FCM_S. (d) Result of HMRF-FCM. (e) Result of FLICM. (f) Result of FLILp. (g) Result of Zhang’s method. (h) Result of proposed method

3.2 Comparison Experiments on Natural Image

We also apply the six algorithms to a natural image. Figure 2(a) [8] is an image composed of flowers, leaves and background. Figure 2(b) is an image of Fig. 2(a) contaminated with \(10\%\) ‘salt & pepper’ noise and Gaussian noise (\(\delta =0.2\)). We set the number of clusters as 3 in the case. Figures 2(c–h) show the segmentation results obtained by the six algorithms, respectively. It is clearly indicated that FCM_S, FLICM and FLILp algorithms are all affected by the noise to different extent, which illustrates that these algorithms is not robust enough to image corrupted by mixed noise. From Figs. 2(d)(g)(h), HMRF shows its advantages of spatial modelling capabilities in natural image, which is more smooth than the original FCM with spatial information. Compared Fig. 2(h) with Fig. 2(g), we can see that our method performs a remarkable result of petals and stamens than Zhang’s method.

Figure 3 plots the curves of segmentation accuracy for different methods on Fig. 2(a). Experiments are implemented on the image corrupted by four types of noise. With the increase of noise level, the performances of all methods slide down but the proposed method deceases more slowly than the others. Besides, compared with Zhang’s method, our method is visibly robust in all cases. It can be seen that our method suppresses the influence of the noise.

Fig. 3.
figure 3

The segmentation accuracy (SA) vs. different noise with different level on Fig. 2(a)

3.3 Comparison Experiments on Brain MR Images

In this subsection, our method are evaluated on a synthetic brain MR image database-BrainWeb [14], which is a 3D simulated brain database that contains a set of realistic MRI data. The segmentation object is to divide the brain MR image into four part: gray matter (GM), white matter (WM), CSF and background. We select sixty brain slice images produced by the MRI simulator with different level noise. We choose two brain MR images randomly for presentation and carry out the numerical analysis on the whole set.

Fig. 4.
figure 4

Segmentation results on T1 brain MR image. (a) and (e) are the MR image examples with 3% noise. (b) and (f) are ground truth of two examples, respectively. (c) and (g) Result of Zhang’s method. (d) and (h) Result of our method

Figure 4 shows the results on two 3% noised MR image examples. As the part in red rectangle in Figs. 4(c)(d) and (g)(h) shown, our result preserves the details and local information, while Zhang’s method is hard to distinguish between noise and details so that the details are smoothed. It reflects that the mean template function in distance measurement and prior probability approximation might lose too much details and lead an unsatisfied result. Furthermore, we calculate the segmentation accuracy of the six algorithms on BrainWeb dataset with different level noise. In Table 2, our method obtains satisfied results compared with the other algorithms under 0%, 3% and 9% noise.

Table 2. Segmentation accuracy (%) of each algorithm on MRI dataset with different level noise

4 Conclusion

We proposed an adaptive fuzzy clustering algorithm with local information and Markov random field for image segmentation under intense noise. In this method, the new dissimilarity function created by the local information with distances of neighbors greatly enhances noise robustness and the novel prior probability function improves the performance on denoising and reduces computing time. The experiments validate the excellent clustering performance of our algorithm, and show that the proposed distance function with MRF model provides a better applicable way to address image segmentation under intense noise.