4. Fuzzy clustering

ck ¼ ð Þ ck, <sup>1</sup>; ck,2;…; ck,n (4)

<sup>þ</sup> … <sup>þ</sup> xi

j,n � ok,n � �<sup>2</sup>

(5)

The distance function can be calculated as in Euclidean distance for k clusters in the next

<sup>þ</sup> <sup>x</sup><sup>i</sup>

The iterative operations are repeated as in the flow diagram in Figure 2. This flowchart

When this algorithm is applied for three-cluster for the original image shown in Figure 3a, this image can be represented in three clusters as in Figure 3b–d, respectively. Cluster-1 shows the

Figure 3. K-means algorithm results. (a) Original image; (b) K-Means Cluster No:1; (c) K-Means Cluster No:2; and (d) K-

represents the iterative distance controlled operations to minimize the J parameter.

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

j,<sup>1</sup> � ok,<sup>2</sup> � �<sup>2</sup>

formula (5).

Means Cluster No:3.

dist x<sup>i</sup> j ; ok � �

Figure 2. Flow chart of the K-Means algorithm.

22 Recent Applications in Data Clustering

¼

r

xi j, <sup>1</sup> � ok,<sup>1</sup> � �<sup>2</sup> Fuzzy theory is firstly developed by Zadeh [10] for defining adjustable degrees of memberships. Fuzzy theory creates intermediate sets rather than classical sets. In classical sets, each data item is assigned into only one cluster. In contrast, data in fuzzy clusters can be represented in multiple clusters. This multiset assignment can belong to all the clusters with a certain degree of membership defined by Bezdek [11]. This one item in multiset representation can be useful for sharply separated cluster boundaries.

The fuzzy C-Mean algorithm (FCM) is frequently used because of its ease of operation and reliability in many applications [12–15]. Conventional Fuzzy C-Mean (FCM) works with the principle of minimizing the objective function [16] shown in the following formula (6):

$$J\_{\rm FCM} = \sum\_{i=1}^{c} \sum\_{k=1}^{n} \mu\_{ik}^{m} d\_{ik}^{2} \tag{6}$$

where um ik is the membership function in the range [0,1]. This membership represents the membership degree of xk for the k th pixel. <sup>k</sup> is defined in the range of <sup>k</sup> <sup>∈</sup>½ � <sup>1</sup>; <sup>n</sup> for the <sup>i</sup> th numbered cluster. Total cluster size (c) given in the range of 1½ � ; <sup>c</sup> . In the formula (7), <sup>d</sup><sup>2</sup> ik represents the distance between x<sup>k</sup> and i th-cluster center (vi).

$$d\_{ik}^2 = \|\mathbf{x}\_k - \mathbf{v}\_i\|\tag{7}$$

The fuzzy set theory aims that the membership function is P<sup>c</sup> <sup>i</sup>¼<sup>1</sup> uik <sup>¼</sup> 1 for each pixel. Using the FCM membership function um ik and cluster center vi, FCM targets to reach local minimums by using the equivalence (8) and (9), respectively.

$$u\_{ik}^{\*} = \left\{ \sum\_{j=1}^{c} \left( \frac{d\_{ik}}{d\_{jk}} \right)^{2/(m-1)} \right\}^{-1} \forall i \in [1, c] \text{ and } k \in [1, n] \tag{8}$$

$$\upsilon\_i^\* = \frac{\sum\_{k=1}^n \mu\_{ik}^m \mathbf{x}\_k}{\sum\_{k=1}^n \mu\_{ik}^m} \quad \forall i \in [1, c] \tag{9}$$

FCM algorithm flow chart is shown in Figure 4. This algorithm will be done in the given iteration step specified in this traditional clustering method. The cluster centers are updated in each iteration step to calculate the membership function.

When the FCM algorithm is applied for the given original image shown in Figure 5a for three clusters, this image can be represented in three clusters as in Figure 5b–d, respectively. This algorithm can only be applied for gray-scaled images. There is no crisp clustering for the given

5. Colored FCM

alence (10).

where u<sup>∗</sup>

where u<sup>∗</sup>

d2

u∗

ship could be defined for each cluster.

cluster for each color domain. v<sup>∗</sup>

assigned into the given cluster.

Figure 4b–i, respectively.

ik Rð Þ ;G;<sup>B</sup> <sup>¼</sup> <sup>X</sup><sup>c</sup>

< :

v∗ i Rð Þ ;G;<sup>B</sup> ¼

ik Rð Þ ;G;<sup>B</sup> <sup>¼</sup> mean xk Rð Þ � vi Rð Þ �

j¼1

� �

Membership for each cluster can be calculated in the following formula (11).

dik Rð Þ ;G;<sup>B</sup> djk Rð Þ ;G;<sup>B</sup>

> P<sup>n</sup> <sup>k</sup>¼<sup>1</sup> um

calculated from the results of the membership function for all RGB colors.

!<sup>2</sup>=ð Þ <sup>m</sup>�<sup>1</sup> 8

Colored Image Fuzzy C-Mean (C-FCM) involves color-based clustering using fuzzy sets. This 3D method is firstly given by Kutbay and Hardalaç [17] as Robust Colored Image FCM (RCI-FCM), but this presented method is different from RCI-FCM. In RCI-FCM, distances are calculated for each R, G and B channels, but in this method, the mean distance is calculated for RGB color spaces. This method represents the RGB color formed images in FCM, which uses FCM-based algorithm in colored images. The membership function calculates the centroids of the clusters for each R, G and B color spaces. After calculation of Euclidian distance for each channel, the mean distance could be calculated shown in equiv-

> �; xk Gð Þ � vi Gð Þ �

> > 9 = ;

ik Rð Þ ;G;<sup>B</sup> represents the membership degree for mean distance for each color. In this

ik Rð Þ ;G;<sup>B</sup> xk Rð Þ ;G;<sup>B</sup>

ik Rð Þ ;G;B

ik Rð Þ ;G;<sup>B</sup> is the membership function of each RGB color pixel. This function calculates for

each R, G and B colors, for the each RGB space representation. c denotes the clusters for each n-

value into the c-cluster. C-FCM algorithm's flow chart is shown in Figure 6. The proposed method aims to create c3 cluster for the given stopping criteria. New cluster centroids are

C-FCM algorithm flow chart is shown in Figure 6. The flowchart shows the C-FCM algorithm for colored images. For each iteration step, RGB distances are calculated and cluster centers are calculated. After updating the cluster centers in the given threshold value, each item will be

Figure 7 represents the C-FCM algorithm, which is applied for the given original image shown in Figure 7a. For each color, pixels assigned into two cluster. For RGB color space 2<sup>3</sup> cluster are created for this image. These clusters can be given in eight clusters as in

representation for each item, cluster's membership can be calculated and statistically member-

New cluster center can be calculated in the following equivalence (12) for each cluster:

P<sup>n</sup> <sup>k</sup>¼<sup>1</sup> um

pixel, and dik Rð Þ ;G;<sup>B</sup> explains the distance between pixel xk and the centroid vi for i

�1

� �

�; xk Bð Þ � vi Bð Þ �

� � � (10)

i Rð Þ ;G;<sup>B</sup> represents the centers of the clusters for each RGB pixel

� �

∀i∈ ½ � 1; c and k∈ ½ � 1; n (11)

Partitional Clustering

25

http://dx.doi.org/10.5772/intechopen.75836

∀i∈ ½ � 1; c (12)

th number

Figure 4. Flow chart of the FCM algorithm.

Figure 5. FCM algorithm results. (a) Original image; (b) FCM Cluster No:1; (c) FCM Cluster No:2; and (d) FCM Cluster No:3.

landscape image. This image includes many objects in different colors, and these colors are generally indented in these objects.

FCM algorithm includes iterative procecesses. For the given image at the end of the 55 iteration steps, clustering processes are completed for the given threshold value which is 10<sup>5</sup> for FCM distance change.
