discrete optimization lecture 5 – part 2 m. pawan kumar [email protected] slides available online
TRANSCRIPT
Discrete OptimizationLecture 5 – Part 2
M. Pawan Kumar
Slides available online http://mpawankumar.info
Interactive Binary Segmentation
Foreground histogram of RGB values FG
Background histogram of RGB values BG
‘1’ indicates foreground and ‘0’ indicates background
Interactive Binary Segmentation
More likely to be foreground than background
Interactive Binary Segmentation
More likely to be background than foreground
θa(0) proportional to -log(BG(da))
θa(1) proportional to -log(FG(da))
Interactive Binary Segmentation
More likely to belong to same label
Interactive Binary Segmentation
Less likely to belong to same label
θab(i,k) proportional to exp(-(da-db)2) if i ≠ k
θab(i,k) = 0 if i = k
Outline
• Minimum Cut Problem
• Submodular Energy Functions
Directed Graph
n1 n2
n3 n4
10
5
3 2
Important restriction
Positive arc lengths
D = (N, A)
Cut
n1 n2
n3 n4
10
5
3 2
Let N1 and N2 such that
• N1 “union” N2 = N
• N1 “intersection” N2 = Φ
C is a set of arcs such that• (n1,n2) A• n1 N1
• n2 N2
D = (N, A)
C is a cut in the digraph D
Cut
n1 n2
n3 n4
10
5
3 2
What is C?
D = (N, A)
N1
N2
{(n1,n2),(n1,n4)} ?
{(n1,n4),(n3,n2)} ?
{(n1,n4)} ?✓
Cut
n1 n2
n3 n4
10
5
3 2
What is C?
D = (N, A)N1N2
{(n1,n2),(n1,n4),(n3,n2)} ?
{(n1,n4),(n3,n2)} ?
{(n4,n3)} ?✓
Cut
n1 n2
n3 n4
10
5
3 2
What is C?
D = (N, A)N2N1
{(n1,n2),(n1,n4),(n3,n2)} ?
{(n1,n4),(n3,n2)} ?
{(n3,n2)} ?
✓
Cut
n1 n2
n3 n4
10
5
3 2
Let N1 and N2 such that
• N1 “union” N2 = N
• N1 “intersection” N2 = Φ
C is a set of arcs such that• (n1,n2) A• n1 N1
• n2 N2
D = (N, A)
C is a cut in the digraph D
Weight of a Cut
n1 n2
n3 n4
10
5
3 2 Sum of length of allarcs in C
D = (N, A)
Weight of a Cut
n1 n2
n3 n4
10
5
3 2 w(C) = Σ(n1,n2) C l(n1,n2)
D = (N, A)
Weight of a Cut
n1 n2
n3 n4
10
5
3 2
What is w(C)?
D = (N, A)
N1
N2
3
Weight of a Cut
n1 n2
n3 n4
10
5
3 2
What is w(C)?
D = (N, A)N1N2
5
Weight of a Cut
n1 n2
n3 n4
10
5
3 2
What is w(C)?
D = (N, A)N2N1
15
st-Cut
n1 n2
n3 n4
10
5
3 2
A source “s”
C is a cut such that• s N1
• t N2
D = (N, A)
C is an st-cut
s
t
A sink “t”
1 2
7 3
Weight of an st-Cut
n1 n2
n3 n4
10
5
3 2
D = (N, A)s
t
1 2
7 3
w(C) = Σ(n1,n2) C l(n1,n2)
Weight of an st-Cut
n1 n2
n3 n4
10
5
3 2
D = (N, A)s
t
1 2
7 3
What is w(C)?
3
Weight of an st-Cut
n1 n2
n3 n4
10
5
3 2
D = (N, A)s
t
1 2
7 3
What is w(C)?
15
Minimum Cut Problem
n1 n2
n3 n4
10
5
3 2
D = (N, A)s
t
1 2
7 3
Find a cut with theminimum weight !!
C* = argminC w(C)
[Slide credit: Andrew Goldberg]
Augmenting Path and Push-Relabel
n: #nodes
m: #arcs
U: maximumarc length
Solvers for the Minimum-Cut Problem
Outline
• Minimum Cut Problem
• Submodular Energy Functions
Hammer, 1965; Kolmogorov and Zabih, 2004
Overview
Energy Q
DigraphD
One nodes per element
N = N1 U N2
ComputeMinimum
Cut
+ Additional nodes “s” and “t”
Optimalsolution
na N1 implies xa = 0
na N2 implies xa = 1
Outline
• Minimum Cut Problem
• Submodular Energy Functions• Unary Potentials• Pairwise Potentials
Digraph for Unary Potentials
P
Q
xa = 0
xa = 1
Digraph for Unary Potentials
na
P
Q
s
t
xa = 0
xa = 1
Digraph for Unary Potentials
na
P
Q
s
t
Let P ≥ Q
P-Q
0
Q
Q+
ConstantP-Q
xa = 0
xa = 1
Digraph for Unary Potentials
na
P
Q
s
t
Let P ≥ Q
P-Q
0
Q
Q+
ConstantP-Q
xa = 1
w(C) = 0
xa = 0
xa = 1
Digraph for Unary Potentials
na
P
Q
s
t
Let P ≥ Q
P-Q
0
Q
Q+
ConstantP-Q
xa = 0
w(C) = P-Q
xa = 0
xa = 1
Digraph for Unary Potentials
na
P
Q
s
t
Let P < Q
0
Q-P
P
P+
Constant
Q-P
xa = 0
xa = 1
Digraph for Unary Potentials
na
P
Q
s
t
Let P < Q
0
Q-P
P
P+
Constant
xa = 1
w(C) = Q-P
Q-P
xa = 0
xa = 1
Digraph for Unary Potentials
na
P
Q
s
t
Let P < Q
0
Q-P
P
P+
Constant
xa = 0
w(C) = 0
Q-P
xa = 0
xa = 1
Outline
• Minimum Cut Problem
• Submodular Energy Functions• Unary Potentials• Pairwise Potentials
Digraph for Pairwise Potentials
P R
Q S
xa = 0 xa = 1
xb = 0
xb = 1
0 0
Q-P Q-P
0 S-Q
0 S-Q
0 R+Q-S-P
0 0+ + +
P P
P P
Digraph for Pairwise Potentials
na nb
P R
Q S
0 0
Q-P Q-P
0 S-Q
0 S-Q
0 R+Q-S-P
0 0+ + +
P P
P P
s
t
Constant
xa = 0 xa = 1
xb = 0
xb = 1
Digraph for Pairwise Potentials
na nb
P R
Q S
0 0
Q-P Q-P
0 S-Q
0 S-Q
0 R+Q-S-P
0 0+ +
s
tUnary Potential
xb = 1
Q-P
xa = 0 xa = 1
xb = 0
xb = 1
Digraph for Pairwise Potentials
na nb
P R
Q S
0 S-Q
0 S-Q
0 R+Q-S-P
0 0+
s
t
Unary Potentialxa = 1
Q-PS-Q
xa = 0 xa = 1
xb = 0
xb = 1
Digraph for Pairwise Potentials
na nb
P R
Q S
0 R+Q-S-P
0 0
s
t
Pairwise Potentialxa = 1, xb = 0
Q-PS-Q
R+Q-S-P
xa = 0 xa = 1
xb = 0
xb = 1
Digraph for Pairwise Potentials
na nb
P R
Q S s
t
Q-PS-Q
R+Q-S-P
R+Q-S-P ≥ 0
xa = 0 xa = 1
xb = 0
xb = 1