Docsity

digital image processing, Lecture notes of Digital Image Processing

Toggle sidebar
bg1
UNIT 2 FUZZY CLUSTERING
Structure Page No
2.1 Introduction 25
Objectives
2.2 What is Clustering? 26
2.3 Fuzzy Cluster Analysis 28
2.4 Classical vs. Fuzzy Clustering 28
2.5 Distance Measure in Clustering 29
2.6 Clustering Algorithms 31
2.7 Fuzzy Clustering Algorithms 32
2.8 Fuzzy C-Means (FCM) Algorithm 33
2.9 Summary 37
2.10 Solutions/Answers 38
2.11 Practical Assignment 39
2.1 INTRODUCTION
Clustering is an important data analysis tool that provides improved data
understanding. It plays a key role in searching for structures in data. Cluster analysis
is aimed at dividing data whose identity is not known in advance, into homogeneous
groups or clusters such that similar data objects belong to the same cluster and
dissimilar data objects to different clusters. A cluster is, therefore, a collection of
objects which are “similar” between them and are “dissimilar” to the objects
belonging to other clusters. In other words, given a finite set of data,
X
, the problem
of clustering in
X
is to find several cluster centers that are required to form a partition
of
X
such that the degree of association is strong for data within blocks of the
partition and weak for data in different blocks. However, this requirement is too
strong in many practical applications, and it is thus desirable to replace it with a
weaker requirement. When the requirement of a crisp partition of
X
is replaced with
a weaker requirement of a fuzzy partition or a fuzzy pseudo partition on
X
, we refer to
the emerging problem area as fuzzy clustering as in Section 2.4. Fuzzy pseudo
partitions are often called fuzzy c-partitions, where c designates the number of fuzzy
classes in the partition.
Clustering is an active research area and there are wide arrays of clustering algorithms
that have been proposed in literature are discussed in Section 2.6. These algorithms
differ from each other in their approach, in the cluster quality they achieve and also in
terms of computational efficiency. In Section 2.7, we will look at these issues in the
light of fuzzy clustering techniques. There are two basic methods of fuzzy clustering.
One of them, which are based on fuzzy c-partitions, is called a fuzzy equivalence
relation-based hierarchical clustering method. We will see these methods in details in
this unit. Various modifications of these methods can be found in the literature. We
have also introduced some major application areas of fuzzy clustering in Section 2.8.
Objectives
After studying this unit, you should be able to
• know the essence the concept of clustering;
• define the fuzzy clustering;
• differentiate the classical cluster analysis and the fuzzy cluster analysis;
• know various distance function useful for clustering;
• apply fuzzy clustering to solve real-life problems.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download digital image processing and more Lecture notes Digital Image Processing in PDF only on Docsity!

UNIT 2 FUZZY CLUSTERING

Structure Page No

2.1 Introduction 25 Objectives 2.2 What is Clustering? 26 2.3 Fuzzy Cluster Analysis 28 2.4 Classical vs. Fuzzy Clustering 28 2.5 Distance Measure in Clustering 29 2.6 Clustering Algorithms 31 2.7 Fuzzy Clustering Algorithms 32 2.8 Fuzzy C-Means (FCM) Algorithm 33 2.9 Summary 37 2.10 Solutions/Answers 38 2.11 Practical Assignment 39

2.1 INTRODUCTION

Clustering is an important data analysis tool that provides improved data understanding. It plays a key role in searching for structures in data. Cluster analysis is aimed at dividing data whose identity is not known in advance, into homogeneous groups or clusters such that similar data objects belong to the same cluster and dissimilar data objects to different clusters. A cluster is, therefore, a collection of objects which are “similar” between them and are “dissimilar” to the objects belonging to other clusters. In other words, given a finite set of data, X , the problem of clustering in X is to find several cluster centers that are required to form a partition of X such that the degree of association is strong for data within blocks of the partition and weak for data in different blocks. However, this requirement is too strong in many practical applications, and it is thus desirable to replace it with a weaker requirement. When the requirement of a crisp partition of X is replaced with a weaker requirement of a fuzzy partition or a fuzzy pseudo partition on X , we refer to the emerging problem area as fuzzy clustering as in Section 2.4. Fuzzy pseudo partitions are often called fuzzy c-partitions , where c designates the number of fuzzy classes in the partition.

Clustering is an active research area and there are wide arrays of clustering algorithms that have been proposed in literature are discussed in Section 2.6. These algorithms differ from each other in their approach, in the cluster quality they achieve and also in terms of computational efficiency. In Section 2.7, we will look at these issues in the light of fuzzy clustering techniques. There are two basic methods of fuzzy clustering. One of them, which are based on fuzzy c-partitions, is called a fuzzy equivalence relation-based hierarchical clustering method. We will see these methods in details in this unit. Various modifications of these methods can be found in the literature. We have also introduced some major application areas of fuzzy clustering in Section 2.8.

Objectives

After studying this unit, you should be able to

  • know the essence the concept of clustering;
  • define the fuzzy clustering;
  • differentiate the classical cluster analysis and the fuzzy cluster analysis;
  • know various distance function useful for clustering;
  • apply fuzzy clustering to solve real-life problems.

Fuzzy Sets 2.2 WHAT IS CLUSTERING?

Data clustering is a common technique for statistical data analysis, which is used in many fields, including machine learning, data mining, pattern recognition, image analysis and bioinformatics. Clustering is the classification of similar objects into different groups, or more precisely, the partitioning of a data set into subsets (clusters), so that the data in each subset (ideally) share some common trait – often proximity according to some defined distance measure. Machine learning typically regards data clustering as a form of unsupervised learning. Besides the term data clustering (or just clustering ), there are a number of term with similar meanings, including cluster analysis , automatic classification , numerical taxonomy , botryology and typological analysis.

Fig. 1: An example of clusters.

Clustering deals with finding a structure in a collection of unlabeled data. A loose definition of clustering could be “the process of organizing objects into groups whose members are similar in some way”. A cluster is, therefore, a collection of objects which are “similar” between them and are “dissimilar” to the objects belonging to other clusters. We can show this with a simple graphical example shown in Fig.1.

In this case we easily identify the 4 clusters into which the data can be divided where the similarity criterion is distance , i.e., two or more objects belong to the same cluster if they are “close’ according to a given distance (in this case geometrical distance). This is called distance-based clustering. Another kind of clustering is conceptual clustering in which two or more objects belong to the same cluster if it defines a concept common to all that objects. In other words, objects are grouped according to their fit to descriptive concepts, not according to simple similarity measures.

The goal of clustering is to determine the intrinsic grouping in a set of unlabeled data. But how to decide what constitutes a good clustering? It can be shown that there is no absolute “best” criterion which would be independent of the final aim of the clustering. Consequently, it is the user which must supply this criterion, in such a way that the result of the clustering will suit their needs.

For instance, we could be interested in finding representatives for homogeneous groups ( data reduction ), in finding “natural clusters” and describe their unknown properties ( “natural” data types ), in finding useful and suitable groupings ( “useful data classes ) or in finding unusual data objects ( outlier detection ).

Clustering techniques have been extensively studied in statistics, machine learning and data mining. Clustering has many interesting commercial applications, and is extensively applied for studying the data pertaining to an organisational application. It helps in discovering hitherto unknown patterns in data, which can be fruitfully engaged in taking future marketing decisions. Some common uses of clustering are stated here:

Fuzzy Sets (^) • Discovering clusters with arbitrary shape

  • Minimal requirements for domain knowledge to determine input parameters
  • Ability to deal with noise and outliers
  • Insensitivity to order of input records
  • High dimensionality
  • Interpretability and usability

There are a number of limitations with clustering. Among them:

  • current clustering techniques do not address all the requirements adequately (and concurrently);
  • dealing with large number of dimensions and large number of data items can be problematic because of time complexity;
  • the effectiveness of the method depends on the definition of “distance” (for distance-based clustering);
  • if and obvious distance measure doesn’t exist we must “define” it, which is not always easy, especially in multi-dimensional spaces;
  • the result of the clustering algorithm (that in many cases can be arbitrary itself) can be interpreted in different ways.

Now we shall discuss fuzzy cluster analysis in the following sections.

2.3 FUZZY CLUSTER ANALYSIS

Cluster analysis divides data into groups (clusters) such that similar data objects belong to the same cluster and dissimilar data objects to different clusters. The resulting data partition improves data understanding and reveals its internal structure. Partitional clustering algorithms divide up a data set into clusters or classes, where similar data objects are assigned to the same cluster whereas dissimilar data objects should belong to different clusters. In real applications there is very often no sharp boundary between clusters so that fuzzy clustering is often better suited for the data. Membership degree between zero and one are used in fuzzy clustering instead of crisp assignments of the data to clusters. The most prominent fuzzy clustering algorithm is the fuzzy c-means, a fuzzification of k-means.

Areas of application of fuzzy cluster analysis include for example data analysis, pattern recognition, and image segmentation. The detection of special geometrical shapes like circles and ellipses can be achieved by so-called shell clustering algorithms. Fuzzy clustering belongs to the group of soft computing techniques (which include neural nets, fuzzy systems, and genetic algorithms).

2.4 CLASSICAL VS. FUZZY CLUSTERING

Clustering is motivated by the need to find interesting patterns or groupings in a given set of data. For example, a market analysis company may want to collect data about a group of customers (e.g., through a survey questionnaire or interviews) and analyze these data by finding interesting groupings of customers. The result of such an analysis can be used by a company to develop its marketing strategy or to develop a family of product lines that are targeted toward various customer groupings.

In the area of pattern recognition and image processing, clustering is often used to perform the task of “segmenting” the image (i.e., partitioning pixels on an image into regions that correspond to different objects or different faces of objects in the images).

This is because image segmentation can be viewed as a kind of data clustering^ Fuzzy Clustering problem where each datum is described by a set of image features (e.g., intensity, color, texture, etc.) of a pixel.

Classical clustering approaches generate partitions in a partition; each pattern belongs to only one cluster. So, the clusters in a partition are disjoint. In other words, classical clustering algorithms find a “hard partition” of a given dataset based on certain criteria that evaluate the goodness of a partition. By “hard partition” we mean that each datum belongs to exactly one cluster of the partition. More formally, we can define the concept “hard partition” as follows:

Definition 1 (Hard Partition): Let X be a set of data, and x 1 be an element of X. A partition P = {C 1 ,C 2 ,…,Ck}of X is “hard” if and only if the following two

condition hold.

(i) for all xi ∈ Xthere exists a partition Ci ∈ Psuch that x (^) i ∈ Cj.

(ii) for all x (^) i ∈ X,xi∈Cj⇒xi∉Ckwhere k ≠ j,Ck Cj∈P.

The first condition in the definition assures that the partition covers all data points in X , whereas the second condition assures that all clusters in the partition are mutually exclusive.

In many real-world clustering problems, however, some data points partially belong to multiple clusters, rather than to a single cluster exclusively. For example, a pixel in a Magnetic Resonance Image (MRI) may correspond to a mixture of two different types of tissues. A particular customer may be a “borderline case” between two groups of customers (e.g., between moderate conservatives and moderate liberals). These observations motivated the development of the “fuzzy clustering” algorithm. A fuzzy algorithm finds “soft partition” of a given data set based on certain criteria. In a soft partition, a datum can partially belong to multiple clusters.

Formally this can be defined as follows:

Definition 2 (Soft Partition): Let X be a set of data, and x (^) ibe an element of X. A

partition P = {C 1 ,C 2 ,…,Ck}of X is “soft” if and only if the following two

conditions hold.

(i) for all xi ∈ Xand for all C (^) j ∈ P, 0 ≤μcj(xi)≤ 1 such that x (^) i ∈ Cj.

(ii) for all xi ∈ Xthere exists C (^) j ∈ Psuch that μ (^) cj (x (^) i)> 0.

where μ (^) cj( xi)denote clustering of special interest to which x (^) ibelongs to cluster C .j

A type of fuzzy clustering of special interest is one that ensures the membership degree of a point x in all clusters adding up to one, i.e.,

j

cj (xi)^1 xi X

A soft partition that satisfies this additional condition is called a constrained soft partition. The fuzzy c-means algorithm, which is best known fuzzy clustering algorithm, produces a constrained partition.

2.5 DISTANCE MEASURE IN CLUSTERING

The central idea of clustering is to group data points in such a way so that similar elements belong to the same cluster and objects belonging to different clusters are

Fuzzy Clustering

=

k

i 1

2 d(x,y) (xi yi)

(ii) Manhattan distance or “L 1 norm” which is given by

=

k

i 1

d(x,y) |xi yi|

(iii) Maximum of dimensions or L∞ norm which is given by

max ki = 1 |xi−yi|

(iv) Cosine measure – This is a non-Euclidean distance measure and represents a similarity measure between two patterns. If the two patterns are represented as two vectors, the cosine of angle between the two vectors is identical to their correlation coefficient. The pattern similarity measure is thus given by

x y

(xy) similarity(x,y)

(v) Minkowski metric – This is given by

d^1 /^ p

i 1

p d (^) p (x,y) |xi yi|  

= where, d is the dimensionality of the data.

In the following section, we shall discuss clustering algorithm.

2.6 CLUSTERING ALGORITHMS

Clustering algorithms may be classified as listed below:

  • Exclusive Clustering – In this approach data are grouped in an exclusive way, so that if a certain datum belongs to a definite cluster then it could not be included in another cluster. A simple example of it is shown in the Fig. 3, where the separation of points is achieved by a straight line on a bi-dimensional plane. K-means algorithm is an example of exclusive clustering.

Fig. 3: Clusters before scaling and after scaling.

  • Overlapping Clustering – The overlapping clustering, uses fuzzy sets to cluster data, so that each point may belongs to two or more clusters with different degrees of membership. In this case, data will be associated to an appropriate membership value. Fuzzy c-means is an overlapping clustering.

Fuzzy Sets (^) • Hierarchical Clustering – Instead, a hierarchical clustering algorithm is based

on the union between the two nearest clusters. The beginning condition is realized by setting every datum as a cluster. After a few iterations it reaches the final clusters wanted.

  • Probabilistic Clustering – Such type of clustering use a completely probabilistic approach. Mixture of Gaussian is an example of probabilistic clustering.

2.7 FUZZY CLUSTERING ALGORITHMS

As discussed earlier, traditional clustering approaches generate partitions; in a partition, each pattern belongs to only one cluster. So, the clusters in a partition are disjoint. Fuzzy clustering extends this notion to associate each partition with every cluster using a membership function. The output of such algorithms is a clustering, but not a partition. Given a set data X = {x 1 ,x 2 ,…,xn}, where x (^) k, in general, is a vector p x (^) k [xk 1 ,xk 2 ,…, xkp]∈R 

For all k ∈ Nnthe problem of fuzzy clustering is to find a fuzzy pseudo partition and the associated cluster centers by which the structure of the data is represented as best as possible.

Definition 3 (Fuzzy Pseudo Partition or Fuzzy c-Partition): Let x = {x 1 ,x 2 ,…,xn}be a set of given data. A fuzzy pseudo partition or fuzzy c-partition of X is a family of fuzzy subsets of X , denoted by P{ A 1 ,A 2 ,…,An} which satisfies

=

c

i 1

A 1 (xk) 1

for all k ∈ Nnand

=

n

k 1

0 Ai (xk) n

for all i ∈ Nc, where c is a positive integer.

Example 1: Let X = {x 1 ,x 2 ,x 3 }and

A 1 = 0. 6 /x 1 + 1 /x 2 + 0. 1 /x 3

A 2 = 0. 4 /x 1 + 0 /x 2 + 0. 9 /x 3

Then {A 1 ,A 2 }is a pseudo partition or fuzzy 2-partition of X. Fuzzy quantizations (or granulations) of variables in fuzzy systems are also examples of fuzzy pseudo partition.

Some of the objective function-based clustering algorithms includes, amongst others, the

  • Fuzzy c-means algorithm (FCM) : It generates spherical clusters of approximately the same size.
  • Gustafson - Kessel algorithm (GK) : It provides ellipsoidal clusters with approximately the same size. There are also axis-parallel variants of this algorithm. The algorithm can also be used to detect lines (to some extent).
  • Gath - Geva algorithm (GG)/Gaussian mixture decom position (GMD) : This is used to generate ellipsoidal clusters with varying size. This algorithm has also

Fuzzy Sets (^) partition P that minimizes the performance index J (^) m (P). That is, the clustering

problem is an optimization problem.

Fuzzy c-means Algorithm

Input: Desired number of clusters c, a real number m ∈ ( 1 ,∞) and a small positive number ε , serving as a stopping criterion.

Output: A fuzzy pseudo partition and the associated cluster centers.

Steps:

  1. Let (^) t = 0. Select an initial fuzzy pseudo partition P (^0 ).
  2. Calculate the c cluster centers v( 1 t ),v( 2 t),…, v(ct), by using the equation

[ ]

∑[^ ]

=

n

k 1

m i k

n

k 1

k

m i k i A(x )

A(x ) x v

For p (t)and the chosen value of m.

  1. Update p (*)by the following procedure: For each x (^) k ∈ X, if x v 0 (t)^2 k − i > for all i ∈ Nc, then define 1 c

j 1

m 1

1

(t)^2 k j

(t)^2 k i k

(t 1 ) i x v

x v A (x )

−

=

−

If x v 0 (t)^2 k −^ i = for some^ i^ ∈^ I⊆Nc, then define^ A^ (xk)

(t 1 ) i

  • (^) for i ∈ Iby any

nonnegative real number satisfying

∈

i I

k

(t 1 ) Ai (x ) 1

And define A (i t+^1 )(xk)= 0 for i ∈Nc −I

4. Compare P (t)and P (t+^1 ). That is, compute the distance | P(^ t+^1 )−P(t)|between

P( t^ )and P (t+^1 )in the space R n×c^. If | P(t^ +^1 )−P(t)|≤ε, then stop; otherwise, increase t by one and return to step 2.

In the fuzzy c-means algorithm, the parameter m^ is selected according to the problem under consideration. When m → 1 , the fuzzy c-means converges to a “generalized”

classical c means. When m →∞, all clusters tend towards the centroid of the data

set X i.e., is the partition becomes fuzzier with increasing m. Currently, there is no

theoretical basis for an optimal choice for the value of m. However, it is established that the algorithm converges for any m ∈ (1, ∞).

We will now illustrate the functioning of the algorithm using a simple one- dimensional data set.

Example 2: Let us suppose the data points are distributed on an axis, say x-axis as shown in Fig. 4.

Fuzzy Clustering

Fig. 4: Data points and their positions.

Visual inspection of Fig. 4 reveals the existence of two prominent clusters in the data which may be centered around the two locations where the points are more concentrated than other places. Suppose these two clusters are named A and B , and their divisions are shown with the dotted line in Fig. 5. Using the partitional hard clustering algorithm, i.e. the k-means algorithm, each data point will be associated to either cluster A or B. Hence if a membership function is drawn to represent the membership of a datum to cluster A , the function would look as shown in Fig. 5. It shows that points belonging to cluster A have membership value 0 to cluster B.

Fig. 5: Membership function for partitional hard clustering of data.

With the Fuzzy c means clustering algorithm, however each datum may not belong exclusively to one cluster. Rather a datum may be placed in both the clusters. A possible membership function for cluster A that can model this situation is shown below. The datum shown as a red spot belongs more to cluster B than to cluster A. Its membership value to cluster A is 0. 2.

Fig. 6: Fuzzy membership function for cluster ‘A’.

Now, instead of using a graphical representation, a matrix U = [Ai(xk)]can be used

to represent the membership values to the different clusters. Matrix U will have as many rows as the number of data points and as many columns as the number of clusters chosen. For a hard clustering approach, the values in this matrix are either 0 or 1 , as shown by the left hand side matrix for c = 2. For a fuzzy clustering matrix however, these values lie between 0 and 1. For example, the right side of Fig. 7 shows that the first datum has membership values 0. 8 and 0. 2 to clusters A^ and B^ , respectively, while the second datum had membership values 0. 3 and 0. 7 to clusters A and B , respectively.

Try the following exercises.^ Fuzzy Clustering

E1) Consider a dataset of six points given in the following table, each of which has

two features f 1 and f. Assuming the values of the parameters 2 c and m as 2

and the initial cluster centers v 1 = ( 5 , 5 )and v 2 ( 10 , 10 ), apply FCM algorithm to find the new cluster center after one iteration.

f 1 f 2 x 1 2 12 x 2 4 9 x 3 7 13 x 4 11 5 x 5 12 7 x 6 14 4

E2) Consider the following two-dimensional dataset that consists of 15 points in

R 2.

k 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 x (^) k 1 0 0 0 1 1 1 2 3 4 5 5 5 6 6 6 x (^) k 2 0 2 4 1 2 3 2 2 2 1 2 3 0 2 4

Assume that we want to determine a fuzzy pseudo partition with two clusters (i.e., c = 2 ). Assume further that m = 1. 25 ; * is the Euclidean distance, and the initial fuzzy pseudo partition is P (^0 )= {A 1 ,A 2 }with A 1 =. 854 /x 1 +. 854 /x 2 +⋯+. 854 /x 15 A 2 =. 146 /x 1 +. 146 /x 2 +⋯+. 146 /x 15 Starting with the initial membership values given above, obtain the final fuzzy pseudo partition and the cluster centers assuming that convergence is achieved when the difference between the two values is ≤0.01.

Let us now summarize the unit.

2.9 SUMMARY

In this unit, we have discussed the fundamental concepts of the fuzzy clustering and their applications. We have also discussed how fuzzy clustering differ with classical clustering process. Specifically we have covered the following:

  1. Elaborated the essence of clustering and that of fuzzy clustering to solve real life complex problems.
  2. Provided a brief introduction of the distance measures used to measure the closeness of the objects.
  3. Provided a comparative introduction of the classical clustering and fuzzy clustering.
  4. Introduce different classes of clustering algorithms.
  5. Provided details about fuzzy clustering algorithms with focus on fuzzy c-means algorithms.

Fuzzy Sets 2.10 SOLUTIONS/ANSWERS

E1) The initial membership values of the data point, x 1 , in the two clusters can be calculated by using the equation:

μ = 2

j 1

2

1 1

2 1 1

c 1 1

x v

x v

(x)

x v 32 72 9 49 58 2 1 − 1 = + = + =

x v 82 22 64 4 68 2 1 − 2 = + = + =

c 1 (x^1 ) =

μ =

Similarly, we obtain the following:

c 2 (x^1 ) =

μ =

c 1 (x^2 ) =

μ =

c 2 (x^2 ) =

μ =

c 1 (x^3 ) =

μ =

c 2 (x^3 ) =

μ =

c 1 (x^4 ) =

μ =

c 2 (x^4 ) =

μ =

c 1 (x^5 ) =

μ =

c 2 (x^5 ) =

μ =

c 1 (x^6 ) =

μ =

c 2 (x^6 ) =

μ =

Fuzzy Sets (^) Table 2 (Dataset-2)

k k^1 2 3 4 5 6 7 x (^) k 1 xk1 0.958^ 1.043^ 1.907^ 0.780^ 0.579^ 0.003^ 0.001^ 0. x (^) k 2 xk2 0.003^ 0.001^ 0.003^ 0.352^ 0.556^ 0.105^ 1.748^ 1.