Clustering
Algorithm
Saja Ali
● Introduction
● Types of clustering algorithms
● Image Segmentation By clustering
● K Means
● How Does K-means clustering works?
● What is Hierarchical Clustering?
● Types of Hierarchical Clustering
● Which method is better between them?
Topics
A clustering algorithm is a popular technique in big data analytics that
involves grouping similar data points together. The main goal of clustering
is to identify meaningful patterns and structures in data sets, which can
help make better decisions and predictions.
In big data, clustering is particularly useful for processing and analyzing
large amounts of data that are too complex and diverse to be analyzed
manually. With the help of clustering algorithms, big data analysts can
automatically identify similarities and differences among data points and
group them into clusters or subgroups based on certain criteria.
Introduction
Types of clustering algorithms
Partitioning
K-means
Hierarchical
Agglomerative and
Divisive
Image Segmentation: is the classification of an image into
different groups, Each group has similar attributes.
It can group pixels with similar characteristics into clusters
or segments. This can be achieved using various clustering
algorithms, such as K means clustering, mean shift
clustering, hierarchical clustering , and fuzzy clustering .
Image Segmentation by Clustering
It is a widely used clustering algorithm for image segmentation. In
this approach, the pixels in an image are treated as data points, and
the algorithm partitions these data points into K clusters based on
their similarity. The similarity is measured using a distance metric.
The algorithm starts by randomly selecting K initial centroids, and
then iteratively assigns each pixel to the nearest centroid and
updates the centroids based on the mean of the assigned pixels.
This process continues until the centroids converge to a stable
value.
K Means
1. Choose the number of clusters you want to find which is k.
2. Randomly assign the data points to any of the k clusters.
3. Then calculate the center of the clusters.
4. Calculate the distance of the data points from the centers of each of the
clusters.
5. Depending on the distance of each data point from the cluster, reassign
the data points to the nearest clusters.
6. Again calculate the new cluster center.
7. Repeat steps 4,5 and 6 till data points don’t change the clusters, or till
we reach the assigned number of iterations.
How Does K-means clustering works?
Hierarchical clustering is a method of cluster analysis in
data mining that creates a hierarchical representation of the
clusters in a dataset. The method starts by treating each
data point as a separate cluster and then iteratively
combines the closest clusters until a stopping criterion is
reached. The result of hierarchical clustering is a tree-like
structure, called a dendrogram, which illustrates the
hierarchical relationships among the clusters.
What is Hierarchical Clustering?
● Agglomerative Clustering
● Divisive clustering
Types of Hierarchical Clustering
Initially consider every data point as an individual
Cluster and at every step, merge the nearest pairs
of the cluster. (It is a bottom-up method). At every
iteration, the clusters merge with different clusters
until one cluster is formed.
Agglomerative Clustering
Divisive Hierarchical clustering
We can say that Divisive Hierarchical clustering is precisely
the opposite of Agglomerative Hierarchical clustering. In
Divisive Hierarchical clustering, we take into account all of
the data points as a single cluster and in every iteration, we
separate the data points from the clusters which aren’t
comparable. In the end, we are left with N clusters.
Hierarchical clustering for image segmentation
To apply hierarchical clustering to image segmentation, you
need to represent each pixel or region of the image as a data
point, with features such as color, intensity, gradient, or
texture. Then, you need to define a similarity or distance
measure between the data points. Next, you need to apply a
linkage criterion to determine how to merge the data points
into clusters. Finally, you need to select a cut-off point or
threshold to obtain the final segmentation.
k-means clustering is faster and simpler, but requires
choosing the number of clusters beforehand and may not
capture complex structures. On the other hand, hierarchical
clustering is more flexible , but can be computationally
expensive and sensitive to outliers. Depending on your data
and your goals, you may prefer one method over the other,
or even combine them in a hybrid approach.
Which method is better between them?
Clustering algorithms Type in image segmentation .pptx

Clustering algorithms Type in image segmentation .pptx

  • 1.
  • 2.
    ● Introduction ● Typesof clustering algorithms ● Image Segmentation By clustering ● K Means ● How Does K-means clustering works? ● What is Hierarchical Clustering? ● Types of Hierarchical Clustering ● Which method is better between them? Topics
  • 3.
    A clustering algorithmis a popular technique in big data analytics that involves grouping similar data points together. The main goal of clustering is to identify meaningful patterns and structures in data sets, which can help make better decisions and predictions. In big data, clustering is particularly useful for processing and analyzing large amounts of data that are too complex and diverse to be analyzed manually. With the help of clustering algorithms, big data analysts can automatically identify similarities and differences among data points and group them into clusters or subgroups based on certain criteria. Introduction
  • 4.
    Types of clusteringalgorithms Partitioning K-means Hierarchical Agglomerative and Divisive
  • 5.
    Image Segmentation: isthe classification of an image into different groups, Each group has similar attributes. It can group pixels with similar characteristics into clusters or segments. This can be achieved using various clustering algorithms, such as K means clustering, mean shift clustering, hierarchical clustering , and fuzzy clustering . Image Segmentation by Clustering
  • 6.
    It is awidely used clustering algorithm for image segmentation. In this approach, the pixels in an image are treated as data points, and the algorithm partitions these data points into K clusters based on their similarity. The similarity is measured using a distance metric. The algorithm starts by randomly selecting K initial centroids, and then iteratively assigns each pixel to the nearest centroid and updates the centroids based on the mean of the assigned pixels. This process continues until the centroids converge to a stable value. K Means
  • 7.
    1. Choose thenumber of clusters you want to find which is k. 2. Randomly assign the data points to any of the k clusters. 3. Then calculate the center of the clusters. 4. Calculate the distance of the data points from the centers of each of the clusters. 5. Depending on the distance of each data point from the cluster, reassign the data points to the nearest clusters. 6. Again calculate the new cluster center. 7. Repeat steps 4,5 and 6 till data points don’t change the clusters, or till we reach the assigned number of iterations. How Does K-means clustering works?
  • 9.
    Hierarchical clustering isa method of cluster analysis in data mining that creates a hierarchical representation of the clusters in a dataset. The method starts by treating each data point as a separate cluster and then iteratively combines the closest clusters until a stopping criterion is reached. The result of hierarchical clustering is a tree-like structure, called a dendrogram, which illustrates the hierarchical relationships among the clusters. What is Hierarchical Clustering?
  • 10.
    ● Agglomerative Clustering ●Divisive clustering Types of Hierarchical Clustering
  • 11.
    Initially consider everydata point as an individual Cluster and at every step, merge the nearest pairs of the cluster. (It is a bottom-up method). At every iteration, the clusters merge with different clusters until one cluster is formed. Agglomerative Clustering
  • 13.
    Divisive Hierarchical clustering Wecan say that Divisive Hierarchical clustering is precisely the opposite of Agglomerative Hierarchical clustering. In Divisive Hierarchical clustering, we take into account all of the data points as a single cluster and in every iteration, we separate the data points from the clusters which aren’t comparable. In the end, we are left with N clusters.
  • 15.
    Hierarchical clustering forimage segmentation To apply hierarchical clustering to image segmentation, you need to represent each pixel or region of the image as a data point, with features such as color, intensity, gradient, or texture. Then, you need to define a similarity or distance measure between the data points. Next, you need to apply a linkage criterion to determine how to merge the data points into clusters. Finally, you need to select a cut-off point or threshold to obtain the final segmentation.
  • 16.
    k-means clustering isfaster and simpler, but requires choosing the number of clusters beforehand and may not capture complex structures. On the other hand, hierarchical clustering is more flexible , but can be computationally expensive and sensitive to outliers. Depending on your data and your goals, you may prefer one method over the other, or even combine them in a hybrid approach. Which method is better between them?