iccv 2007 tutorial part iii message-passing algorithms for energy minimization

44
ICCV 2007 tutorial Part III Message-passing algorithms for energy minimization Vladimir Kolmogorov University College London

Upload: abla

Post on 19-Mar-2016

51 views

Category:

Documents


2 download

DESCRIPTION

ICCV 2007 tutorial Part III Message-passing algorithms for energy minimization. Vladimir Kolmogorov University College London. Message passing. q. p. Iteratively pass messages between nodes... Message update rule? Belief propagation (BP) Tree-reweighted belief propagation (TRW) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

ICCV 2007 tutorial

Part III

Message-passing algorithms for energy minimization

Vladimir Kolmogorov

University College London

Page 2: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Message passing

• Iteratively pass messages between nodes...

• Message update rule?– Belief propagation (BP)– Tree-reweighted belief propagation (TRW)

– max-product (minimizing an energy function, or MAP estimation)– sum-product (computing marginal probabilities)

• Schedule?– Parallel, sequential, ...

p q qp

qppqp

pp xxxE,

),()()( x

Page 3: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Outline• Belief propagation

– BP on a tree• Min-marginals

– BP in a general graph– Distance transforms

• Reparameterization

• Tree-reweighted message passing– Lower bound via combination of trees– Message passing– Sequential TRW

Page 4: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Belief propagation(BP)

Page 5: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

• Dynamic programming: global minimum in linear time

• BP:– Inward pass (dynamic programming)– Outward pass

– Gives min-marginals

qp r

BP on a tree [Pearl’88]

rootleaf

leaf

Page 6: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

),()( qppqpp xxx

qp r

),()( min)( jiijM pqpipq

j

Inward pass (dynamic programming)

Page 7: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

),()( qppqpp xxx

qp r

),()( min)( jiijM pqpipq

j

Inward pass (dynamic programming)

Page 8: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

),()( qppqpp xxx

qp r

),()( min)( jiijM pqpipq

j

Inward pass (dynamic programming)

Page 9: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

),()( qppqpp xxx

qp r

),()( min)( jiijM pqpipq

j

5.11.015.2

pqM

Inward pass (dynamic programming)

Page 10: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

qp r

),()()(min)( kjjMjkM qrpqqjqr

0.22.125.0

pqM

Inward pass (dynamic programming)

k

Page 11: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

qp r

Inward pass (dynamic programming)

Page 12: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

qp r

Inward pass (dynamic programming)

Page 13: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

qp r

Outward pass

Page 14: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

qp r

BP on a tree: min-marginals

Min-marginal for node q and label j:

jxE q )(min xx

)()()( jMjMj rqpqq

j

Page 15: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

BP in a general graph• Pass messages using same rules

– Empirically often works quite well

• May not converge

• “Pseudo” min-marginals

• Gives local minimum in the “tree neighborhood” [Weiss&Freeman’01],[Wainwright et al.’04]

– Assumptions: • BP has converged• no ties in pseudo min-marginals

Page 16: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Distance transforms [Felzenszwalb & Huttenlocher’04]

),()(min)( jiiDjM pqpipq

pD pq

• Naïve implementation: O(K2)• Often can be improved to O(K)

– Potts interactions, truncated linear, truncated quadratic, ...

j

Page 17: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Reparameterization

Page 18: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Energy function - visualization

0

4

0

1

3

02

5

node p edge (p,q) node q

label 0

label 1

)0(p

)1,0(pq

qp

qppqp

pp xxxE,

),()()|( x

vector ofall parameters

Page 19: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Energy function - visualization

4

0

1

3

02

5

node p edge (p,q) node q

label 0

label 1

qp

qppqp

pp xxxE,

),()()|( x

0

vector ofall parameters

Page 20: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Reparameterization

0

4

0 3

2

5

1 0

Page 21: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Reparameterization

0

4

0 3

2

5

1 0 �

Page 22: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Reparameterization

• Definition. is a reparameterization ofif they define the same energy:

• Maxflow, BP and TRW perform reparameterisations

xxx )|()|( EE

0

4-

0 3

2

5

1-

Page 23: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

BP as reparameterization[Wainwright et al. 04]

+�

Mpq

j

• Messages define reparameterization:

qp

pqqq jMjj,

)()()(

)()(),(),( iMjMjiji qppqpqpq

• BP on a tree: reparameterize energy so that unary potentials become min-marginals

= Mpq( j )

min-marginals (for trees)

Page 24: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Tree-reweighted message passing

(TRW)

Page 25: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Lower bound onthe energy function

E

Energy functionwith discrete variables

E E

LP relaxation

Linear Programming relaxation• Energy minimization: NP-hard problem • Relax integrality constraint: xp{0,1} xp[0,1]

– LP relaxation [Schlesinger’76,Koster et al.’98,Chekuri et al.’00,Wainwright et al.’03]

• Try to solve dual problem:– Formulate lower bound on the function– Maximize the bound

Page 26: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

• Goal: compute minimum of the energy for

• Obtaining lower bound:– Split into several components: – Compute minimum for each component:

– Combine to get a bound on

• Use trees!

)|(min)( xx

E

)|(min)( ii E xx

Convex combination of trees [Wainwright, Jaakkola, Willsky ’02]

Page 27: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

'

21 TT

21

graph tree T tree T’

)( )(21 T )(

21 'T

lower bound on the energymaximize

Convex combination of trees (cont’d)

Page 28: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Maximizing lower bound

• Subgradient methods – [Schlesinger&Giginyak’07], [Komodakis et al.’07]

• Tree-reweighted message passing (TRW)– [Wainwright et al.’02], [Kolmogorov’05]

Page 29: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

• Two reparameterization operations:– Ordinary BP on trees– Node averaging

TRW algorithms

Page 30: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

0

1

4

0

• Two reparameterization operations:– Ordinary BP on trees– Node averaging

TRW algorithms

Page 31: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

2

0.5

2

0.5

TRW algorithms

• Two reparameterization operations:– Ordinary BP on trees– Node averaging

Page 32: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

TRW algorithms

• Order of operations?– Affects performance dramatically

• Algorithms:– [Wainwright et al. ’02]: parallel schedule (TRW-E, TRW-T)

• May not converge

– [Kolmogorov’05]: specific sequential schedule (TRW-S)• Lower bound does not decrease, convergence guarantees• Needs half the memory

Page 33: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

TRW algorithm of Wainwright et al. with tree-based updates (TRW-T)

Run BP on all trees “Average” all nodes

• If converges, gives (local) maximum of lower bound• Not guaranteed to converge. • Lower bound may go down.

Page 34: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Sequential TRW algorithm (TRW-S)[Kolmogorov’05]

Run BP on all trees containing p

“Average” node p

Pick node p

Page 35: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Main property of TRW-S

• Theorem: lower bound never decreases.• Proof sketch:

constT 0)(

0

1

4

0

' 0)( ' constT

Page 36: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Main property of TRW-S

constT 5.0)(

2

0.5

2

0.5

' 5.0)( ' constT

• Theorem: lower bound never decreases.• Proof sketch:

Page 37: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

TRW-S algorithm

• Particular order of averaging and BP operations

• Lower bound guaranteed not to decrease

• There exists limit point that satisfies weak tree agreement condition

• Efficiency?

Page 38: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

“Average” node p

Pick node p

inefficient?

Efficient implementation

Run BP on all trees containing p

Page 39: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Efficient implementation

• Key observation: Node averaging operation preserves messages oriented towards this node

• Reuse previously passed messages!

• Need a special choice of trees:– Pick an ordering of nodes– Trees: monotonic chains

4 5 6

7 8 9

1 2 3

Page 40: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Efficient implementation

4 5 6

7 8 9

1 2 3

• Algorithm:– Forward pass:

• process nodes in the increasing order• pass messages from lower neighbours

– Backward pass:• do the same in reverse order

• Linear running time of one iteration

Page 41: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Efficient implementation

4 5 6

7 8 9

1 2 3

• Algorithm:– Forward pass:

• process nodes in the increasing order• pass messages from lower neighbours

– Backward pass:• do the same in reverse order

• Linear running time of one iteration

Page 42: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Memory requirements• Standard message passing: 2 messages per edge• TRW-S: 1 message per edge

– Similar observation for bipartite graphs and parallel schedule in [Felzenszwalb&Huttenlocher’04]

standard message passing TRW-S

Page 43: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Experimental results: stereo

left image ground truth

BP TRW-S20 40 60 80 100

3.6

3.8

4x 105

• Global minima for some instances with TRW [Meltzer,Yanover,Weiss’05]• See evaluation of MRF algorithms [Szeliski et al.’07]

TRW-ETRW-T

Page 44: ICCV 2007 tutorial Part  III Message-passing algorithms  for energy minimization

Conclusions• BP

– Exact on trees• Gives min-marginals (unlike dynamic programming)

– If there are cycles, heuristic– Can be viewed as reparameterization

• TRW– Tries to maximize a lower bound– TRW-S:

• lower bound never decreases• limit point - weak tree agreement• efficient with monotonic chains

– Not guaranteed to find an optimal bound!• See subgradient techniques [Schlesinger&Giginyak’07], [Komodakis et al.’07]