500 likes | 512 Vues
Discover the principles of energy minimization techniques in optimization through this detailed lecture. Learn about submodular energy functions and move-making algorithms. Slides available online for reference.
E N D
Optimization- Lecture 4, Part 0 M. Pawan Kumar http://www.robots.ox.ac.uk/~oval/ Slides available online http://mpawankumar.info
Energy Minimization Vb Vc Vd Va
Energy Minimization 6 3 2 4 Label l1 Label l0 5 3 7 2 Vb Vc Vd Va Q(f;) = ∑a a(f(a))
Energy Minimization 0 6 1 3 2 0 4 Label l1 1 2 3 4 1 1 Label l0 1 0 5 0 3 7 2 Vb Vc Vd Va Q(f;) = ∑a a(f(a)) +∑(a,b) ab(f(a),f(b))
Energy Minimization 0 6 1 3 2 0 4 Label l1 1 2 3 4 1 1 Label l0 1 0 5 0 3 7 2 Vb Vc Vd Va Q(f;) = ∑a a(f(a)) +∑(a,b) ab(f(a),f(b))
Energy Minimization 0 6 1 3 2 0 4 Label l1 1 2 3 4 1 1 Label l0 1 0 5 0 3 7 2 Vb Vc Vd Va Q(f;) = ∑a a(f(a)) +∑(a,b) ab(f(a),f(b)) 2 + 1 + 2 + 1 + 3 + 1 + 3 = 13
Energy Minimization 0 6 1 3 2 0 4 Label l1 1 2 3 4 1 1 Label l0 1 0 5 0 3 7 2 Vb Vc Vd Va Q(f;) = ∑a a(f(a)) +∑(a,b) ab(f(a),f(b))
Energy Minimization 0 6 1 3 2 0 4 Label l1 1 2 3 4 1 1 Label l0 1 0 5 0 3 7 2 Vb Vc Vd Va Q(f;) = ∑a a(f(a)) +∑(a,b) ab(f(a),f(b)) 5 + 1 + 4 + 0 + 6 + 4 + 7 = 27
Energy Minimization 0 6 1 3 2 0 4 Label l1 1 2 3 4 1 1 Label l0 1 0 5 0 3 7 2 Vb Vc Vd Va No loops Q(f;) = ∑a a(f(a)) +∑(a,b) ab(f(a),f(b)) q* = min Q(f; ) = Q(f*; ) Solve using dynamic programming
Energy Minimization Q(f;) = ∑a a(f(a)) +∑(a,b) ab(f(a),f(b)) q* = min Q(f; ) = Q(f*; ) In general, NP-hard
Outline • Minimum Cut Problem • Two-Label Submodular Energy Functions • Move-Making Algorithms
Cut D = (N, A) • Let N1 and N2 such that • N1 “union” N2 = N • N1 “intersection” N2 = Φ 10 n1 n2 3 2 • C is a set of arcs such that • (n1,n2) A • n1 N1 • n2 N2 n3 n4 5 C is a cut in the digraph D
Cut D = (N, A) N1 What is C? 10 n1 n2 {(n1,n2),(n1,n4)} ? 3 2 {(n1,n4),(n3,n2)} ? ✓ n3 n4 {(n1,n4)} ? 5 N2
Weight of a Cut D = (N, A) 10 n1 n2 3 Sum of length of all arcs in C 2 n3 n4 5
Weight of a Cut D = (N, A) N1 What is w(C)? 10 n1 n2 3 3 2 n3 n4 5 N2
st-Cut s D = (N, A) 1 2 A source “s” 10 n1 n2 A sink “t” 3 2 • C is a cut such that • s N1 • t N2 n3 n4 5 7 t 3 C is an st-cut
Weight of an st-Cut s D = (N, A) 1 2 10 n1 n2 3 w(C) = Σ(n1,n2) C l(n1,n2) 2 n3 n4 5 7 t 3
Weight of an st-Cut s D = (N, A) 1 2 What is w(C)? 10 n1 n2 3 3 2 n3 n4 5 7 t 3
Minimum Cut Problem s D = (N, A) 1 2 Find a cut with the minimum weight !! 10 n1 n2 3 2 C* = argminC w(C) n3 n4 5 Non-negative arc lengths 7 t 3
Solvers for the Minimum-Cut Problem Augmenting Path and Push-Relabel n: #nodes m: #arcs U: maximum arc length [Slide credit: Andrew Goldberg]
Outline • Minimum Cut Problem • Two-Label Submodular Energy Functions • Move-Making Algorithms Hammer, 1965; Kolmogorov and Zabih, 2004
Overview Digraph D Energy Q One node per random variable + Additional nodes “s” and “t” Compute Minimum Cut na N1 implies f(a) = 0 Labeling f* N = N1 U N2 na N2 implies f(a) = 1
Outline • Minimum Cut Problem • Two-Label Submodular Energy Functions • Unary Potentials • Pairwise Potentials • Move-Making Algorithms
Digraph for Unary Potentials θa(1) f(a) = 0 θa(0) f(a) = 1 Va
Digraph for Unary Potentials s f(a) = 0 f(a) = 1 na t
Digraph for Unary Potentials Let P ≥ Q s f(a) = 0 f(a) = 1 na Constant P-Q t +
Digraph for Unary Potentials Let P ≥ Q s f(a) = 0 f(a) = 1 f(a) = 1 na Constant P-Q w(C) = 0 t +
Digraph for Unary Potentials Let P ≥ Q s f(a) = 0 f(a) = 1 f(a) = 0 na Constant P-Q w(C) = P-Q t +
Digraph for Unary Potentials Let P < Q s f(a) = 0 Q-P f(a) = 1 na Constant t +
Digraph for Unary Potentials Let P < Q s f(a) = 0 Q-P f(a) = 1 f(a) = 1 na Constant w(C) = Q-P t +
Digraph for Unary Potentials Let P < Q s f(a) = 0 Q-P f(a) = 1 f(a) = 0 na Constant w(C) = 0 t +
Outline • Minimum Cut Problem • Two-Label Submodular Energy Functions • Unary Potentials • Pairwise Potentials • Move-Making Algorithms
Digraph for Pairwise Potentials f(a) = 0 f(a) = 1 θab(1,1) f(b) = 0 θab(0,1) θab(1,0) f(b) = 1 θab(0,0) Va Vb + + +
Digraph for Pairwise Potentials f(a) = 0 f(a) = 1 f(b) = 0 s f(b) = 1 na nb Constant t + + +
Digraph for Pairwise Potentials f(a) = 0 f(a) = 1 f(b) = 0 s Q-P f(b) = 1 na nb Unary Potential f(b) = 1 t + +
Digraph for Pairwise Potentials f(a) = 0 f(a) = 1 f(b) = 0 s S-Q Q-P f(b) = 1 na nb t Unary Potential f(a) = 1 +
Digraph for Pairwise Potentials f(a) = 0 f(a) = 1 f(b) = 0 s S-Q Q-P f(b) = 1 R+Q-S-P na nb t Pairwise Potential f(a) = 1, f(b) = 0
Digraph for Pairwise Potentials f(a) = 0 f(a) = 1 f(b) = 0 s S-Q Q-P f(b) = 1 R+Q-S-P na nb t R+Q-S-P ≥ 0 General 2-label problem is NP-hard
Outline • Minimum Cut Problem • Two-Label Submodular Energy Functions • Move-Making Algorithms (Multiple Labels)
Stereo Correspondence Disparity Map
Stereo Correspondence L= {disparities} Pixel (xa,ya) in left corresponds to pixel (xa+f(a),ya) in right
Stereo Correspondence L= {disparities} θa(i) is proportional to the difference in intensity values (IL(xa,ya) – IR(xa+i,ya))2
Stereo Correspondence L= {disparities} θab(i,k) = wab d(i,k) d: Distance function over labels wab ∝ exp(-|IL(xa,ya)-IL(xb,yb)|)
Move-Making Algorithms Space of All Labelings f
Expansion Algorithm Initialize labeling f = f0 (say f0(a) = 0, for all Va) For α = 0, 2, … , h-1 fα = argminf’ Q(f’) s.t. f’(a) {f(a)} U {lα} Repeat until convergence Update f = fα End Boykov, Veksler and Zabih, 2001
Expansion Algorithm Variables take label lα or retain current label Slide courtesy PushmeetKohli
Expansion Algorithm Variables take label lα or retain current label Tree Ground House Status: Initialize with Tree Expand Ground Expand House Expand Sky Sky Slide courtesy PushmeetKohli
Expansion Algorithm Restriction on pairwise potentials? θab(i,k) + θab(α,α) ≤ θab(i,α) + θab(α,k) θab(i,k) = wab d(i,k) d(.,.) is a metric distance function
Swap Algorithm Initialize labeling f = f0 (say f0(a) = 0, for all Va) For α, β = 0, 2, … , h-1 fαβ= argminf’ Q(f’) s.t. f’(a) {lα,lβ} if f(a) {lα,lβ} f’(a) = f(a) otherwise Repeat until convergence Update f = fαβ End Boykov, Veksler and Zabih, 2001
Swap Algorithm Restriction on pairwise potentials? θab(α,α) + θab(β,β) ≤ θab(α,β) + θab(β,α) θab(i,k) = wab d(i,k) d(.,.) is a semi-metric distance function