Introduction

Magnetic Resonance Imaging (MRI) is an important non-invasive medical imaging technique for the early detection of diseases and therapy planning. Especially, MR brain images play a vital role in the analysis of a variety of diseases, including Schizophrenia, Multiple Sclerosis, brain tumors etc., Segmentation of brain images is an important and challenging task in the analysis of these diseases and proper treatment planning. Manual Segmentation is time consuming and it leads to intra and inter observer variability. Hence methods of automatic segmentation of brain images into three tissue regions – White Matter (WM), Gray Matter (GM) and Cerebrospinal Fluid (CSF) are in research focus. An image can be modeled as the union of c homogenous regions \( {\displaystyle {\cup}_{k=1}^c{A}_k} \) where each homogeneous region is specified by A k  = b k  p k +\( {n}_k \) where p k represents signal intensity,b k represents a multiplicative bias field and n k represents additive, zero mean random noise component. The difficulties associated with MR brain image segmentation arise from three main factors which are (a) Partial Volume Effect (b) Intensity Non-Uniformity (INU) and (c) Noise. Partial Volume Effects occur because of multiple pixels contributing to a single pixel, resulting in blurring of intensity across boundaries. These effects occur due to the limited resolving power of the imaging device and due to these, finer anatomical details are lost in the image. The INU artifact arises due to the inhomogeneity in the magnetic field and results in an unwanted low frequency bias term modulating the signal. All MR images are affected by random noise. The noise comes from the stray currents in the detector coil due to the fluctuating magnetic fields arising from random ionic currents in the body, or the thermal fluctuations in the detector coil itself. The most popular clustering methods for MR brain image segmentation are the Fuzzy C Means Clustering (FCM) and the Gaussian Mixture Model – Expectation Maximization (EM) [13]. But these methods, as such, fail to address the problems of Partial Volume Effects, Intensity Non-Uniformity and Noise. Hence modifications are required to the conventional FCM and EM to make them overcome these adverse effects which considerably reduce the segmentation accuracy. The conventional methods for MR brain image segmentation does not incorporate the spatial incorporation among the neighboring pixels and also does not consider the low frequency bias field existing in the image. Various techniques have been proposed in literature which modify the existing methods to address these issues specifically to the MR brain image segmentation.

An expectation Maximization algorithm with extension for partial volume effects is proposed [4]. Thanh Minh Nguyen et al. and Balafar proposed methods of incorporating spatial relationship between neighboring pixels into the standard GMM [57]. Markov Random field (MRF) is an efficient method for MR brain image segmentation. Mei Xie et al. [8] Proposed modified MRF which is an interleaved method combining the segmentation and bias field estimation. Each tissue represented by a large number of Gaussian components to capture the complex tissue spatial layout has been proposed [9]. Extension of traditional Gaussian mixtures expectation-maximization Segmentation to a power transformation has been proposed [10]. M. Y. Siyal et al. [11] proposed an intelligent modified FCM in which the objective function of the FCM is modified to deal with the problems of INU and noise. Several methods of FCM incorporated with spatial information have been proposed recently [1216]. Multiresolution methods have also been proposed to integrate the spatial information in the segmentation process [17, 18]. Zengsi Chen et al. [19] proposed the method of incorporating non-local regularization mechanism for simultaneous image segmentation and bias field estimation. Other methods like Ant Colony Optimization Algorithm and Active Contour Model are also available which overcome the effect of INU and noise [2022].

In the clustering process of FCM, the membership function is convolved with the mean filter in all iterations to incorporate the spatial information [23]. Similarly, methods of incorporating spatial information by convolving the posterior probability of the Expectation Maximization algorithm with spatial factor – mean, Gaussian and non-local means filters in all iterations and pixel re-labeling of IBSR data has been proposed [24]. It is observed that to overcome the effect of bias field and noise in the segmentation process, both spatial information and the bias correction has to be incorporated in the segmentation process. Hence, in the proposed method, the bias correction term is introduced in the objective function of FCM and in the distribution function of EM. Also, after bias correction, the spatial information is included through convolving of the posterior probability and membership function with spatial filter in one of the iterations alone. The contributions of the article are:

  • Integrating bias field correction with Spatial FCM and EM.

  • Incorporating the spatial information among the neighboring pixels by the method of convolving the posterior probability in EM and the membership function matrix in FCM with mean filter in the one of the iterations alone.

  • A method or re-labeling the pixels [23, 24] to improve the segmentation accuracy has been included.

The proposed method is fully automatic and operates on all the slices of the volume of MR brain images. The method is tested on synthetic brain image data from Brainweb and real brain images from IBSR. The rest of the paper is organized as follows. Section 2 describes the FCM and GMM-EM algorithms with their proposed modified method for bias correction and spatial information. In Section 3, experimental results are discussed with conclusion in Section 4.

FCM, EM algorithms and modified method

Gaussian mixture model - spatial EM algorithm with bias correction

In the case of single real valued variable x, the Gaussian distribution is defined by

$$ N\left(x|\mu, {\sigma}^2\right)=\frac{1}{\left(2{\pi \sigma}^2\right)\begin{array}{c}\hfill \frac{1}{2}\hfill \\ {}\hfill\ \hfill \end{array}} \exp \left\{-\frac{1}{2{\sigma}^2}{\left(x-\mu -b\right)}^2\right\} $$
(1)

where μ is the mean, σ2 is the variance and b is the bias field [25, 26].

The Gaussian mixture distribution can be composed as a linear superposition of K Gaussian densities of the form

$$ p(x)={\displaystyle {\sum}_{k=1}^K{\pi}_{k\ }N\left({x}_n/{\mu}_k,{\sigma}_k^2,{b}_k\right)} $$
(2)

Each Gaussian density \( N\left({x}_n/{\mu}_k,{\sigma}_k^2,{b}_k\right) \) is called a component of the mixture with its own mean μ k , variance \( {\sigma}_k^2 \) and bias b k . The parameter \( {\pi}_k \)are called the mixing coefficients.

$$ {\displaystyle {\sum}_{k=1}^K{\pi}_k=1\kern0.5em \mathrm{and}\kern0.5em 0\le {\pi}_k\le 1} $$
(3)

From Bayes’ theorem, the posterior probabilities p (k/x) are given by

$$ {\gamma}_k(x)=p\left(k/x\right)=\frac{\pi_kN\left({x}_n|{\mu}_k,{\sigma}_k^2,{b}_k\right)}{{\displaystyle {\sum}_{k=1}^K}{\pi}_kN\left({x}_n|\ {\mu}_k,{\sigma}_{k,}^2,{b}_k\right)} $$
(4)

From Eq. 2, The log of the likelihood function is given by

$$ \ln p\left(x|\pi, \mu, {\sigma}^2\right)={\displaystyle {\sum}_{n=1}^N \ln}\left\{{\displaystyle {\sum}_{k=1}^K{\pi}_kN\left({x}_n|{\mu}_k,{\sigma}_k^2,{b}_k\right)}\right\} $$
(5)

For maximizing the log likelihood, the derivatives of Eq. 5 with respect to μ k , \( {\sigma}_k^2,{b}_k \) and π k are set to zero.

$$ {N}_k={\displaystyle {\sum}_{n=1}^N{\gamma}_k(x)} $$
(6)

The parameters are obtained as

$$ {\mu}_k=\frac{1}{N_k}{\displaystyle {\sum}_{n=1}^N{\gamma}_{k\ }\left.(x)\right)\left({x}_n-{b}_k\right)} $$
(7)
$$ {\sigma}_k^2=\frac{1}{N_k}{\displaystyle {\sum}_{n=1}^N{\gamma}_k(x){\left({x}_n-{\mu}_k-{b}_k\right)}^2} $$
(8)
$$ {\uppi}_{\mathrm{k}} = \frac{{\mathrm{N}}_{\mathrm{k}}}{\mathrm{N}} $$
(9)
$$ {b}_k=\frac{1}{N_k}{\displaystyle {\sum}_{n=1}^N{\gamma}_{k\ }\left.(x)\right)\left({x}_n-{\mu}_k\right)} $$
(10)

The spatial EM algorithm with bias correction is explained in the next steps.

Given a Gaussian Mixture Model, the goal is to maximize the likelihood function with respect to the parameters – mean, variance, bias and mixing coefficient.

  1. Step 1:

    Initialize the number of classes, threshold, means μ k , bias field b k , variances \( {\sigma}_k^2 \) and mixing coefficients \( {\pi}_k \)for all the classes, and evaluate the initial value of the log likelihood.

  2. Step 2:

    E Step: Evaluate the posterior probabilities using the current parameter values (Eq. 4).

  3. Step 3:

    For the first iteration alone, convolve the posterior probability with the mean filter given by

$$ {M}_F=\left[\begin{array}{ccc}\hfill 1/9\hfill & \hfill 1/9\hfill & \hfill 1/9\hfill \\ {}\hfill 1/9\hfill & \hfill 1/9\hfill & \hfill 1/9\hfill \\ {}\hfill 1/9\hfill & \hfill 1/9\hfill & \hfill 1/9\hfill \end{array}\right] $$
(11)
  1. Step 4:

    M Step: Re-estimate the parameters (Eqs. 710) mean μ k , bias field b k , variance \( {\sigma}_k^2 \) and mixing coefficients π k .

  2. Step 5:

    Evaluate the Log likelihood (Eq. 5) and check for convergence. The convergence criterion is selected as that the log likelihood increases by less than 1% from one iteration to the next [27]. If the convergence criterion is not satisfied, return to step2.

  3. Step 6:

    Each pixel is assigned to the class that has the highest probability density p(x) (Eq. 2) and perform segmentation of the image subtracted with the bias.

Spatial fuzzy C means algorithm with bias correction

FCM clustering was developed by Bezdek and it is very widely applied to image segmentation. Let X = {x1, x2,….. xn} denotes the set of data points to be partitioned into c clusters. The objective function of FCM to be minimized is defined as follows:

$$ {J}_m={\displaystyle {\sum}_{k=1}^c{\displaystyle {\sum}_{i=1}^n{u}_{ki}^m{\left\Vert {x}_i-\kern0.5em {b}_k-{v}_k\right\Vert}^2}} $$
(12)
$$ where\ {\displaystyle {\sum}_{k=1}^c{u}_{ki} = 1,}\kern0.5em {u}_{ki\kern0.5em }\varepsilon\ \left[0,1\right]\ \mathrm{and}\ 0\le {\displaystyle {\sum}_{i=1}^n{u}_{ki}\le \mathrm{n}} $$
(13)

u ki represents the membership function of ith data point to kth cluster, m > 1 is the degree of fuzzyfication and vk represents the kth cluster center and b k represents the bias field [28, 29]. By minimizing Eq. (12), the update equations for membership functions, cluster center and bias filed are obtained as,

$$ {u}_{ki}=\frac{1}{{\displaystyle {\sum}_{l=1}^c}{\left(\frac{{\left\Vert {x}_{i-}{b}_k-{v}_k\right\Vert}^2}{{\left\Vert {x}_{i-}{b}_l-{v}_l\right\Vert}^2}\right)}^{\frac{1}{m}}} $$
(14)
$$ {v}_k=\frac{{\displaystyle {\sum}_{i=1}^n}{u}_{ki\kern0.5em }^m\left({x}_{i-}{b}_k\right)}{{\displaystyle {\sum}_{i=1}^n}{u}_{ki}^m} $$
(15)
$$ {b}_k=\kern0.5em \frac{{\displaystyle {\sum}_{i=1}^n}{u}_{ki\kern0.5em }^m\left({x}_{i-}{v}_k\right)}{{\displaystyle {\sum}_{i=1}^n}{u}_{ki}^m} $$
(16)

The spatial FCM algorithm with bias correction is explained in the next steps.

  1. Step 1:

    Initialize the number of clusters c , cluster centers v k, and m > 1.

  2. Step 2:

    Update the membership function matrix U = {u ki } by Eq. (14).

  3. Step 3:

    Update cluster centers V = {vk} by Eq. (15).

  4. Step 4:

    Update bias field by Eq. (16)

  5. Step 5:

    The process gets repeated until the cluster centers stabilized.

  6. Step 6:

    Convolve the membership function matrix with with the mean filter given by

$$ {M}_F=\left[\begin{array}{ccc}\hfill 1/9\hfill & \hfill 1/9\hfill & \hfill 1/9\hfill \\ {}\hfill 1/9\hfill & \hfill 1/9\hfill & \hfill 1/9\hfill \\ {}\hfill 1/9\hfill & \hfill 1/9\hfill & \hfill 1/9\hfill \end{array}\right] $$
(17)
  1. Step 7:

    Each pixel is assigned to a specific cluster for which the membership is maximal.

Re-labeling of pixels

The proposed method is tested on IBSR and Brainweb Data. The re-labeling of pixels to improve the segmentation accuracy is done for IBSR data which is explained in the following steps.

Step 1: Classify the pixels into three classes. The first two classes are labeled as GM and the third class as WM since the volume of CSF of IBSR data is very low.

Step 2: Perform histogram based EM segmentation with a number of classes as 7. The pixels obtained in class 2 are labelled as CSF.

Step 3: Re-label the GM pixels obtained in step 1, that are labelled as CSF in Step 2, as CSF.

Experiments and discussion

In this section, the proposed spatial FCM and EM with bias correction are applied to brain MR data, including T1-weighted brain MR images provided by the BrainWeb database and clinical brain MR images from the Internet Brain Segmentation Repository (IBSR) (www.bic.mni.mcgill.ca/brainweb/, www.nitrc.org/projects/ibsr). The method is fully automatic in the sense that it does not require any variation in the setting of the parameters for different cases.

Dice’s coefficient (DC) and Tanimoto Coefficient (TC) are used as the metrics to quantitatively evaluate the segmentation accuracy of the proposed method. The DC and TC are defined by

$$ DC\left(X,Y\right)=\frac{2\left|X{\displaystyle \cap }Y\right|}{\left|X\right|+\left|Y\right|} $$
(18)
$$ TC\left(X,Y\right)=\frac{\left|X{\displaystyle \cap }Y\right|}{\left|X{\displaystyle \cup }Y\right|} $$
(19)

Where |.| represents the area of a region, X is the region segmented by segmentation algorithms, and Y is the corresponding region in the ground truth. The closer the DC and TC values to 1 means the better segmentation accuracy. The system configuration used is Intel Core 2 Duo CPU @2. 53GHz with 1.98GB of RAM. The algorithm is carried out using MATLAB.

Initial values and parameter selection

Spatial EM with bias correction

The number of classes is set as 4 – Background, CSF, GM and WM. The means are initialized using the K-Means algorithm. The variances are initialized with the maximum pixel value in the image. The mixing coefficients are initialized with equal proportionate for all the classes and it is calculated for all the pixels. The bias field is initialized to zero and updated in every iteration using Eq. 10. The convergence criterion is selected as that the log likelihood increases by less than 1% from one iteration to the next.

Spatial FCM with bias correction

The background pixels are removed in the FCM segmentation. The number of classes is set at 3 – CSF, GM and WM. The cluster centers are initialized using the K-Means algorithm. The bias field is initialized to zero and updated in every iteration using Eq. 16. The termination criterion is set as (V new  − V old )2 < 0.001.

Results on IBSR brain images

The proposed spatial FCM and spatial EM with bias correction methods are applied to segment 3-D MR images with intensity inhomogeneity, noise and low contrast. The proposed methods are tested on 20 normal T1-weighted 3D MR images from IBSR. Each volume consists of around 60 coronal T1 slices of dimension 256 × 256 and a voxel size of 1.0 × 1.0 × 3.0 mm3. Each of the brain volumes in the IBSR site is provided with manual segmentation by expert clinicians. The results are compared with that of six segmentation algorithms provided by the IBSR, MAP, adaptive MAP, Biased MAP, FCM, tree-structure k-mean, and maximum-likelihood classifier algorithms. Figure 1 shows the qualitative comparison of the segmentation results of the spatial FCM and EM with bias correction with that of the conventional FCM and EM. Figs. 2 and 3 depicts the quantitative analysis of the proposed method with that of the segmentation results of the six algorithms available in the IBSR website for 10 datasets. Figure 4 and Table 1 depict the result comparison of the average segmentation results obtained over twenty 3D MR brain images with that of six different algorithms provided by IBSR and Spatial Constrained K-mean Algorithm [17].

Fig. 1
figure 1

a T1 weighted original MR brain image IBSR volume 12_3 – Slice 30 b Ground Truth c Segmentation by FCM d Segmentation by EM e Segmentation by Spatial EM with bias correction f Segmentation by Spatial FCM with bias correction

Fig. 2
figure 2

Comparison of the Tanimoto Coefficient (TC) for 10 volumes - Proposed Spatial FCM with bias correction method with six different algorithms provided by IBSR (a) GM (b) WM

Fig. 3
figure 3

Comparison of the Tanimoto Coefficient (TC) for 10 volumes - Proposed Spatial EM with bias correction method with six different algorithms provided by IBSR (a) GM (b) WM

Fig. 4
figure 4

Comparison of the average Tanimoto Coefficient (TC) for 20 volumes - Proposed Spatial EM and Spatial FCM with bias correction method with six different algorithms provided by IBSR and Spatial Constrained K-mean algorithm

Table 1 Comparison of the mean Tanimoto Coefficient (TC) for 20 volumes - Proposed method with six different algorithms provided by IBSR and Spatial Constrained K-mean algorithm. Bold figures indicate superior performance

The qualitative and quantitative result analysis depicts that the proposed method is superior to the conventional methods by around 25% and over the state-of-the art method by 8%.

Results in brainweb simulated MR images

The simulated 3-D MRI data are obtained from the Brain Web Database at McConnell Brain Imaging Center of the Montreal Neurological Institute (MNI), McGill University, Canada. A set of T1-weighted images of dimension 181 × 217 × 181 and a voxel size of 1 × 1 × 1 mm3 with varying noise levels of 3%, 5%, 7% and 9% and intensity inhomogeneity of 0%, 20% and 40% is used in this experiment. Segmentation ground truth is available in the BrainWeb and hence it is able to evaluate and compare the segmentation accuracy with other methods. For 3% and 5% noise levels, the spatial factor term has not been included since the noise level is very low and incorporation of spatial term in addition to the bias term will result in smoothing of the image. Figure 5 shows the qualitative comparison of the segmentation results of the spatial FCM and EM with bias correction with that of the conventional FCM and EM. Tables 2,3 and 4 depict the segmentation results obtained (DC) for 20 images from BrainWeb.

Fig. 5
figure 5

a T1 weighted original MR brain image from BrainWeb with 0%INU and 9% Noise- Slice 100 b Ground Truth c Segmentation by FCM d Segmentation by EM e Segmentation by Spatial EM with bias correction f Segmentation by Spatial FCM with bias correction

Table 2 DC values of CSF for Segmentation of 20 images from BrainWeb with varying noise and INU levels by EM, FCM and proposed method. Bold figures indicate superior performance
Table 3 DC values of GM for Segmentation of 20 images from BrainWeb with varying noise and INU levels by EM, FCM and proposed method. Bold figures indicate superior performance
Table 4 DC values of WM for Segmentation of 20 images from BrainWeb with varying noise and INU levels by EM, FCM and proposed method. Bold figures indicate superior performance

The efficacy of the proposed method is validated by the qualitative and quantitative analysis. The proposed method gives better segmentation results even in the presence of high levels of noise and INU, and also fine structures are preserved. In Table 2, from the results of CSF segmentation, it is observed that there is decrease in segmentation accuracy for 5% of noise alone. This occurs since the spatial term is not included and the noise is more visible in the dark CSF structures.

The bias output of sample IBSR and BrainWeb images are shown in Fig. 6.

Fig. 6
figure 6

a Bias output of sample IBSR image b Bias output of sample BrainWeb Image

Conclusion

A fully automated method for MR brain image segmentation has been proposed. The method overcomes the major difficulties of Intensity Non-uniformity and noise associated with the conventional methods – FCM and EM. Spatial information and bias correction are integrated in the FCM and EM framework to overcome these effects. The proposed method has been tested on both simulated and real brain images from Brainweb and IBSR database respectively. It has been shown that the method outperforms the conventional and state- of-the art methods. The method can very well be extended to segmentation of clinical MR brain images and in the identification of pathologies.