Вы находитесь на странице: 1из 7

Proceedings of the 2013 International Conference on Machine Learning and Cybernetics, Tianjin, 14-17 July, 2013

IMAGE SEGMENTATION BA SED ON EDGE DETECTION USING K-MEANS


AND AN IMPROVED ANT COLONY OPTIMIZATION
ZENG-WEI JU, JIA-ZHONG CHEN, JING-LI ZHOU

School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan 430074, China
E-MAIL: juzengwei@hust.eud.cn.jzchen@hust.edu.cn.jlzhou@hust.edu.cn

Abstract:
On

the

base

of

edge

detection

using

the

K-means

algorithm and an improved ant colony optimization (ACO), a


novel

image

proposed

segmentation

method

disadvantages

of

can

algorithm

enhance

edge-based

is

proposed.

advantages

and

clustering

and

The
avoid

methods

by

embedding the clustering in edge detection, combining them in


a novel way. Since the clustering centers are determined
roughly using K-means in ACO, the proposed algorithm can
address the problem of slow convergence of the traditional ant
colony

(AC)

algorithm

and

reduces

its

complexity.

Experiments are divided into two stages to test the results of


edge detection and segmentation respectively. It is shown that
the proposed algorithm based on superior edge detection
achieves better performance compared to the typical image
segmentation methods.

Keywords:
Image

segmentation;

Edge

detection;

K-means;

Clustering; Ant colony optimization

1.

Introduction

Image segmentation is the division of an image into


regions or categories that are homogeneous with respect to
one or more characteristics and correspond to different
objects or parts of objects so as to simplify or change the
representation of an image into something that is more
meaningful and easier to analyze [ 1 ]. In statistics, this
problem is known as cluster analysis and is a widely
studied area. It is usually the first task of many image
analysis and process works, and the subsequent tasks such
as feature extraction and object recognition rely heavily on
the quality of the segmentation. With a good segmentation
algorithm, many associated tasks can achieve perfect
performance. Therefore, it has been applied to many fields,
e.g., image and video retrieval [2], [3], medical imaging [4],
recognition tasks [5], computer vision [6], traffic control
systems [7] etc.
On the one hand, the resulting regions of segmentation
share common characteristics based on color, intensity,
978-1-4799-0260-6/13/$31.00 2013 IEEE

texture, etc. Many segmentation methods have been


proposed in the literature. The choice of a segmentation
method over another and the level of segmentation are
decided by the particular type of image and characteristics
of the problem being considered. On the other hand, the
object of image segmentation can be a grayscale image but
also a color one. Segmentation techniques were proposed
mainly for grayscale images in the early stages, there has
been a remarkable growth of algorithms for segmentation
of color images in last two decades. In this paper, we are
concerned with color image segmentation which is of
increasing importance
Basically, we divide the image segmentation
algorithms into supervised and unsupervised methods
according to whether they need prior knowledge or not.
These methods can be further subdivided into several
common categories, termed thresholding, edge-based,
clustering, region-based, fuzzy theory-based, Markov
Random Field (MRF) model-based, and special theoretical
tools-based methods [8]. These techniques have been used
extensively but each has its pros and cons [9]. In view of
this, the proposed segmentation algorithm should take
advantages of many techniques but with less complexity.
Edge is a boundary between two homogeneous regions.
Edge detection is a fundamental tool used in most image
processing applications to obtain information from the
frames as a critical precursor step to feature extraction and
object segmentation. So it has strong effects on the image
analysis results. One of the successful applications of edge
detection is in image segmentation and is also the core
motivation of the current work. The clustering analysis
methods can also be used for edge detection, so do for
image segmentation, e.g., the K-means algorithm has been
used frequently to improve the compactness of the regions
due to its clustering validity and simplicity of
implementation in computer vision and pattern recognition.
Ant colony optimization (ACO) is an optimization
algorithm inspired by the natural behavior of ant deposit
pheromone on the ground for foraging and with broad

297

Proceedings of the 2013 International Conference on Machine Learning and Cybernetics, Tianjin, 14-17 July, 2013
application prospects. It will be introduced to tackle the
edge detection problem in this paper.
Based on aforementioned, we propose a simple and
efficient image segmentation algorithm which is based on
edge and clustering and takes the advantages of both. Of
particular importance is embedding clustering in
edge-based method. An improved ACO using k-means is
used to detect edge information. The proposed algorithm
based on superior edge detection achieves better
performance compared with the existing image
segmentation methods.
The contribution of this paper is threefold. Firstly, the
clustering is embedded in edge detection, combining
edge-based and clustering methods in a novel way.
Secondly, the combination and flexible use of various
algorithms enhance advantages and avoid disadvantages of
these methods. Thirdly, the algorithm determines clustering
centers roughly using K-means to address the problem of
slow convergence of the traditional AC algorithm.
The paper is organized as follows. Section 2 presents a
review of the existing approaches and motivations to
develop the new algorithm. Section 3 describes the
framework and procedure of the current work. In section 4,
the experiment is carried out to demonstrate the superiority
of the proposed approach. Finally, we conclude the current
work with brief discussion about the future directions in
Section 5.
2.

Related works and motivations

We briefly explore the existing image segmentations


based on aforementioned above categories in this section.
( 1 ) Thresholding methods: Thresholding is among the
most popular techniques for grayscale images. This method
has the characteristics of less calculation, high velocity and
high efficiency [ 1 0]. In the case of color images, things
become complicated [ 1 1 ]. Moreover, it is very sensitive to
noise due to not considering spatial feature and is often
used in combination with other methods.
(2) Edge-based methods: As one of the most important
applications of edge information, image segmentation is
done using various edge detection techniques such as Sobel,
Prewitt, Roberts, Canny, LoG, EM algorithm, OSTU and
Genetic Algorithm [1 2]. This approach has been extensively
investigated until now. There are some downsides to this
approach, e.g., weak adaptability and discontinuous edges.
Especially, the edge detection of color image is different to
the grayscale image and segmentation on the basis of edge
results is worth exploring.
(3) Clustering methods: Clustering can be broadly
defmed as an unsupervised classification of objects in

which one has to generate classes or partitions without any


priori knowledge [1 3]. There are many clustering methods
such as K-means [1 4], fuzzy C-means (FCM) [ 1 5],
intelligent clustering [ 1 6] and so on. However, this method
has a fatal weakness that it requires to set the initial
parameters which has strong affects to the segmentation
results.
Region-based
methods:
Region-based
(4)
segmentations mainly include following two methods:
region growing [ 1 7] and region splitting and merging [18].
It is hard to select a group of seed pixels for the former
while the latter with high complexity and heavy
computation.
(5) Fuzzy theory-based methods [ 1 9]: This kind of
algorithm includes FCM [ 1 5], Gustafson-Kessel (GK),
Gaussian mixture decomposition (GMD), Fuzzy C varieties
(FCY) and etc. The choice of membership function is the
most critical problem of this kind of methods.
(6) Other methods: In recent years, many image
segmentation techniques combined with specific theories,
methods and tools are emerging with the study of various
disciplines and development of new theories and methods,
such as MRF model-based [20], morphology-based [21 ],
genetic-based [22] etc.
To the best of our knowledge, in spite of extensive
research for several decades, there are many challenging
issues like development of a universally accepted approach
to image segmentation which can be applied to all type of
images, even the selection of appropriate one for a specific
type of image is a difficult problem.
3.

Proposed algorithm

First of all, the gradient function is defined for the


color image edge detection. Then the proposed algorithm
starts from the determination of the clustering centers
roughly by using K-means in ACO to detect edge
information. Each entry of the resulting pheromone matrix
represents the edge information at each pixel location of the
image. Consequently, the final image segmentation can be
carried out on the basis of edge results.
3.1 Define the gradient function
Gradient functions for color images may be basically
defined in two ways: 1) by embedding in a single measure
the variations of all three color channels or 2) by computing
the gradients of the single channels and by combining them
according to certain criteria [ 1 3]. The former defmition
mode is selected in the proposed algorithm. Let
,(x): 912 913 be a color image with components

298

Proceedings of the 2013 International Conference on Machine Learning and Cybernetics, Tianjin, 14-17 July, 2013

'Pn (x): 912 m. The differential distance for the manifold


'P n (x) is given by
(1)
d'J' (8'P/8x)dx + (8'P/8y)dy
=

And its squared norm can b e expressed i n matrix form as


d'J'2 dxT Gdx where G is a 2 x 2 matrix containing
the partial derivatives of 'P(x).
=

3.2 Ant colony optimization (ACO)

Initialize the positions of totally

ants, as well as the

pheromone matrix r(o).


For the construction-step index n 1: N
For the ant index k 1: K
Consecutively move the k-th ant for L steps
according to a probabilistic transition
matrix p(n).

the ant

choosing

x.
J

and fJ (

a >

0 , fJ > 0 ) determines the

)r(n:-1)
:
lJ

otherwise

(4)
3.3 The K-means algorithm
K-means clustering is an algorithm to classify or to
group the objects based on attributes or features into K
clusters. K is a positive integer number. The grouping is
done by minimizing the distances between data and the
corresponding cluster center. The K-means algorithm
basically consists of three steps:

Initialization: Choose an initial set of K so-called


centers, i.e., virtual points in the data space is created
randomly.
Every point of the data set is assigned to its nearest
center.
The position of the center is updated by the means of
the data points assigned to that cluster. In other words,
the center is moved toward the center of its assigned
points.

for

as the next solution component, i.e., the k-th

coefficient.

...

construction-step of ACO, the probabilities of

given that it is on the node i. The value of

p is the evaporation rate, and the test tour is determined

Let X be the given original image and each pixel


is viewed as an ant, and j 1,2, ,N. At the n-th
=

is the neighborhood nodes for

by the user-defined criteria. Moreover, after the move all K


ants within each construction-step, the pheromone matrix is
updated as the following and If/ is the pheromone decay

-------

0i

relative importance of pheromone value and heuristic


information respectively. The pheromone will change with
the moving of the ant.
(1 - p
p 11(k)
+
',J
(i,j )E the best tour (3)
dn:-I)
' (n:-I)

Update the pheromone matrix r(n).


Make the solution decision according to the final
pheromone matrix r(N).

ak

parameters

IJ

The ACO is a paradigm for designing metaheuristic


algorithms for combinatorial optimization problems.
Several ACO algorithms have been proposed in the
literature, such as the original Ant System (AS), MAX-MIN
Ant System (MMAS), Ant Colony System (ACS) [23, 1 6].
ACO aims to iteratively find the optimal solution of the
target problem through a guided search over the solution
space by constructing the pheromone information. To be
more specific, suppose totally K ants applied in a space X
that consists of M x N nodes, the steps of ACO are as
following.

construction-step, and

ant moves from the node i to the node j, namely the

3.4 The improved ant colony optimization using K-means

transition probabilities, are defined as follow:

We improve ACO using the K-means that determines


the cluster centers roughly at first. The specific various
parameters are set as [ 1 6]. The following is the process of
the improved algorithm.

(ri-I) r h,j Y
(n)_
((n-1)): \B
Pi,j - L En; ri,j J rhj J

,(n-l)
',J

X
1

jE 0i

(2)

otherwise

is the pheromone information value of the arc linking


to

X"
J

going form

n. ,
'I,,
}

represents the heuristic information for


to

X'
j

which is fixed to be same for each

Step 1 : Pick totally K initial cluster centers randomly


for initialization:
C2 , , CK
Step 2: Assign each data in the data set X to
Ci, i 1,2, , K in cluster centers according to the

C1,

. . .

minimum distance.

299

'

Proceedings of the 2013 International Conference on Machine Learning and Cybernetics, Tianjin, 14-17 July, 2013

Step 3: Calculate the new cluster centers:

Ci, i

, ,

where C i

1
Nj

_
_

LX

XESj

and Ni is

the number of elements of the cluster region Ci and


Ci*Ci
Step 4: Repeat step 2 until either the motion is below a
threshold or a finite number of specified steps, i.e., to
convergence. Save the iterative times as T.
Step 5: When T close to zero, we compute the
cluster centers C]' C2,., CK on the basis of the results
based on K-means. Then compute the initial
valuer .(0), i,j 1 2
N for all cluster centers.
',J

Step 6: Every ant goes to next node according to the


probabilistic transition Pi,} .
Step 7: Calculate the distances each node to the cluster
centers and update r(n-l)
by the formula (2).
l,
j

Step 8: If iterative times are less than number of


specified steps and there is no degradation, we can
output the optimal solutions, otherwise, go to step 6.

Experiment is divided into two stages: 1) Edge


detection and 2) Image segmentation. Therefore, the
performance of the proposed algorithm is demonstrated
according to these two stages.

3.5 Image segmentation


Image segmentation can be regard as a joint smoothing
and edge detection problem where one seeks to segment the
image
by simultaneously finding a piecewise

X(x)

smoothed image

S(x)

Figure 1. Original images: (a) Castle, (b) Fungus, (c) Boy

and

E(x).

The best image

segmentation is then obtained by minimizing the function.

J(S,E)= fVS(xt + (S(x)-x(x))) dx+length(E)

(5)

4.1 Test edge detection


Four methods, i.e., Sobel, Canny, traditional ant
colony (AC) algorithm and the improved ACO, are applied
to test their performance results of edge detection. The edge
information results are illustrated in Figure 2.

Up to now, the proposed algorithm is completely.


4.

Experiment and analysis

Experiments are conducted to evaluate the


performance of the proposed algorithm using three
representative images: Castle, Fungus, Boy, which are
shown in Figure 1 .

300

Proceedings of the 2013 International Conference on Machine Learning and Cybernetics, Tianjin, 14-17 July, 2013

(d) The improved ACO


Figure 2. Comparison of Sobel, Canny, AC and the improved ACO

It is shown that the improved ACO is superior than


Sobel and AC completely in edge detection and has
comparative ability to capturing edge details with Canny
but discards the redundant parts. As shown in Figure 2(b),
the Canny performs well in detecting edge details but lacks
ofIhierarchy, e.g., the foreground and the background. Note
that the hierarchy in edge information has important impact
on the following segmentation. From the perspective of
image segmentation based on edge, the improved ACO is
preferable to Canny. As for computational complexity, the
improved ACO is much less than AC due to that the former
can address the problem of convergence slowly of the latter.
4.2 Test image segmentation
From an overall perspective, the improved ACO has
superior edge detection results by comparing with methods

301

Proceedings of the 2013 International Conference on Machine Learning and Cybernetics, Tianjin, 14-17 July, 2013
such as Sobel, Canny and AC. Therefore, the proposed
algorithm can achieve superior segmentation performance
among edge-based methods. Figure 3(a) and 3(b) illustrate
the segmentation using the proposed algorithm and
clustering respectively. Especially, black, white, light gray
and dark gray or more grays can be used to specify the
clusters and enhance visual comparison results in the latter
method.

In the clustering shown in Figure 3(b), segmentation


works on the CIE L*a*b* color space using K-means. It is
obviously that the proposed algorithm has better results
comparing with clustering. Moreover, the proposed
algorithm spends comparable time with the clustering
method. So, the conclusion can be drawn that the proposed
has superior performance compared with edge-based and
clustering image segmentation methods.
5.

Conclusions

A novel image segmentation algorithm based on edge


detection using K-means and an improved ant colony
optimization is proposed in this paper. The current work is
discussed from two perspectives: 1) image segmentation
based on more excellent edge detection; 2) edge detection
based on an improved ant colony optimization. The
combination of clustering and edge detection in a novel
way takes the advantages while overcomes the drawback of
both. Compared with the typical existing methods, the
improved algorithm achieves superior performance. In the
future, we will do our best to reduce the complexity of the
current work and extend it to the related research fields
such as saliency map, object recognition and so on.
Acknowledgements

This work is supported by the Huawei Innovation


Research Program in Research on Image Processing
Technology in the Mobile Environment funded by Huawei
under grant number YJCB201 1 04 1 RE.
References

[1]

[2]

[3]

[4]
(b) Clustering
Figure 3. Segmentation comparison

302

Gregor Miller, Sidney Fels, Steve Oldridge, "A


Conceptual Structure for Computer Vision", st. Johns,
20 1 1 Canadian Conference on Computer and Robot
Vision, pp. 1 68-1 74, May 20 1 1 .
Rosalind W. Picard, Alex Paul Pentland, "Introduction
to the Special Section on Digital Libraries:
Representation and Retrieval", IEEE Transactions on
Pattern Analysis and Machine Intelligence, Vol. 18,
No.8, pp. 769-770, Aug. 1 996.
Yong Rui, Thomas S. Huang, Shih-Fu Chang, "Image
Retrieval: Current Techniques, Promising Directions,
and Open Issues", Journal of Visual Communication
and Image Representation. Vol. 1 0, No. 5, pp. 39-62,
Mar. 1 999.
Jagadish H. Pujar, Pallavi S. Gurjal, Shambhavi D.S,
Kiran S. Kunnur, "Medical Image Segmentation
Based on Vigorous Smoothing and Edge Detection

Proceedings of the 2013 International Conference on Machine Learning and Cybernetics, Tianjin, 14-17 July, 2013

[5]

[6]

[7]

[8]

[9]

[ 1 0]

[1 1]

[ 1 2]

[ 1 3]

[ 1 4]

Ideology", International Journal of Electrical and


Computer Engineering, Vol. 5, No. 2, pp. 1 2 1 - 1 27,
Mar. 20 1 0.
Tie Qi Chen, Yi Lu, "Color Image Segmentation - An
Innovative Approach", Pattern recognition, Vol. 35,
No.2, pp. 395-405, February 2002.
Micheal. J. Swain, Dana H. Ballard, "Color Indexing",
International Journal of Computer Vision, Vol. 7, No.
1 , pp. 1 1 -32, November 1 99 1 .
Pankaj D. Thakur, M. E. Patil, "Traffic Symbol
Recognition by Means of Image Segmentation",
World Journal of Science and Technology, Vol. 2, No.
3, pp. 1 37- 1 39, Apr. 20 1 2.
Alain Tremeau, Shoji Tominaga, Konstantinos N.
Platantiotis, "Color in Image and Video Processing:
Most Recent Rrends and Future Research Directions",
Journal on Image and Video Processing - Color in
Image and Video Processing, Vol. 2008, No. 7, pp.
1 -26, Jan. 2008.
Rajeshwar Dass, Priyanka, Swapna Devi, "Image
Segmentation Techniques", IJECT, Vol. 3, No. 1 , pp.
66-70, January-March 20 1 2.
Robert M. Haralick, Linda G. Shapiro, "Image
Segmentation
Techniques",
Computer
Vision,
Graphics, and Image Processing, Vol. 29, No. 1 , pp.
1 00- 1 32, Jan. 1 985.
L. Shafarenko, M. Petrou, J. Kittler, "Histogram
Based Segmentation in Perceptually Uniform Color
Space", IEEE Transactions on Image Processing, Vol.
7, No.9, pp. 1 354- 1 358, September 1 998.
Y. Ramadevi, T. Sridevi, B. Poornima, B. Kalyani,
"Segmentation and Object Recognition Using Edge
Detection Techniques", International Journal of
Computer Science & Information Technology
(IJCSIT), Vol. 2, No.6, pp. 1 56- 1 6 1 , December 20 1 0.
L. Lucchese, S. K. Mitra, "Color Image Segmentation:
A State-of-the-Art Survey", International Journal of
Computational Intelligence Research. Vol. 8, No. 1 ,
pp. 1 7-25, 20 1 2.
Wan Ting Lin, Chuen Horng Lin, Tsung Ho Wu,
Yung Kuan Chan, "Image Segmentation Using the

303

[ 1 5]

[ 1 6]

[ 1 7]

[18]

[ 1 9]

[20]

[21 ]

[22]

[23]

K-means Algorithm for Texture Features", World


Academy of Science, Engineering and Technology,
Vol. 4 1 , pp. 6 1 2-61 5, 20 1 0.
Yong Yang, "Image Segmentatioin by Fuzzy C-means
Clustering Algorithm with A Novel Penalty Term",
Computer and Informatics, Vol. 26, No. 1 , pp. 1 7-3 1 ,
2007.
Jing Tian, Weiyu Yu, Shengli Xie, "An Ant Colony
Optimization Algorithm for Image Edge Detection",
2008 IEEE Congress on Evolutionary Computation
(CEC 2008), pp. 75 1 -756, 2008.
Qiyao Yu, Davie A. Clausi, "Image Segmentation
Using Edge Penalties and Region Growing", IEEE
Transaction on Pattern Analysis and Machine
Intelligence, Vol. 30, No. 1 2, pp. 21 26-2 1 39, Dec.
2008.
W. X. Kang, Q. Q. Yang, R. R. Liang, "The
Comparative Research on Image Segmentation
Algorithms", IEEE Conference on ETCS, pp. 703-707,
March 2009.
L. Cinque, G. Foresti, L. Lombardi, "A Clustering
Fuzzy Approach for Image Segmentation", Pattern
Recognition, Vol. 37, pp. 1 797- 1807, 2004.
Yimin Hou, Lei Guo, Xiangmin LUll, "A Novel
MRF-Based Image Segmentation Algorithm", 9th
International Conference on Contorl, Automation,
Robotics and Vision, pp. 1 -5, December 2006.
Md. Shakowat Zaman Sarker, Tan Wooi Haw,
Rajasvaran Logeswaran, "Morphological Based
Technique for Image Segmentation", International
Journal of Information Technology, Vol. 1 4, No. 1 , pp.
55-80, 2008.
Lie Tang, Lei F. Tian, Brian L. Steward, "Color Image
Segmentation with Genetic Algorithm for In-filed
Weed Sensing", Transactions of the ASAE, Vol. 43,
No.4, pp. 1 0 1 9- 1 027, 2000.
M. Dorigo, M. Birattari, and T. Stutzle, "Ant Colony
Optimization", IEEE Computational Intelligence
Magazine, Nol. 1 , pp. 28-39, Nov. 2006.

Вам также может понравиться