Ulti Region Segmentation Using Graph Cuts
Ulti Region Segmentation Using Graph Cuts
Ulti Region Segmentation Using Graph Cuts
Abstract
This project deals with multi-region segmenation using
graph-cuts and is mainly based on a paper by Delong and
Boykov [1]. The difference between a multi-label model and
multi-region model is that certain geometrical constraints can
be added with the multi-region models.
Introduction
flow, and thus also the minimum cut. The one we will use
[3] is specifically developed to solve the kind of graphs which
A segmentation is a partitioning of an image into multiple arises in computer vision problems. It works by pushing
segments. This can be the partitioning of an image into flow from both the source and sink, instead of just pushing
one segment belonging to a object in the image and one flow from the source like standard algorithms.
segment belonging to the background in the image. Each
pixel is given a label corresponding to which segment it is
part of. In multi-label segmentation more than one object is 2 Segmentation
searched for in the image and in multi-region segmentation
each pixel can be part of more than one label. In applications 2.1 Binary segmentation
information about an image can be known a priori. When In binary segmentation the image should be partitioned into
segmenting an image of the heart you know before you start two different segments, one belonging to the object and one
that there are two chambers (in a healthy patient) and that belonging to the background.
the chambers are surrounded by the heart muscle. This inWe introduce P as the set of pixel indices and a binary
formation can be used to improve the segmentation by im- variable for each pixel such that xp BP for every p
posing restriction in between the different regions. More on P. When xp = 0 pixel p is a background pixel and when
this later. We first need some background on graphs.
xp = 1 the pixel is part of the object. The intensity of any
A graph G (V, E) is a collection of data-points called ver- pixel p is given by I (p). The segmentation problem can
tices (V ) and connections between the vertices called edges formulated in the form of minimizing the energy function:
(E). Each edge has a capacity c, where we let e(i, j) = c denote an added edge between vertice i and j with capacity c.
regularization terms
data terms
In our treatment e (i, j) and e (j, i) may differ, e (i, j) 0
{ zX }|
{
zX }|
i, j and e(i, i) = 0, i.e we have no loops in the graph.
Dp (xp ) +
Vp,q (xp , xq ), (1)
E (x) =
s
5
4
2
3
2
pP
5
p,qN
i6=j
where there are many different chooses of data and regularization terms.
min-cut
(
0,
Vp,q (xp , xq ) =
2
1 (I (p) I (q))
if xp = xq
if xp 6= xq ,
(3)
where can be used to regulate the influence from the
regularization term on the energy function
2.1.1
Graph construction
nected to the sink. The energy function E (x) can be reformulated into a min-cut problem where the minimal cut
leads to the same labeling as the global minimum of E (x) .
In [4] a general method for converting the energy minimization problem into a min-cut problem is presented, which
works as long as E (x) is a submodular function of up to
three variables.
Definition 1. A function f of two variables with the domain {0, 1} is called submodular if
Figure 2: Examples on how E (x) is turned into a graph.
L EFT: Edge for Dp (xp ) when Dp (1) > Dp (0) R IGHT:
f (0, 0) + f (1, 1) f (1, 0) + f (0, 1) .
(4) Edges for V (x , x ) when D C > 0 and C A < 0.
pq
p
q
A function of n variables is called submodular if from
fixing n 2 variables to any values it follows that the two
(
free variables fulfill (4).
e (s, q) = D C, if D > C
e (q, t) = C D, otherwise.
Definition 2. A supermodular function is the same a subThe last term could be very tricky if it wasnt for the submodular function with the inequality reversed.
modularity, we know that it must be positive and it suffices
It is possible to minimize E (x) via graphs even when the to add the edge e(p, q) = B + C A D. An example on
function is not submodular [5], however global optimum is how the edges are added is given in figure 2. To better unnot guaranteed. These methods lay outside the scope of this derstand why this work it is recommended to work through
the example given in the figure and validate that any cut
project.
We now shortly describe how the graph is constructed for indeed give the same cost as Vp,q (xp , xq ).
the binary segmentation problem. We begin with the data
term, for each pixel p, add the edge
2.1.2 User seeds
(
If we a priori know the label of some pixels we can use this
e (s, p) = Dp (1) Dp (0) , if Dp (1) > Dp (0)
information to calculate an estimation of Eb and Eo . The
e(p, t) = Dp (0) Dp (1) , otherwise.
information can also be added to the graph by adding the
For the regularization term we begin by splitting Vp,q into edges:
the four different combinations of labeling for neighboring
pixels.
Vp,q =
Vp,q (0, 0)
Vp,q (1, 0)
Vp,q (0, 1)
A
=
Vp,q (1, 1)
C
(
e (s, p) =
e (p, t) =
B
D
By adding these edges we prohibit cuts which will contradict our a priori knowledge.
B
D
=A+
0
C A
0
C A
0
0
DC
+
DC
0
0
p known to be background,
p known to be object.
B+C AD
0
2.2
Multi-region segmentation
i contains j
ij
xip xjq Wpq
0
0
0
0
1
1
0
0
1
1
0
i excludes j
ij
xip xjq Wpq
0
0
0
0
1
0
1
0
0
1
1
i attracts j
ij
xip xjq Wpq
0
0
0
0
1
0
1
0
1
1
0
A + D
A+F
A+G
B+C
B+E .
C +E
Figure 4
(5)
E + H
C +H
B+H
F +G
D+G.
D+F
(6)
(7)
3.1
3.1.1
(8)
Motivation
We begin with motivational example for a two-region segmentation. We have the image in Figure 5a, and assume we
are only interested in segmenting out gray regions when they
are contained inside a black region. This requirement can be
enforced with geometric interaction terms leading up to the
resulting segmentation found in Figure 5b. Here no user
seeds are used, only expected intensities of both regions.
Two regions
B = A + F + G E,
C = A + F + G E,
3.1.2
MR-segmentation
We continue with the more difficult problem of segmenting out both the myocardium (heart muscle) and the left
and right ventricles (heart chambers) of a short-axis images
(a direction in which the MR-images are captured). We
know a priori that both chambers will be surrounded by myocardium. We set region 1 to be the myocardium and region
2 to be both the left and right ventricle, we then force region
2 to be contained inside region 1. We give the algorithm
3 Experiments
some user seeds, figure 6a. The resulting segmentation can
In all experiments the data term is chosen as (2) and the be seen in Figure 6b, where = 1/5 was used as parameter
regularization terms like (3) with = 1 if nothing else is for the regularization term and connected components with
less than 50 pixels was filtered away in a post processing step.
stated.
which hold as long as G, F 0. In case 2 we see that we
cannot achieve a better value for H because of (6). For the
details on how to construct the graph from this the reader
is referred to [4], and note that P = 0 for the maximum
chose of H.
Figure 6
Figure 5
(a) L EFT: A short axis image of the human heart. The lighter area around the
letters LV and RV are the left and right ventricles. The grayish area around
both ventricles is the myocardium. The myocardium is much thicker around
left ventricle compared to the right ventricle. R IGHT: Seeds used to segment
the heart.
3.2
3.2.1
Three regions
Basic result
Submodular limitations
(b) For both images the user seeds are shown in a darker overlay. L EFT: Region 1, myocardium and the left and right ventricles shown in blue overlay.
R IGHT: Region 2, the left and right ventricles shown in red overlay.
A = Dp (0, 0, 0)
+ (I (p) E (Background))
E = Dp (1, 0, 0)
F = Dp (1, 0, 1)
G = Dp (1, 1, 0)
H = Dp (1, 1, 1)
F + G E,
MR segmentation
(a) Example image where submodularity causes problem. User seeds are given in yellow, blue, red and green.
The scale is used in all images in this Figure.
Discussion
(b) A = Dp (0, 0, 0)
(c) E = Dp (1, 0, 0)
(d) F = Dp (1, 0, 1)
(e) G = Dp (1, 1, 0)
References
[1] A. Delong and Y. Boykov, Globally Optimal Segmentation of Multi-Region Objects, ICCV, 2009.
[2] L. Ford and D. Fulkerson, Maximal Flow Through a
Network, Canadian Journal of Mathematics, 1956.
[3] Y. Boykov and V. Kolmogorov, An experimental comparison of min-cut/max- flow algorithms for energy
minimization in vision, Pattern Analysis and Machine
Intelligence, IEEE Transactions on, 2004.
(f ) H = Dp (1, 1, 1)
[4] V. Kolmogorov and R. Zabih, What Energy Functions
Can Be Minimized via Graph Cuts?, Pattern Analysis
Figure 7: The problem with a submodular constraint on H,
and Machine Intelligence, IEEE Transactions on, 2004.
H = F + G E.
[5] V. Kolmogorov and C. Rother, Minimizing Nonsubmodular Functions with Graph Cuts-a Review, IEEE
transactions on pattern analysis and machine intelligence,
2007.