K-Means Clustering Presentation Slides for Machine Learning Course

ssuserfece35 18 views 30 slides Mar 03, 2025
Slide 1
Slide 1 of 30
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30

About This Presentation

KMeans Lecture Slides.


Slide Content

DTS304TC: Machine Learning Lecture 7: K-Means Clustering Dr Kang Dang D-5032, Taicang Campus [email protected] Tel: 88973341 1

Acknowledges This set of lecture notes has been adapted from materials originally provided by Christopher M. Bishop’s and Xin Chen. 2

Overview. K-means clustering Application of K-means clustering in image segmentation

Q&A What is clustering? What is one application of the clustering? 4

Old Faithful Data Set Duration of eruption (minutes) Time between eruptions (minutes)

K-means Algorithm Goal: represent a data set in terms of K clusters each of which is summarized by a prototype Initialize prototypes, then iterate between two phases: E-step (Cluster Assignment) : assign each data point to nearest prototype M-step(Prototype update): update prototypes to be the cluster means Simplest version is based on Euclidean distance

Responsibilities Responsibilities assign data points to clusters such that Example: 5 data points and 3 clusters n: data point index k: cluster index

Q&A We know What does mean? 17

K-means Cost Function prototypes responsibilities data

Minimizing the Cost Function E-step: minimize w.r.t. assigns each data point to nearest prototype M-step: minimize w.r.t gives each prototype set to the mean of points in that cluster

Convergence of K-means Algorithm 20 Will K-Means objective oscillate?

Convergence of K-means Algorithm 21 Will K-Means objective oscillate?. The answer is NO. Each iteration of K-means algorithm decrease the objective. Both E step and M step decrease the objective for each data point

Convergence of K-means Algorithm 22 Will K-Means objective oscillate?. The answer is NO. Each iteration of K-means algorithm decrease the objective. Both E step and M step decrease the objective for each data point The minimum value of the objective is finite. The minimal value of objective is simply 0

Convergence of K-means Algorithm 23 Will K-Means objective oscillate?. The answer is NO. Each iteration of K-means algorithm decrease the objective. Both E step and M step decrease the objective for each data point The minimum value of the objective is finite. The minimal value of objective is simply 0 Therefore K-means algorithm will converge with sufficiently large number of iterations.

How to choose K? Plot the within-cluster sum of squares (WCSS) against the number of clusters (k). The WCSS decreases as k increases, but the rate of decrease sharply changes at a certain point, creating an "elbow" in the graph.

Application of K-Means Algorithm to Image Segmentation First, we convert all the image pixels to the HSV color space. We then proceed to cluster the image pixels based on their HSV color intensities. Finally, we replace each pixel with the color of its corresponding cluster center.

Application of K-Means Algorithm to Image Segmentation Nice Artistic Effects!

Limitations of K-means Sensitivity to Initial Centroids: The final results of k-means clustering are sensitive to the initial random selection of cluster centers. This can lead to different results each time k-means is run. For certain initialization, k-means clustering will perform badly. Q&A: How to handle the bad initialization issue?

Limitations of K-means Sensitivity to Initial Centroids: The final results of k-means clustering are sensitive to the initial random selection of cluster centers. This can lead to different results each time k-means is run. For certain initialization, k-means clustering will perform badly. Q&A: How to handle the bad initialization issue? Run k-means several times with different random initializations and choose the clustering result with the lowest objective score (lowest within-cluster sum of squares (WCSS))

Limitations of K-means Assumption of Spherical Clusters and Equal Variance of Clusters: K-means assumes that clusters are spherical and isotropic, which means all clusters are of the same size (variance) and density Difficulty with Non-convex Shapes

Limitations of K means Other limitations: Not clear how to choose the value of K Sensitivity to Outliers Scalability with High Dimensionality GMM can resolve some but not all the above issues. 30