34
EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

Embed Size (px)

Citation preview

Page 1: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

1

Lecture 3-4Clustering (1hr)Gaussian Mixture and EM (1hr)

Tae-Kyun Kim

Page 2: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

2

2D data vectors (green) are grouped to two homogenous clusters (blue and red).Clustering is achieved by an iterative algorithm (left to right). The cluster centers are marked x.

Vector Clustering

Page 3: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

3

``

RGB

Pixel Clustering (Image Quantisation)Image pixels are represented by 3D vectors of R,G,B values.The vectors are grouped to K=10,3,2 clusters, and represented by the mean values of the respective clusters.

Page 4: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

4

dim

ensi

on

D………

……

or raw pixels

K codewords

Patch Clustering (BoW in Lecture 9-10) Image patches are harvested around feature points in a large number of images.They are represented by finite dimensional vectors, and clustered to form a visual dictionary.

SIFT

20

20D=400

Page 5: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

5……

Image ClusteringWhole images are represented as finite dimensional vectors.Homogenous vectors are grouped together in Euclidean space.

Page 6: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

6

K-means vs GMM

Hard clustering: a data point is assigned only one cluster.

Soft clustering: a data point is assigned multiple Gaussians probabilistically.

Two representative techniques are k-means and Gaussian Mixture Model (GMM).K-means assigns data points to the nearest clusters, while GMM assigns data to the Gaussian densities that best represent the data.

Page 7: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

7

Matrix and Vector Derivatives

Page 8: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

8

Page 9: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

9

K-means Clustering

Page 10: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

10

Page 11: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

11

till converge

Page 12: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

12

K=2

μ1

μ2

rnk

Page 13: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

13

Convergence proof (yes)Global minimum (no)

Page 14: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

14

V=V=

Page 15: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

15

Statistical Pattern Recognition Toolbox for Matlab

http://cmp.felk.cvut.cz/cmp/software/stprtool/

…\stprtool\probab\cmeans.m…\stprtool\probab\cmeans_tk.m

Page 16: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

16

Mixture of Gaussians

Page 17: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

17

Page 18: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

18

Page 19: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

19

Page 20: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

20

Maximum Likelihood

s.t.

Page 21: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

21

Page 22: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

22

objective ftn. f(x)constraints g(x)

max f(x) s.t. g(x)=0 max f(x) + g(x)

http://en.wikipedia.org/wiki/Lagrange_multiplier

Page 23: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

23

Page 24: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

24

till converge

Page 25: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

25

Page 26: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

26

Page 27: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

27

Statistical Pattern Recognition Toolbox for Matlab

http://cmp.felk.cvut.cz/cmp/software/stprtool/

…\stprtool\visual\pgmm.m…\stprtool\demos\demo_emgmm.m

Page 28: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

28

Supplementary Material

Page 29: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

29

Information Theory (for Lecture 7-8)

Page 30: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

30

Page 31: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

31

Advanced topic (optional)

http://www.iis.ee.ic.ac.uk/~tkkim/mlcv/lecture_clustering_em.pdf

Page 32: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

32

EM Algorithm in General

Page 33: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

33

Page 34: EE462 MLCV 1 Lecture 3-4 Clustering (1hr) Gaussian Mixture and EM (1hr) Tae-Kyun Kim

EE462 MLCV

34