You are on page 1of 6

IPASJ International Journal of Information Technology (IIJIT)

Web Site: http://www.ipasj.org/IIJIT/IIJIT.htm


A Publisher for Research Motivation ........ Email: editoriijit@ipasj.org
Volume 2, Issue 6, June 2014 ISSN 2321-5976


Volume 2, Issue 6, June 2014 Page 8


Abstract
Image segmentation is an important method for image analysis and understanding. In this paper, image segmentation
framework based on clustering technique is given. By shielding the image pixel gray, different pixels in the original image are
of the same gray, and we select a representative of the pixels which are of same gray. Then clustering algorithm is used for
some selected representative pixels. And pixels with same gray in the shield are allocated to the same cluster. In experiment, we
choose K-means clustering algorithm to study performance of image segmentation. Experimental results show the effectiveness
of the proposed algorithm.

Keywords: image segmentation, clustering, framework, reduction

1. INTRODUCTION
Clustering is an important tool for data analysis, which is a collection of physical or abstract data objects to be divided
into a plurality of clusters, and the objects in the same cluster are similar to each other, and objects in the different
cluster differ from each other. Currently, in the literature there are many clustering algorithms, which can be divided
into five types, namely partition-based clustering algorithm, hierarchy-based clustering algorithm, density-based
clustering algorithm, grid-based clustering algorithm and model-based clustering algorithm. The partition-based
clustering is more commonly used method, among which is typical of K-means clustering algorithm. K-means
clustering algorithm is commonly used in the field of pattern recognition, data analysis, data classification and data
compression [1]. In order to reduce the clustering time, Eschrich et al. [2] used data reduction technique to study the K-
means clustering algorithm, Vasuda et al. [3] used data compression techniques to study the brain MR image
segmentation based on fuzzy clustering. It can be said that image segmentation based on clustering technology is one of
the important methods, and more and more people pay attention it. In fact, image segmentation refers to segment the
image into non-overlapping areas of interest and extract the target, which is a prerequisite for image analysis and
understanding. Image segmentation directly impacts on the image analysiss results. Therefore, it becomes an
important image processing technology. Due to the complexity of the image data, there does not exist a complete and
accurate image segmentation method. So, researchers still study image segmentation algorithm in-depth in order to get
better results. For example, Ahmed et al [4] proposed BCFCM algorithm and successfully applied to MRI data by
adjusting objective function of FCM. In order to reduce segmentation time, Chen et al [5-7] proposed an improved
BCFCM algorithm and applied kernel to BCFCM to propose KFCM algorithm. In the same year, they also proposed a
new kernel-based fuzzy C-means algorithm for medical images. Yang et al [8] further studied the spatial correction
kernel clustering algorithm. They proposed GKFCM algorithm and successfully used for image segmentation. For
medical images, Kannan et al [9] proposed fuzzy clustering algorithm based on kernel; Swagatam et al [10] studied the
kernel image segmentation based on fuzzy clustering. In this paper, we use data reduction technique to study the fast
image segmentation based on clustering technique. On the basis of method given by ref. [3], we obtain a framework for
image segmentation based on data reduction and clustering method. Experiments are conduct to show effectiveness of
the presented method.

2. K-MEANS CLUSTERING
K-means clustering is a dynamic clustering method, which is a clustering method based on squared error criterion. In
order to obtain the better result, initial partition for sample set is needed. Usually, some representative points are chosen
as initial class center. Then the rest of the data points are assigned to each class in some way.

2.1 Selection of representative points
For the selection of representative points, the centers can be selected by experience, or the data are randomly divided
into K classes, and then samples for each class are averaged to obtain center, or the density selection method is used to
obtain center. Here is a center initialization method [9], named as InitCenter (X, cluster), where X represents the
A Fast Image Segmentation Based on Clustering
Technique

Kai Li, Yu Wang

School of mathematics and computer, Hebei university,
Baoding 071000, China
IPASJ International Journal of Information Technology (IIJIT)
Web Site: http://www.ipasj.org/IIJIT/IIJIT.htm
A Publisher for Research Motivation ........ Email: editoriijit@ipasj.org
Volume 2, Issue 6, June 2014 ISSN 2321-5976


Volume 2, Issue 6, June 2014 Page 9

sample set, cluster represents number of the cluster. In addition, assuming that
{ | 1,2,..., }
s
i
X x R i n = e = , ( , , , )
i i1 i2 is
x x x x = . In the following, we give the center initialization method.
InitCenter (X, cluster):
Step 1 Sort m
i
in descending order, where
1
/ , 1,2, ,
s
i ip
p
m x s i n
=
= =

.
Step 2 According to m
i
obtained above, data is rearranged and divided into K groups so that the former K-1 groups
contain r data, K-th group contains the remaining data, wherer =n / K, where K is the number of clusters.
Step 3 Calculate the distance between two points for each group.
Step 4 Select mean of two points as center for each group, where the selected two points has the maximum distance
with respect to each group.

2.2 Determination of the initial partition
After the initial centers are determined, how to divide the remaining points to the respective group? Different methods
can be used to determine the initial partition. Commonly used methods are as follows:
(1) After the initial centers or representative points are determined, the remaining points are classified to
corresponding group whose center is from those points.
(2) Data set X is standardized and standardized data set is written as
{y | 1,2,..., }
s
i
Y R i n = e =
and
( , , , )
i i1 i2 is
y y y y =
. For each data point,
( 1)[ ( ) ]
( )
K Sum i MIN
k
MAX MIN

=

is calculated,
where
1
( )
n
ij
j
Sum i y
=
=

,
max{ ( )}
i
MAX Sum i =
and
min{ ( )}
i
MIN Sum i =
.
Then, y
i
is classified into group whose order is closest k.
(3) Set a positive number V as the threshold. First select a sample x
1
as a group and calculate the distance between
the samples x
2
and x
1
. If the distance is less than the threshold V, x
2
and x
1
will belong to same group, otherwise create
a new group which include sample x
2
. Repeat this process until all samples are classified to different group.

2.3 K-means clustering algorithm
K-means algorithms idea is to partition data set X into K disjoint subset X
1
, X
2
, ..., X
K
and X
1
X
2
... X
K
=X
square error for each center to the point within the cluster is minimized. It is seen that object for K-means clustering is
to minimize
2
|| ||
n K
ij j i
j=1 i=1
J( ,v) = x v

, where v
i
is cluster center and
1
( ) , =1,2, , ; =1,2, ,
0
j i
ij i j
j i
x X
x i K j n
x X

e

= =

e


.
Specific K-means clustering algorithm is as follows:
Step 1 Select an initial partition which has K clusters and compute means of each cluster.
Step 2 Repeat steps 3 and 4 until the condition is met.
Step 3 Compute distances between all data point and means of each cluster and data point is assigned to the nearest
cluster corresponding to the cluster center.
Step 4 Calculate the new cluster center for each cluster.

3. IMAGE SEGMENTATION BASED ON DATA REDUCTION
In order to improve the performance of image segmentation, Vasuda et al.[3] studied the image segmentation based on
fuzzy clustering using quantitative and aggregative operations. In this paper, we generalize their method and give a
framework based on clustering technique. In the quantitative step, the pixel gray is shielded the lower m bits so that the
pixels with different gray obtain the same brightness, and select a pixel from the group to represent pixels for this
group. Then clustering algorithm is used to clustering the representative pixels. After clustering is completed, then
aggregative operation is followed, that is pixels with the same brightness are assigned to a cluster. In the following, we
give a framework for image segmentation based on data reduction. And we refer it as RIS (I, K), where I is a gray
image, its size is p q, K is number of segmentation.
Algorithm RIS (I, K):
Assuming that image is represented as a matrix I and I (i, j) is a gray value of the i-th row and j-th column, M is a
mask, for example, M =11111000.
Step Quantitative step
T=I;
for i=1 to p
IPASJ International Journal of Information Technology (IIJIT)
Web Site: http://www.ipasj.org/IIJIT/IIJIT.htm
A Publisher for Research Motivation ........ Email: editoriijit@ipasj.org
Volume 2, Issue 6, June 2014 ISSN 2321-5976


Volume 2, Issue 6, June 2014 Page 10

for j=1 to q
T(i,j)=T(i,j) & M
end
end
Step 2 Compute the number of different gray after pixels are shielded. Here, provided there is d different gray,
namely D
1
D
2
D
d
.
Step 3 Select a clustering algorithm to clustering data {D
1
D
2
D
d
}.
Step 4 Aggregative step
for i=1 to p
for j=1 to q
for l=1 to d
if T(i,j)=D
l
then T(i,j) and D
l
are in the same cluster.
end
end
end

4. EXPERIMENTS AND ANALYSIS
In order to verify the performance of image segmentation algorithm RIS, we select seven images, i.e. rice, coin, dog,
moon, cameraman, coins and Lena image which are shown in Figure 1. Selected clustering algorithm is the K-means
clustering. The used center initialization method is InitCenter (X, cluster). The initial partition is used according to
first method given in subsection 2.2.


Figure 1 Selected images for experiment
First, we study image rice on experiment. Gray for each pixel in the image is converted binary data and we shield the
last one, the last two, until the last seven, i.e. the value of M is 11111110,11111100,11111000,11110000, 11100000,
11000000 and 10000000, respectively. Experimental results are shown in Figure 2, where (a) is the original image, (b)
is segmentation results using the K-means clustering algorithm, (c) - (i) are segmentation results by shielding the last
one bit, the last two bits until last seven bits, respectively.

(a) (b) (c)

(d) (e) (f)
IPASJ International Journal of Information Technology (IIJIT)
Web Site: http://www.ipasj.org/IIJIT/IIJIT.htm
A Publisher for Research Motivation ........ Email: editoriijit@ipasj.org
Volume 2, Issue 6, June 2014 ISSN 2321-5976


Volume 2, Issue 6, June 2014 Page 11


(g) (h) (i)
Figure 2 Segmentation results using K-means and RIS method

In addition, CPU time used for image segmentation is given in Figure 3 when M takes different value. Figure 4 shows
CPU time using the K-means clustering algorithm for image segmentation and mean CPU time for M taking different
value using RIS method.
0
0.1
0.2
0.3
0.4
1 2 3 4 5 6 7
Number of shielding bit
C
P
U

t
i
m
e
(
s
e
c
o
n
d
)

Figure 3 CPU time for different M value using RIS method

0
0.1
0.2
0.3
0.4
0.5
K-means RIS
C
P
U

t
i
m
e
(
s
e
c
o
n
d
)

Figure 4 Comparison of CPU time using K-means and RIS method,
where CPU time for RIS is mean time for different M value
It is seen from the results in Figure 3, when the number of shielding bit is 5, CPU time used for image segmentation is
minimal and we obtain better segmentation. Moreover, we also see in Figure 4 that CPU time directly using the K-
means clustering algorithm for image segmentation is more than mean CPU time for M taking different value using
RIS method. Therefore, in following the experiment, we only aim at M=11100000. Experimental results are given in
Figure 5 to Figure 10. Among them, (a), (b) and (c) represent the original image, segmentation results using K-means
clustering algorithm and segmentation results using RIS algorithm, respectively.


(a) (b) (c)
Figure 5 Segmentation result for image coin using K-means and RIS algorithm

(a) (b) (c)
Figure 6 Segmentation result for image dog using K-means and RIS algorithm
IPASJ International Journal of Information Technology (IIJIT)
Web Site: http://www.ipasj.org/IIJIT/IIJIT.htm
A Publisher for Research Motivation ........ Email: editoriijit@ipasj.org
Volume 2, Issue 6, June 2014 ISSN 2321-5976


Volume 2, Issue 6, June 2014 Page 12


(a) (b) (c)
Figure 7 Segmentation result for image moon using K-means and RIS algorithm

(a) (b) (c)
Figure 8 Segmentation result for image cameraman using K-means and RIS algorithm

(a) (b) (c)
Figure 9 Segmentation result for image coins using K-means and RIS algorithm

(a) (b) (c)
Figure 10 Segmentation result for image lena using K-means and RIS algorithm

From Figure 5 to Figure 10, we know that image segmentation results are not severely affected using RIS method
which saves a lot of time. Of course, this is true only for the portion of the image as well as K-means clustering
algorithm.

5. CONCLUSIONS
In this paper, data reduction technique is introduced into image segmentation. And we obtain image segmentation
framework which combine data reduction and clustering algorithm. In experiments, we select rice, coin, dog, moon,
cameraman, coins and lena image and K-means clustering algorithm to conduct the experimental study. Segmentation
results show the effectiveness of the proposed algorithm.

Acknowledgment
This work is supported by Natural Science Foundation of Hebei Province (No. F2012201014) and Natural Science
Foundation of China (No. 61375075).

IPASJ International Journal of Information Technology (IIJIT)
Web Site: http://www.ipasj.org/IIJIT/IIJIT.htm
A Publisher for Research Motivation ........ Email: editoriijit@ipasj.org
Volume 2, Issue 6, June 2014 ISSN 2321-5976


Volume 2, Issue 6, June 2014 Page 13

References
[1] A. K. Jain, Data clustering: 50 years beyond K-means, Pattern Recognition Letters, 31, pp. 651-666, 2010.
[2] S. Eschrich, K. Jingwei, L. O. Hall, et al, Fast accurate fuzzy clustering through data reduction, IEEE Trans.
Fuzzy Systems, 11 (2), pp. 262-270,2003.
[3] P. Vasuda, S. Satheesh, Improved Fuzzy C-Means Algorithm for MR Brain Image Segmentation, International
Journal on Computer Science and Engineering, 2(5), pp.1713-1715, 2010.
[4] M. N. Ahmed, S. M. Yamany, N. Mohamed, A. A. Farag, T. Moriarty, A modified fuzzy c-means algorithm for
bias field estimation and segmentation of MRI data, IEEE Trans. Med. Imaging,21(3), pp. 193-199, 2002.
[5] D.Q. Zhang, S.C. Chen, Kernel-based fuzzy and possibilistic c-means clustering, In Proceedings of the
International Conference on Artificial Neural Networks (ICANN03), pp. 122-125, 2003.
[6] S.C. Chen, D.Q. Zhang, Robust image segmentation using FCM with spatial constrains based on new kernel-
induced distance measure, IEEE Trans. Systems Man Cybernet. Pt. B, 34, pp. 1907-1916, 2004.
[7] D.Q. Zhang, S.C. Chen, A novel kernelized fuzzy c-means algorithm with application in medical image
segmentation, Artificial intelligence in medicine, 32, pp. 37-50, 2004.
[8] M. S. Yang, H. S. Tsai, A gaussian kernel-based fuzzy c-means algorithm with a spatial bias correction, Pattern
recognition letters, 29, pp. 1713-1725, 2008.
[9] S. R. Kannan, S. Ramathilagam, A.Sathya et al. Effective fuzzy c-means based kernel function in segmenting
medical images, Computers in Biology and Medicine, 40, pp.572579, 2010.
[10] D. Swagatam, S. Sudeshna, Kernel-induced fuzzy clustering of image pixels with an improved differential
evolution algorithm, Information Sciences, 180, pp. 1237-1256, 2010.


AUTHOR
Kai Li received the B.S. and M.S. degrees in mathematics department electrical engineering department
from Hebei University, Baoding, China, in 1982 and 1992, respectively. He received the Ph.D. degree from
Beijing Jiaotong University, Beijing, China, in 2001.He is currently a Professor in school of mathematics
and computer science, Hebei University. His current research interests include machine learning, data
mining, computational intelligence, and pattern recognition.

Yu Wang received the B.S. and M.S. degrees in Computer Technology and Application from Inner
Mongolia university of Science and Technology, in 1997, and in Computer Technology from Hebei
University, Baoding, China, in 1999, respectively. His current research interests include data mining, and
pattern recognition.

You might also like