DEVELOPMENT OF METHODS FOR DETERMINING THE CONTOURS OF OBJECTS FOR A COMPLEX STRUCTURED COLOR IMAGE BASED ON THE ANT COLONY OPTIMIZATION ALGORITHM

A method for determining the contours of objects on complexly structured color images based on the ant colony optimization algorithm is proposed. The method for determining the contours of objects of interest in complexly structured color images based on the ant colony optimization algorithm, unlike the known ones, provides for the following. Color channels are highlighted. In each color channel, a brightness channel is allocated. The contours of objects of interest are determined by the method based on the ant colony optimization algorithm. At the end, the transition back to the original color model (the combination of color channels) is carried out. A typical complex structured color image is processed to determine the contours of objects using the ant colony optimization algorithm. The image is presented in the RGB color space. It is established that objects of interest can be determined on the resulting image. At the same time, the presence of a large number of "garbage" objects on the resulting image is noted. This is a disadvantage of the developed method. A visual comparison of the application of the developed method and the known methods for determining the contours of objects is carried out. It is established that the developed method improves the accuracy of determining the contours of objects. Errors of the first and second kind are chosen as quantitative indicators of the accuracy of determining the contours of objects in a typical complex structured color image. Errors of the first and second kind are determined by the criterion of maximum likelihood, which follows from the generalized criterion of minimum average risk. The errors of the first and second kind are estimated when determining the contours of objects in a typical complex structured color image using known methods and the developed method. The well-known methods are the Canny, k-means (k=2), k-means (k=3), Random forest methods. It is established that when using the developed method based on the ant colony optimization algorithm, the errors in determining the contours of objects are reduced on average by 5–13 %.


Introduction
Many branches of technology related to the receipt, processing, storage and transmission of information are currently largely oriented towards the development of systems in which information has the character of color images. A large number of color images are obtained in geology, mineralogy, biology, metallurgy, medicine, ecology, agriculture, military affairs, cartography, etc. [1][2][3][4].
The current trend in the development of technical systems is the production of complex structured color images presented in heterogeneous color spaces. Folding structure of color images of modern technical systems is determined by the resolution of the sensors, their sensitivity, and also due to [5]: -presence of a large number of heterogeneous objects; -objects in the image belong to various structural and spatial elements; -each type of object has its own significant characteristics, it must be taken into account; -objects are morphologically complex structures; -objects are compact and low contrast compared to the background. In such systems, it is important to ensure the accuracy of determining the contours of objects of interest. The accuracy of determining the contour of an object is understood as ensuring the continuity of the contour. This is especially important in automated image processing in order to develop and use machine learning methods using deep neural networks, convolutional deep neural networks, recurrent neural networks, etc. [1,2]. Machine learning methods are used in computer vision systems, decoding of aerospace images, medicine, bioinformatics, automatic speech recognition, etc. [1,2,5,6].
Existing methods for determining the contours of objects in color images provide for the preliminary conversion of a color image into a tonal image [1,5,6] and the further use of wellknown methods for determining the contours of objects in tone images [1,7,8]. A study of the use of well-known methods for determining the contours of objects in color images indicates the following disadvantages [1,[5][6][7][8]: -conversion of a complex structured color image into a tonal image leads to a break in the contour of the object, loss of the share of information, and, as a result, some decoding features of objects of interest; Computer Sciences -definition of the contours of objects is carried out sequentially in the "sliding" window leads to breaks in the contours of the objects when combining the information of the "sliding" windows; -accuracy of determining the contours of objects substantially depends on the selected initial parameters of known methods; -complicated procedure for adapting well-known methods to the current situation (methods work according to a "hard" program); -accuracy of determining the contours of objects by known methods does not satisfy the quality requirements for solving problems that are assigned to technical systems and the like.
So, the development of a method for determining the contours of objects of interest in complexly structured color images is relevant.
The aim of research is increasing the accuracy of determining the contours of objects of interest in complexly structured color images through the use of an ant colony optimization algorithm.
To achieve the aim, the following objectives: -to develop a method (set of actions) to determine the contours of objects in a typical complex structured color image based on an ant colony optimization algorithm; -to determine the contours of objects in a typical complex structured color image by the method based on the ant colony optimization algorithm; -to evaluate the accuracy of determining the contours of objects in a typical complex structured color image by the method based on the ant colony optimization algorithm.

Review of problem
In [9], it is proposed to determine the contours of regions in a color image using the method of maximum likelihood (expectation-maximization). The method uses colored signs of regions, spatial coordinates of points, texture signs (anisotropy, polarity, contrast, etc.). The method [9] is effective only for determining the contours of large regions (forest of various textures, field, lake, sea, ocean, city, etc.) in color images.
In [10], a method for searching scenes in color images (WAveLetbased Retrieval of User-specified Scenes) is proposed. Scenes are understood as large territories -forests, agricultural fields, wetlands, rivers, lakes, seas, oceans, urban landscape and the like. At the first stage of the method, the Haar wavelet transform is carried out, the coefficients of which form the scene feature vector. At the second stage, scenes are highlighted in a color image by clustering local areas in the feature space. The feature vector is the result of averaging the local feature vectors of the areas included in the corresponding scene. The main disadvantage of the method [10] is the possibility of its application only for determining the contours of large territories.
In [11], a method based on wavelet-based Indexing of Images Using Region Fragmentation was proposed to determine the contours of objects in color images. The method uses the global Haar transform wavelet for the image in the Hue-Saturation-Value (HSV) color space (hue-saturation-brightness). The determination of the color uniformity of the region is performed by comparing the trace of the covariance matrix of the image. It follows the covariance matrix of the image is calculated by the coefficients of the wavelet transform with an empirically selected threshold value. For regions with a heterogeneous color, the wavelet-perturbation coefficients are partitioned into 2-10 clusters. Better breakdowns are determined by the value of the evaluation function, taking into account only large regions. The main disadvantage of the method [11] is its effectiveness for determining the contours of only large regions, the consumption of significant time for conducting wavelet image analysis.
Methods for determining the contours of color images [1,[5][6][7][8] provide for the preliminary conversion of a color image into a tonal one. After conversion, in the future, well-known methods for determining the contours of objects on tone images are used. Briefly consider the known methods for determining the contours of objects in tone images.

Computer Sciences
In [1], methods are proposed for determining the contours of objects in images based on the use of a two-dimensional differential scalar Laplace operator. The main disadvantages are the impossibility of determining the direction of the border, not highlighting, but only emphasizing the difference in brightness. This leads to breaks in the contours of objects.
In [2], gradient methods are proposed in which the full image gradient vector is calculated. The main disadvantages are the difficulty of solving the Bayesian problem, the need for a priori knowledge of conditional probabilities of gradient values.
In [6,7], heterogeneous methods of spatial differentiation are used (Sobel, Prewitt, Roberts, Wallace methods, sequential masking, etc.). The main disadvantages of the methods are the presence of gaps, points, and strokes forming an interfering background, the need to know the initial approximation to the desired boundary, and significant computational costs. The disadvantage of sequential masking methods [7] is the reduction in image contrast, image blur. The disadvantage of the Laplacian -Gausian (LoG) method [7] is the non-directionality of the Laplace and Gauss operators, which leads to the appearance of contour breaks.
In [8], the Canny boundary extraction method is used to determine the contours in an image. The Canny method provides a high probability of detection, high localization accuracy. The disadvantage of the Canny method is the destruction of boundaries at the connection points.
In [12], a method for determining closed loops in images based on a piecewise optimization strategy is proposed. The main disadvantage of the method [12] is the possibility of using it only for contours consisting of Bezier curves.
In [13], the active contour method is proposed. The disadvantages of the method are: high accuracy of the initial approximations, the presence of gaps, significant computational costs.
In [14], the use of neural networks is proposed to determine the contours. Neural networks are certainly suitable for determining the contours of objects in complexly structured color images, but require lengthy preliminary training.
In [15], the use of neural networks for mapping and land cadaster using images from the WorldView-2 system (DigitalGlobe, United States of America) was proposed. The methods proposed in [15] solve problems in rural areas. The application of the methods [15] to the determination of contours in complexly structured color images without a preliminary high-quality learning process is difficult.
Methods [16][17][18] are based on the fact that objects consist of geometric primitives (straight lines, circles, etc.). The work of such methods is based on the integral vector Radon transform [16] and the Hough transform [17]. These methods provide a qualitative definition of geometric primitives in images, for example, when revealing a power line in a forest area [17]. The use of the Radon and Hough transforms [18] is advisable only in the case of determining the geometric primitives of simple objects. It can be images of forests, agricultural fields, rivers, seas, oceans and the like. In conditions of complex structured images, the Radon and Hough transforms do not ensure the integrity of the contours of objects of interest, leading to the appearance of a large number of "garbage" objects. This significantly affects the quality of further decryption of images.
In [5], in the processing of medical tone images when determining geometric primitives, the well-known methods for determining contours and the Radon and Hough transforms are successively used. The results [5] make it possible to qualitatively determine the geometric primitive in medical images. More complex contours of objects in medical images, especially in bioinformatics systems, are destroyed.
Thus, the methods for determining the contours of objects in images have certain drawbacks, and their application to determining the contours of objects in complexly structured color images does not ensure the continuity of the contours of objects.
In [19], the use of evolutionary methods is proposed for segmenting medical images. The main attention in [19] is given to the genetic method of segmenting a medical image. The main drawback [19] is the use of the method only for segmenting simple objects on medical images. This is due to the strict binding to the conditions for the formation of the medical image and the information component, which is presented in the medical image.

Computer Sciences
In recent years, swarm methods for solving heterogeneous optimization problems have been rapidly developing. So, in [20], to find global extrema of complex functions (the function of a sphere, Rastrigin, Schwefel, and others), the method of artificial bee colony is used. The main advantages of the method are the non-susceptibility of looping at local optima; multiagency implementation; ability to adapt to environmental changes; the possibility of using for solving both discrete and continuous optimization problems.
In [21], the use of the ant colony optimization algorithm is proposed to solve the traveling salesman problem and heterogeneous transportation problems. The main advantages of the ant colony optimization algorithm are ensuring the continuity of the transport path, the possibility of efficient separation into parallel processes, adaptation, high speed, optimization of control, independence from unsuccessful initial solutions, primer search for the best solution in the solutions of all agents (ants).
The appearance of swarm methods does not go unnoticed by image processing specialists either. In [5], the use of swarm methods for segmenting tone images was proposed. The features of the ant method, the artificial bee colony method, the particle swarm method, and the like are considered. But the fact of using swarm methods in [5] is not investigated, but only postulated.
In [22], the well-known k-means method was proposed for segmenting a medical image. To select the optimal number of segments k and calculate the Euclidean distance between the segments, the use of the ant colony optimization algorithm is proposed. The sequence of operations of the ant colony optimization algorithm in general is given in [21]. In [22], in contrast to [21], an objective function is introduced that takes into account the features of calculating the Euclidean distance between segments, an optimization problem is formulated and solved, which consists in minimizing this distance. The results of [22] are applied to optimize the choice of k domains of the k-means method.
In [23], the application of the ant colony optimization algorithm to determine the contours of objects in tone images is presented. In [23], the objective function is introduced taking into account the peculiarities of the formation of an aerospace image. Applying the results of [23] to determining the contours of objects in complexly structured color images leads to a loss of the share of information and some decoding features of objects of interest. Also, the quality of determining the contours of objects of interest does not satisfy the requirements for the quality of problem solving.
To conduct further research in order to increase the accuracy of determining the contours, let's pose the problem of developing a method for determining the contours of objects of interest in complexly structured color images based on an ant colony optimization algorithm.

Materials and methods
It is known [21,23] that the ant colony optimization algorithm provides for the determination of the inextricable path of each agent (ant). The continuity of the path of agents along the contour of objects, in turn, will lead to the continuity of the contour of the object of interest in the image. By the method of determining the contours of objects of interest in complexly structured color images based on an ant colony optimization algorithm, let's mean the set of actions leading to the solution of the problem [24]. When developing a method for determining the contours of objects on complexly structured color images, let's take into account the color space of the image representation. The most difficult in terms of processing is the processing of color images presented in the Red-Green-Blue (RGB) color space [1,5,7,8]. So, for further study of the definition of the contours, let's carry out in each color channel of the color spaceRGB. It is known [1,5,7,8] that the quality of determining the contours of objects depends more on the brightness of the pixels in the picture and less on the hue and saturation. In this regard, in each color channel, it is advisable to highlight the brightness channel. In view of the above, the method for determining the contours of objects of interest in complexly structured color images based on the ant colony optimization algorithm, in accordance with the definition of the term "method" [24], can be represented in the following form (Fig. 1).  4. Determination of the contours of objects of interest by the method based on the ant colony optimization algorithm [22,23], obtaining images for each color channel: fs R (X), fs G (X), fs B (X) (where fs R (X), fs G (X), fs B (X) -an image with certain contours of objects of interest in the color channels Red, Green, Blue, respectively).
5. Return to the RGB color model (combining color channels). 6. Obtaining the resulting image fs(X). Thus, the novelty of the method for determining the contours of objects of interest in complexly structured color images based on the ant colony optimization algorithm, in contrast to the known ones, consists in: -highlighting color channels; -highlighting in each color channel of the brightness channel; -determination of the contours of objects of interest by the method based on the ant colony optimization algorithm; -reverse transition to the original color model (combination of color channels).

Experiments on processing conventional color images 1. Determination of the contours of objects on a typical complex structured color image by the method based on the ant colony optimization algorithm
As a typical output of a complex structured color image, let's use a color image from the on-board optical-electronic surveillance system based on the Ikonos spacecraft (GeoEye, USA) ( Fig. 2) [25]. This is the territory of the Donetsk airport in 2015. The image is presented in the RGB color space. Image size -(868×847) pixels.

Fig. 2. Initial color image [25]
Image Processing of complex structured color image for determining the contours of objects will be carried out by the method based on the ant colony optimization algorithm (Fig. 1).  Fig. 3 shows the images of the brightness channel of each color channel of the RGB color space of the original image (Fig. 2).
In the brightness channel of each color space, the ant colony optimization algorithm is used to determine the contours of objects. The ant colony optimization algorithm, taking into account the results of [21,23], is represented by the following sequence of actions.  , . , 3. Movement of agents. In the ant colony optimization algorithm in each iteration of the iterative process, m agents search for a solution and update pheromones along the found route. Each m-th agent starts the path from the starting point of the route, successively passes the turning points of the route selected by the method and ends the path at one of the end points of the route. The movement of agents is carried out according to the criterion of the minimum of the objective function (1), which, taking into account the quadruple connection of the movement of agents (5): ( ) ( ) 1, has the form (6): Let's believe that the attractiveness of the route ( ) m i L j section for the m-th agent at the i-th image point at the j-th iteration inversely depends on the length of the route segment, for example (7): where D 0 -a parameter that takes into account the image scale. At the beginning of the iterative process, the amount of pheromone in the sections of the route is taken equal to and equal to some small number F 0 . After each iteration, the concentration of pheromones in the areas selected by the agents is updated according to the rule (8): where [ ] 0, 1 ρ ∈ -the evaporation rate of pheromone; ∆ m i F -the concentration of the pheromone on the i-th section of the route is created by the passage of the m-th agent.
As a result of a certain number of iterations, the most attractive routes are determined by the chosen criterion, the concentration of pheromone on which is maximum. Pheromone gradually "evaporates" on unattractive routes, and unattractive routes disappear. At α=0, the agents at each step go to the nearest turning point of the route, and the ant colony optimization algorithm turns into the "greedy" method of the classical optimization theory. When β=0, only the effect of pheromones is taken into account will quickly lead to a suboptimal solution.
4. Verification of the fulfillment of the stopping condition. If the condition is met, then the original image with certain contours of the objects is obtained. Otherwise -the transition to the second paragraph.
Thus, in the ant colony optimization algorithm for determining the contours of objects, it is reduced to calculating the objective function, the totality of the areas of movement of agents, and the concentration of pheromone on the routes of movement of agents.
The method parameters are the same for the brightness channel of each color channel and are equal to: S=735,196 agents (the number of pixels in the picture), α=2; β=1; ρ=10 -3 ; F 0 =10 -2 . The number of iterations in each color channel is the same and equal to 50.
The return to the RGB color model is carried out by combining color channels using the well-known rules for mixing colors and the laws of mathematical logic [1].

Computer Sciences
The result of determining the contours in a typical complex structured color image using the ant colony optimization algorithm is shown in Fig. 4. Objects of interest are also identified in the resulting image (Fig. 4), for example, containers with oil or fuel for airplanes; airplanes that survived after striking; aircraft that have been damaged or destroyed and the like. Decryption of these objects of interest, recognition, thematic classification, and more is the subject of further research and remains outside the scope of this work. It should be noted that there is a large number of "garbage" objects in the resulting image (Fig. 4). This is a disadvantage of the developed method.

2. Assessment of the accuracy of determining the contours of objects
Let's conduct a comparative visual assessment of the accuracy of determining the contours of objects by the developed method and known methods. As well-known methods for determining the contours of objects, let's consider the Canny method [8], the k-means method (with different k values) [22,26], and the Random forest method [19,22]. Fig. 5 shows the results of determining the contours of objects by known methods (Canny, k-means (k=2, k=3), Random forest). From visual analysis of Fig. 5, a it is possible to state that the Canny method has significant gaps in the contours of objects. This is especially true for fuel tanks and small airport infrastructure. Visual analysis of Fig. 5, b, c indicates a low visual quality of determining the contours of objects using the k-means method. The Random forest method determines a large number of false paths (Fig. 5, d).

Computer Sciences
In well-known works [1,2,5,6,10], various quantitative indicators are used to evaluate the quality of image processing. Such indicators take into account the type of image, the presence or absence of a priori information about objects of interest, etc. and characterize the quality of image processing. To quantify the accuracy of determining the contours of objects of interest in practice, errors of the first and second kind are widely used [2,5,23,27]. Therefore, let's choose the errors of the first and second kind as indicators of the quality of determining the contours of objects in a typical complex structured color image.
Errors of the first (α 1 ) and second (β 2 ) kind are determined by the criterion of maximum likelihood, which follows from the generalized criterion of minimum average risk [2,5,23,27]. Errors in determining the first-kind contours α 1 and second-kind β 2 are calculated using expressions (9), (10), respectively [2,5,23,27]: where N 1 ( fs(X)) -the number of pixels in the background, erroneously assigned to the contours of objects in the image fs(X); N 2 ( f(X)) -the number of pixels in the background of the original image f(X); N 3 ( fs(X)) -the number of pixels correctly assigned to the contours of objects in the image fs(X); N 4 ( f(X)) -the number of points that belong to the contours of the objects in the original image f(X).
Calculations by expressions (9), (10) will be carried out under the same conditions, the same signal-to-noise ratio for the methods for determining the contours of objects by known methods. The well-known methods were the Canny methods, the k-means method (k=2), the k-means method (k=3), and the Random forest method. The sample size is equal to the number of pixels in the image. In this case, it is 735,196 pixels. The variability of observation is equal to the time of obtaining a color image. Calculated by the expressions (9), (10), the values of errors of the first and second kind for various methods are given in Table 1. Method for determining the contours of objects based on ant colony optimization algorithm 19 21 The calculations are carried out using a high-level programming language and an interactive environment for programming, numerical calculations and visualization of the results of MATLAB R2017b. Table 1 and Fig. 6 show a part of program code.
Analysis of data in Table 1 indicates a reduction in the errors of the first and second kind of edge detection in a typical complex structured color image using the developed method based on the ant colony optimization algorithm. Errors in determining the contours of objects are reduced on average by 5-13 %. Fig. 6. A fragment of the program code for calculating the data in Table 1

Discussion of results
The method for determining the contours of objects of interest in complexly structured color images based on the ant colony optimization algorithm, unlike the known ones, provides for the following (Fig. 1). Color channels are highlighted. In each color channel, a brightness channel is allocated. The contours of objects of interest are determined by the method based on the ant colony optimization algorithm. At the end, the transition back to the original color model (the combination of color channels) is carried out.
The contours of objects are determined on a typical complex structured color image (Fig. 2) by the method based on the ant colony optimization algorithm. In the resulting image (Fig. 4), objects of interest can be identified, for example, containers with oil or fuel for aircraft; airplanes that survived after striking; aircraft that have been damaged or destroyed and the like. Decryption of these objects of interest, recognition, thematic classification, and more is the subject of further research and remains outside the scope of this work. The presence of a large number of "garbage" objects on the resulting image (Fig. 4) is noted. This is a disadvantage of the developed method.
A visual comparison of the application of the developed method and the known methods for determining the contours of objects is carried out. It is established that the developed method improves the accuracy of determining the contours of objects. Errors of the first and second kind were chosen as quantitative indicators of the accuracy of determining the contours of objects in a close all clear all clc k0=2.5; n=1; src=single(imread([srcPath files(n).name]))/255; g0=rgb2gray(src); th=mean2(g0)+k0*std2(g0); bw0=g0>th; method={ 'ACO', 'k-means_2', k-means_3', Randon forest'}; typical complex structured color image. Errors of the first and second kind are determined by the criterion of maximum likelihood, which follows from the generalized criterion of minimum average risk (expressions (9), (10)). The errors of the first and second kind are estimated when determining the contours of objects in a typical complex structured color image using known methods and the developed method ( Table 1). The well-known methods are the Canny, k-means (k=2), k-means (k=3), Random forest methods. It is established that when using the developed method based on the ant colony optimization algorithm, the errors in determining the contours of objects are reduced on average by 5-13 %. When conducting further research, it is necessary to: -develop a method to reduce "garbage" objects; -conduct a comparative assessment of the quality of the developed methods with known using information quality indicators (for example, image entropy, Kullback-Leibler distance, etc.).

Conclusions
1. The method for determining the contours of objects in complex color images based on the ant colony optimization algorithm has been improved. Unlike the known methods, the method provides for: the allocation of color channels, in each color channel the allocation of the brightness channel, the determination of the contours of objects of interest by the method based on the ant colony optimization algorithm, the reverse transition to the original color model.
2. The determination of the contours of objects on a typical complex-structured color image by the method based on the ant colony optimization algorithm has been carried out. It is established that objects of interest can be determined on the resulting image. At the same time, the presence of a large number of "garbage" objects on the resulting image is noted. This is a disadvantage of the developed method.
3. A visual comparison of the application of the developed method and known methods for determining the contours of objects. It is established that the developed method improves the accuracy of determining the contours of objects. The errors of the first and second kind are estimated when determining the contours of objects in a typical complex structured color image using known methods and the developed method. It is established that when using the developed method based on the ant colony optimization algorithm, the errors in determining the contours of objects are reduced on average by 5-13 %.