THE EFFECT OF METRIC SPACE ON THE RESULTS OF GRAPH BASED COLOUR IMAGE SEGMENTATION THE EFFECT OF METRIC SPACE ON THE RESULTS OF GRAPH BASED COLOUR IMAGE SEGMENTATION

This paper deals with the impact of the metric space on the results of colour image segmentation algorithm. Distance and similarity measures are important tasks for quality of colour image segmentation. Main idea of this research is to make a comparison of algorithm results with using different metrics. Euclidean distance is the most used metric in many colour image segmentation algorithms. This paper shows comparison of this metric with many other metrics. Nine different metrics are gradually used in efficient graph based colour image segmentation algorithm created in the C++ language. The efficiency of precision and recall is one of the investigation tasks of colour image segmentation.


Introduction
Colour image segmentation is an important process in image analysis and processing. The main idea of this process is dividing the representation of image into spatially coherent regions that cover entire image. Image segmentation is fundamental problem in the image analysis. There is problem to find a fast, simple, automatic, robust algorithm that will be efficiently segment varied types of images [1], [2].
In the last decades, some colour image segmentation algorithms have been developed and improved. The algorithms used for colour image segmentation can be divided into next groups: algorithms based on Markov random field [3], graph based algorithms [4], algorithms based on neural networks [5], algorithms based on mean shift [6], clustering algorithms [7], algorithms with using colour histograms [8], region growing algorithms [9], and finally fuzzy algorithms [10]. Most of those algorithms used Euclidean distance to computing dissimilarity between pixels in the image. The goal of this paper is to compare this distance with other ten distances and find the best metric as a best solution for the algorithm. This paper is organized as follows: Section 1 is Introduction, Section 2 presents the efficient graph based algorithm. In Section 3, metric space is described. Experiments and experimental results are presented in Section 4. Finally, Section 5 introduces the conclusion and suggestions for future works.

The efficient graph based algorithm
The efficient graph based algorithm presented in [11] deals with problem in terms of a graph G ϭ (V, E) where nodes v i ʦ V represent pixels in the image, and the edges (v i , v j ) ʦ E connect certain pairs of neighbouring nodes. Each edge (v i , v j ) has responding weight w(v i , v j ) that is nonnegative dissimilarity measure between connected nodes by the edge (e.g. the difference in colour, location, intensity, motion, etc). There are several techniques to correct pixels merging. One of most popular is merging pixels via their similarity or dissimilarity. Thus, edges between two vertices in the same segment should have low weights and high weights for edges between two vertices in different segments [11].
Efficient graph based algorithm has two important tasks, namely, definition of difference between two components or segments and the definition of threshold function. In the first step each segment contains one pixel only. In the next step, segments are iterative merged by the following conditions: where Diff(C 1 , C 2 ) is difference between C 1 and C 2 components, Int(C 1 ) and Int(C 2 ) are internal differences of C 1 and C 2 components, T(C 1 ) and T(C 2 ) are threshold functions of C 1 and C 2 components [11].
The threshold function controls the level of two segments merging, where in order to boundary detection the difference between two segments must be bigger than their internal difference. Threshold function is defined as follows: where |C| presents the size of component C, k parameter is constant, which manages size of the components. For small segments, stronger evidence of a boundary is required. Larger k causes a preference for larger segments, smaller segments are allowed when there is a sufficiently large difference between them [11].

Metric space
In computer vision, colourcolour image segmentation is process of partitioning image into multiple segments. The main form how to find object and boundaries in the image is by using efficient graph based algorithm. For computing differences between the pixels or segment, dissimilarity metric is used. The most used metric to measure difference between pixels is Euclidean distance. In this chapter, Euclidean distance and other metrics will be introduced.
Euclidean distance represents shortest distance between two vectors in Cartesian coordinate system. This distance examines the root of square of absolute value of differences between coordinates of a pair of objects (pixels or segments in image segmentation). Euclidean distance is the most common use of distances and is given as [12]: where x i and y i are elements of vectors.
Nine different distances are compared in this paper. All the equations that compute those distances are shown in next equations [13] - [15]: G Jaccard distance (Jacc)

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 parameter F1. These three parameters determine the algorithms efficiency by comparing boundaries of their segments. Each of the algorithms is compared with segmentation by a human. Based on this comparison, precision, recall and parameter F1 are computed. The definition of precision and recall is given by: , (15) 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.
Parameter 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 parameter F1 is going down. The definition of parameter F1 is given by: . (16)

Experimental results
Experimental part of the paper consists of the experiments on real images. For this purpose, Berkeleys database of natural images was used [16]. The size of images is 256 ϫ 384 (384 ϫ 256) pixels. The example of images is in Fig. 1.
Efficient graph based colour image segmentation algorithm was used for the experiments. The algorithm was programmed in C++ language. The main principle of this paper is to compare the results of segmentations with using different type of metrics. Gradually, all metrics introduced in chapter 3 were used in the algorithm. Special evaluation criterion was used for the comparison [17]. The criterion is based on the computing precision, recall and parameter F1. It works by comparison of two images, comparison of boundaries of the segments from image segmented by algorithm and boundaries made by human. The experimental results from algorithm are shown in the next figure and tables.
Based on visual representation of results shown in Fig. 2, the best results were achieved by metrics Bray Curtis Fig. 2b, Canberra  Fig. 2c, Clark Fig. 2d and Jaccard Fig. 2g. They have less over-seg- Averaged results achieved for all metrics. mented images. The segmented images of other metrics seem to be more over-segmented.
From Table 1 there can be seen that the selection of metric has impact on the quality of results. There is lot of differences in the percent results achieved from the experiments. Neither from all metrics had the best all three evaluation parameters and best computing time.
The first parameter from evaluation criterion is precision. From Fig. 3 it is evident that the results for all metrics are very similar. The values of this parameter are about 55% for the best metrics. Only one metric has worse results value and that metric is Jaccard distance. This metric achieved results under 46%.
The next evaluation criterion parameter is recall. The results for all metrics are shown in Fig. 4. From Fig. 4 it is evident that the Jaccard distance had the best results in recall, almost 37%. The second was Clark distance with 27.33% and after that were Bray Curtis and Canberra distances with almost 25% recall. Other metrics had the final result of recall under the 19%.
Parameter F1 is final parameter of evaluation criterion. It is defined as combination of precision and recall. The differences between the metrics based on this parameter can be seen in Fig. 5. The best from all metrics was Jaccard distance with almost 41%. This metric was the only one that reached the final results above 40%. The Clark distance had second best results with 35.75%. The Canberra and Bray Curtis distances had the same results almost 34%. All other distances had the parameter F1 parameter less than 28%.
In Fig. 6 there are shown differences in computing time for the metrics. All results are for segmentation of 100 images. The best computing time for all images had the Manhattan, Canberra and Bray Curtis distances. Their computing time for all images was about 34 seconds. The Euclidean and Jaccard distances had the time about 37 seconds. The worst computing time score had the Lorentzian and Minkowski distances with results about 50 seconds. On the other hand, the differences are so big only for segmentations more images. For one image, the differences are only in milliseconds.

Conclusion
In this paper, one well known colour image segmentation algorithm, and nine metrics that were gradually implemented to this algorithm, were presented. From the results it is possible to say that the best metric for efficient graph based algorithm is not definitly determined. For the precision, almost all metrics had the results more than 55%. Only Jaccard distance had the precision less than 50% (45.87%). On the other hand, the Jaccard distance is the best in the recall and F1 parameters (R ϭ 36.82% and F1 ϭ 40.85%). The experiments have shown that the metric selection is very important for the efficient graph based algorithm. The computing time for one image was different only in milliseconds for all metrics. This paper has been supported by the VEGA grant agency no. 1/0570/10, "Algorithms research for automatic analysis of multimedia data".