Transcript
Page 1: Integration and Graphical Models

Integration and Graphical Models

Derek HoiemCS 598, Spring 2009

April 14, 2009

Page 2: Integration and Graphical Models

Why?

The goal of vision is to make useful inferences about the scene.

In most cases, this requires integrative reasoning about many types of information.

Page 3: Integration and Graphical Models

Example: 3D modeling

Page 4: Integration and Graphical Models

Object context

From Divvala et al. CVPR 2009

Page 5: Integration and Graphical Models

How?

• Feature passing

• Graphical models

Page 6: Integration and Graphical Models

Class Today

• Feature passing

• Graphical models– Bayesian networks– Markov networks– Various inference and learning methods

• Example

Page 7: Integration and Graphical Models

Properties of a good mechanism for integration

• Modular: different processes/estimates can be improved independently

• Symbiotic: each estimate improves

• Robust: mistakes in one process are not fatal for others that partially rely on it

• Feasible: training and inference is fast and easy

Page 8: Integration and Graphical Models

Feature Passing• Compute features from one estimated scene

property to help estimate another

Image X Estimate

Y Estimate

X Features

Y Features

Page 9: Integration and Graphical Models

Feature passing: example

ObjectWindow

Below

Above

Use features computed from “geometric context” confidence images to improve object detection

Hoiem et al. ICCV 2005

Features: average confidence within each window

Page 10: Integration and Graphical Models

Feature Passing• Pros and cons

– Simple training and inference– Very flexible in modeling interactions– Not modular

• if we get a new method for first estimates, we may need to retrain

– Requires iteration to be symbiotic• complicates things

– Robust in expectation but not instance

Page 11: Integration and Graphical Models

Probabilistic graphical modelsExplicitly model uncertainty and dependency structure

a

b

c

a

b

c

Directed Undirected Factor graph

d d

a

b

c d

Key concept: Markov blanket

Page 12: Integration and Graphical Models

Directed acyclical graph (Bayes net)

a

b

c d

P(a,b,c,d) = P(c|b)P(d|b)P(b|a)P(a)

a

b

c d

P(a,b,c,d) = P(b|a,c,d)P(a)P(c)P(d)

Arrow directions matter

a,c,d dependent when conditioned on b

c independent of a given b

d independent of a given b

Page 13: Integration and Graphical Models

Directed acyclical graph (Bayes net)

a

b

c d

P(a,b,c,d) = P(c|b)P(d|b)P(b|a)P(a)

• Can model causality• Parameter learning

– Decomposes: learn each term separately (ML)

• Inference– Simple exact inference if tree-

shaped (belief propagation)

Page 14: Integration and Graphical Models

Directed acyclical graph (Bayes net)

a

b

c d

• Can model causality• Parameter learning

– Decomposes: learn each term separately (ML)

• Inference– Simple exact inference if tree-shaped

(belief propagation)– Loops require approximation

• Loopy BP• Tree-reweighted BP• Sampling

P(a,b,c,d) = P(c|b)P(d|a,b)P(b|a)P(a)

Page 15: Integration and Graphical Models

• Example: Places and scenes

Directed graph

Place: office, kitchen, street, etc.

Car Person Toaster MicrowaveFire

Hydrant

Objects Present

P(place, car, person, toaster, micro, hydrant) = P(place) P(car | place) P(person | place) … P(hydrant | place)

Page 16: Integration and Graphical Models

• Example: “Putting Objects in Perspective”

Directed graph

Page 17: Integration and Graphical Models

Undirected graph (Markov Networks)

• Does not model causality• Often pairwise• Parameter learning difficult• Inference usually approximate

x1

x2

x3 x4

edgesji

jii

iZ dataxxdataxdataP,

24..1

11 ),;,(),;(),;( x

Page 18: Integration and Graphical Models

Markov Networks• Example: “label smoothing” grid

Binary nodes

0 10 0 K1 K 0

Pairwise Potential

Page 19: Integration and Graphical Models

Factor graphs• A general representation

a

b

c

Bayes Net

Factor Graph

d

a

b

c d

Page 20: Integration and Graphical Models

Factor graphs• A general representation

a

b

c

Markov Net

d

Factor Graph

a

b

c d

Page 21: Integration and Graphical Models

Factor graphs

),()(),,(),,,( 321 dafdfcbafdcbaP

Write as a factor graph

Page 22: Integration and Graphical Models

Inference: Belief Propagation• Very general • Approximate, except for tree-shaped graphs

– Generalizing variants BP can have better convergence for graphs with many loops or high potentials

• Standard packages available (BNT toolbox, my website)

• To learn more:– Yedidia, J.S.; Freeman, W.T.; Weiss, Y., "Understanding Belief Propagation and Its

Generalizations”, Technical Report, 2001: http://www.merl.com/publications/TR2001-022/

Page 23: Integration and Graphical Models

Inference: Graph Cuts• Associative: edge potentials penalize different labels• Associative binary networks can be solved optimally

(and quickly) using graph cuts

• Multilabel associative networks can be handled by alpha-expansion or alpha-beta swaps

• To learn more:– http://www.cs.cornell.edu/~rdz/graphcuts.html– Classic paper: What Energy Functions can be Minimized via Graph Cuts? (Kolmogorov

and Zabih, ECCV '02/PAMI '04)

Page 24: Integration and Graphical Models

Inference: Sampling (MCMC)• Metropolis-Hastings algorithm

– Define transitions and transition probabilities– Make sure you can get from any state to any other

(ergodicity)– Make proposal and accept if rand(1) < P(new

state)/P(old state) P(backward transition) / P(transition)

• Note: if P(state) decomposes, this is easy to compute

– Example: “Image parsing” by Tu and Zhu to find good segmentation

Page 25: Integration and Graphical Models

Learning parameters: maximize likelihood

• Simply count for Bayes network with discrete variables

• Run BP and do gradient descent for Markov network

• Often do not care about full likelihood

Page 26: Integration and Graphical Models

Learning parameters: maximize objective• SPSA (simultaneous perturbation stochastic

approximation) algorithm:– Take two trial steps in a random direction, one forward and

one backwards– Compute loss (or objective) for each and get a pseudo-

gradient– Take a step according to results– Refs

• Li and Huttenlocher, “Learning for Optical Flow Using Stochastic Optimization”, ECCV 2008

• Various papers by Spall on SPSA

Page 27: Integration and Graphical Models

Learning parameters: structured learning

See also Tsochantaridis et al.: http://jmlr.csail.mit.edu/papers/volume6/tsochantaridis05a/tsochantaridis05a.pdf

Szummer et al. 2008

Page 28: Integration and Graphical Models

How to get the structure?• Set by hand (most common)

• Learn (mostly for Bayes nets)– Maximize score (greedy search)– Based on independence tests

• Logistic regression with L1 regularization for finding Markov blanket

For more: www.autonlab.org/tutorials/bayesstruct05.pdf

Page 29: Integration and Graphical Models

Graphical Models• Pros and cons

– Very powerful if dependency structure is sparse and known

– Modular (especially Bayesian networks)– Flexible representation (but not as flexible as

“feature passing”)– Many inference methods– Recent development in learning Markov network

parameters, but still tricky

Page 30: Integration and Graphical Models

Which techniques have I used?• Almost all of them

– Feature passing (ICCV 2005, CVPR 2008)– Bayesian networks (CVPR 2006)

• In factor graph form (ICCV 2007)• Semi-naïve Bayes (CVPR 2004)

– Markov networks (ECCV 2008, CVPR 2007, CVPR 2005: HMM)

– Belief propagation (CVPR 2006, ICCV 2007)– Structured learning (ECCV 2008)– Graph cuts (CVPR 2008, ECCV 2008)– MCMC (IJCV 2007… didn’t work well)– Learning Bayesian structure (2002-2003, not published)

Page 31: Integration and Graphical Models

Example: faces, skin, cloth


Recommended