EVALUATION METHODS OF IMAGE SEGMENTATION QUALITY

Context. The basic methods of quantitative evaluation of image segmentation quality are explored. They are used to select segmentation algorithms for specific image classes. The object of the study is cytological and histological images that are used in diagnosing the pathological processes in oncology. The subject of the study is quantitative methods for segmentation algorithms’ quality evaluation. Objective. The purpose of the work is to introduce the Gromov-Fr chet metric and develop a metric-based method for quantitative evaluation of segmentation quality for image segmentation algorithms’ comparison. Method. The quantitative evaluation criteria, which are based on comparison with etalon image and without the comparison with etalon image, are analyzed. The algorithms for measuring the distances between images based on the Fr chet, Hausdorff, and Gromov-Hausdorff metrics are analyzed. To calculate the distance between the contours of images, the Gromov-Fr chet distance was introduced. The condition of identity, symmetry and triangle is proved, and it is shown that the Gromov-Fr chet distance is a metric. The metric-based method of quantitative evaluation of segmentation quality is developed. It is based on the use of the Gromov-Hausdorff and Gromov-Fr chet metrics. The method is based on the algorithms for non-convex-into-convex polygon transformation, weighted chord algorithm, and algorithms for calculating the Fr chet and Hausdorff distances. To calculate the Hausdorff distance between convex regions, the Atalah’s algorithm was used. The Thierry and Manillo algorithm was used to find the discrete Fr chet distance. These algorithms have the lowest computational complexity among their class of algorithms. Results. The Gromov-Fr chet metric was introduced and the metric-based method of quantitative evaluation of segmentation quality was developed. Conclusions . The conducted experiments on the basis of cytological images confirmed the performance of software for evaluation the distances between images. The developed method showed a high accuracy of estimation the distances between images. The developed software module was used in intelligence systems for diagnosing the breast precancerous and cancerous conditions. The software can be used in various software systems of computer vision. Promising areas for further research are search for new metrics to evaluate the distances between images.

I -a predefined image; O -algorithm computational complexity. .

INTRODUCTION
Image processing and analysis have been widely used in computed tomography, magnetic resonance tomography, ПРОГРЕСИВНІ ІНФОРМАЦІЙНІ ТЕХНОЛОГІЇ X-ray imaging (digital radiography), histology and cytology, etc. [1]. For diagnostics in oncology, automated microscopic system (AMS) are used to process and analyze cytological and histological images.
The object of this research is cytological and histological image segmentation.
Cytological image is a microscopic image of preparations containing cells and their components (nucleus, cytoplasm) [2]. Histological image is a microscopic image of preparation thin sections of fixed tissues that reflect their structure [3].
The main disadvantages of most histological and cytological images are low quality, non-uniform illumination of areas, presence of noise, lack of clear contours between the microscopic objects and the background. It is known that image segmentation is crucial for the average computer vision. There are many algorithms for image segmentation, such as threshold, watershed distribution, k-means, and others. Therefore, the choice of segmentation algorithms and their parameters is of great significance. To select the optimal parameters for segmentation algorithms, it is necessary to evaluate the results of segmentation.
The subject of the research is methods of segmentation quality evaluation.
There are the following segmentation evaluation criteria: non-standard segmentation criteria that do not require standard (etalon) segmentation and standard (etalon-based) segmentation criteria.
One of the main criteria of the first group is homogeneity of segments. This approach is based on calculation of value dispersion of a certain image feature used for segmentation [4]. Another criterion for evaluating segmentation is contrast between segments. Besides, a shape of a segment is also a criterion that can help evaluate segmentation quality. This criterion can be effectively used for a specific image analysis. The advantage of using non-standard criteria is simplicity and speed.
The most famous algorithms belonging to the second group are AR, FOM, NR FOM, AUMA, RUMA, FOC, Baddeley, Average Distance, Variance distance, FRAG [5]. This group of algorithms is based on the use of metrics [6]. The results of etalon-based segmentation are compared with the results of specific segmentation algorithm. The main advantage of the second group of algorithms is high accuracy of evaluation.
There is no single unified theory of image segmentation. Most algorithms are heuristic in nature. Therefore, the actual problem is objective quantitative evaluation of segmentation quality.
The purpose of this article is to analyze and compare the current evaluation methods of image segmentation, develop a metric-based method and algorithms for quantitative evaluation of image segmentation using histological and cytological images. It necessary to find out the algorithm j A that meets the requirement of distance minimum ) ,..., , min( It is necessary to find out the algorithm.

LITERATURE REVIEW
Segmentation quality evaluation has become a research focus of many researchers since the late 80s -early 90s. Zhang, Mattana, and Huo [5] stated that it is accuracy of individual objects' selection that can serve as image segmentation evaluation. The authors considered individual characteristics of objects. To evaluate the threshold segmentation methods, Lee, Chung, and Park introduced segmentation error probability criterion based on counting wrongly classified pixels. Yasnoff and Mui [7] introduced pixel distance error (PDE) to find out the distances between pixels in the target and segmented images. The longer the distance is, the higher the segmentation error will be. Gerbrands [8] introduced FOM criterion to determine the distance between the segmented pixel and "correct" pixel location. Criterion RUMA, offered by Zhang [9], uses geometric object parameters to evaluate segmentation quality.
The analyzed criteria mainly evaluate the distances between individual objects in etalon and segmented images. In practice, it is necessary to evaluate the quality of segmentation for a group of objects.
The algorithms for comparing segmentation results by means of metrics are based on known Frйchet and Hasdorf metrics.
Thus, Lopez and Reisner [10] developed an algorithm to reduce a number of vertices of the convex polygon for a given error ξ in the Hausdorff metric. The algorithm can be used only for convex polygons. Alt and Scharfz [11] calculated the Hausdorff distance between algebraic plane curves using Voronoi diagrams. The algorithm is used for partial cases with algebraic curves and has a high computational complexity. Chew and Kedem [12] developed an algorithm for finding the minimum Hausdorff distance in metrics i L and ∞ L . The resulting computational complexity ⋅ . Knauer and Scherfenberg [13] developed a search method by a given image pattern, which has the least distance in the metric of Hausdorff. In this case, translation of the specified pattern is used to the search image. The algorithm has a high computational complexity. Alvarez and Seidel [14] developed a method for finding the minimum weight spanning tree based on the Hausdorff metric for d -dimensional space. The problem of approximation of such a tree is solved in polynomial time. Atallah [15] developed an algorithm for finding the Hausdorff distance between convex polygons. The computational complexity of this algorithm is ) ( n m O ⋅ , where m and n refer to a number of vertices of the first and second polygons, respectively. A number of publications are devoted to the development of algorithms for finding the Frйchet distance between curves. Alt and Godau [16]  The mentioned algorithms calculate the distances separately between the curves (contours) of the images in the Fr chet metric and between the regions of the images in the Hausdorff metric. Therefore, it is necessary to develop a metric, method, and software for evaluating segmentation quality for complex images with many objects.

MATERIALS AND METHOD
In order to compute distances between images, we use Hausdorff and Frйchet metrics. To compute the shortest distances between images, we use Gromov-Hausdorff and Gromov-Fr chet metrics.
We present the basic metrics below.
Frйchet metric. Let X be a metric space with a metric d .
For two curves , [ : , the Frйchet distance between them is equal to [10]: Gromov-Hausdorff metric. The distance between two compact sets A and B is equal to [26]: Gromov-Fr chet metric. To measure the distance between two curves, we use Gromov-Fr chet metric: . 2).We embed isometrically Then we take a Fr chet distance between 1 1 γ j and 2 2 γ j , ) , ( Finally, infimum of such (1) along all isometric embeddings 1 j , 2 j will be a Gromov-Fr chet distance: x .
Let us define a metric d in a bouquet by means of the formula: ; and 0 > ε . There are metric spaces 12 Z and 23 Z , and such isometric embeddings 12 : 23 : In other words, Z is derived Metric d on Z is defined by the formula: is arbitrary, we obtain the required inequality. . To evaluate segmentation quality, the researchers developed quantitative evaluation method of segmentation quality (QEMSQ), which is built on metric-based measuring the distance between images.
After segmentation, we obtain a set of segments that we approximate linearly and get a set of polygons. In general, they are not convex. Thus, the task is to compare two nonconvex polygons after a specific algorithm segmentation and expert segmentation.
Let P and Q be two non-convex polygons ( fig. 3). .
Then we receive Let us represent the latter expressions in the following form: Then the distance between polygons P and Q is equal to a sum of distances between contours and internal regions of convex polygons i P and j Q . The distance between regions equals: { Similarly, we calculate the distances between contours: Quantitative evaluation method of segmentation quality is based on a combination of algorithms that ensure finding the shortest distances between images. This combination includes a set of algorithms: algorithm for non-convex-intoconvex polygon transformation, weighted chords algorithm, Hausdorff distance algorithm, and discrete Fr chet distance algorithm.
Stepwise quantitative evaluation method of segmentation quality can be represented as follows: 1. Formation of a convex polygons' set. 2. Conducting isometric transformations for embedding convex polygons with a maximum cross section.
3. Computing a Fr chet distance for convex polygons. 4. Computing a Hausdorff distance for convex polygons. 5. Finding the shortest distance based on weighted metrics (Fr chet and Hausdorff metrics) between polygons P and Q according to Let us describe the basic algorithms that underpin this method.
Algorithm for non-convex-into-convex polygon transformation: Let P be a non-convex polygon with vertices . Algorithm for convex polygon formation consists of the following steps: 1. Beginning with an upper vertex, we select the vertices with internal angles i α larger than 180°. If such angles do not exist, then the polygon is convex and the algorithm is completed. Otherwise, we get an array of vertices ,..., , 1 0 = .
2. We connect consistently the received vertices 1 b beginning with the top vertex and get a polygon 1 P .
3. We repeat step 1 with a received polygon 1 P . Weighted chords algorithm is described in the article of Berezsky, Melnyk, Batko, and Pitsun [27] Computational complexity of the algorithm is ) ( m n O ⋅ , where n is a number of weighted chords of the first polygon and m is a number of weighted chords of the second polygon. For convex regions' comparison, the Atallah's algorithm [15] was used. For contour comparison, we used the Fr chet discrete distance algorithm developed by Eiter and Mannila [25]. So, the developed QEMSQ algorithms have the least computational complexity.

EXPERIMENTS
For computer experiments, we used cytological images [28].
To Other images for these experiments were generated randomly. In this case, we use the following methods to evaluate segmentation quality: CSP, WSP, PDE, FRAG, AUMA, and RUMA.
To evaluate segmentation quality of micro objects' groups, we use cytological images. Fig. 6 shows the etalon image and images segmented by means of thresholding, k-means, and watershed distribution algorithms [29]. We used Hausdorff, Fr chet, Gromov-Hausdorff, and Gromov-Fr chet metrics.
c d e Figure 6 -Image segmentation: а -output image, b -etalon image, c -segmentation results by k-means + threshold algorithms, dsegmentation results by watershed + threshold algorithms, e -segmentation results by threshold algorithm

RESULTS
Comparative analysis of image segmentation is demonstrated in Table 1.
Thus, the described methods of segmentation quality evaluation rated the most similar to etalon images and the most dissimilar images. These methods should be used to evaluate the segmentation quality of individual microscopic objects rather than the entire image as a whole. Table 2 shows the results of segmentation quality evaluation of images illustrated in fig. 6.
Analysis of data in Table 2 demonstrates that Gromov-Fr chet and Gromov-Hausdorff metrics showed better results than others. The combination of segmentation algorithms k-means and threshold optimally suits the segmentation of cytological images.

DISCUSSION
The analyzed methods of quantitative evaluation of segmentation quality, such as CSP, WSP, PDE, FRAG, AUMA, RUMA provide evaluation for only individual microscopic objects.
To evaluate the quality of segmentation of micro objects' groups, it is necessary to apply metrics. The most common metrics are the classical metrics of Fr chet and Hausdorff. At present, the best known algorithms that implement the Fr chet metric for contours (  3. There are no algorithms that calculate the shortest distance between contours.
The advantages of the developed algorithms are the following: 1. The proposed Gromov-Fr chet metric allows estimating the shortest distance between the contours of images; 2. The use of a combined metric based on the metrics of Gromov-Hausdorff and Gromov-Freche provided the possibility to calculate the shortest distances between contours and non-convex regions of images.
3. The developed EMISQ, which is based on the best known algorithms for calculating the Fr chet and Hausdorff distances, automatically estimates the shortest distances between groups of micro objects.

CONCLUSIONS
In the article, the authors introduced the Gromov-Fr chet distance and proved that distance is a metric. The method of quantitative evaluation of image segmentation quality is developed, on the basis of which a program module is designed and implemented, which allows calculating the shortest distance between images in an automatic mode.
The scientific novelty of the results is the following: -for the first time, a Gromov-Fr chet metric was proposed for measuring the shortest distance between the contours of images; -for the first time, quantitative evaluation method of segmentation quality based on the integrated use of Gromov-Fr chet and Gromov-Hausdorff metrics was applied allowing to evaluate the shortest distances between images.
The practical significance of the results is in the development of software to evaluate the shortest distances between the images. Computer experiments that were conducted on the example of cytological and histological images showed high efficiency of software that was used in image automatic segmentation algorithms. Further areas of research embrace the development of algorithms of de-paralleling the metric quantitative evaluation method of segmentation quality, which will help speed up the process of segmentation quality evaluation and segmentation algorithm optimization. Besides, a promising area for further investigations is development of a metric for evaluation the similarities of non-convex polygons.