mean shift theory and applications reporter: zhongping ji

72
Mean Shift Theory and Applications Reporter: Zhongping Ji

Upload: paula-ball

Post on 12-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mean Shift Theory and Applications Reporter: Zhongping Ji

Mean ShiftTheory and Applications

Reporter: Zhongping Ji

Page 2: Mean Shift Theory and Applications Reporter: Zhongping Ji

Agenda• Mean Shift Theory

• What is Mean Shift ? • Density Estimation Methods• Deriving the Mean Shift• Mean shift properties

• Applications• Clustering• Discontinuity Preserving Smoothing• Object Contour Detection• Segmentation• Object Tracking

Page 3: Mean Shift Theory and Applications Reporter: Zhongping Ji

Papers

• Mean Shift: A Robust Approach Toward Feature Space Analysis

Authors: Dorin Comaniciu, Peter Meer (Rutgers University EECS, Member IEEE). IEEE Trans. Pattern analysis and machine intelligence 24(5), 2002

Field: application of modern statistical methods to image understanding problems

• A Topological Approach to Hierarchical Segmentation using Mean Shift

Authors: Sylvain Paris, Fredo Durand. (MIT EECS, computer science and artificial intelligence laboratory) Proceedings of the IEEE conference on Computer Vision and Pattern Recognition (CVPR'07)

Field: most aspects of image processing

Page 4: Mean Shift Theory and Applications Reporter: Zhongping Ji

Mean Shift Theory

Page 5: Mean Shift Theory and Applications Reporter: Zhongping Ji

Intuitive Description

Distribution of identical billiard balls

Region ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 6: Mean Shift Theory and Applications Reporter: Zhongping Ji

Intuitive Description

Distribution of identical billiard balls

Region ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 7: Mean Shift Theory and Applications Reporter: Zhongping Ji

Intuitive Description

Distribution of identical billiard balls

Region ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 8: Mean Shift Theory and Applications Reporter: Zhongping Ji

Intuitive Description

Distribution of identical billiard balls

Region ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 9: Mean Shift Theory and Applications Reporter: Zhongping Ji

Intuitive Description

Distribution of identical billiard balls

Region ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 10: Mean Shift Theory and Applications Reporter: Zhongping Ji

Intuitive Description

Distribution of identical billiard balls

Region ofinterest

Center ofmass

Mean Shiftvector

Objective : Find the densest region

Page 11: Mean Shift Theory and Applications Reporter: Zhongping Ji

Intuitive Description

Distribution of identical billiard balls

Region ofinterest

Center ofmass

Objective : Find the densest region

Page 12: Mean Shift Theory and Applications Reporter: Zhongping Ji

What is Mean Shift ?

Non-parametricDensity Estimation

Non-parametricDensity GRADIENT Estimation

(Mean Shift)

Data

Discrete PDF Representation

PDF Analysis

PDF in feature space• Color space• Scale space• Actually any feature space you can conceive• …

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

Page 13: Mean Shift Theory and Applications Reporter: Zhongping Ji

Non-Parametric Density Estimation

Assumption : The data points are sampled from an underlying PDF

Assumed Underlying PDF Real Data Samples

Data point density implies PDF value !

Page 14: Mean Shift Theory and Applications Reporter: Zhongping Ji

Assumed Underlying PDF Real Data Samples

Non-Parametric Density Estimation

Page 15: Mean Shift Theory and Applications Reporter: Zhongping Ji

Assumed Underlying PDF Real Data Samples

?Non-Parametric Density Estimation

Page 16: Mean Shift Theory and Applications Reporter: Zhongping Ji

Parametric Density Estimation

Assumption : The data points are sampled from an underlying PDF

Assumed Underlying PDF

2

2

( )

2

i

PDF( ) = i

iic e

x-μ

x

Estimate

Real Data Samples

Page 17: Mean Shift Theory and Applications Reporter: Zhongping Ji

Kernel Density Estimation Parzen Windows - Function Forms

1

1( ) ( )

n

ii

P Kn

x x - x A function of some finite number of data pointsx1…xn

DataIn practice one uses the forms:

1

( ) ( )d

ii

K c k x

x or ( )K ckx x

Same function on each dimension Function of vector length only

Page 18: Mean Shift Theory and Applications Reporter: Zhongping Ji

Kernel Density EstimationVarious Kernels

1

1( ) ( )

n

ii

P Kn

x x - x A function of some finite number of data pointsx1…xn

Examples:

• Epanechnikov Kernel

• Uniform Kernel

• Normal Kernel

21 1

( ) 0 otherwise

E

cK

x xx

1( )

0 otherwiseU

cK

xx

21( ) exp

2NK c

x x

Data

Page 19: Mean Shift Theory and Applications Reporter: Zhongping Ji

Kernel Density EstimationGradient

1

1 ( ) ( )

n

ii

P Kn

x x - x Give up estimating the PDF !Estimate ONLY the gradient

2

( ) iiK ck

h

x - xx - x

Using theKernel form:

We get :

1

1 1

1

( )

n

i in ni

i i ni i

ii

gc c

P k gn n g

xx x

Size of window

g( ) ( )kx x

Page 20: Mean Shift Theory and Applications Reporter: Zhongping Ji

Kernel Density EstimationGradient

1

1 1

1

( )

n

i in ni

i i ni i

ii

gc c

P k gn n g

xx x

Computing The Mean Shift

g( ) ( )kx x

Page 21: Mean Shift Theory and Applications Reporter: Zhongping Ji

1

1 1

1

( )

n

i in ni

i i ni i

ii

gc c

P k gn n g

xx x

Computing The Mean Shift

Yet another Kernel density estimation !

Simple Mean Shift procedure:• Compute mean shift vector

•Translate the Kernel window by m(x)

2

1

2

1

( )

ni

ii

ni

i

gh

gh

x - xx

m x xx - x

g( ) ( )kx x

Page 22: Mean Shift Theory and Applications Reporter: Zhongping Ji

Mean Shift Mode Detection

Updated Mean Shift Procedure:• Find all modes using the Simple Mean Shift Procedure• Prune modes by perturbing them (find saddle points and plateaus)• Prune nearby – take highest mode in the window

What happens if wereach a saddle point

?

Perturb the mode positionand check if we return back

Page 23: Mean Shift Theory and Applications Reporter: Zhongping Ji

AdaptiveGradient Ascent

Mean Shift Properties

• Automatic convergence speed – the mean shift vector size depends on the gradient itself.

• Near maxima, the steps are small and refined

• Convergence is guaranteed for infinitesimal steps only infinitely convergent,

• For Uniform Kernel ( ), convergence is achieved in a finite number of steps

• Normal Kernel ( ) exhibits a smooth trajectory, but is slower than Uniform Kernel ( ).

Page 24: Mean Shift Theory and Applications Reporter: Zhongping Ji

Real Modality Analysis

Tessellate the space with windows

Run the procedure in parallel

Page 25: Mean Shift Theory and Applications Reporter: Zhongping Ji

Real Modality Analysis

The blue data points were traversed by the windows towards the mode

Page 26: Mean Shift Theory and Applications Reporter: Zhongping Ji

Real Modality AnalysisAn example

Window tracks signify the steepest ascent directions

Page 27: Mean Shift Theory and Applications Reporter: Zhongping Ji

Mean Shift Strengths & Weaknesses

Strengths :

• Application independent tool

• Suitable for real data analysis

• Does not assume any prior shape (e.g. elliptical) on data clusters

• Can handle arbitrary feature spaces

• Only ONE parameter to choose

• h (window size) has a physical meaning, unlike K-Means

Weaknesses :

• The window size (bandwidth selection) is not trivial

• Inappropriate window size can cause modes to be merged, or generate additional “shallow” modes Use adaptive window size

Page 28: Mean Shift Theory and Applications Reporter: Zhongping Ji

Mean Shift Applications

Page 29: Mean Shift Theory and Applications Reporter: Zhongping Ji

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

Mean Shift : A robust Approach Toward Feature Space Analysis, by Comaniciu, Meer

Page 30: Mean Shift Theory and Applications Reporter: Zhongping Ji

ClusteringSynthetic Examples

Simple Modal Structures

Complex Modal Structures

Page 31: Mean Shift Theory and Applications Reporter: Zhongping Ji

ClusteringReal Example

Initial windowcenters

Modes found Modes afterpruning

Final clusters

Feature space:L*u*v representation

Page 32: Mean Shift Theory and Applications Reporter: Zhongping Ji

ClusteringReal Example

L*u*v space representation

Page 33: Mean Shift Theory and Applications Reporter: Zhongping Ji

ClusteringReal Example

2D (L*u) space representation

Final clusters

Page 34: Mean Shift Theory and Applications Reporter: Zhongping Ji

Discontinuity Preserving SmoothingFeature space : Joint domain = spatial coordinates + color space

( )s r

s rs r

K C k kh h

x xx

Meaning : treat the image as data points in the spatial and gray level domain

Image Data(slice)

Mean Shiftvectors

Smoothingresult

Mean Shift : A robust Approach Toward Feature Space Analysis, by Comaniciu, Meer

Page 35: Mean Shift Theory and Applications Reporter: Zhongping Ji

Discontinuity Preserving Smoothing

y

z

Page 36: Mean Shift Theory and Applications Reporter: Zhongping Ji

Discontinuity Preserving SmoothingThe effect of window sizein spatial andrange spaces

Page 37: Mean Shift Theory and Applications Reporter: Zhongping Ji

Discontinuity Preserving SmoothingExample

Page 38: Mean Shift Theory and Applications Reporter: Zhongping Ji

Discontinuity Preserving SmoothingExample

Page 39: Mean Shift Theory and Applications Reporter: Zhongping Ji

Object Contour DetectionRay Propagation

Vessel Detection by Mean Shift Based Ray Propagation, by Tek, Comaniciu, Williams

Accurately segment various objects (rounded in nature) in medical images

Page 40: Mean Shift Theory and Applications Reporter: Zhongping Ji

Object Contour DetectionRay Propagation

Use displacement data to guide ray propagation

Discontinuity preserving smoothing

Displacementvectors

Vessel Detection by Mean Shift Based Ray Propagation, by Tek, Comaniciu, Williams

Page 41: Mean Shift Theory and Applications Reporter: Zhongping Ji

Object Contour DetectionRay Propagation

( , ) ( , )Ray

s t Speed x y Nt

Speed function

Normal to the contour

( , ) ( , ) ( , )Speed x y f disp x y x y

Curvature

Page 42: Mean Shift Theory and Applications Reporter: Zhongping Ji

Object Contour DetectionOriginal image

Gray levels along red line

Gray levels aftersmoothing

Displacement vectors Displacement vectors’derivative

( , ) ( , ) ( , )Speed x y f disp x y x y

Page 43: Mean Shift Theory and Applications Reporter: Zhongping Ji

Object Contour DetectionExample

Page 44: Mean Shift Theory and Applications Reporter: Zhongping Ji

Object Contour DetectionExample

Importance of smoothing by curvature

Page 45: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationSegment = Cluster, or Cluster of Clusters

Algorithm:• Run Filtering (discontinuity preserving smoothing)• Cluster the clusters which are closer than window size

Image Data(slice)

Mean Shiftvectors

Segmentationresult

Smoothingresult

Mean Shift : A robust Approach Toward Feature Space Analysis, by Comaniciu, Meerhttp://www.caip.rutgers.edu/~comanici

Page 46: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationExample

…when feature space is only gray levels…

Page 47: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationExample

Page 48: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationExample

Page 49: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationExample

Page 50: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationExample

Page 51: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationExample

Page 52: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationExample

Page 53: Mean Shift Theory and Applications Reporter: Zhongping Ji

SegmentationExample

Page 54: Mean Shift Theory and Applications Reporter: Zhongping Ji
Page 55: Mean Shift Theory and Applications Reporter: Zhongping Ji

Image editing

Page 56: Mean Shift Theory and Applications Reporter: Zhongping Ji

A Topological Approach to Hierarchical Segmentation using Mean Shift

Page 57: Mean Shift Theory and Applications Reporter: Zhongping Ji

Fast and Hierarchical

• Efficient numerical schemes to evaluate the density function and extract its modes.

• A hierarchical segmentation based on a topological analysis of mean shift.

• Do not aim for better segmentation accuracy and focus on computational efficiency and creating a hierarchy.

Page 58: Mean Shift Theory and Applications Reporter: Zhongping Ji
Page 59: Mean Shift Theory and Applications Reporter: Zhongping Ji

FAST COMPUTATION OF THE FEATURE POINT DENSITY

Coarse grid

Page 60: Mean Shift Theory and Applications Reporter: Zhongping Ji

EXTRACTION OF THE DENSITY MODES

• 0 label: The processed node is a local maximum. We create a new label.

• 1 label: All the ascending paths go to the same summit. We copy the label.

• 2+ labels: Boundary between two modes. We put a special marker.

Page 61: Mean Shift Theory and Applications Reporter: Zhongping Ji

Boundaries refinement

Page 62: Mean Shift Theory and Applications Reporter: Zhongping Ji

Hierarchical Segmentation

Page 63: Mean Shift Theory and Applications Reporter: Zhongping Ji
Page 64: Mean Shift Theory and Applications Reporter: Zhongping Ji

Boundary Persistence

Page 65: Mean Shift Theory and Applications Reporter: Zhongping Ji

Simplification

Page 66: Mean Shift Theory and Applications Reporter: Zhongping Ji

Examples

Page 67: Mean Shift Theory and Applications Reporter: Zhongping Ji

Examples

Page 68: Mean Shift Theory and Applications Reporter: Zhongping Ji
Page 69: Mean Shift Theory and Applications Reporter: Zhongping Ji
Page 70: Mean Shift Theory and Applications Reporter: Zhongping Ji
Page 71: Mean Shift Theory and Applications Reporter: Zhongping Ji

• Monkey saddle

Page 72: Mean Shift Theory and Applications Reporter: Zhongping Ji

Ask & Answer