Abstract
Image segmentation is the process of partitioning the image into regions of interest in order to provide a meaningful representation of information. Nowadays, segmentation has become a necessity in many practical medical imaging methods as locating tumors and diseases. Hidden Markov Random Field model is one of several techniques used in image segmentation. It provides an elegant way to model the segmentation process. This modeling leads to the minimization of an objective function. Conjugate Gradient algorithm (CG) is one of the best known optimization techniques. This paper proposes the use of the nonlinear Conjugate Gradient algorithm (CG) for image segmentation, in combination with the Hidden Markov Random Field modelization. Since derivatives are not available for this expression, finite differences are used in the CG algorithm to approximate the first derivative. The approach is evaluated using a number of publicly available images, where ground truth is known. The Dice Coefficient is used as an objective criterion to measure the quality of segmentation. The results show that the proposed CG approach compares favorably with other variants of Hidden Markov Random Field segmentation algorithms.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
- Brain image segmentation
- Hidden Markov Random Field
- The Conjugate Gradient algorithm
- Dice Coefficient metric
1 Introduction
Automatic segmentation of medical images has become a crucial task due to the huge amount of data produced by imaging devices. Many popular tools as FSL [42] and Freesurfer [11] are dedicated to this aim. There are several techniques to achieve the segmentation. We can broadly classify them into thresholding methods [21, 28, 43], clustering methods [7, 31, 39], edge detection methods [5, 30, 35], region-growing methods [22, 34], watersheds methods [3, 24], model-based methods [6, 20, 25, 38] and Hidden Markov Random Field methods [1, 14, 14,15,16,17,18,19, 29, 42]. Threshold-based methods are the simplest ones that require only one pass through the pixels. They begin with the creation of an image histogram. Then, thresholds are used to separate the different image classes. For example, to segment an image into two classes, foreground and background, one threshold is necessary. The disadvantage of threshold-based techniques is the sensitivity to noise. Region-based methods assemble neighboring pixels of the image in non-overlapping regions according to some homogeneity criterion (gray level, color, texture, shape and model). We distinguish two categories, region-growing methods and split-merge methods. They are effective when the neighboring pixels within one region have similar characteristics. In model-based segmentation, a model is built for a specific anatomic structure by incorporating prior information on shape, location and orientation. The presence of noise degrades the segmentation quality. Therefore, noise removal phase is generally an essential prior. Hidden Markov Random Field (HMRF) [12] provides an elegant way to model the segmentation problem. It is based on the MAP (Maximum A Posteriori) criterion [40]. MAP estimation leads to the minimization of an objective function [37]. Therefore, optimization techniques are necessary to compute a solution. Conjugate Gradient algorithm [26, 33, 36] is one of the most popular optimization methods.
This paper presents an unsupervised segmentation method based on the combination of Hidden Markov Random Field model and Conjugate Gradient algorithm. This method referred to as HMRF-CG, does not require preprocessing, feature extraction, training and learning. Brain MR image segmentation has attracted a particular attention in medical imaging. Thus, our tests focus on BrainWebFootnote 1 [8] and IBSRFootnote 2 images where the ground truth is known. Segmentation quality is evaluated using Dice Coefficient (DC) [9] criterion. DC measures how much the segmentation result is close to the ground truth. This paper is organized as follows. We begin by introducing the concept of Hidden Markov Field in Sect. 2. Section 3 is devoted to the well known Conjugate Gradient algorithm. Section 4 is dedicated to the experimental results and Sect. 5 concludes the paper.
2 Hidden Markov Random Field (HMRF)
Let \(S=\{s_1,s_2,\dots ,s_{M}\}\) be the sites, pixels or positions set. Both image to segment and segmented image are formed of M sites. Each site \(s \in S\) has a neighborhood set \( V_s (S) \) (see an example in Fig. 1).
A neighborhood system V(S) has the following properties:
A r-order neighborhood system \( V^r(S) \) is defined by the following formula:
where \(\text{ distance }(s,t)\) is the Euclidean distance between pixels s and t. This distance depends only on the pixel position i.e., it is not related to the pixel value (see examples in Fig. 2). For volumetric data sets, as slices acquired by scanners, a 3D neighborhood system is used.
A clique c is a subset of S where all sites are neighbors to each other. For a non single-site clique, we have:
A p-order clique noted \( C_p \) contains p sites i.e. p is the cardinal of the clique (see an example in Fig. 3).
Let \(y=({y}_{1},{y}_{2},{\dots },{y}_{M })\) be the pixels values of the image to segment and \(x=({x}_{1},{x}_{2},{\dots },{x}_{M })\) be the pixels classes of the segmented image. \(y_i\) and \(x_i\) are respectively pixel value and class of the site \(s_i\). The image to segment y and the segmented image x are seen respectively as a realization of Markov Random families \(Y=({Y}_{1},{Y}_{2},{\dots },{Y}_{M })\) and \(X=({X}_{1},{X}_{2},{\dots },{X}_{M })\). The families of Random variables \( \{Y_s\}_{s \in S} \) and \( \{X_s\}_{s \in S} \) take their values respectively in the gray level space \( E_{y}=\{0,\ldots ,255\} \) and the discrete space \(E_x=\left\{ 1,{\dots },K\right\} \). K is the number of classes or homogeneous regions in the image. Configurations set of the image to segment y and the segmented image are respectively \(\varOmega _y=E_{y}^M\) and \(\varOmega _x=E_{x}^M\). Figure 4 shows an example of segmentation into three classes.
The segmentation of the image y consists of looking for a realization x of X. HMRF models this problem by maximizing the probability \(P\left[ X=x \;|\; {Y}=y\right] \).
where B is a constant, T is a control parameter called temperature, \( \delta \) is a Kronecker’s delta and \( \mu _{x_s} \), \( \sigma _{x_s} \) are respectively the mean and standard deviation of the class \(x_s\). When \(B>0\), the most likely segmentation corresponds to the constitution of large homogeneous regions. The size of these regions is controlled by the B value.
Maximizing the probability \( P[X=x\;|\;Y=y] \) is equivalent to minimizing the function \( \varPsi (x,y) \).
The computation of the exact segmentation \({x}^*\) is practically impossible [12]. Therefore optimization techniques are necessary to compute an approximate solution \(\hat{{x}}\).
Let \(\mu =(\mu _1,\dots ,\mu _j,\dots ,\mu _K)\) be the means and \(\sigma =(\sigma _1,\dots ,\sigma _j,\dots ,\sigma _K)\) be the standard deviations of the K classes in the segmented image \(x=(x_1,\dots ,x_s,\dots ,x_M)\) i.e.,
In our approach, we will minimize \(\varPsi (\mu )\) defined below instead of minimizing \(\varPsi (x,y)\). We can always compute x through \(\mu \) by classifying \(y_s\) into the nearest mean \(\mu _j\) i.e., \(x_s=j\) if the nearest mean to \(y_s\) is \(\mu _j\). Thus instead of looking for \(x^*\), we look for \(\mu ^*\). The configuration set of \(\mu \) is \(\varOmega _{\mu }=[0\dots 255]^K\).
where \(S_j\), \(\mu _j\) and \(\sigma _j\) are defined in the Eq. (6).
To apply unconstrained optimization techniques, we redefine the function \(\varPsi (\mu )\) for \(\mu \in \mathbb R^K\) instead of \(\mu \in [0 \dots 255]^K\) as recommended by [4]. Therefore, the new function \(\varPsi (\mu )\) becomes as follows:
3 Hidden Markov Random Field and Conjugate Gradient algorithm (HMRF-CG)
To solve the minimization problem expressed in Eq. 7, we used the nonlinear conjugate gradient method. This latter generalizes the conjugate gradient method to nonlinear optimization. The summary of the algorithm is set out below.
Let \(\mu ^0\) be the initial point and \(d^0=-\varPsi ^{'}(\mu ^{0})\) be the first direction search.
Calculate the step size \(\alpha ^k\) that minimizes \(\varphi _k(\alpha )\). It is found by ensuring that the gradient is orthogonal to the search direction \(d^k\).
At the iteration \(k + 1\), calculate \(\mu ^{k+1}\) as follows:
Calculate the residual or the steepest direction:
Calculate the search direction \(d^{k+1}\) as follows:
In conjugate gradient method there are many variants to compute \(\beta ^{k+1}\), for example:
-
1.
The Fletcher-Reeves conjugate gradient method:
$$\begin{aligned} \beta ^{k+1}= \frac{\left( r^{k+1}\right) ^T r^{k+1}}{\left( r^{k}\right) ^T r^{k}} \end{aligned}$$(14) -
2.
The Polak-Ribière conjugate gradient method:
$$\begin{aligned} \beta ^{k+1}= \max \left\{ \frac{\left( r^{k+1}\right) ^T \left( r^{k+1}-r^{k}\right) }{\left( r^{k}\right) ^T r^{k}}, 0 \right\} \end{aligned}$$(15)
To use conjugate gradient algorithm, we need the first derivative \(\varPsi ^{'}(\mu )=(\varDelta _1,\dots ,\varDelta _i,\dots ,\varDelta _K)\). Since no mathematical expression is available, it is approximated with finite differences [10]. In our tests, we have used a centered difference approximation to compute the first derivative as follows:
The good approximation of the first derivative relies on the choice of the value of the parameter \(\varepsilon \). Through the tests conducted, we have selected 0.01 as the best value. In practice, the application is implemented in the cross-platform Qt creator (C++) under Linux system. We have used the GNU Scientific Library implementation of Polak-Ribière conjugate gradient method [13, 32]. The HMRF-CG method is summarized hereafter.
-
Input:
y the image to segment, K the number of classes, B the constant parameter of HMRF, T the control parameter of HMRF, \(\mu ^0\) the initial point, \(\varepsilon \) the parameter used by the first derivative.
-
Initialization:
we define s as the minimizer structure of gsl_multimin_fdfminimizer type and we initialize it by: K the size problem, \(\varPsi \) the function to minimize using the Eq. 8, \(\varPsi ^{'}\) the first derivative of the function to minimize using the Eq. 16, \(\mu ^0\) the start point, gsl\(\_\)multimin\(\_\)fdfminimizer\(\_\)conjugate\(\_\)pr (Polak-Ribière conjugate gradient) the minimizer function.
-
Iterations:
we perform one iteration to update the state of the minimizer using the function gsl_multimin_fdfminimizer_iterate(s) and after that, we test s for convergence.
-
The stopping criterion:
in our case, the minimization procedure should stop when the norm of the gradient (\(||\varPsi ^{'}||\)) is less than \(10^{-3}\).
-
Output:
an approximation \(\hat{\mu }\) of \({\mu }^* \in \mathbb R^n\), \(\hat{x}\) the segmented image using \(\hat{\mu }\).
4 Experimental Results
In this section, we show the effectiveness of HMRF-CG method. To this end, we will make a comparison with some methods that are: improved k-means and MRF-ACO-Gossiping [41]. Next, we will show, the robustness of HMRF-CG method against noise, by doing a comparison with FAST FSL(FMRIBs Automated Segmentation Tool) and LGMM (Local Gaussian Mixture Model)[23]. To perform a fair and meaningful comparison, we have used a metric known as Dice Coefficient [9]. Morey et al. [27] used interchangeably Dice coefficient and Percentage volume overlap. This metric is usable only when the ground truth segmentation is known (see Sect. 4.1). The image sets and related parameters are described in Sect. 4.2. Finally, Sect. 4.3 is devoted to the yielded results.
4.1 Dice Coefficient Metric
Dice Coefficient (DC) measures how much the result is close to the ground truth. Let the resulting class be \(\hat{A}\) and its ground truth be \(A^*\). Dice Coefficient is given by the following formula:
4.2 The Image Sets and Related Parameters
To evaluate the quality of segmentation, we use four volumetric (3D) MR images, one obtained from IBSR (real image) and the others from BrainWeb (simulated images). Three components were considered: GM (Grey Matter), WM (White Matter) and CSF (Cerebro Spinal Fluid). IBSR image has the following characteristics: dimension is \(256\times 256\times 63\), with voxel\({}=1\times 3\times 1\) mm and T1-weighted modality. The three BrainWeb image sets BrainWeb1, BrainWeb2 and BrainWeb3 have the following characteristics: dimensions are \(181\times 217\times 181\), with voxels\({}=1\times 1\times 1\) mm and T1-weighted modality. They have different levels of noise and intensity non-uniformity that are respectively: (\(0\%\),\(0\%\)), (\(3\%\),\(20\%\)) and (\(5\%\),\(20\%\)). In this paper we have retained a subset of slices, which are cited in [41]. The IBSR slices retained are: 1-24/18, 1-24/20, 1-24/24, 1-24/26, 1-24/30, 1-24/32 and 1-24/34. The BrainWeb slices retained are: 85, 88, 90, 95, 97, 100, 104, 106, 110, 121 and 130.
Table 1 defines some parameters necessary to execute HMRF-CG method.
4.3 Results
Table 2 shows the mean DC values using IBSR image. The parameters used by HMRF-CG are described in Table 1. The parameters used by the other methods are given in [41].
Table 3 shows the mean DC values using BrainWeb images. The parameters used by HMRF-CG are described in Table 1. The parameters used by the LGMM method are given in LGMM [23]. The implementation of LGMM is built upon the segmentation method [2] of SPM 8 (Statistical Parametric MappingFootnote 3), which is a well known software for MRI analysis. As reported by [23], LGMM has better results than SPM 8.
Figure 5 shows a sample of slices to segment obtained from IBSR image, their ground truths and their segmentation using HMRF-CG method.
Figure 6 shows the slices number #95 with different noise and intensity non-uniformity from BrainWeb images and their segmentation using HMRF-CG.
5 Discussion and Conclusion
In this paper, we have described a method which combines Hidden Markov Random Field (HMRF) and Conjugate Gradient (GC). The tests have been carried out on samples obtained from IBSR and BrainWeb images, the most commonly used images in the field. For a fair and meaningful comparison of methods, the segmentation quality is measured using the Dice Coefficient metric. The results depend on the choice of parameters. This very sensitive task has been conducted by performing numerous tests. From the results obtained, the HMRF-GC method outperforms the methods tested that are: LGMM, Classical MRF, MRF-ACO-Gossiping and MRF-ACO. Tests permit to find good parameters for HMRF-CG to achieve good segmentation results. To further improve performances a preprocessing step can be added to reduce noise and inhomogeneity using appropriate filters.
References
Ait-Aoudia, S., Guerrout, E.H., Mahiou, R.: Medical image segmentation using particle swarm optimization. In: 18th International Conference on Information Visualisation (IV) 2014, pp. 287–291. IEEE (2014)
Ashburner, J., Friston, K.J.: Unified segmentation. Neuroimage 26(3), 839–851 (2005)
Benson, C., Lajish, V., Rajamani, K.: Brain Tumor Extraction from MRI Brain Images Using Marker Based Watershed Algorithm, pp. 318–323 (2015)
Boyd, S., Vandenberghe, L.: Convex optimization. Cambridge University Press, Cambridge (2004)
Canny, J.: A computational approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell. 6, 679–698 (1986)
Chan, T.F., Vese, L., et al.: Active contours without edges. IEEE Trans. Image Process. 10(2), 266–277 (2001)
Chuang, K.S., Tzeng, H.L., Chen, S., Wu, J., Chen, T.J.: Fuzzy c-means clustering with spatial information for image segmentation. Comput. Med. Imaging Graph. 30(1), 9–15 (2006)
Cocosco, C.A., Kollokian, V., Kwan, R.K.S., Pike, G.B., Evans, A.C.: BrainWeb: Online Interface to a 3D MRI Simulated Brain Database (1997)
Dice, L.R.: Measures of the amount of ecologic association between species. Ecology 26(3), 297–302 (1945)
Eberly, D.: Derivative Approximation by Finite Differences. Magic Software, Inc (2003)
Fischl, B.: Freesurfer. Neuroimage 62(2), 774–781 (2012)
Geman, S., Geman, D.: Stochastic relaxation, Gibbs distributions, and the Bayesian restoration of images. IEEE Trans. Pattern Anal. Mach. Intell. 6, 721–741 (1984)
Grippo, L., Lucidi, S.: A globally convergent version of the Polak-Ribière conjugate gradient method. Math. Program. 78(3), 375–391 (1997)
Guerrout, E.H., Ait-Aoudia, S., Michelucci, D., Mahiou, R.: Hidden Markov random field model and BFGS algorithm for brain image segmentation. In: Proceedings of the Mediterranean Conference on Pattern Recognition and Artificial Intelligence, pp. 7–11. ACM (2016)
Guerrout, E.H., Ait-Aoudia, S., Michelucci, D., Mahiou, R.: Hidden Markov random field model and Broyden-Fletcher-Goldfarb-Shanno algorithm for brain image segmentation. J. Exp. Theor. Artif. Intell. 1–13 (2017)
Guerrout, E.H., Mahiou, R., Ait-Aoudia, S.: Medical image segmentation on a cluster of PCs using Markov random fields. Int. J. New Comput. Architectures Appl. (IJNCAA) 3(1), 35–44 (2013)
Guerrout, E.H., Mahiou, R., Ait-Aoudia, S.: Medical image segmentation using hidden Markov random field a distributed approach. In: The Third International Conference on Digital Information Processing and Communications. The Society of Digital Information and Wireless Communication, pp. 423–430 (2013)
Guerrout, E.H., Mahiou, R., Ait-Aoudia, S.: Hidden Markov random fields and swarm particles: a winning combination in image segmentation. IERI Procedia 10, 19–24 (2014)
Held, K., Kops, E.R., Krause, B.J., Wells III, W.M., Kikinis, R., Muller-Gartner, H.W.: Markov random field segmentation of brain MR images. IEEE Trans. Med. Imaging 16(6), 878–886 (1997)
Ho, S., Bullitt, L., Gerig, G.: Level-Set Evolution with Region Competition: Automatic 3-D Segmentation of Brain Tumors, vol. 1, pp. 532–535 (2002)
Kumar, S., et al.: Skull Stripping and Automatic Segmentation of Brain MRI Using Seed Growth and Threshold Techniques, pp. 422–426 (2007)
Lin, G.C., Wang, W.J., Kang, C.C., Wang, C.M.: Multispectral MR images segmentation based on fuzzy knowledge and modified seeded region growing. Magn. Reson. Imaging 30(2), 230–246 (2012)
Liu, J., Zhang, H.: Image segmentation using a local GMM in a variational framework. J. Math. Imag. Vis. 46(2), 161–176 (2013)
Masoumi, H., Behrad, A., Pourmina, M.A., Roosta, A.: Automatic liver segmentation in MRI images using an iterative watershed algorithm and artificial neural network. Biomed. Sig. Process. Control 7(5), 429–437 (2012)
McInerney, T., Terzopoulos, D.: Deformable models in medical image analysis: a survey. Med. Image Anal. 1(2), 91–108 (1996)
Møller, M.F.: A scaled conjugate gradient algorithm for fast supervised learning. Neural Netw. 6(4), 525–533 (1993)
Morey, R.A., Petty, C.M., Xu, Y., Hayes, J.P., Wagner, H.R., Lewis, D.V., LaBar, K.S., Styner, M., McCarthy, G.: A comparison of automated segmentation and manual tracing for quantifying hippocampal and amygdala volumes. Neuroimage 45(3), 855–866 (2009)
Natarajan, P., Krishnan, N., Kenkre, N.S., Nancy, S., Singh, B.P.: Tumor Detection Using Threshold Operation in MRI Brain Images, pp. 1–4 (2012)
Panjwani, D.K., Healey, G.: Markov random field models for unsupervised segmentation of textured color images. IEEE Trans. Pattern Anal. Mach. Intell. 17(10), 939–954 (1995)
Perona, P., Malik, J.: Scale-space and edge detection using anisotropic diffusion. IEEE Trans. Pattern Anal. Mach. Intell. 12(7), 629–639 (1990)
Pham, D.L., Xu, C., Prince, J.L.: Current methods in medical image segmentation. Ann. Rev. Biomed. Eng. 2(1), 315–337 (2000)
Polak, E., Ribière, G.: Note sur la convergence de méthodes de directions conjuguées. Revue française d’informatique et de recherche opérationnelle, série rouge 3(1), 35–43 (1969)
Powell, M.J.D.: Restart procedures for the conjugate gradient method. Math. Program. 12(1), 241–254 (1977)
Roura, E., Oliver, A., Cabezas, M., Vilanova, J.C., Rovira, À., Ramió-Torrentà, L., Lladó, X.: MARGA: multispectral adaptive region growing algorithm for brain extraction on axial MRI. Comput. Methods Programs Biomed. 113(2), 655–673 (2014)
Senthilkumaran, N., Rajesh, R.: Edge detection techniques for image segmentation-a survey of soft computing approaches. Int. J. Recent Trends Eng. 1(2), 250–254 (2009)
Shewchuk, J.R.: An introduction to the conjugate gradient method without the agonizing pain. Lecture available on internet (1994)
Szeliski, R., Zabih, R., Scharstein, D., Veksler, O., Kolmogorov, V., Agarwala, A., Tappen, M., Rother, C.: A comparative study of energy minimization methods for Markov random fields with smoothness-based priors. IEEE Trans. Pattern Anal. Mach. Intell. 30(6), 1068–1080 (2008)
Wang, L., Shi, F., Li, G., Gao, Y., Lin, W., Gilmore, J.H., Shen, D.: Segmentation of neonatal brain MR images using patch-driven level sets. NeuroImage 84, 141–158 (2014)
Wu, Z., Leahy, R.: An optimal graph theoretic approach to data clustering: theory and its application to image segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 15(11), 1101–1113 (1993)
Wyatt, P.P., Noble, J.A.: MAP MRF joint segmentation and registration of medical images. Med. Image Anal. 7(4), 539–552 (2003)
Yousefi, S., Azmi, R., Zahedi, M.: Brain tissue segmentation in MR images based on a hybrid of MRF and social algorithms. Med. Image Anal. 16(4), 840–848 (2012)
Zhang, Y., Brady, M., Smith, S.: Segmentation of brain MR images through a hidden Markov random field model and the expectation-maximization algorithm. IEEE Trans. Med. Imaging 20(1), 45–57 (2001)
Zhao, M., Lin, H.Y., Yang, C.H., Hsu, C.Y., Pan, J.S., Lin, M.J.: Automatic threshold level set model applied on MRI image segmentation of brain tissue. Appl. Math. 9(4), 1971–1980 (2015)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 IFIP International Federation for Information Processing
About this paper
Cite this paper
Guerrout, EH., Ait-Aoudia, S., Michelucci, D., Mahiou, R. (2018). Conjugate Gradient Method for Brain Magnetic Resonance Images Segmentation. In: Amine, A., Mouhoub, M., Ait Mohamed, O., Djebbar, B. (eds) Computational Intelligence and Its Applications. CIIA 2018. IFIP Advances in Information and Communication Technology, vol 522. Springer, Cham. https://doi.org/10.1007/978-3-319-89743-1_48
Download citation
DOI: https://doi.org/10.1007/978-3-319-89743-1_48
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-89742-4
Online ISBN: 978-3-319-89743-1
eBook Packages: Computer ScienceComputer Science (R0)