a bayesian hierarchical model for learning natural …venky/se263/slides/soumya_p1.pdfa bayesian...

28
A Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona. CVPR 2005 Presented By N. Soumya, ME (SSA)

Upload: nguyenhuong

Post on 10-Jul-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

A Bayesian Hierarchical Model for

Learning Natural Scene

Categories

L. Fei-Fei and P. Perona. CVPR 2005

Presented By

N. Soumya, ME (SSA)

Page 2: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Goal: Learn and Recognize Natural Scene

Categories

Classify a scene without first extracting objects.

The key idea is to use intermediate representation

(themes)before classifying scenes.

In previous work, such themes were learnt from hand-

annotations of experts, while method in this paper learns the

theme distributions as well as the codewords distribution over

the themes without supervision.

Page 3: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Visual Themes

zebra

grass

tree

Page 4: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Mixture Models

zebra grass treeNew image

= α1 + α2 + α3

Page 5: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Flow Chart: Quick Overview

Page 6: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Local Region Detection

Four Different ways of extracting local regions

1) Evenly sampled grid.

2) Random Sampling.

3) Kadir and Brady Saliency Detector.

4) Lowe's DOG Detector.

Page 7: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Local Region Representation

1) Normalised 11x11 pixel gray values.

2) 128-Dimensional SIFT Vector.

Page 8: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Codebook

• 174 code words .

• Code words are sorted in the descending order according to membership.

• Most dominant code words represent simple orientations and illumination patterns similar to the ones early human visual system responds to.

Page 9: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Topic Models for Learning & Recognition

The basic idea is that the documents are represented as randommixtures over latent topics (themes), where a topic is characterizedby a distribution over words.

Learning:

Achieve a model that best represents the distribution of these codewords in each category of scenes.

Recognition:

Identify all the codewords in the unknown image. Then we find the category model that fits best the distribution of the codewords of the particular image.

Algorithm used here is Latent Dirichlet Allocation (LDA) model proposed by Blei et al.[Ref-2]

Page 10: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

w

N

c z

D

Latent Dirichlet Allocation

Latent Dirichlet Allocation (LDA)

“beach”

Page 11: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Latent Dirichlet Allocation

Analogy to document classification

• Image Document

• Mixture of themes Mixture of topics.

• Visual codeword Word.

• Each topic is represented as multinomial distribution over words with a Dirichlet prior .

• A document is generated by sampling mixture of topics and then words from that mixture.

• Distribution of words is also multiinomial

Page 12: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

η – distribution of class labelsθ – parameter (estimated )c – class labelπ – distribution of themes for imagez – themex – patchβ – parameter (estimated)

Hierarchial Representation Of Scene Category Model

Observed Variable

Unobserved Variable

Page 13: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

How to Generate an Image?

Given scene generate an intermediate

probability vector over „themes‟

Determine current theme from mixture

of themes

Choose a scene (mountain, beach, …)

For each word:

Draw a codeword from that theme

Page 14: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

p(c|η)= Mult(c|η)

Page 15: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona
Page 16: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona
Page 17: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona
Page 18: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Theta and beta must be estimated before we can find the topic mixing

proportions belonging to a previously unseen image

Theta - a matrix which encodes the probability of observing a

codeword

w conditioned on a topic z.

Beta - a matrix which encodes the Dirichlet parameters for each image

class.

Page 19: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Must integrate over hidden variables π, z

Page 20: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Variational Inference in LDA

• Goal is to maximise the log likelihood term

log p(x/θ,β,c) by estimating optimal θ and

β. Unfortunately, this is intractable to

compute in general to compute due to

coupling between π and β.

• Variational Methods: Use Jensen‟s

inequality to obtain a lower bound

(variational distribution) on the log likelihood

that is indexed by a set of variational

parameters γ and φ.

Page 21: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Variational EM

This leads to variational EM algorithm

• (E Step) For each class of images, find the optimizing values of the variational parameters (γ, φ).

• (M Step) Maximize variational distribution w.r.t. θ, β for the γ and φ values found in the E step.

Iterate steps 1 and 2 till convergence.

Page 22: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Results

Page 23: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona
Page 24: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Results: The Distributions

Theme

distribution

Codeword

distribution

Page 25: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Theme Distribution

Page 26: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Testing Image Results

Correct Incorrect

Superimposed are the patches of most significant code words.In Incorrectlycategorized images, the number of significant codewords of the model tendsto occur less likely.

Page 27: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

Performance Summary

Page 28: A Bayesian Hierarchical Model for Learning Natural …venky/SE263/slides/Soumya_P1.pdfA Bayesian Hierarchical Model for Learning Natural Scene Categories L. Fei-Fei and P. Perona

References

1) L. Fei-Fei, P. Perona. A Bayesian Hierarchical Model

for Learning Natural Scene Categories. CVPR 2005.

2) D. M. Blei, A. Y. Ng and M. I. Jordan.

Latent Dirichlet Allocation. JMLR, 2003.

3) L. Fei Fei. Bag of words models.

CVPR 2007 Short Course. Presentation Slides.http: //

vision. cs. princeton. edu/ documents/ CVPR2007_

tutorial_ bag_of_ words. ppt