Image Segmentation and Classification: Professor Michael Brady Frs Freng Hilary Term 2005
Image Segmentation and Classification: Professor Michael Brady Frs Freng Hilary Term 2005
Lecture 5
Professor Michael Brady FRS FREng
Hilary Term 2005
The goal
• Segmentation means to divide up the image into a
patchwork of regions, each of which is “homogeneous”,
that is, the “same” in some sense
– Intensity, texture, colour, …
• Classification means to assign to each point in the image
a tissue class, where the classes are agreed in advance
– Grey matter (GM), White matter (WM), cerebrospinal fluid (CSF),
air, … in the case of the brain
• Note that the problems are inter-linked: a classifier
implicitly segments an image, and a segmentation
implies a classification
MRI brain slices
?
WM
GM CSF
The noisy MRI image of the brain slice shown left is ideally piecewise constant,
comprising grey matter, white matter, air, ventricles. The right image is a segmentation
of the image at left. Evidently, while it is generally ok, there are several errors. Brain
MRI is as easy as it gets!!
Medical image segmentation is
generally difficult
• Noisy images
– often Noise-to-signal is 10%
– This is ten times N/S of camera images
• Often textured in complex ways
• Relatively poorly sampled
– Many pixels contain more than one tissue
type … this is called Partial Volume Effect
• Objects of interest have complex shapes
• Signs of clinical interest are subtle
Even MRI image segmentation is hard
p ( yi | l ) = f ( yi ; θ l )
1 ⎛ ( yi − µ l ) 2
⎞
= exp⎜⎜ − ⎟
⎟
2πσ l2
⎝ 2σ l
2
⎠
Tissue Probability Density
Functions Note the huge overlap
between the Gaussian pdf for
GM and that for WM
This means that there are
many misclassifications of
GM pixels as WM and vice
versa.
Even small amounts of noise
can change the ML
classification.
Can we do better?
(a) take spatial information into
account; and
(b) model expected spatial
image distortions.
We address both issues using a
MRF.
MRF model
A lattice of sites = the pixels of an image S = {1,..., N }
A family of random variables, R = {ri , i ∈ S }
whose values define a configuration ( R1 = r1 ,..., RN = rN ) ≡ R = r
Markovian assumptions:
P(x) > 0, ∀x ∈ X
probability of class label i
depends only on the local P( xi | xS −{i} ) = P( xi | x N i )
neighbourhood N
i
MRF equivalent to Gibbs
distributions
• Deep theorem of Hammersley & Clifford
– MRFs are equivalent to systems with a local potential function
• Define cliques made of neighbouring pixels
Recall that
1
P ( x) = exp(−U ( x))
Z
And, if we have Gaussian distributions of pixel values for
each class, and xi = l
1 ⎛ ( yi − µ l ) 2
⎞
p ( yi | xi ) = exp⎜⎜ − ⎟
⎟
2πσ l2
⎝ 2σ l2
⎠
Pixel-wise independence & ICM
P (y | x) = ∏ p ( yi | xi )
i∈S
So that
⎡ ( yi − µ l ) 2 ⎤
U ( y | x) = ∑ ⎢ + log σ l ⎥
i∈S ⎣ σl2
⎦
k
Update the class label x at iteration k
i
by minimising U ( xi | y , x N i −{i} )
Model estimation HMRF-EM
We have assumed that we know the model parameters
θ l = ( µ l , σ l ) ahead of time. Unfortunately, this is rarely
the case. The next idea is to estimate the parameters and
do the segmentation cooperatively using the EM algorithm
Corrected threshold to
image find white
matter
Classification/segmentation without
bias correction
Typical MR
images
Segmentation
misses lots of
grey matter
Bias field affects image histogram
(pdf)
Original image without bias field Bias field corrupted image and
and its histogram its histogram
Estimating the bias field amounts to estimating the pdf, given prior
assumptions about the bias field and expected pdf
Applying HMRF to bias correction
E step
M step
Compute ML
θ (t +1) = arg max P(y | θ , x t , B t )
estimates of the θ
parameters of the
classes given current
information
Bias field correction
MAP
analysis
MRF
analysis
Zhang, Smith, Brady, IEEE Trans. Med. Im. 20(1), 45, 2001
Experiments on Brain MR
Images
MAP
analysis
MRF
analysis
Zhang, Smith, Brady, IEEE Trans. Med. Im. 20(1), 45, 2001
Experiments on Brain MR
Images
L-to-R:
original
image;
estimated
bias field;
corrected
image; and
segmentation
automatic manual
HMRF segmentation
segmentation by a skilled
clinician