Probabilistic Inference Lecture 5

Preview:

DESCRIPTION

Probabilistic Inference Lecture 5. M. Pawan Kumar pawan.kumar@ecp.fr. Slides available online http:// cvc.centrale-ponts.fr /personnel/ pawan /. What to Expect in the Final Exam. Open Book Textbooks Research Papers Course Slides No Electronic Devices Easy Questions – 10 points - PowerPoint PPT Presentation

Citation preview

Probabilistic InferenceLecture 5

M. Pawan Kumarpawan.kumar@ecp.fr

Slides available online http://cvc.centrale-ponts.fr/personnel/pawan/

• Open Book– Textbooks– Research Papers– Course Slides– No Electronic Devices

• Easy Questions – 10 points

• Hard Questions – 10 points

What to Expect in the Final Exam

Easy Question – BPCompute the reparameterization constants for (a,b)and (c,b) such that the unary potentials of b are equalto its min-marginals.

Va Vb

2

5 5-3Vc

6 12-6

-5

-2

9

-2 -1 -4 -3

Hard Question – BPProvide an O(h) algorithm to compute thereparameterization constants of BP for an edge whosepairwise potentials are specified by a truncated linearmodel.

Easy Question – Minimum CutProvide the graph corresponding to the MAP estimationproblem in the following MRF.

Va Vb

2

5 5-3Vc

6 12-6

-5

-2

9

-2 -1 -4 -3

Hard Question – Minimum CutShow that the expansion algorithm provides a bound of2M for the truncated linear metric, where M is the valueof the truncation.

Easy Question – RelaxationsUsing an example, show that the LP-S relaxation is not tight for a frustrated cycle (cycle with an odd number ofsupermodular pairwise potentials).

Hard Question – RelaxationsProve or disprove that the LP-S and SOCP-MS relaxations are invariant to reparameterization.

Recap

Integer Programming Formulation

min ∑a ∑i a;i ya;i + ∑(a,b) ∑ik ab;ik yab;ik

ya;i {0,1}

∑i ya;i = 1

yab;ik = ya;i yb;k

Integer Programming Formulation

min Ty

ya;i {0,1}

∑i ya;i = 1

yab;ik = ya;i yb;k

= [ … a;i …. ; … ab;ik ….]y = [ … ya;i …. ; … yab;ik ….]

Linear Programming Relaxation

min Ty

ya;i {0,1}

∑i ya;i = 1

yab;ik = ya;i yb;k

Two reasons why we can’t solve this

Linear Programming Relaxation

min Ty

ya;i [0,1]

∑i ya;i = 1

yab;ik = ya;i yb;k

One reason why we can’t solve this

Linear Programming Relaxation

min Ty

ya;i [0,1]

∑i ya;i = 1

∑k yab;ik = ∑kya;i yb;k

One reason why we can’t solve this

Linear Programming Relaxation

min Ty

ya;i [0,1]

∑i ya;i = 1

One reason why we can’t solve this

= 1∑k yab;ik = ya;i∑k yb;k

Linear Programming Relaxation

min Ty

ya;i [0,1]

∑i ya;i = 1

∑k yab;ik = ya;i

One reason why we can’t solve this

Linear Programming Relaxation

min Ty

ya;i [0,1]

∑i ya;i = 1

∑k yab;ik = ya;i

No reason why we can’t solve this *

*memory requirements, time complexity

Dual of the LP RelaxationWainwright et al., 2001

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

1

2

3

4 5 6

i =

Dual of the LP RelaxationWainwright et al., 2001

q*(1)

i =

q*(2)

q*(3)

q*(4) q*(5) q*(6)

q*(i)

Dual of LP

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

max

Dual of the LP RelaxationWainwright et al., 2001

q*(1)

i

q*(2)

q*(3)

q*(4) q*(5) q*(6)

Dual of LP

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi q*(i)max

Dual of the LP RelaxationWainwright et al., 2001

i

max q*(i)

I can easily compute q*(i)

I can easily maintain reparam constraint

So can I easily solve the dual?

• TRW Message Passing

• Dual Decomposition

Outline

Things to Remember

• Forward-pass computes min-marginals of root

• BP is exact for trees

• Every iteration provides a reparameterization

TRW Message PassingKolmogorov, 2006

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

1

2

3

4 5 6

i q*(i)

Pick a variable Va

TRW Message PassingKolmogorov, 2006

i q*(i)

Vc Vb Va

1c;0

1c;1

1b;0

1b;1

1a;0

1a;1

Va Vd Vg

4a;0

4a;1

4d;0

4d;1

4g;0

4g;1

TRW Message PassingKolmogorov, 2006

1 + 4 + rest q*(1) + q*(4) + K

Vc Vb Va Va Vd Vg

Reparameterize to obtain min-marginals of Va

1c;0

1c;1

1b;0

1b;1

1a;0

1a;1

4a;0

4a;1

4d;0

4d;1

4g;0

4g;1

TRW Message PassingKolmogorov, 2006

’1 + ’4 + rest

Vc Vb Va

’1c;0

’1c;1

’1b;0

’1b;1

’1a;0

’1a;1

Va Vd Vg

’4a;0

’4a;1

’4d;0

’4d;1

’4g;0

’4g;1

One pass of Belief Propagation

q*(’1) + q*(’4) + K

TRW Message PassingKolmogorov, 2006

’1 + ’4 + rest

Vc Vb Va Va Vd Vg

Remain the same

q*(’1) + q*(’4) + K

’1c;0

’1c;1

’1b;0

’1b;1

’1a;0

’1a;1

’4a;0

’4a;1

’4d;0

’4d;1

’4g;0

’4g;1

TRW Message PassingKolmogorov, 2006

’1 + ’4 + rest

min{’1a;0,’1a;1} + min{’4a;0,’4a;1} + K

Vc Vb Va Va Vd Vg

’1c;0

’1c;1

’1b;0

’1b;1

’1a;0

’1a;1

’4a;0

’4a;1

’4d;0

’4d;1

’4g;0

’4g;1

TRW Message PassingKolmogorov, 2006

’1 + ’4 + rest

Vc Vb Va Va Vd Vg

Compute average of min-marginals of Va

’1c;0

’1c;1

’1b;0

’1b;1

’1a;0

’1a;1

’4a;0

’4a;1

’4d;0

’4d;1

’4g;0

’4g;1

min{’1a;0,’1a;1} + min{’4a;0,’4a;1} + K

TRW Message PassingKolmogorov, 2006

’1 + ’4 + rest

Vc Vb Va Va Vd Vg

’’a;0 = ’1a;0+ ’4a;0

2’’a;1 = ’1a;1+ ’4a;1

2

’1c;0

’1c;1

’1b;0

’1b;1

’1a;0

’1a;1

’4a;0

’4a;1

’4d;0

’4d;1

’4g;0

’4g;1

min{’1a;0,’1a;1} + min{’4a;0,’4a;1} + K

TRW Message PassingKolmogorov, 2006

’’1 + ’’4 + rest

Vc Vb Va Va Vd Vg

’1c;0

’1c;1

’1b;0

’1b;1

’’a;0

’’a;1

’’a;0

’’a;1

’4d;0

’4d;1

’4g;0

’4g;1

’’a;0 = ’1a;0+ ’4a;0

2’’a;1 = ’1a;1+ ’4a;1

2

min{’1a;0,’1a;1} + min{’4a;0,’4a;1} + K

TRW Message PassingKolmogorov, 2006

’’1 + ’’4 + rest

Vc Vb Va Va Vd Vg

’1c;0

’1c;1

’1b;0

’1b;1

’’a;0

’’a;1

’’a;0

’’a;1

’4d;0

’4d;1

’4g;0

’4g;1

’’a;0 = ’1a;0+ ’4a;0

2’’a;1 = ’1a;1+ ’4a;1

2

min{’1a;0,’1a;1} + min{’4a;0,’4a;1} + K

TRW Message PassingKolmogorov, 2006

Vc Vb Va Va Vd Vg

2 min{’’a;0, ’’a;1} + K

’1c;0

’1c;1

’1b;0

’1b;1

’’a;0

’’a;1

’’a;0

’’a;1

’4d;0

’4d;1

’4g;0

’4g;1

’’1 + ’’4 + rest

’’a;0 = ’1a;0+ ’4a;0

2’’a;1 = ’1a;1+ ’4a;1

2

TRW Message PassingKolmogorov, 2006

Vc Vb Va Va Vd Vg

’1c;0

’1c;1

’1b;0

’1b;1

’’a;0

’’a;1

’’a;0

’’a;1

’4d;0

’4d;1

’4g;0

’4g;1

min {p1+p2, q1+q2} min {p1, q1} + min {p2, q2}≥ 2 min{’’a;0, ’’a;1} + K

’’1 + ’’4 + rest

TRW Message PassingKolmogorov, 2006

Vc Vb Va Va Vd Vg

Objective function increases or remains constant

’1c;0

’1c;1

’1b;0

’1b;1

’’a;0

’’a;1

’’a;0

’’a;1

’4d;0

’4d;1

’4g;0

’4g;1

2 min{’’a;0, ’’a;1} + K

’’1 + ’’4 + rest

TRW Message Passing

Initialize i. Take care of reparam constraint

Choose random variable Va

Compute min-marginals of Va for all trees

Node-average the min-marginals

REPEAT

Kolmogorov, 2006

Can also do edge-averaging

Example 1

Va Vb

0

1 1

0

2

5

4

2l0

l1

Vb Vc

0

2 3

1

4

2

6

3Vc Va

1

4 1

0

6

3

6

4

5

6

7

Pick variable Va. Reparameterize.

Example 1

Va Vb

-3

-2 -1

-2

5

7

4

2Vb Vc

0

2 3

1

4

2

6

3Vc Va

-3

1 -3

-3

6

3

10

7

5

6

7

Average the min-marginals of Va

l0

l1

Example 1

Va Vb

-3

-2 -1

-2

7.5

7

4

2Vb Vc

0

2 3

1

4

2

6

3Vc Va

-3

1 -3

-3

6

3

7.5

7

7

6

7

Pick variable Vb. Reparameterize.

l0

l1

Example 1

Va Vb

-7.5

-7 -5.5

-7

7.5

7

8.5

7Vb Vc

-5

-3 -1

-3

9

6

6

3Vc Va

-3

1 -3

-3

6

3

7.5

7

7

6

7

Average the min-marginals of Vb

l0

l1

Example 1

Va Vb

-7.5

-7 -5.5

-7

7.5

7

8.75

6.5Vb Vc

-5

-3 -1

-3

8.75

6.5

6

3Vc Va

-3

1 -3

-3

6

3

7.5

7

6.5

6.5

7 Value of dual does not increase

l0

l1

Example 1

Va Vb

-7.5

-7 -5.5

-7

7.5

7

8.75

6.5Vb Vc

-5

-3 -1

-3

8.75

6.5

6

3Vc Va

-3

1 -3

-3

6

3

7.5

7

6.5

6.5

7 Maybe it will increase for Vc

NO

l0

l1

Example 1

Va Vb

-7.5

-7 -5.5

-7

7.5

7

8.75

6.5Vb Vc

-5

-3 -1

-3

8.75

6.5

6

3Vc Va

-3

1 -3

-3

6

3

7.5

7

Strong Tree Agreement

Exact MAP Estimate

f1(a) = 0 f1(b) = 0 f2(b) = 0 f2(c) = 0 f3(c) = 0 f3(a) = 0

l0

l1

Example 2

Va Vb

0

1 1

0

2

5

2

2Vb Vc

1

0 0

1

0

0

0

0Vc Va

0

1 1

0

0

3

4

8

4

0

4

Pick variable Va. Reparameterize.

l0

l1

Example 2

Va Vb

-2

-1 -1

-2

4

7

2

2Vb Vc

1

0 0

1

0

0

0

0Vc Va

0

0 1

-1

0

3

4

9

4

0

4

Average the min-marginals of Va

l0

l1

Example 2

Va Vb

-2

-1 -1

-2

4

8

2

2Vb Vc

1

0 0

1

0

0

0

0Vc Va

0

0 1

-1

0

3

4

8

4

0

4 Value of dual does not increase

l0

l1

Example 2

Va Vb

-2

-1 -1

-2

4

8

2

2Vb Vc

1

0 0

1

0

0

0

0Vc Va

0

0 1

-1

0

3

4

8

4

0

4 Maybe it will decrease for Vb or Vc

NO

l0

l1

Example 2

Va Vb

-2

-1 -1

-2

4

8

2

2Vb Vc

1

0 0

1

0

0

0

0Vc Va

0

0 1

-1

0

3

4

8

f1(a) = 1 f1(b) = 1 f2(b) = 1 f2(c) = 0 f3(c) = 1 f3(a) = 1

f2(b) = 0 f2(c) = 1

Weak Tree Agreement Not Exact MAP Estimate

l0

l1

Example 2

Va Vb

-2

-1 -1

-2

4

8

2

2Vb Vc

1

0 0

1

0

0

0

0Vc Va

0

0 1

-1

0

3

4

8

Weak Tree Agreement Convergence point of TRW

l0

l1

f1(a) = 1 f1(b) = 1 f2(b) = 1 f2(c) = 0 f3(c) = 1 f3(a) = 1

f2(b) = 0 f2(c) = 1

Obtaining the Labelling

Only solves the dual. Primal solutions?

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

’ = i

Fix the labelOf Va

Obtaining the Labelling

Only solves the dual. Primal solutions?

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

’ = i

Fix the labelOf Vb

Continue in some fixed orderMeltzer et al., 2006

Computational Issues of TRW

• Speed-ups for some pairwise potentials

Basic Component is Belief Propagation

Felzenszwalb & Huttenlocher, 2004

• Memory requirements cut down by half Kolmogorov, 2006

• Further speed-ups using monotonic chains Kolmogorov, 2006

Theoretical Properties of TRW

• Always converges, unlike BP Kolmogorov, 2006

• Strong tree agreement implies exact MAP Wainwright et al., 2001

• Optimal MAP for two-label submodular problems

Kolmogorov and Wainwright, 2005

ab;00 + ab;11 ≤ ab;01 + ab;10

ResultsBinary Segmentation Szeliski et al. , 2008

Labels - {foreground, background}

Unary Potentials: -log(likelihood) using learnt fg/bg models

Pairwise Potentials: 0, if same labels

1 - exp(|da - db|), if different labels

ResultsBinary Segmentation

Labels - {foreground, background}

Unary Potentials: -log(likelihood) using learnt fg/bg models

Szeliski et al. , 2008

Pairwise Potentials: 0, if same labels

1 - exp(|da - db|), if different labels

TRW

ResultsBinary Segmentation

Labels - {foreground, background}

Unary Potentials: -log(likelihood) using learnt fg/bg models

Szeliski et al. , 2008

Belief Propagation

Pairwise Potentials: 0, if same labels

1 - exp(|da - db|), if different labels

ResultsStereo Correspondence Szeliski et al. , 2008

Labels - {disparities}

Unary Potentials: Similarity of pixel colours

Pairwise Potentials: 0, if same labels

1 - exp(|da - db|), if different labels

ResultsSzeliski et al. , 2008

Labels - {disparities}

Unary Potentials: Similarity of pixel colours

Pairwise Potentials: 0, if same labels

1 - exp(|da - db|), if different labels

TRW

Stereo Correspondence

ResultsSzeliski et al. , 2008

Labels - {disparities}

Unary Potentials: Similarity of pixel colours

Belief Propagation

Pairwise Potentials: 0, if same labels

1 - exp(|da - db|), if different labels

Stereo Correspondence

ResultsNon-submodular problems Kolmogorov, 2006

BP TRW-S

30x30 grid K50

BP TRW-S

BP outperforms TRW-S

Code + Standard Data

http://vision.middlebury.edu/MRF

• TRW Message Passing

• Dual Decomposition

Outline

Dual Decomposition

minx ∑i gi(x)s.t. x C

Dual Decomposition

minx,xi ∑i gi(xi)

s.t. xi C xi = x

Dual Decomposition

minx,xi ∑i gi(xi)

s.t. xi C

Dual Decomposition

minx,xi ∑i gi(xi) + ∑i λi

T(xi-x)

s.t. xi Cmaxλi

KKT Condition: ∑i λi = 0

Dual Decomposition

minx,xi ∑i gi(xi) + ∑i λi

Txi

s.t. xi Cmaxλi

Dual Decomposition

minxi ∑i (gi(xi) + λi

Txi)s.t. xi C

Projected Supergradient Ascent

maxλi

Supergradient s of h(z) at z0

h(z) - h(z0) ≤ sT(z-z0), for all z in the feasible region

Dual Decomposition

minxi ∑i (gi(xi) + λi

Txi)s.t. xi C

Initialize λi0

= 0

maxλi

Dual Decomposition

minxi ∑i (gi(xi) + λi

Txi)s.t. xi C

Compute supergradients

maxλi

si = argminxi ∑i (gi(xi) + (λi

t)Txi)

Dual Decomposition

minxi ∑i (gi(xi) + λi

Txi)s.t. xi C

Project supergradients

maxλi

pi = si - ∑j sj/m

where ‘m’ = number of subproblems (slaves)

Dual Decomposition

minxi ∑i (gi(xi) + λi

Txi)s.t. xi C

Update dual variables

maxλi

λit+1

= λit + ηt pi

where ηt = learning rate = 1/(t+1) for example

Dual DecompositionInitialize λi

0 = 0

Compute projected supergradients

si = argminxi ∑i (gi(xi) + (λi

t)Txi)

pi = si - ∑j sj/m

Update dual variables

λit+1

= λit + ηt pi

REPEAT

Dual DecompositionKomodakis et al., 2007

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

1

2

3

4 5 6

1

0s1

a =

1

0s4

a =

Slaves agree on label for Va

Dual DecompositionKomodakis et al., 2007

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

1

2

3

4 5 6

1

0s1

a =

1

0s4

a =

0

0p1

a =

0

0p4

a =

Dual DecompositionKomodakis et al., 2007

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

1

2

3

4 5 6

1

0s1

a =

0

1s4

a =

Slaves disagree on label for Va

Dual DecompositionKomodakis et al., 2007

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

1

2

3

4 5 6

1

0s1

a =

0

1s4

a =

0.5

-0.5p1

a =

-0.5

0.5p4

a =

Unary cost increases

Dual DecompositionKomodakis et al., 2007

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

1

2

3

4 5 6

1

0s1

a =

0

1s4

a =

0.5

-0.5p1

a =

-0.5

0.5p4

a =

Unary cost decreases

Dual DecompositionKomodakis et al., 2007

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

Va Vb Vc

Vd Ve Vf

Vg Vh Vi

1

2

3

4 5 6

1

0s1

a =

0

1s4

a =

0.5

-0.5p1

a =

-0.5

0.5p4

a =

Push the slavestowards agreement

ComparisonTRW DD

Fast Slow

Local Maximum Global Maximum

RequiresMin-Marginals

RequiresMAP Estimate

Other forms of slavesTighter relaxations

Sparse high-order potentials

Recommended