Spatial Bayesian Nonparametrics for Natural Image Segmentation

47
Spatial Bayesian Nonparametrics for Natural Image Segmentation Erik Sudderth Brown University Joint work with Michael Jordan University of California Soumya Ghosh Brown University

Transcript of Spatial Bayesian Nonparametrics for Natural Image Segmentation

Page 1: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Spatial Bayesian Nonparametrics for Natural Image Segmentation

Erik Sudderth Brown University

Joint work with Michael Jordan University of California

Soumya Ghosh Brown University

Page 2: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Parsing Visual Scenes

trees

skyscraper sky

bell

dome

temple buildings

sky

Page 3: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Region Classification with Markov Field Aspect Models

Local: 74%

MRF: 78%

Verbeek & Triggs, CVPR 2007

Page 4: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Human Image Segmentation

Page 5: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Berkeley Segmentation Database & Boundary Detection Benchmark

Page 6: Spatial Bayesian Nonparametrics for Natural Image Segmentation

BNP Image Segmentation

•! How many regions does this image contain? •! What are the sizes of these regions?

Segmentation as Partitioning

•! Huge variability in segmentations across images •! Want multiple interpretations, ranked by probability

Why Bayesian Nonparametrics?

Page 7: Spatial Bayesian Nonparametrics for Natural Image Segmentation

The Infinite Hype •! Infinite Gaussian Mixture Models •! Infinite Hidden Markov Models •! Infinite Mixtures of Gaussian Process Experts •! Infinite Latent Feature Models •! Infinite Independent Components Analysis •! Infinite Hidden Markov Trees •! Infinite Markov Models •! Infinite Switching Linear Dynamical Systems •! Infinite Factorial Hidden Markov Models •! Infinite Probabilistic Context Free Grammars •! Infinite Hierarchical Hidden Markov Models •! Infinite Partially Observable Markov Decision Processes •! !

Page 8: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Some Hope: BNP Segmentation

Inference !!Stochastic search &

expectation propagation

Model !!Dependent Pitman-Yor processes

!!Spatial coupling via Gaussian processes

Results !!Multiple segmentations of

natural images

cesses

Learning !!Conditional covariance

calibration

Page 9: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Pitman-Yor Processes The Pitman-Yor process defines a distribution on

infinite discrete measures, or partitions

Dirichlet process:

0 1

Page 10: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Pitman-Yor Stick-Breaking

Page 11: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Human Image Segmentations

Labels for more than 29,000 segments in 2,688 images of natural scenes

Page 12: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Statistics of Human Segments How many objects are in this image?

Many Small

Objects

Some Large

Objects

Object sizes follow a power law

Labels for more than 29,000 segments in 2,688 images of natural scenes

Page 13: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Why Pitman-Yor?

Jim Pitman

Marc Yor

Generalizing the Dirichlet Process !!Distribution on partitions leads to a

generalized Chinese restaurant process

! Special cases of interest in probability: Markov chains, Brownian motion, !

Power Law Distributions DP PY

Number of unique clusters in N observations

Heaps Law:

Size of sorted cluster weight k

Goldwater, Griffiths, & Johnson, 2005 Teh, 2006

Natural Language Statistics

Zipf s Law:

Page 14: Spatial Bayesian Nonparametrics for Natural Image Segmentation

An Aside: Toy Dataset Bias

! !"# $ $"# % %"# & &"# ' '"# #!

!"#

$

$"#

%

%"#

&

&"#

'

'"#

#()*+,-.-/01+234+

! !"# $ $"# % %"# & &"# ' '"# #!

!"#

$

$"#

%

%"#

&

&"#

'

'"#

#0)(35(67500+,-&-/01+234+

! !"# $ $"# % %"# & &"# ' '"# #!

!"#

$

$"#

%

%"#

&

&"#

'

'"#

#8914/0916+,-%-/01+234+

! !"# $ $"# % %"# & &"# ' '"# #!

!"#

$

$"#

%

%"#

&

&"#

'

'"#

#+:1);;03+,-'-/01+234+

! !"# $ $"# % %"# & &"# ' '"# #!

!"#

$

$"#

%

%"#

&

&"#

'

'"#

#2<9/)4/03+,-%-/01+234+

! !"# $ $"# % %"# & &"# ' '"# #!

!"#

$

$"#

%

%"#

&

&"#

'

'"#

#2=433/)4/03+ >9)(36,-%-/01+234+

- - - - - -Ng, Jordan, & Weiss, NIPS 2001

Page 15: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Feature Extraction

•! Partition image into ~1,000 superpixels •! Compute texture and color features:

Texton Histograms (VQ 13-channel filter bank) Hue-Saturation-Value (HSV) Color Histograms

•! Around 100 bins for each histogram

Page 16: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Pitman-Yor Mixture Model

Observed features (color & texture)

Assign features to segments

PY segment size prior

Visual segment appearance model

Color: Texture:

π

z1 z2

z3z4

x1x2

x3x4xc

i ∼ Mult(θczi)

xsi ∼ Mult(θszi)

zi ∼ Mult(π)

πk = vk

k−1∏

�=1

(1− v�)

vk ∼ Beta(1− a, b+ ka)

Page 17: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Dependent DP&PY Mixtures

Observed features (color & texture)

Visual segment appearance model

Color: Texture:

z1 z2

z3z4

x1x2

x3x4xc

i ∼ Mult(θczi)

xsi ∼ Mult(θszi)

π1 π2

π3π4

Assign features to segments

zi ∼ Mult(πi)

Some dependent prior with DP/PY

“like” marginals

Kernel/logistic/probit stick-breaking process,

order-based DDP, !

Page 18: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Example: Logistic of Gaussians

•! Pass set of Gaussian processes through softmax to get probabilities of independent segment assignments

•! Nonparametric analogs have similar properties Figueiredo et. al., 2005, 2007

Fernandez & Green, 2002 Woolrich & Behrens, 2006 Blei & Lafferty, 2006

Page 19: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Discrete Markov Random Fields Ising and Potts Models

•! Interactive foreground segmentation •! Supervised training for known categories

Previous Applications

!but learning is challenging, and little success at unsupervised segmentation.

GrabCut: Rother, Kolmogorov, & Blake 2004

Verbeek & Triggs, 2007

Page 20: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Phase Transitions in Action

Potts samples, 10 states sorted by size: largest in blue, smallest in red

Page 21: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Product of Potts and DP? Orbanz & Buhmann 2006

Potts Potentials DP Bias:

Page 22: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Spatially Dependent Pitman-Yor Spatially D •! Cut random surfaces

(samples from a GP) with thresholds (as in Level Set Methods)

•! Assign each pixel to the first surface which exceeds threshold (as in Layered Models)

Duan, Guindani, & Gelfand, Generalized Spatial DP, 2007

π

z1 z2

z3z4

x1x2

x3x4

Page 23: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Spatially Dependent Pitman-Yor Spatially D Pitman-Yor •! Cut random surfaces

(samples from a GP) with thresholds (as in Level Set Methods)

•! Assign each pixel to the first surface which exceeds threshold (as in Layered Models)

Duan, Guindani, & Gelfand, Generalized Spatial DP, 2007

Page 24: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Spatially Dependent Pitman-Yor Spatially D Pitman-Yor •! Cut random surfaces

(samples from a GP) with thresholds (as in Level Set Methods)

•! Assign each pixel to the first surface which exceeds threshold (as in Layered Models)

•! Retains Pitman-Yor marginals while jointly modeling rich spatial dependencies (as in Copula Models)

Page 25: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Spatially Dependent Pitman-Yor Spatially D Non-Markov Gaussian Processes:

PY prior: Segment size

Feature Assignments

Normal CDF

Page 26: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Samples from PY Spatial Prior

Comparison: Potts Markov Random Field

Page 27: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Outline

Inference !!Stochastic search &

expectation propagation

Model !!Dependent Pitman-Yor processes

!!Spatial coupling via Gaussian processes

Results !!Multiple segmentations of

natural images

cesses

Learning !!Conditional covariance

calibration

Page 28: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Mean Field for Dependent PY

K

K

Factorized Gaussian Posteriors

Sufficient Statistics

Allows closed form update of via

Page 29: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Robustness and Initialization

Log-likelihood bounds versus iteration, for many random initializations of mean field variational inference on a single image.

Page 30: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Alternative: Inference by Search

Consider hard assignments of

superpixels to layers (partitions) Integrate

likelihood parameters analytically (conjugacy)

Marginalize layer support functions via expectation propagation (EP): approximate but very accurate

No need for a finite, conservative model truncation!

Page 31: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Discrete Search Moves

!!Merge: Combine a pair of regions into a single region

!!Split: Break a single region into a pair of regions (for diversity, a few proposals)

!!Shift: Sequentially move single superpixels to the most probable region

!!Permute: Swap the position of two layers in the order

Stochastic proposals, accepted if and only if they improve our EP estimate of marginal likelihood:

Marginalization of continuous variables simplifies these moves!

Page 32: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Inference Across Initializations

Mean Field Variational EP Stochastic Search

Best Worst Best Worst

Page 33: Spatial Bayesian Nonparametrics for Natural Image Segmentation

BSDS: Spatial PY Inference Sp

atia

l PY

(EP)

Sp

atia

l PY

(MF)

Page 34: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Outline

Inference !!Stochastic search &

expectation propagation

Model !!Dependent Pitman-Yor processes

!!Spatial coupling via Gaussian processes

Results !!Multiple segmentations of

natural images

cesses

Learning !!Conditional covariance

calibration

Page 35: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Covariance Kernels •! Thresholds determine segment size: Pitman-Yor •! Covariance determines segment shape:

Roughly Independent Image Cues:

Berkeley Pb (probability of boundary) detector

probability that features at locations are in the same segment

!!Color and texture histograms within each region: Model generatively via multinomial likelihood (Dirichlet prior)

! Pixel locations and intervening contour cues: Model conditionally via GP covariance function

Page 36: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Learning from Human Segments

!!Data unavailable to learn models of all the categories we’re interested in: We want to discover new categories!

! Use logistic regression, and basis expansion of image cues, to learn binary “are we in the same segment” predictors:

!! Generative: Distance only

!! Conditional: Distance, intervening contours, !

Page 37: Spatial Bayesian Nonparametrics for Natural Image Segmentation

From Probability to Correlation

There is an injective mapping between covariance and the probability that two superpixels are in

the same segment.

Page 38: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Low-Rank Covariance Projection

!! The pseudo-covariance constructed by considering each superpixel pair independently may not be positive definite

!!Projected gradient method finds low rank (factor analysis), unit diagonal covariance close to target estimates

Page 39: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Prediction of Test Partitions

Heuristic versus Learned Image Partition Probabilities

Learned Probability versus Rand index measure of partition overlap

Page 40: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Comparing Spatial PY Models

Image PY Learned PY Heuristic

Page 41: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Outline

Inference !!Stochastic search &

expectation propagation

Model !!Dependent Pitman-Yor processes

!!Spatial coupling via Gaussian processes

Results !!Multiple segmentations of

natural images

cesses

Learning !!Conditional covariance

calibration

Page 42: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Other Segmentation Methods

FH Graph Mean Shift NCuts gPb+UCM Spatial PY

Page 43: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Quantitative Comparisons

Berkeley Segmentation LabelMe Scenes !!On BSDS, similar or better than all methods except gPb

! On LabelMe, performance of Spatial PY is better than gPb

!! Implementation efficiency and search run-time

!!Histogram likelihoods discard too much information

!!Most probable segmentation does not minimize Bayes risk

Room for Improvement:

Page 44: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Multiple Spatial PY Modes

Most Probable

Page 45: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Multiple Spatial PY Modes

Most Probable

Page 46: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Spatial PY Segmentations

Page 47: Spatial Bayesian Nonparametrics for Natural Image Segmentation

Conclusions Successful BNP modeling requires!

!! careful study of how model assumptions match data statistics & model comparisons

! reliable, consistent (general-purpose?) inference algorithms, carefully validated

! methods for learning hyperparametersfrom data, often with partial supervision

ns sons

d