Professional Documents
Culture Documents
Image (D)
Example: Image Segmentation
E: {0,1}n → R
E(x) = ∑ ci xi + ∑ cij xi(1-xj) 0 → fg
1 → bg
i i,j
n = number of pixels
Unary Cost
(ci)
Dark (negative) Bright (positive)
Example: Image Segmentation
E: {0,1}n → R
E(x) = ∑ ci xi + ∑ cij xi(1-xj) 0 → fg
1 → bg
i i,j
n = number of pixels
Discontinuity
Cost (cij)
Example: Image Segmentation
E: {0,1}n → R
E(x) = ∑ ci xi + ∑ cij xi(1-xj) 0 → fg
1 → bg
i i,j
n = number of pixels
How to minimize
E(x)?
Global Minimum (x*)
Outline of the Tutorial
Source
2 9 Graph (V, E, C)
1 Vertices V = {v1, v2 ... vn}
v1 v2 Edges E = {(v1, v2) ....}
Sink
The st-Mincut Problem
What is a st-cut?
Source
2 9
1
v1 v2
2
5 4
Sink
The st-Mincut Problem
What is a st-cut?
An st-cut (S,T) divides the nodes
between source and sink.
Source
Sink
5 + 2 + 9 = 16
The st-Mincut Problem
What is a st-cut?
An st-cut (S,T) divides the nodes
between source and sink.
Source
2 + 1 + 4 = 7
How to compute the st-mincut?
Flow = 0
Augmenting Path Based
Algorithms
Source
Flow = 0
Augmenting Path Based
Algorithms
Source
Flow = 0 + 2
Augmenting Path Based
Algorithms
Source
Flow = 2
Augmenting Path Based
Algorithms
Source
Flow = 2
Augmenting Path Based
Algorithms
Source
Flow = 2
Augmenting Path Based
Algorithms
Source
Flow = 2 + 4
Augmenting Path Based
Algorithms
Source
Flow = 6
Augmenting Path Based
Algorithms
Source
Flow = 6
Augmenting Path Based
Algorithms
Source
Flow = 6 + 1
Augmenting Path Based
Algorithms
Source
Flow = 7
Augmenting Path Based
Algorithms
Source
Flow = 7
Augmenting Path Based
Algorithms
Source
Algorithms
assume non-
negative edge
weights
Algorithms
assume non-
negative edge
weights
Source
1000 1000
1
a1 a2
0
1000 1000
Sink
Augmenting Path based Algorithms
Source
1000 1000
1
a1 a2
0 Bad
1000 1000 Augmenting
Paths
Sink
Augmenting Path based Algorithms
Source
1000 1000
1
a1 a2
0 Bad
1000 1000 Augmenting
Path
Sink
Augmenting Path based Algorithms
Source
999 1000
0
a1 a2
1
1000 999
Sink
Augmenting Path based Algorithms
n: #nodes
Source
999 1000
0
a1 a2
1
1000 999
Sink
Source
1000 1000
1
a1 a2
0
1000 1000
Sink
E: {0,1}n → R
S st-mincut
E(x)
T
Solution
Graph Construction
E(a1,a2)
Source (0)
a1 a2
Sink (1)
Graph Construction
E(a1,a2) = 2a1
Source (0)
a1 a2
Sink (1)
Graph Construction
Source (0)
a1 a2
5
Sink (1)
Graph Construction
Source (0)
2 9
a1 a2
5 4
Sink (1)
Graph Construction
Source (0)
2 9
a1 a2
2
5 4
Sink (1)
Graph Construction
Source (0)
2 9
1
a1 a2
2
5 4
Sink (1)
Graph Construction
Source (0)
2 9
1
a1 a2
2
5 4
Sink (1)
Graph Construction
Source (0)
2 9 Cost of cut = 11
1
a1 a2 a1 = 1 a2 = 1
2
E (1,1) = 11
5 4
Sink (1)
Graph Construction
Source (0)
2 9 st-mincut cost = 8
1
a1 a2 a1 = 1 a2 = 0
2
E (1,0) = 8
5 4
Sink (1)
Energy Function Reparameterization
For instance:
a1 ā1 1+ 2a1 + 3ā1 3 + ā1
E1 (a1) = 1+ 2a1 + 3ā1
0 1 4 4
E2 (a1) = 3 + ā1
1 0 3 3
Flow and Reparametrization
Source (0)
2 9
1
a1 a2
2
5 4
Sink (1)
Flow and Reparametrization
Source (0)
2 9
2a1 + 5ā1
1
a1 a2
= 2(a1+ā1) + 3ā1
2
= 2 + 3ā1
5 4
Sink (1)
Flow and Reparametrization
Source (0)
0 9
2a1 + 5ā1
1
a1 a2
= 2(a1+ā1) + 3ā1
2
= 2 + 3ā1
3 4
Sink (1)
Flow and Reparametrization
Source (1)
0 9
9a2 + 4ā2
1
a1 a2
= 4(a2+ā2) + 5ā2
2
= 4 + 5ā2
3 4
Sink (0)
Flow and Reparametrization
Source (1)
0 5
9a2 + 4ā2
1
a1 a2
= 4(a2+ā2) + 5ā2
2
= 4 + 5ā2
3 0
Sink (0)
Flow and Reparametrization
Source (1)
0 5
1
a1 a2
2
3 0
Sink (0)
Flow and Reparametrization
Source (1)
0 5
1
a1 a2
2
3 0
Sink (0)
Flow and Reparametrization
= 2(ā1+a2+a1ā2) +ā1+3a2
Source (1)
= 2(1+ā1a2) +ā1+3a2
0 5
F1 = ā1+a2+a1ā2
1
a1 a2 F2 = 1+ā1a2
2 a1 a2 F1 F2
3 0 0 0 1 1
0 1 2 2
Sink (0) 1 0 1 1
1 1 1 1
Flow and Reparametrization
= 2(ā1+a2+a1ā2) +ā1+3a2
Source (1)
= 2(1+ā1a2) +ā1+3a2
0 3
F1 = ā1+a2+a1ā2
3
a1 a2 F2 = 1+ā1a2
0 a1 a2 F1 F2
1 0 0 0 1 1
0 1 2 2
Sink (0) 1 0 1 1
1 1 1 1
Flow and Reparametrization
Source (1)
0 3
3 No more
a1 a2
augmenting paths
0 possible
1 0
Sink (0)
Flow and Reparametrization
Source (1)
Total Flow
bound on the 0 3
optimal solution
3
a1 a2
0
1 0
Sink (0)
Inference of the optimal solution becomes
trivial because the bound is tight
Flow and Reparametrization
Source (1)
Total Flow
bound on the 0 3 st-mincut cost = 8
optimal solution
3
a1 a2 a1 = 1 a2 = 0
0
E (1,0) = 8
1 0
Sink (0)
Inference of the optimal solution becomes
trivial because the bound is tight
Example: Image Segmentation
E: {0,1}n → R
E(x) = ∑ ci xi + ∑ cij xi(1-xj) 0 → fg
1 → bg
i i,j
How to minimize
E(x)?
Global Minimum (x*)
How does the code look like?
Graph *g;
end
g->compute_maxflow();
Graph *g;
end
a1 a2
for all adjacent pixels p,q
add_weights(nodeID(p), nodeID(q), cost);
end
fgCost(a1) fgCost(a2)
g->compute_maxflow();
Graph *g;
Graph *g;
E(x) w pq
x*
t =1
Image
Global
Flow Optimum
Dynamic Energy Minimization
minimize
EA SA
Can we do Recycling
better? Solutions
EB SB
computationally
expensive operation
differences
A and B between EB* Simpler
energy
similar A and B
cheaper
operation
EB SB
computationally 3 – 100000
Reparametrization
expensive operation time speedup!
Kohli& &Torr
Boykov & Jolly ICCV’01, Kohli Torr(ICCV05,
(ICCV05,PAMI07)
PAMI07)
Dynamic Energy Minimization
Original Energy
E(a1,a2) = 2a1 + 5ā1+ 9a2 + 4ā2 + 2a1ā2 + ā1a2
Reparametrized Energy
E(a1,a2) = 8 + ā1+ 3a2 + 3ā1a2
New Energy
E(a1,a2) = 2a1 + 5ā1+ 9a2 + 4ā2 + 7a1ā2 + ā1a2
New Reparametrized Energy
E(a1,a2) = 8 + ā1+ 3a2 + 3ā1a2 + 5a1ā2
Kohli& &Torr
Boykov & Jolly ICCV’01, Kohli Torr(ICCV05,
(ICCV05,PAMI07)
PAMI07)
Outline of the Tutorial
Space of Function
Minimization Problems
Submodular Set Functions
Let E= {a1,a2, .... an} be a set
2|E| = #subsets of E
E
A B
Important Property
Sum of two submodular functions is submodular
Minimizing Submodular Functions
• Quadratic pseudoboolean
– Can be transformed to st-mincut
– One node per variable [ O(n3) complexity]
– Very low empirical running time
Submodular Pseudoboolean Functions
Function defined over boolean vectors x = {x1,x2, .... xn}
Definition:
• All functions for one boolean variable (f: {0,1} -> R) are submodular
Equivalent (transformable)
xj
0 1 0 1 0 1 0 1
B+C
0 A B 0 0 0 0 0 D-C 0 0
-A-D
xi = A + + +
1 C D 1 C-A C-A 1 0 D-C 1 0 0
xj
0 1 0 1 0 1 0 1
B+C
0 A B 0 0 0 0 0 D-C 0 0
-A-D
xi = A + + +
1 C D 1 C-A C-A 1 0 D-C 1 0 0
xj
0 1 0 1 0 1 0 1
B+C
0 A B 0 0 0 0 0 D-C 0 0
-A-D
xi = A + + +
1 C D 1 C-A C-A 1 0 D-C 1 0 0
xj
0 1 0 1 0 1 0 1
B+C
0 A B 0 0 0 0 0 D-C 0 0
-A-D
xi = A + + +
1 C D 1 C-A C-A 1 0 D-C 1 0 0
xj
0 1 0 1 0 1 0 1
B+C
0 A B 0 0 0 0 0 D-C 0 0
-A-D
xi = A + + +
1 C D 1 C-A C-A 1 0 D-C 1 0 0
Equivalent (transformable)
st-mincut
S
T
Minimizing Non-Submodular Functions
unary
E ({ x p }) p ( x p )
E ({ x p }) p ( x p ) E ' ({ x p },{x p })
p ( x p ) p (1 x p )
2
pq ( x p , xq ) pq ( x p , xq ) pq (1 x p ,1 xq )
2
~ ~
~ pq ( x p ,1 xq ) pq (1 x p , xq )
pq ( x p , xq )
2
E ({ x p }) p ( x p ) E ' ({ x p },{x p })
p ( x p ) p (1 x p )
2
pq ( x p , xq ) pq ( x p , xq ) pq (1 x p ,1 xq )
2
~ ~
~ pq ( x p ,1 xq ) pq (1 x p , xq )
pq ( x p , xq )
2
~
f pq ( x p , xq ) pq ( x p ,1 xq )
~ ~ ~ ~
pq (0,0) pq (1,1) pq (0,1) pq (1,0) f pq (0,1) f pq (1,0) f pq (0,0) f pq (1,1)
Non- submodular Submodular
Minimization using Roof-dual Relaxation
Double number of variables: x p x p , x p ( x p 1 x p )
E ({ x p }) p ( x p ) E ' ({ x p },{x p })
p ( x p ) p (1 x p )
2
pq ( x p , xq ) pq ( x p , xq ) pq (1 x p ,1 xq )
2
~ ~
~ pq ( x p ,1 xq ) pq (1 x p , xq )
pq ( x p , xq )
2
E ({ x p }) p ( x p ) E ' ({ x p },{x p })
p ( x p ) p (1 x p )
2
pq ( x p , xq ) pq ( x p , xq ) pq (1 x p ,1 xq )
2
~ ~
~ pq ( x p ,1 xq ) pq (1 x p , xq )
pq ( x p , xq )
2
Multi-label Pseudoboolean
Functions Functions
Transforming problems in QBFs
Multi-label Pseudoboolean
Functions Functions
Higher order to Quadratic
• Simple Example using Auxiliary variables
f(x) = { 0 if all xi = 0
C1 otherwise
x ϵ L = {0,1}n
C1∑xi
C1
1 2 3
∑xi
Higher order to Quadratic
C1∑xi
a=0 a=1
Lower envelop
of concave
C1 functions is
concave
1 2 3
∑xi
Higher order to Quadratic
min f(x)
x
= min f1 (x)a + f2(x)ā
x,a ϵ {0,1}
Higher Order Quadratic Submodular
Submodular Function Function
f2(x)
a=1
f1(x) Lower envelop
of concave
functions is
concave
1 2 3
∑xi
Higher order to Quadratic
min f(x)
x
= min f1 (x)a + f2(x)ā
x,a ϵ {0,1}
Higher Order Quadratic Submodular
Submodular Function Function
f2(x)
a=0 a=1
f1(x) Lower envelop
of concave
functions is
concave
1 2 3
∑xi
Transforming problems in QBFs
Multi-label Pseudoboolean
Functions Functions
Multi-label to Pseudo-boolean
So what is the problem?
Em (y1,y2, ..., yn) Eb (x1,x2, ..., xm)
Ishikawa’s result:
Convex
θij (yi,yj) = g(|yi-yj|) Function
g(|yi-yj|)
|yi-yj|
Multi-label to Pseudo-boolean
• Popular encoding scheme
[Roy and Cox ’98, Ishikawa ’03, Schlesinger & Flach ’06]
• Applicability
– Only solves restricted class of energy functions
– Cannot handle Potts model potentials
• Computational Cost
– Very high computational cost
– Problem size = |Variables| x |Labels|
– Gray level image denoising (1 Mpixel image)
(~2.5 x 108 graph nodes)
Outline of the Tutorial
Solution Space
Move Making Algorithms
Current Solution
Search
Neighbourhood
Optimal Move
Energy
Solution Space
Computing the Optimal Move
Current Solution
Search
Neighbourhood
Optimal Move
xc
Key Property
Energy
(t)
Move Space
Solution Space
Current Solution
Search
Neighbourhood
Current Solution
x = t x1 + (1- t) x2
New Current Second
solution Solution solution
θij (la,lb) ≥ 0
θij (la,lb) = 0 a = b
x = t x1 + (1-t) x2
New First Second
solution solution solution
x = t x1 + (1-t) x2
x1, x2 can be continuous Optical Flow
Example
Solution
from
Method 2 x2
Solution
from F Final
Method 1 x1 x Solution
T
θij (yi,yj) = min(|yi-yj|,T)
θij (yi,yj)
|yi-yj|
[Kohli, Kumar and Torr, CVPR07] [Kohli, Ladicky and Torr, CVPR08]
Outline of the Tutorial
ω θi (ω, xi)
Pose Shape
Prior
Stickman Rough Shape
Model Prior
Open Problems
Submodular
Functions
st-mincut
Equivalent
Minimizing General Higher Order
Functions
st-mincut
S
Sub-problem
T
Move making algorithms
Thanks. Questions?
Use of Higher order Potentials
E(x1,x2,x3) = θ12 (x1,x2) + θ23 (x2,x3)
θij (xi,xj) =
{ 0 if xi=xj
C otherwise
8
E(6,6,6) = 0 + 0 = 0
7
Disparity 6
Labels
5
P1 P2 P3
Pixels
θij (xi,xj) =
{ 0 if xi=xj
C otherwise
8
E(6,6,6) = 0 + 0 = 0
7
Disparity 6
E(6,7,7) = 1 + 0 = 1
Labels
5
P1 P2 P3
Pixels
θij (xi,xj) =
{ 0 if xi=xj
C otherwise
8
E(6,6,6) = 0 + 0 = 0
7
Disparity 6
E(6,7,7) = 1 + 0 = 1
Labels E(6,7,8) = 1 + 1 = 2
5
Pairwise potential
P1 P2 P3
penalize slanted
Pixels planar surfaces
x
T(xc, t) = xn = xc + t
Computing the Optimal Move
Current Solution
Search
Neighbourhood
Optimal Move
xc Transformation
T function
E(x) (t)
Em Move Energy
x
T(xc, t) = xn = xc + t
Em(t) = E(T(xc, t))
Computing the Optimal Move
Current Solution
Search
Neighbourhood
Optimal Move
xc Transformation
T function
E(x) (t)
Em Move Energy
x
T(xc, t) = xn = xc + t
minimize
Em(t) = E(T(xc, t)) t*
Optimal Move