[IEEE 2011 21st International Conference Radioelektronika (RADIOELEKTRONIKA 2011) - Brno, Czech...

4
Simple Comparison of Image Segmentation Algorithms Based on Evaluation Criterion Peter LUKAC, Robert HUDEC, Miroslav BENCO, Patrik KAMENCAY, Zuzana DUBCOVA, Martina ZACHARIASOVA Department of Telecommunication and Multimedia, University of Zilina, Univerzitna 1, 010 26 Zilina, Slovak Republic [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] Abstract. In the image analysis, image segmentation is the operation that divides image into set of different segments. The paper deals about common color image segmentation techniques and methods. The advantages and disadvantage of each one will be described in this paper. At the end of the paper, the evaluation criterion will be introduced and applied on the algorithms results. Five most used image segmentation algorithms, namely, Efficient graph based, K- means, Mean shift, Expectation maximization and hybrid method are compared by designed criterion. Keywords Image analysis, color segmentation, algorithm, evaluation criterion. 1. Introduction In present, the image processing and analyzing is still rapidly growing area of research. Image segmentation is important part of image analysis and image processing. The image segmentation algorithms may be applied into the range of image processing systems. The goal of image segmentation is dividing an image into set of segments that cover entire image. The final segments must fulfill the next four conditions [1]: * n i i R R 1 = = ; for all i and j, i j, there exists 0 = j i R R ; for i = 1, 2, … , n, it must have ( ) TRUE R P i = ; for all i j, there exist ( ) FALSE R R P j i = * ; where R represents whole image, R i (i = 1, 2, … , n) are disjoint non-empty segments of R, P(R i ) is a uniformity predicate for all elements in R i and 0 represents an empty set. The summation of segments could include all pixels in the image, is the first condition. The second condition express, that different segments could not overlap each other. The third condition express, that the pixels in the same segment should have similar properties. The pixels belonging to different segments should have different properties is the last condition. 2. Color Image Segmentation Algorithms Over the last 50 years, a great number of image segmentation algorithms have been developed and this number is continually increasing. In this chapter, some of them will be presented. Especially, k-means algorithm, graph based algorithm, mean shift algorithm, expectation maximization algorithm and hybrid algorithm. 2.1 K – Means Algorithm K-means algorithm is statistical clustering algorithm. Data clustering is method that creates groups of objects (clusters). K-means algorithm is based upon the index of similarity or dissimilarity between pairs of data components. K-means algorithm is iterative, numerical, non-deterministic and unsupervised method [2]. This type of algorithm is popular for simplicity, implementation and it is commonly used for grouping pixels in images [3,4]. K- means algorithm has three basic disadvantages [5]: K, the number of clusters must be determined. Different initial conditions produce different results. The data far away from center pull the centers away from optimum location. Let X = {x 1 , x 2 , … , x n } R P be a finite set of data where N is the number of data items and R P is p- dimensional Euclidean space. Let V KN be the set of matrices (K × N, 2 K < N), where K is number of clusters. A K partition of X is defined: { } ° ¿ ° ¾ ½ ° ¯ ° ® < < = = ¦ ¦ = = K i N k ik ik ik KN K i N u k u k i u V U M 1 1 , 0 ; , 1 ; , , 1 , 0 , (1) 978-1-61284-324-7/11/$26.00 ©2011 IEEE

Transcript of [IEEE 2011 21st International Conference Radioelektronika (RADIOELEKTRONIKA 2011) - Brno, Czech...

Simple Comparison of Image Segmentation Algorithms Based on Evaluation Criterion

Peter LUKAC, Robert HUDEC, Miroslav BENCO, Patrik KAMENCAY, Zuzana DUBCOVA, Martina ZACHARIASOVA

Department of Telecommunication and Multimedia, University of Zilina, Univerzitna 1, 010 26 Zilina, Slovak Republic

[email protected], [email protected], [email protected], [email protected], [email protected], [email protected]

Abstract. In the image analysis, image segmentation is the operation that divides image into set of different segments. The paper deals about common color image segmentation techniques and methods. The advantages and disadvantage of each one will be described in this paper. At the end of the paper, the evaluation criterion will be introduced and applied on the algorithms results. Five most used image segmentation algorithms, namely, Efficient graph based, K-means, Mean shift, Expectation maximization and hybrid method are compared by designed criterion.

Keywords Image analysis, color segmentation, algorithm, evaluation criterion.

1. Introduction In present, the image processing and analyzing is still

rapidly growing area of research. Image segmentation is important part of image analysis and image processing. The image segmentation algorithms may be applied into the range of image processing systems.

The goal of image segmentation is dividing an image into set of segments that cover entire image. The final segments must fulfill the next four conditions [1]:

• n

ii RR

1=

= ;

• for all i and j, i ≠ j, there exists 0=ji RR ;

• for i = 1, 2, … , n, it must have ( ) TRUERP i = ;

• for all i ≠ j, there exist ( ) FALSERRP ji = ;

where R represents whole image, Ri (i = 1, 2, … , n) are disjoint non-empty segments of R, P(Ri) is a uniformity predicate for all elements in Ri and 0 represents an empty set. The summation of segments could include all pixels in the image, is the first condition. The second condition express, that different segments could not overlap each

other. The third condition express, that the pixels in the same segment should have similar properties. The pixels belonging to different segments should have different properties is the last condition.

2. Color Image Segmentation Algorithms Over the last 50 years, a great number of image

segmentation algorithms have been developed and this number is continually increasing. In this chapter, some of them will be presented. Especially, k-means algorithm, graph based algorithm, mean shift algorithm, expectation maximization algorithm and hybrid algorithm.

2.1 K – Means Algorithm K-means algorithm is statistical clustering algorithm.

Data clustering is method that creates groups of objects (clusters). K-means algorithm is based upon the index of similarity or dissimilarity between pairs of data components. K-means algorithm is iterative, numerical, non-deterministic and unsupervised method [2]. This type of algorithm is popular for simplicity, implementation and it is commonly used for grouping pixels in images [3,4]. K-means algorithm has three basic disadvantages [5]:

• K, the number of clusters must be determined.

• Different initial conditions produce different results.

• The data far away from center pull the centers away from optimum location.

Let X = {x1, x2, … , xn} ⊂ RP be a finite set of data where N is the number of data items and RP is p-dimensional Euclidean space. Let VKN be the set of matrices (K × N, 2 ≤ K < N), where K is number of clusters. A K partition of X is defined:

{ }

∀<<∀=

∀∈∈=

= =

K

i

N

kikik

ik

KNK iNuku

kiu

VUM

1 1,0;,1

;,,1,0 , (1)

978-1-61284-324-7/11/$26.00 ©2011 IEEE

where uik = 1 denotes that component xk belongs to cluster i, ujk = 0 denotes that component xk is out of the cluster j. The objective function JK is:

( ) 2

1 1, ik

K

i

N

kikK duVUJ

= == , (2)

where V is set of K clusters:

{ } KIRvvvvV PiK ≤≤∈= 1,,,...,, 21 , (3)

and dik is Euklidean distance between component xk and cluster vi:

ikik vxd −= , (4)

Optimal K clusters of X is produced by minimization of objective function JK(U, V) [6].

2.2 Graph Based Algorithm The efficient graph based algorithm presented in [7]

deals about problem in terms of a graph G = (V, E) where nodes vi ∈ V represents pixels in the image, and the edges (vi, vj) ∈ E connect certain pairs of neighboring nodes. Each edge (vi, vj) has responding weight w(vi, vj) that is nonnegative dissimilarity measure between connected nodes by the edge (e.g. the difference in color, location, intensity, motion etc). There are several techniques for image segmentation quality measurement. One of them is based on similarity of pixels in the same segment, and dissimilarity if pixels in the different segments. Consequently, edges between two vertices in the same segment should have low weights and high weights for edges between two vertices in different segments [7].

The efficient graph based algorithm has two important tasks, definition of difference between two components or segments, and the second important task is definition of threshold function. The algorithm starts with the step where each segment contains only one pixel. In the next step, segments are iterative merged by the following conditions:

)()(),( 1121 CTCIntCCDiff +≤ , (5)

)()(),( 2221 CTCIntCCDiff +≤ , (6)

where Diff (C1, C2) is difference between C1 and C2 components, Int(C1) and Int(C2) are internal differences of C1 and C2 components, T(C1) and T(C2) are threshold functions of C1 and C2 components [7].

The threshold function controls the degree of the difference between two segments. The difference must be bigger than internal difference of segments. Threshold function is defined:

CkCT =)( , (7)

where |C| is the size of component C, k is constant, which manages size of the components. For small segments is required stronger evidence of a boundary. Larger k causes a

creation of larger segments, smaller segments are allowed when there is a sufficiently large difference between them [7].

2.3 Mean Shift Algorithm The mean shift algorithm was proposed by Fukunaga

and Hostetler. The algorithm is based the on the kernel density estimation.

The mean shift algorithm is non-parameter iterative algorithm. Len xi, i = 1, 2, …, n be a set of points in d-dimensional space Rd. The number of points xi belonging to d-dimensional area around x with edge length h is given by:

=

−n

i

i

hxx

K1

, (8)

where K(x) is kernel or window function. So the kernel density estimation is given by:

( )=

−=

n

i

idKh h

xxK

nhxf

1,

1ˆ . (9)

Assuming a radial symmetric kernel, where K(x) = ck,d k(||x||2), whereby k(x) is kernel profile and ck,d is normalized constant, the (7) may be rewritten to:

( )=

−=n

i

iddk

kh hxxk

nh

cxf

1

2,

,ˆ . (10)

By taking the estimation as the gradient of the density estimation:

( ) ( )=

+−−=∇

n

i

iid

dkkh h

xxkxxnh

cxf

1

2

2,

, ´2ˆ . (11)

Afterwards, new kernel can be defined as G(x) = cg, d g(||x||2), whereby g(x) = – k´(x) is new kernel function and cg, d is normalized constant. After substitution in an equation (11):

( ) ( )=

+−−=∇

n

i

iid

dkkh h

xxgxxnh

cxf

1

2

2,

,2ˆ

( ) −

−=∇

=

=

=+

∧x

hxx

g

hxx

gx

hxx

gnh

cxf

n

i

i

n

i

ii

n

i

id

dkkh

1

2

1

2

1

2

2,

,2

. (12)

From this equation is possible to define the mean shift vector, which is important for algorithm. The mean shift vector is defined:

( ) x

hxxg

hxxgx

xmn

i

i

n

i

ii

gh −−

=

=

=

1

2

1

2

, . (13)

The mean shift algorithm is based on iterative computing the mean shift vector and consistent actualizing of kernel position by equation xk+1 = xk + m(xk). The last step of the algorithm is pixel allocation to the correspondent kernels [8].

2.4 Expectation Maximization Algorithm The expectation maximization algorithm is iterative

statistical technique for maximizing complex probability that pixel belongs to segment [9]. This algorithm is based on the Gaussians mixture model, which is a linear combination of some number k of simpler, component distribution.

The Gaussian mixture model for algorithm is defined:

( ) ( )=

=Θk

iiiik xpxp

1,μα , (14)

where k denotes number of Gaussians, αi denotes weight of all Gaussians, μi is mean and i inverse covariance of Gaussian probability density. For simplifying, all parameters can be registered into one vector as Θk = (αi, μi,

i )ki=1.

For a set of data S = {x1, x2, … , xN} is the log-likelihood function defined:

( ) ( )( )

( )= =

=

=

Θ=

Θ=Θ

N

t

k

i iti

N

t kt

kk

xp

xp

SpSL

1 1

1

log

log

log

θα

. (15)

The EM algorithm consists of 2 basic steps. In the first step is estimating the probability distribution of the variable and in the second step is increasing the log-likelihood function. The probability is given by:

( ) ( )( )

=

= k

t iti

jtjt

xp

xpxjP

1,

,

θα

θα. (16)

The parameters are recalculated by:

( )( )( )

( )( )( )( )

=

=

=

=

=

−−=Σ

=

=

k

t t

k

tT

jtjttj

k

t t

k

t ttj

k

t tj

xjP

xxxjP

xjP

xxjP

xjPk

1

1

1

1

11

μμ

μ

α

. (17)

This iteration process repeats two steps and continuous until convergence at local optimum [10].

2.5 Hybrid Algorithm In the image segmentation, hybrid algorithm proposes

segmentation by combination of two or more different image segmentation algorithms or methods. Examples of hybrid algorithms are in [11, 12, 13]. For example, there is hybrid algorithm as a combination of mean shift algorithm and graph based algorithm. In the first step of algorithm is retrieving means of segments by applying mean shift theory. After that, in the second step is merging the segments together by graph based theory.

3. Evaluation Criterion With the increase in the number of developed

algorithms for image segmentation, evaluation criterion for studying of segmentation is required.

The criterion used for comparing image segmentation algorithms presented in this article, is based on computing precision, recall and F1. These three parameters determine the algorithms efficiency by comparing boundaries their segments. Each of the algorithms is compared with segmentation by a human. Based on this comparison, precision, recall and F1 are computed. The definition of precision, recall and F1 is given by:

%100⋅+

=FC

CP , (18)

%100⋅+

=MC

CR , (19)

where C is the number of correct detected pixels that belongs to boundary, F is the number of false detected pixels and M is the number of not detected pixels.

F1 is combined measure from precision and recall. It is in high values if both precision and recall have high values and on the other hand, if one of them has low value, the value of the F1 is going down. The definition of F1 is given by:

%10021 ⋅+

=RP

PRF . (20)

4. Experiments and Results All the experiments were practiced on pictures from

Berkeleys database consists of 50 natural images. Each image has resolution 240x160 pixels. The presented algorithms were implemented in MATLAB. The final comparison was made by using the criterion presented in chapter three. For better results comparison, more segmented images by user were used.

0%5%

10%15%20%25%30%35%40%45%50%

PRECISION RECALL F1

EGA

KMA

MSA

EM HEGA

KMA

MSA

EM H

EGA

KMA

MSA

EM H

Fig. 1. Best results of image segmentation algorithms.

0%5%

10%15%20%25%30%35%40%45%50%

PRECISION RECALL F1

EGA

KMA

MSA

EMA HA EGA

KMA

MSA

EMA

HAEGA

KMA

MSA

EMA

HA

Fig. 2. Average results of image segmentation algorithms.

The best results of all algorithms are shown in Figure 1. The Figure 2 shows average values of precision, recall and F1 for algorithms. The results are also shown in the next tables. The EGA characterizes Efficient Graph based Algorithm, KMA K-Means Algorithm, MSA Mean Shift Algorithm, EMA Expectation Maximization Algorithm and the last one HA characterizes Hybrid Algorithm.

Best results EGA KMA MSA EMA HA

P 34,5% 24,4% 21,2% 12,1% 15,4%

R 19,4% 13,6% 13,7% 13,7% 13,8%

F1 24,8% 17,5% 16,6% 12,9% 14,6%

Tab. 1. Best results of image segmentation algorithms.

Table 1 shows accuracy of the best results of the algorithms and the Table 2 shows average results of experiments of all algorithms.

Average results EGA KMA MSA EMA HA

P 30,2% 22,1% 20,4% 12% 14,2%

R 16,1% 10,7% 12,5% 9,9% 11%

F1 20,9% 14,4% 15,4% 10,8% 12,4%

Tab. 2. Average results of image segmentation algorithms.

5. Conclusion In this paper, the several common algorithms and

methods for color image segmentation were presented. Furthermore, the evaluation criterion was presented. Based on this criterion, the algorithms were compared. The best color image segmentation algorithm was graph based algorithm, which had average accuracy 20,9 percents. The worst algorithm from all of presented was expectation maximization algorithm with accuracy 10,8 percents. For future work, the improving of color segmentations algorithms will be researched.

Acknowledgements This paper has been supported by the VEGA grant

agency no. 1/0570/10, “Algorithms research for automatic analysis of multimedia data”.

References [1] ZHANG, Y. J. Advances in image and video segmentation. IRM

PRESS, USA, 2006.

[2] MORAVCIK, T. Image segmentation in Programming Environment MATLAB. In OWD International PhD Workshop. Wisla (Poland), 2009, p. 469 - 470.

[3] KANUNGO, T., MOUNT, D., NETANYAHU, N., PIATKO, C., SILVERMAN, R., WU, A. Y. An efficient k-means clustering algorithm: analysis and implementation. IEEE Transactions and Pattern Analysis and Machine Inteligence, 2002, vol. 24, no. 7, p. 881-892.

[4] BENCO, M., HUDEC, R. The advanced image segmentation techniques for broadly useful retrieval in large image databases. In Nové Smery v Spracovaní Signálov IX. Tatranské Zruby (Slovensko), 2006, p. 40 - 44.

[5] MAT-ISA, N. A., MASHOR, M. Y., OTHMNA, N. H. Comparison of segmentation performance of clustering algorithms for Pap smear images. In Proceedings of International Conference on Robotics, Vision, Information and Signal processing. 2003, p. 118 - 125.

[6] DONG, L., OGUNBONA, P., LI, W., YU, G., FAN, L., ZHENG, G. A fast algorithm for color image segmentation. First International Conference on Innovative Computing, Information and Control. 2006, p. 685 - 688.

[7] FELENZWALB, P. F., HUTTENLOCHER, D.P. Efficient graph-based image segmentation. International Journal of Computer Vision, 2004, vol. 59, no.2, p. 167 - 181.

[8] SIQIANG, L., WEI, L. Image segmentation based on the mean-shift in the HSV space, 26th Chinese Control Conference [Online], 2007.

[9] DUDA, R., HART, P., STORK, D. Pattern classification. 2nd ed. Wiley-Interscience, 2000.

[10] SHENTAL, N., BAR-HILLER, A., HERTZ, T., WEINSHALL, D. Computing Gaussian mixture models with EM using equivalence constraints. In Advances in Neural Information Processing System 16: Proceeding of the 2003 Conference. MIT Press, 2004, p. 465 - 472.

[11] HE, R., ZHU, Y. A hybrid image segmentation approach based on mean shift and fuzzy c-means. In Asia-Pacific Conference on Information Processing. Shenzhen (China), 2009, p. 105 - 108.

[12] MOKTI, M.N., SALAM, R. A. Hybrid of mean shift and median cut algorithm for fish segmentation. In International Conference on Electronic Design. Penang (Malaysia), 2008, p. 1 - 5.

[13] ZHANG, X.X., YANG, Y. M. Hybrid intelligent algorithm for color image segmentation. In Control and Decision Conference.Yantai, Shandong (China) , 2008, p. 264 - 268.