CSE 185 Introduction to Computer Vision Pattern Recognition 2.
-
Upload
andrea-fitzgerald -
Category
Documents
-
view
225 -
download
0
Transcript of CSE 185 Introduction to Computer Vision Pattern Recognition 2.
![Page 1: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/1.jpg)
CSE 185 Introduction to Computer
VisionPattern Recognition 2
![Page 2: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/2.jpg)
Agglomerative clustering
![Page 3: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/3.jpg)
Agglomerative clustering
![Page 4: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/4.jpg)
Agglomerative clustering
![Page 5: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/5.jpg)
Agglomerative clustering
![Page 6: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/6.jpg)
Agglomerative clustering
![Page 7: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/7.jpg)
Agglomerative clustering
How to define cluster similarity?
- Average distance between points, maximum distance, minimum distance
- Distance between means or medoids
How many clusters?- Clustering creates a dendrogram (a
tree)- Threshold based on max number of
clusters or based on distance between merges di
stan
ce
![Page 8: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/8.jpg)
Agglomerative Clustering
Good• Simple to implement, widespread application• Clusters have adaptive shapes• Provides a hierarchy of clusters
Bad• May have imbalanced clusters• Still have to choose number of clusters or
threshold• Need to use a good metric to get a
meaningful hierarchy
![Page 9: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/9.jpg)
Mean shift segmentation
• Versatile technique for clustering-based segmentation
D. Comaniciu and P. Meer, Mean Shift: A Robust Approach toward Feature Space Analysis, PAMI 2002.
![Page 10: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/10.jpg)
Mean shift algorithm
• Try to find modes of this non-parametric density
2D (first 2components) datasetof 110,400 pointsin the LUV space
Mean shift procedure (7 clusters)
Trajectories of mean shiftprocedure
![Page 11: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/11.jpg)
Kernel density estimationKernel density estimation function
Gaussian kernel
![Page 12: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/12.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Mean shift
![Page 13: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/13.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Mean shift
![Page 14: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/14.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Mean shift
![Page 15: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/15.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Mean shift
![Page 16: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/16.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Mean shift
![Page 17: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/17.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Mean shift
![Page 18: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/18.jpg)
Region ofinterest
Center ofmass
Mean shift
![Page 19: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/19.jpg)
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
Computing the mean shift
![Page 20: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/20.jpg)
Attraction basin
• 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 21: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/21.jpg)
Attraction basin
![Page 22: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/22.jpg)
Mean shift clustering
• The mean shift algorithm seeks modes of the given set of points1. Choose kernel and bandwidth2. For each point:
a) Center a window on that pointb) Compute the mean of the data in the search windowc) Center the search window at the new mean locationd) Repeat (b,c) until convergence
3. Assign points that lead to nearby modes to the same cluster
![Page 23: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/23.jpg)
Segmentation by mean shift
• Compute features for each pixel (color, gradients, texture, etc)
• Set kernel size for features Kf and position Ks
• Initialize windows at individual pixel locations• Perform mean shift for each window until convergence
• Merge windows that are within width of Kf and Ks
![Page 24: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/24.jpg)
Mean shift segmentation
![Page 25: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/25.jpg)
http://www.caip.rutgers.edu/~comanici/MSPAMI/msPamiResults.html
![Page 26: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/26.jpg)
Mean shift pros and cons
• Pros– Good general-practice segmentation– Flexible in number and shape of regions– Robust to outliers
• Cons– Have to choose kernel size in advance– Not suitable for high-dimensional features
• When to use it– Oversegmentatoin– Multiple segmentations– Tracking, clustering, filtering applications
![Page 27: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/27.jpg)
Spectral clustering
• Group points based on links in a graph
A B
![Page 28: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/28.jpg)
Cuts in a graph
Normalized Cut
• a cut penalizes large segments• fix by normalizing for size of segments
• volume(A) = sum of costs of all edges that touch A
A B
![Page 29: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/29.jpg)
Normalized cuts
![Page 30: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/30.jpg)
Which algorithm to use?
• Quantization/Summarization: K-means– Aims to preserve variance of original
data– Can easily assign new point to a cluster
Quantization for computing histograms
Summary of 20,000 photos of Rome using “greedy k-means”
http://grail.cs.washington.edu/projects/canonview/
![Page 31: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/31.jpg)
Which algorithm to use?
• Image segmentation: agglomerative clustering– More flexible with distance measures
(e.g., can be based on boundary prediction)
– Adapts better to specific data– Hierarchy can be useful
http://www.cs.berkeley.edu/~arbelaez/UCM.html
![Page 32: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/32.jpg)
Things to remember• K-means useful for
summarization, building dictionaries of patches, general clustering
• Agglomerative clustering useful for segmentation, general clustering
• Spectral clustering useful for determining relevance, summarization, segmentation
![Page 33: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/33.jpg)
Clustering
Key algorithm• K-means
![Page 34: CSE 185 Introduction to Computer Vision Pattern Recognition 2.](https://reader036.fdocuments.us/reader036/viewer/2022081511/56649ec65503460f94bd1266/html5/thumbnails/34.jpg)