## Description

1. (50 marks) Segmenting a Brain Magnetic Resonance (MR) Image. Download the bias-corrupted and noise-corrupted magnitude-MR image of a human brain from: http://www.cse.iitb.ac.in/~suyash/cs736/assignmentSegmentBrain.mat.zip The mat ﬁle also contains a binary (mask) image that separates the set of pixels within the brain from those outside the brain. Implement the algorithm (covered in class lectures) for segmenting the brain in 3 segments, namely, (i) white matter, (ii) gray matter, and (iii) cerebrospinal ﬂuid, using a modiﬁed fuzzy-cmeans (FCM) to estimate, and account for, the bias/inhomogeneity ﬁeld in the brain MR image. Assume the number of classes K = 3. Run the segmentation algorithm only on the image data inside the brain. Manually tune values for (i) parameter q that controls the fuzziness of the segmentation and (ii) neighborhood mask (size and values) that gives the weights wij (you may choose the weights based on a Gaussian with mean as the center pixel of the mask; you should rescale the weight, if needed, so that they sum to 1). You must choose q to be greater than 1.5. You must choose the initial estimate for the bias ﬁeld to be a constant image. After ﬁnding the optimal estimates of the (i) class means ck for each class k, (ii) memberships unk at each pixel n inside the brain, and (iii) bias-ﬁeld values bn, construct the following images: • Construct a bias-removed-image A as follows: at each pixel n, the intensity An in the bias-removed image equals the weighted sum: An :=Pk unkck.• Construct a residual-image R as follows: at each pixel n, the intensity Rn in the residual image equals the difference: Rn := Yn −Anbn, where Y is the corrupted data image. Implement the following functionality as part of the segmentation algorithm:

(a) (5 marks) Code to ﬁnd the optimal value of the class means, within every iteration.

1

(b) (5 marks) Code to ﬁnd the optimal value of the memberships, within every iteration. (c) (5 marks) Code to ﬁnd the optimal value of the bias ﬁeld, within every iteration.

Report the following:

(a) (0 marks) The chosen value for q. (b) (0 marks) The neighborhood mask wij seen as an image. (c) (0marks)Theinitialestimateforthemembershipvaluesshownas3images, i.e., oneimage thatshowsthemembershipvaluesofallpixelstoaparticularclass. Describeyourmotivation and algorithm for choosing this initialization. (d) (0 marks) The initial estimates of the class means. Describe your motivation and algorithm for choosing this initialization. (e) (10 marks) The value of the objective function at each iteration in the modiﬁed-FCM algorithm. (f) (20 marks) Show the following 5 images in the report (i) Corrupted image provided, (ii) Optimal class-membership image estimates, (iii) Optimal bias-ﬁeld image estimate (iv) Biasremoved image, (v) Residual image. (g) (0 marks) The optimal estimates for the class means.

2. (50 marks) Segmenting a Brain Magnetic Resonance (MR) Image. Download the corrupted magnitude-MR image of a human brain from: http://www.cse.iitb. ac.in/~suyash/cs736/assignmentSegmentBrainGmmEmMrf.mat.zip The mat ﬁle also contains a binary (mask) image that separates the set of pixels within the brain from those outside the brain. Implement the algorithm (covered in class lectures) for segmenting the brain in 3 segments, namely, (i) white matter, (ii) gray matter, and (iii) cerebrospinal ﬂuid, using an expectationmaximization (EM) optimization algorithm that relies on a Gaussian mixture model (GMM) for intensities and a Markov random ﬁeld (MRF) model on the labels. Assume the number of classes K = 3. Run the segmentation algorithm only on the image data inside the brain. Manually tune the β parameter value underlying the potential function in the MRF model on the label image, to control the smoothness on the labeling (and memberships). Implement the following functionality as part of the segmentation algorithm:

(a) (5 marks) Code to ﬁnd the optimal value of the memberships, within every iteration. (b) (5 marks) Code to ﬁnd the optimal value of the class means, within every iteration. (c) (5 marks) Code to ﬁnd the optimal value of the class standard deviations, within every iteration. (d) (10 marks) Code to ﬁnd the optimal labeling, within every iteration, based on a modiﬁed iterated-conditional-mode (ICM) optimization that updates all labels at once ensuring that the posteriorprobability (computed uptothe normalizationconstant Z; recallthat, within any iteration, Z will be a function of β as well as the Gaussians’ parameters) increases.

2

Report the following:

(a) (0 marks) The chosen value for β that, in your judgement, gives a smooth and realistic segmentation. (b) (0 marks) The initial estimate for the label image x. Describe your motivation and algorithm for choosing this initialization. (c) (0 marks) The initial estimates of the Gaussian parameters θ, i.e., the class means and standard deviations. Describe your motivation and algorithm for choosing this initialization. (d) (5 marks) Within every iteration, for the modiﬁed ICM segmentation, the values of the log posterior probability for the labels, i.e., P(x|y,θ,β), before and after the ICM update. (e) (20 marks) Show the following 5 images in the report (i) Corrupted image provided, (ii) Optimal class-membership image estimates for chosen β, (iii) Optimal label image estimate for chosen β, (iv) Optimal class-membership image estimates β = 0, i.e., NO MRF prior on labels, (v) Optimal label image estimate for β = 0, i.e., NO MRF prior on labels. (f) (0 marks) The optimal estimates for the class means for the chosen β.