Probabilistic Inference Lecture 2 M. Pawan Kumar Slides available online

Slides:



Advertisements
Similar presentations
MAP Estimation Algorithms in M. Pawan Kumar, University of Oxford Pushmeet Kohli, Microsoft Research Computer Vision - Part I.
Advertisements

Mean-Field Theory and Its Applications In Computer Vision1 1.
Algorithms for MAP estimation in Markov Random Fields Vladimir Kolmogorov University College London Tutorial at GDR (Optimisation Discrète, Graph Cuts.
Linear Time Methods for Propagating Beliefs Min Convolution, Distance Transforms and Box Sums Daniel Huttenlocher Computer Science Department December,
Discrete Optimization Lecture 4 – Part 3 M. Pawan Kumar Slides available online
Introduction to Markov Random Fields and Graph Cuts Simon Prince
Exact Inference in Bayes Nets
ICCV 2007 tutorial Part III Message-passing algorithms for energy minimization Vladimir Kolmogorov University College London.
Discrete Optimization in Computer Vision Nikos Komodakis Ecole des Ponts ParisTech, LIGM Traitement de l’information et vision artificielle.
Loopy Belief Propagation a summary. What is inference? Given: –Observabled variables Y –Hidden variables X –Some model of P(X,Y) We want to make some.
An Analysis of Convex Relaxations (PART I) Minimizing Higher Order Energy Functions (PART 2) Philip Torr Work in collaboration with: Pushmeet Kohli, Srikumar.
Convergent Message-Passing Algorithms for Inference over General Graphs with Convex Free Energies Tamir Hazan, Amnon Shashua School of Computer Science.
EE462 MLCV Lecture Introduction of Graphical Models Markov Random Fields Segmentation Tae-Kyun Kim 1.
Probabilistic Inference Lecture 1
Pearl’s Belief Propagation Algorithm Exact answers from tree-structured Bayesian networks Heavily based on slides by: Tomas Singliar,
Belief Propagation by Jakob Metzler. Outline Motivation Pearl’s BP Algorithm Turbo Codes Generalized Belief Propagation Free Energies.
GS 540 week 6. HMM basics Given a sequence, and state parameters: – Each possible path through the states has a certain probability of emitting the sequence.
Belief Propagation in a Continuous World Andrew Frank 11/02/2009 Joint work with Alex Ihler and Padhraic Smyth TexPoint fonts used in EMF. Read the TexPoint.
An Analysis of Convex Relaxations M. Pawan Kumar Vladimir Kolmogorov Philip Torr for MAP Estimation.
Global Approximate Inference Eran Segal Weizmann Institute.
P 3 & Beyond Solving Energies with Higher Order Cliques Pushmeet Kohli Pawan Kumar Philip H. S. Torr Oxford Brookes University CVPR 2007.
Improved Moves for Truncated Convex Models M. Pawan Kumar Philip Torr.
Efficiently Solving Convex Relaxations M. Pawan Kumar University of Oxford for MAP Estimation Philip Torr Oxford Brookes University.
Belief Propagation, Junction Trees, and Factor Graphs
Optical flow and Tracking CISC 649/849 Spring 2009 University of Delaware.
Understanding Belief Propagation and its Applications Dan Yuan June 2004.
Relaxations and Moves for MAP Estimation in MRFs M. Pawan Kumar STANFORDSTANFORD Vladimir KolmogorovPhilip TorrDaphne Koller.
Hierarchical Graph Cuts for Semi-Metric Labeling M. Pawan Kumar Joint work with Daphne Koller.
Measuring Uncertainty in Graph Cut Solutions Pushmeet Kohli Philip H.S. Torr Department of Computing Oxford Brookes University.
A Trainable Graph Combination Scheme for Belief Propagation Kai Ju Liu New York University.
MAP Estimation Algorithms in M. Pawan Kumar, University of Oxford Pushmeet Kohli, Microsoft Research Computer Vision - Part I.
Multiplicative Bounds for Metric Labeling M. Pawan Kumar École Centrale Paris École des Ponts ParisTech INRIA Saclay, Île-de-France Joint work with Phil.
Probabilistic Inference Lecture 4 – Part 2 M. Pawan Kumar Slides available online
Computer vision: models, learning and inference
Reconstructing Relief Surfaces George Vogiatzis, Philip Torr, Steven Seitz and Roberto Cipolla BMVC 2004.
Multiplicative Bounds for Metric Labeling M. Pawan Kumar École Centrale Paris Joint work with Phil Torr, Daphne Koller.
Rounding-based Moves for Metric Labeling M. Pawan Kumar Center for Visual Computing Ecole Centrale Paris.
Learning a Small Mixture of Trees M. Pawan Kumar Daphne Koller Aim: To efficiently learn a.
Discrete Optimization Lecture 2 – Part I M. Pawan Kumar Slides available online
Discrete Optimization Lecture 5 – Part 2 M. Pawan Kumar Slides available online
Discrete Optimization Lecture 4 – Part 2 M. Pawan Kumar Slides available online
Probabilistic Inference Lecture 3 M. Pawan Kumar Slides available online
Combinatorial Optimization Problems in Computational Biology Ion Mandoiu CSE Department.
Algorithms for MAP estimation in Markov Random Fields Vladimir Kolmogorov University College London.
Discrete Optimization in Computer Vision M. Pawan Kumar Slides will be available online
Discrete Optimization Lecture 3 – Part 1 M. Pawan Kumar Slides available online
Readings: K&F: 11.3, 11.5 Yedidia et al. paper from the class website
Probabilistic Inference Lecture 5 M. Pawan Kumar Slides available online
Daphne Koller Message Passing Belief Propagation Algorithm Probabilistic Graphical Models Inference.
Efficient Discriminative Learning of Parts-based Models M. Pawan Kumar Andrew Zisserman Philip Torr
Belief Propagation and its Generalizations Shane Oldenburger.
Discrete Optimization Lecture 2 – Part 2 M. Pawan Kumar Slides available online
Exact Inference in Bayes Nets. Notation U: set of nodes in a graph X i : random variable associated with node i π i : parents of node i Joint probability:
Inference for Learning Belief Propagation. So far... Exact methods for submodular energies Approximations for non-submodular energies Move-making ( N_Variables.
Discrete Optimization Lecture 1 M. Pawan Kumar Slides available online
Discrete Optimization Lecture 4 – Part 1 M. Pawan Kumar
Efficient Belief Propagation for Image Restoration Qi Zhao Mar.22,2006.
MAP Estimation of Semi-Metric MRFs via Hierarchical Graph Cuts M. Pawan Kumar Daphne Koller Aim: To obtain accurate, efficient maximum a posteriori (MAP)
Markov Networks: Theory and Applications Ying Wu Electrical Engineering and Computer Science Northwestern University Evanston, IL 60208
Discrete Optimization Lecture 3 – Part 1 M. Pawan Kumar Slides available online
Rounding-based Moves for Metric Labeling M. Pawan Kumar École Centrale Paris INRIA Saclay, Île-de-France.
Lecture 20. Graphs and network models 1. Recap Binary search tree is a special binary tree which is designed to make the search of elements or keys in.
Introduction of BP & TRW-S
Discrete Inference and Learning
CSCI 5822 Probabilistic Models of Human and Machine Learning
An Analysis of Convex Relaxations for MAP Estimation
Graphical Models and Learning
Expectation-Maximization & Belief Propagation
MAP Estimation of Semi-Metric MRFs via Hierarchical Graph Cuts
Readings: K&F: 11.3, 11.5 Yedidia et al. paper from the class website
Presentation transcript:

Probabilistic Inference Lecture 2 M. Pawan Kumar Slides available online

Pose Estimation Courtesy Pedro Felzenszwalb

Pose Estimation Courtesy Pedro Felzenszwalb

Pose Estimation Variables are body partsLabels are positions

Pose Estimation Unary potentials θ a;i proportional to fraction of foreground pixels Variables are body partsLabels are positions

Pose Estimation Pairwise potentials θ ab;ik proportional to d 2 Head Torso Joint location according to ‘head’ part Joint location according to ‘torso’ part d

Pose Estimation Pairwise potentials θ ab;ik proportional to d 2 Head Torso d Head Torso d >

Outline Problem Formulation –Energy Function –Energy Minimization –Computing min-marginals Reparameterization Energy Minimization for Trees Loopy Belief Propagation

Energy Function VaVa VbVb VcVc VdVd Label l 0 Label l 1 Random Variables V = {V a, V b, ….} Labels L = {l 0, l 1, ….} Labelling f: {a, b, …. }  {0,1, …}

Energy Function VaVa VbVb VcVc VdVd Q(f) = ∑ a  a;f(a) Unary Potential Label l 0 Label l 1 Easy to minimize Neighbourhood

Energy Function VaVa VbVb VcVc VdVd E : (a,b)  E iff V a and V b are neighbours E = { (a,b), (b,c), (c,d) } Label l 0 Label l 1

Energy Function VaVa VbVb VcVc VdVd +∑ (a,b)  ab;f(a)f(b) Pairwise Potential Label l 0 Label l 1 Q(f) = ∑ a  a;f(a)

Energy Function VaVa VbVb VcVc VdVd Parameter Label l 0 Label l 1 +∑ (a,b)  ab;f(a)f(b) Q(f;  )= ∑ a  a;f(a)

Outline Problem Formulation –Energy Function –Energy Minimization –Computing min-marginals Reparameterization Energy Minimization for Trees Loopy Belief Propagation

Energy Minimization VaVa VbVb VcVc VdVd Q(f;  ) = ∑ a  a;f(a) + ∑ (a,b)  ab;f(a)f(b) Label l 0 Label l 1

Energy Minimization VaVa VbVb VcVc VdVd Q(f;  ) = ∑ a  a;f(a) + ∑ (a,b)  ab;f(a)f(b) = 13 Label l 0 Label l 1

Energy Minimization VaVa VbVb VcVc VdVd Q(f;  ) = ∑ a  a;f(a) + ∑ (a,b)  ab;f(a)f(b) Label l 0 Label l 1

Energy Minimization VaVa VbVb VcVc VdVd Q(f;  ) = ∑ a  a;f(a) + ∑ (a,b)  ab;f(a)f(b) = 27 Label l 0 Label l 1

Energy Minimization VaVa VbVb VcVc VdVd Q(f;  ) = ∑ a  a;f(a) + ∑ (a,b)  ab;f(a)f(b) f* = arg min Q(f;  ) q* = min Q(f;  ) = Q(f*;  ) Label l 0 Label l 1

Energy Minimization f(a)f(b)f(c)f(d) Q(f;  ) possible labellings f(a)f(b)f(c)f(d) Q(f;  ) f* = {1, 0, 0, 1} q* = 13

Outline Problem Formulation –Energy Function –Energy Minimization –Computing min-marginals Reparameterization Energy Minimization for Trees Loopy Belief Propagation

Min-Marginals VaVa VbVb VcVc VdVd f* = arg min Q(f;  ) such that f(a) = i Min-marginal q a;i Label l 0 Label l 1

Min-Marginals 16 possible labellings q a;0 = 15 f(a)f(b)f(c)f(d) Q(f;  ) f(a)f(b)f(c)f(d) Q(f;  )

Min-Marginals 16 possible labellings q a;1 = 13 f(a)f(b)f(c)f(d) Q(f;  ) f(a)f(b)f(c)f(d) Q(f;  )

Min-Marginals and MAP Minimum min-marginal of any variable = energy of MAP labelling min f Q(f;  ) such that f(a) = i q a;i min i min i ( ) V a has to take one label min f Q(f;  )

Summary Energy Minimization f* = arg min Q(f;  ) Q(f;  ) = ∑ a  a;f(a) + ∑ (a,b)  ab;f(a)f(b) Min-marginals q a;i = min Q(f;  ) s.t. f(a) = i Energy Function

Outline Problem Formulation Reparameterization Energy Minimization for Trees Loopy Belief Propagation

Reparameterization VaVa VbVb f(a)f(b) Q(f;  ) Add a constant to all  a;i Subtract that constant from all  b;k

Reparameterization f(a)f(b) Q(f;  ) Add a constant to all  a;i Subtract that constant from all  b;k Q(f;  ’) = Q(f;  ) VaVa VbVb

Reparameterization VaVa VbVb f(a)f(b) Q(f;  ) Add a constant to one  b;k Subtract that constant from  ab;ik for all ‘i’ - 3

Reparameterization VaVa VbVb f(a)f(b) Q(f;  ) Q(f;  ’) = Q(f;  ) Add a constant to one  b;k Subtract that constant from  ab;ik for all ‘i’

Reparameterization VaVa VbVb VaVa VbVb VaVa VbVb  ’ a;i =  a;i  ’ b;k =  b;k  ’ ab;ik =  ab;ik + M ab;k - M ab;k + M ba;i - M ba;i Q(f;  ’) = Q(f;  )

Reparameterization Q(f;  ’) = Q(f;  ), for all f  ’ is a reparameterization of , iff  ’    ’ b;k =  b;k  ’ a;i =  a;i  ’ ab;ik =  ab;ik + M ab;k - M ab;k + M ba;i - M ba;i Equivalently Kolmogorov, PAMI, 2006 VaVa VbVb

Recap Energy Minimization f* = arg min Q(f;  ) Q(f;  ) = ∑ a  a;f(a) + ∑ (a,b)  ab;f(a)f(b) Min-marginals q a;i = min Q(f;  ) s.t. f(a) = i Q(f;  ’) = Q(f;  ), for all f  ’   Reparameterization

Outline Problem Formulation Reparameterization Energy Minimization for Trees Loopy Belief Propagation Pearl, 1988

Belief Propagation Belief Propagation is exact for chains Some problems are easy Exact MAP for trees Clever Reparameterization

Two Variables VaVa VbVb VaVa VbVb Choose the right constant  ’ b;k = q b;k Add a constant to one  b;k Subtract that constant from  ab;ik for all ‘i’

VaVa VbVb VaVa VbVb Choose the right constant  ’ b;k = q b;k  a;0 +  ab;00 =  a;1 +  ab;10 = min M ab;0 = Two Variables

VaVa VbVb VaVa VbVb Choose the right constant  ’ b;k = q b;k Two Variables

VaVa VbVb VaVa VbVb Choose the right constant  ’ b;k = q b;k f(a) = 1  ’ b;0 = q b;0 Two Variables Potentials along the red path add up to 0

VaVa VbVb VaVa VbVb Choose the right constant  ’ b;k = q b;k  a;0 +  ab;01 =  a;1 +  ab;11 = min M ab;1 = Two Variables

VaVa VbVb VaVa VbVb Choose the right constant  ’ b;k = q b;k f(a) = 1  ’ b;0 = q b;0 f(a) = 1  ’ b;1 = q b;1 Minimum of min-marginals = MAP estimate Two Variables

VaVa VbVb VaVa VbVb Choose the right constant  ’ b;k = q b;k f(a) = 1  ’ b;0 = q b;0 f(a) = 1  ’ b;1 = q b;1 f*(b) = 0f*(a) = 1 Two Variables

VaVa VbVb VaVa VbVb Choose the right constant  ’ b;k = q b;k f(a) = 1  ’ b;0 = q b;0 f(a) = 1  ’ b;1 = q b;1 We get all the min-marginals of V b Two Variables

Recap We only need to know two sets of equations General form of Reparameterization  ’ a;i =  a;i  ’ ab;ik =  ab;ik + M ab;k - M ab;k + M ba;i - M ba;i  ’ b;k =  b;k Reparameterization of (a,b) in Belief Propagation M ab;k = min i {  a;i +  ab;ik } M ba;i = 0

Three Variables VaVa VbVb VcVc Reparameterize the edge (a,b) as before l0l0 l1l1

VaVa VbVb VcVc Reparameterize the edge (a,b) as before f(a) = Three Variables l0l0 l1l1

VaVa VbVb VcVc Reparameterize the edge (a,b) as before f(a) = 1 Potentials along the red path add up to Three Variables l0l0 l1l1

VaVa VbVb VcVc Reparameterize the edge (b,c) as before f(a) = 1 Potentials along the red path add up to Three Variables l0l0 l1l1

VaVa VbVb VcVc Reparameterize the edge (b,c) as before f(a) = 1 Potentials along the red path add up to 0 f(b) = 1 f(b) = Three Variables l0l0 l1l1

VaVa VbVb VcVc Reparameterize the edge (b,c) as before f(a) = 1 Potentials along the red path add up to 0 f(b) = 1 f(b) = 0 q c;0 q c; Three Variables l0l0 l1l1

VaVa VbVb VcVc f(a) = 1 f(b) = 1 f(b) = 0 q c;0 q c;1 f*(c) = 0 f*(b) = 0f*(a) = 1 Generalizes to any length chain Three Variables l0l0 l1l1

VaVa VbVb VcVc f(a) = 1 f(b) = 1 f(b) = 0 q c;0 q c;1 f*(c) = 0 f*(b) = 0f*(a) = 1 Dynamic Programming Three Variables l0l0 l1l1

Dynamic Programming 3 variables  2 variables + book-keeping n variables  (n-1) variables + book-keeping Start from left, go to right Reparameterize current edge (a,b) M ab;k = min i {  a;i +  ab;ik }  ’ ab;ik =  ab;ik + M ab;k - M ab;k  ’ b;k =  b;k Repeat

Dynamic Programming Start from left, go to right Reparameterize current edge (a,b) M ab;k = min i {  a;i +  ab;ik } Repeat MessagesMessage Passing Why stop at dynamic programming?  ’ ab;ik =  ab;ik + M ab;k - M ab;k  ’ b;k =  b;k

VaVa VbVb VcVc Reparameterize the edge (c,b) as before Three Variables l0l0 l1l1

VaVa VbVb VcVc Reparameterize the edge (c,b) as before  ’ b;i = q b;i Three Variables l0l0 l1l1

VaVa VbVb VcVc Reparameterize the edge (b,a) as before Three Variables l0l0 l1l1

VaVa VbVb VcVc Reparameterize the edge (b,a) as before  ’ a;i = q a;i Three Variables l0l0 l1l1

VaVa VbVb VcVc Forward Pass   Backward Pass All min-marginals are computed Three Variables l0l0 l1l1

Belief Propagation on Chains Start from left, go to right Reparameterize current edge (a,b) M ab;k = min i {  a;i +  ab;ik }  ’ ab;ik =  ab;ik + M ab;k - M ab;k  ’ b;k =  b;k Repeat till the end of the chain Start from right, go to left Repeat till the end of the chain

Belief Propagation on Chains A way of computing reparam constants Generalizes to chains of any length Forward Pass - Start to End MAP estimate Min-marginals of final variable Backward Pass - End to start All other min-marginals

Computational Complexity Each constant takes O(|L|) Number of constants - O(|E||L|) O(|E||L| 2 ) Memory required ? O(|E||L|)

Belief Propagation on Trees VbVb VaVa Forward Pass: Leaf  Root All min-marginals are computed Backward Pass: Root  Leaf VcVc VdVd VeVe VgVg VhVh

Outline Problem Formulation Reparameterization Energy Minimization for Trees Loopy Belief Propagation Pearl, 1988; Murphy et al., 1999

Belief Propagation on Cycles VaVa VbVb VdVd VcVc Where do we start? Arbitrarily  a;0  a;1  b;0  b;1  d;0  d;1  c;0  c;1 Reparameterize (a,b)

Belief Propagation on Cycles VaVa VbVb VdVd VcVc  a;0  a;1  ’ b;0  ’ b;1  d;0  d;1  c;0  c;1 Potentials along the red path add up to 0

Belief Propagation on Cycles VaVa VbVb VdVd VcVc  a;0  a;1  ’ b;0  ’ b;1  d;0  d;1  ’ c;0  ’ c;1 Potentials along the red path add up to 0

Belief Propagation on Cycles VaVa VbVb VdVd VcVc  a;0  a;1  ’ b;0  ’ b;1  ’ d;0  ’ d;1  ’ c;0  ’ c;1 Potentials along the red path add up to 0

Belief Propagation on Cycles VaVa VbVb VdVd VcVc  ’ a;0  ’ a;1  ’ b;0  ’ b;1  ’ d;0  ’ d;1  ’ c;0  ’ c;1 Potentials along the red path add up to 0

Belief Propagation on Cycles VaVa VbVb VdVd VcVc  ’ a;0  ’ a;1  ’ b;0  ’ b;1  ’ d;0  ’ d;1  ’ c;0  ’ c;1 Potentials along the red path add up to 0 -  a;0 -  a;1

Belief Propagation on Cycles VaVa VbVb VdVd VcVc  a;0  a;1  b;0  b;1  d;0  d;1  c;0  c;1 Any suggestions?Fix V a to label l 0

Belief Propagation on Cycles VaVa VbVb VdVd VcVc Any suggestions?Fix V a to label l 0  a;0  b;0  b;1  d;0  d;1  c;0  c;1 Equivalent to a tree-structured problem

Belief Propagation on Cycles VaVa VbVb VdVd VcVc  a;1  b;0  b;1  d;0  d;1  c;0  c;1 Any suggestions?Fix V a to label l 1 Equivalent to a tree-structured problem

Belief Propagation on Cycles Choose the minimum energy solution VaVa VbVb VdVd VcVc  a;0  a;1  b;0  b;1  d;0  d;1  c;0  c;1 This approach quickly becomes infeasible

Loopy Belief Propagation V1V1 V2V2 V3V3 V4V4 V5V5 V6V6 V7V7 V8V8 V9V9 Keep reparameterizing edges in some order Hope for convergence and a good solution

Belief Propagation Generalizes to any arbitrary random field Complexity per iteration ? O(|E||L| 2 ) Memory required ? O(|E||L|)

Theoretical Properties of BP Exact for Trees Pearl, 1988 What about any general random field? Run BP. Assume it converges.

Theoretical Properties of BP Exact for Trees Pearl, 1988 What about any general random field? Choose variables in a tree. Change their labels. Value of energy does not decrease

Theoretical Properties of BP Exact for Trees Pearl, 1988 What about any general random field? Choose variables in a cycle. Change their labels. Value of energy does not decrease

Theoretical Properties of BP Exact for Trees Pearl, 1988 What about any general random field? For cycles, if BP converges then exact MAP Weiss and Freeman, 2001

Speed-Ups for Special Cases  ab;ik = 0, if i = k = C, otherwise. M ab;k = min i {  a;i +  ab;ik } Felzenszwalb and Huttenlocher, 2004

Speed-Ups for Special Cases  ab;ik = w ab |i-k| M ab;k = min i {  a;i +  ab;ik } Felzenszwalb and Huttenlocher, 2004

Speed-Ups for Special Cases  ab;ik = min{w ab |i-k|, C} M ab;k = min i {  a;i +  ab;ik } Felzenszwalb and Huttenlocher, 2004

Speed-Ups for Special Cases  ab;ik = min{w ab (i-k) 2, C} M ab;k = min i {  a;i +  ab;ik } Felzenszwalb and Huttenlocher, 2004