35
KECE471 Computer Vision EM Algorithm and Mean Shift Chang-Su Kim Chapter 14, Computer Vision by Forsyth and Ponce Chapter 5, Computer Vision by Richard Szeliski Note: Dr. Forsyth’s notes are partly used. The contents on meanshift part are copied from the ppt file of Yaron Ukrainitz & Bernard Sarel

KECE471 Computer Vision EM Algorithm and Mean Shift

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: KECE471 Computer Vision EM Algorithm and Mean Shift

KECE471 Computer Vision

EM Algorithm and Mean Shift

Chang-Su Kim

Chapter 14, Computer Vision by Forsyth and PonceChapter 5, Computer Vision by Richard SzeliskiNote: Dr. Forsyth’s notes are partly used.

The contents on meanshift part are copied from the ppt file of Yaron Ukrainitz & Bernard Sarel

Page 2: KECE471 Computer Vision EM Algorithm and Mean Shift

EM -

EXPECTATION MAXIMIZATION

Page 3: KECE471 Computer Vision EM Algorithm and Mean Shift

K-means and EM algorithm

• K-Means

– Hard Clustering• An instance belongs to only one cluster

• EM

– Soft Clustering. • An instance belongs to several clusters with

membership probability

I

C1

C2

0.7

0.3

I

C1

C2

Page 4: KECE471 Computer Vision EM Algorithm and Mean Shift

Clustering - EM algorithm

• Gaussian mixture model

– A mixture is a set of k Gaussian distributions,

representing k clusters.

– Each Gaussian distribution is represented by

mean and variance.

– The mixture model combines several Gaussian

distributions.

Page 5: KECE471 Computer Vision EM Algorithm and Mean Shift

Clustering - EM algorithm

• Example : Mixture of 3 Gaussians

Page 6: KECE471 Computer Vision EM Algorithm and Mean Shift

Fitting a Gaussian Mixture

• Given the data set, estimate the parameters:

– Mixing coefficients

– Means

– Variances

• If we know which cluster generates each

data point, the estimation is very easy

• But the information is unknown

Page 7: KECE471 Computer Vision EM Algorithm and Mean Shift

Informal derivation

• Iterative scheme

– Make initial guesses for the parameters

– Alternate between the following two stages:

1. E-step: evaluate responsibilities

2. M-step: update parameters using ML results

itera

tion

Page 8: KECE471 Computer Vision EM Algorithm and Mean Shift
Page 9: KECE471 Computer Vision EM Algorithm and Mean Shift
Page 10: KECE471 Computer Vision EM Algorithm and Mean Shift
Page 11: KECE471 Computer Vision EM Algorithm and Mean Shift
Page 12: KECE471 Computer Vision EM Algorithm and Mean Shift
Page 13: KECE471 Computer Vision EM Algorithm and Mean Shift
Page 14: KECE471 Computer Vision EM Algorithm and Mean Shift

Another Example

• Data set – 6 clusters

Page 15: KECE471 Computer Vision EM Algorithm and Mean Shift

Fitting the Gaussian Mixture

• Resulting density estimation

Page 16: KECE471 Computer Vision EM Algorithm and Mean Shift

Another Example

Original image 2 clusters 5 clusters

10 clusters 20 clusters 50 clusters

Page 17: KECE471 Computer Vision EM Algorithm and Mean Shift

MEAN SHIFT AND MODE

FINDING

• D. Comaniciu and P. Meer, “Mean shift: A robust approach toward

feature space analysis,” IEEE Trans. PAMI, vol. 24, no. 5, pp. 603-619,

2002.

• Slides are excerpted from those of Yaron Ukrainitz & Bernard Sarel

Page 18: KECE471 Computer Vision EM Algorithm and Mean Shift

Mean shift and Mode Finding

Page 19: KECE471 Computer Vision EM Algorithm and Mean Shift

Intuitive DescriptionRegion ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 20: KECE471 Computer Vision EM Algorithm and Mean Shift

Intuitive DescriptionRegion ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 21: KECE471 Computer Vision EM Algorithm and Mean Shift

Intuitive DescriptionRegion ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 22: KECE471 Computer Vision EM Algorithm and Mean Shift

Intuitive DescriptionRegion ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 23: KECE471 Computer Vision EM Algorithm and Mean Shift

Intuitive DescriptionRegion ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 24: KECE471 Computer Vision EM Algorithm and Mean Shift

Intuitive DescriptionRegion ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 25: KECE471 Computer Vision EM Algorithm and Mean Shift

Intuitive DescriptionRegion ofinterest

Center ofmass

Objective : Find the densest region

Page 26: KECE471 Computer Vision EM Algorithm and Mean Shift

What is Mean Shift ?

Non-parametricDensity Estimation

Non-parametricDensity GRADIENT Estimation

(Mean Shift)

Data

Discrete PDF Representation

PDF Analysis

A tool for:Finding modes in a set of data samples, representing an underlying probability density function (PDF) in RN

Page 27: KECE471 Computer Vision EM Algorithm and Mean Shift

Density Estimation

Underlying PDF Real Data Samples

Data point densityimplies PDF value !

Page 28: KECE471 Computer Vision EM Algorithm and Mean Shift

Density Estimation

• Parametric density estimation

𝑓 𝑥 =1

𝜎 2𝜋exp −

𝑥 −𝑚 2

2𝜎2

• Nonparametric density estimation

𝑓 𝑥 =

𝑖

𝑘(𝑥 − 𝑥𝑖)

– Kernel density estimation

– Parzen window technique

Page 29: KECE471 Computer Vision EM Algorithm and Mean Shift

Non-Parametric Density Estimation

Page 30: KECE471 Computer Vision EM Algorithm and Mean Shift

Non-Parametric Density Estimation

Page 31: KECE471 Computer Vision EM Algorithm and Mean Shift

Mean Shift Operation

• In the mean shift procedure, we obtain not the density 𝑓(𝑥), but its gradient 𝛻𝑓 𝑥

• Clustering

– Record the moving trajectory of each point

– All points leading to a mode form a cluster

• A faster approach

– Randomly subsample input points

– Keep track of the temporal evolution of each point.

– Classify the remaining points based on the nearest evolution path

Page 32: KECE471 Computer Vision EM Algorithm and Mean Shift

Clustering

Attraction basin : the region for which all trajectories lead to the same mode

Cluster : All data points in the attraction basin of a mode

Page 33: KECE471 Computer Vision EM Algorithm and Mean Shift

Drainage Basin (Watershed)

Page 34: KECE471 Computer Vision EM Algorithm and Mean Shift

SegmentationExample

Page 35: KECE471 Computer Vision EM Algorithm and Mean Shift

SegmentationExample