Volume 2023, Issue 1 1039870
Research Article
Open Access

A Double Clustering Approach for Color Image Segmentation

Asma Khazaal Abdulsahib

Corresponding Author

Asma Khazaal Abdulsahib

University of Baghdad, College of Education for Human Science Ibn Rushd, Baghdad, Iraq uobaghdad.edu.iq

Search for more papers by this author
Siti Sakira Kamaruddin

Siti Sakira Kamaruddin

School of Computing, Universiti Utara Malaysia, 06010 UUM Sintok, Malaysia uum.edu.my

Search for more papers by this author
Mustafa Musa Jabar

Mustafa Musa Jabar

Department of Medical Instruments Engineering Techniques, Al-Turath University College, Baghdad 10021, Iraq turath.edu.iq

Department of Medical Instruments Engineering Techniques, Al-Farahidi University, Baghdad 10021, Iraq uoalfarahidi.edu.iq

Search for more papers by this author
First published: 17 April 2023
Academic Editor: Kalidoss Rajakani

Abstract

One of the significant stages in computer vision is image segmentation which is fundamental for different applications, for example, robot control and military target recognition, as well as image analysis of remote sensing applications. Studies have dealt with the process of improving the classification of all types of data, whether text or audio or images, one of the latest studies in which researchers have worked to build a simple, effective, and high-accuracy model capable of classifying emotions from speech data, while several studies dealt with improving textual grouping. In this study, we seek to improve the classification of image division using a novel approach depending on two methods used to segment the images. The first method used the minimum distance, and the second method used the clustering algorithm called DBSCAN. Both methods were tested with and without reclustering using the self-organizing map (SOM). The result from comparing the images after segmenting them and comparing the time taken to implement the segmentation process shows the effectiveness of these methods when used with SOM.

1. Introduction

Image segmentation is significant processes in modern computer vision. This includes partitioning the picture into specific parts [1, 2]. It is the mechanism through which a computation converts the definition of the original image, for example, an array of grey levels, into segments with uniform and homogenous attributes. The structural units (“objects”) in the scene would conform to these. This research is aimed at getting an anonymous image segmentation to get image components without human intervention; this may be useful in many applications, including in robots, military objectives, and image analysis, in remote sensing applications [3]. Studies have dealt with the process of improving the classification of all types of data, whether text or audio; for example, researchers worked on building a simple, effective, and high-accuracy model capable of classifying emotions from speech data. In this paper, the segmentation is applied utilizing the DBSCAN algorithm and minimum distance with and without SOM. Segmentation with SOM is done through many stages. In the first stage, initialization and reading of images are done as well as type identification and normalization. In the second stage, SOM is implemented at the resultant image to extract its fundamental colors. In the last stage, image segmentation is accomplished via a clustering technique with the use of the DBSCAN algorithm and minimal distance. Segmentation is executed employing the following steps:
  • (1)

    Image is segmented into two sections utilizing two cluster centers

  • (2)

    Calculation of a recommended quality factor to test segmentation quality for that range of clusters

  • (3)

    Increment number of clusters by one, compute another quality factor, and contrast it with the past segmentation quality factor. Emphasize this until the quality factor degrades and think about the past category as the correct one

  • (4)

    When the right cluster centers are fixed, a new image is created by substituting image pixels with the cluster center value that is closest to the pixel value and then exhibiting and storing the new image

And previous studies dealt with this issue, for example, in [4]. The researchers on this paper provide a comparison among DBSCAN and mean shift. Considering images as a dataset of pixels the researchers, first of all, dispose of salt and pepper noise from images through the use the median filtering approach observed by making use of the DBSCAN set of rules to cluster it. Next, the implementation of the mean shift set of rules is visibly observed through the comparison of each the outputs. Density-based clustering algorithms are used to discover spatial connectivity and color similarity of the pixels that is used to find out clusters of arbitrary form main to the partitioning of pixels and similarly keeping apart the noise points. Experimental consequences, the use of proposed approach, show encouraging performance.

In [5], it was proposed picture segmentation approach with “50 frames” with the aid of using the density-based spatial clustering of packages with noise (“DBSCAN”). To lower the computational operations, the experimental consequences reveal that real-time superpixel algorithm (50 frames/s) with the aid of using the DBSCAN clustering outperforms the present superpixel segmentation strategies in efficiency and accuracy. The authors in [6] present DSets-DBSCAN as a parameter-free clustering set of rules based on the mixture of the dominant unit set of algorithm and DBSCAN. This DSets-DBSCAN set of rules is proven to be powerful in each statistics clustering and image segmentation experiments. In experiments turned into proven, the DSets-DBSCAN algorithm may be used as a powerful image segmentation approach. Additionally, the word, during natural image segmentation, does not yield a unique, accurate result. In [7], the researchers present the investigations that conveyed image processing technologies in paddy area and propose the design of the framework for recognizing the beginning phase of the leaf illnesses and finding the weed species. The proposed framework reduces the danger of sicknesses from turning out to be more terrible which may limit the paddy yields.

2. The Self-Organizing Map (SOM)

The network of the self-organizing map also called the “Kohonen” network cluster units [8] is arranged in a single- or two-dimensional matrix that have input signals consisting of several units. In other words, the geometric structure between units is taken into account. Each entry will be entirely linked to cluster units, which respond otherwise to the input pattern. The Kohonen map is the size of map that produces the quantity of rivalry neuron. The quantity of rivalry neurons affects the clustering result.

The cluster unit with the least distance during the self-regulating phase is the one whose weight vector approximates the input sample more than the representation vector see equation (1)). Input match node is selected as the winner as shown in Figure 1 [9]. This winning unit and its vicinity (the units around it) occur in the manner where their weights are adjacent to the provided input (note equation (2)). That factor adopted modernization is different for all cells. But it is higher in the nearer unit and decreases in the most distant units.
()
where x is the input vector, Wc is the weight of winning unit, Wi is the vector weights, and t is the time.
Details are in the caption following the image
Neighborhood around the winning unit.
Weights occur over time, the acquired factor should be reduced, and the neighborhood should decrease in size. The convergence of characteristics refers to the main image characteristics that tend to be organized by geometric distribution in the grid. The convergence of these characteristics in the self-regulation map takes into account several disadvantages on the acquired factor during the revision of the weights which is done according to the following equation:
()
where α is the acquired linear function and N is the neighborhood.

The adopted function is linear, with the highest values in the winning unit [10] and the lowest at the boundary of the circular region, note the shape.

The radius of the neighborhood and the acquired function both decrease in magnitude over time. This is accomplished by multiplying the radius and coefficients of the obtained function by two reduction factors, to lower their values. Both values are in the range of 0% to 100%. 100% means total decay, and 0% means no reduction. A small amount of reduction is usually required to achieve the SOM space convergence [4]. The Euclidean distance of adjacent areas is calculated using following formula:
()
where n is the number of array elements and Dist is the distance Euclidean.

3. Methodology

Segmentation methods are described in this section. In the preprocessing stage, the true color image is verified as well as performing the normalization of the color of the images. After that, the image is segmented using DBSCAN algorithms and minimum distance. Figure 2 shows the proposed method in this study.

Details are in the caption following the image
Image segmentation procedure.

3.1. Preprocessing Stage

Segmentation is one of the most important stages in computer vision systems. It is important in a lot of computer vision and image processing applications. The image segmentation is aimed at creating representative areas (objects) or important parts of objects in the image. By categorizing image points (Pixels) with similar color values in areas that represent these items. Segmentation image into areas identical to the important objects in the image is longer; it is necessary before any processing falls at a level higher than the point level (pixel) [4].

Before going into talking about segmentation methods, we must address some of the problems in the image segmentation process. The main problem is the noise generated in the image when converting the image from analog to digital image, noise caused by the camera, lens, lighting, or otherwise. Its effect can be minimized by using a preprocessor configuration method. The lighting effect is removed in this study by first normalizing the picture colors to acquire the image’s natural colors without the lighting effect and then using a neural network to remove noise and emphasize the image’s key colors. The clustering method, a method of segmenting the image into groups, was used in this research where the cluster method can handle distorted and indistinguishable image boundaries of things inside the image. The elements of these groups have a degree of similarity and a degree of contrast with other groups [11].

The concept of unsupervised learning and clustering looks for information drawn from random samples, and the general method of clustering defines some similarity measures between two clusters in addition to the general scale such as the sum of the square of errors or the amount of scatter matrix. It should be noted here that when we process data, we deal with random samples of these data; these samples can form clusters of points (pixels) in multidimensional space if we know that these samples came from a single normal distribution; the most important two samples are the mean and covariance matrix, and the sample rate determines the center of gravity in a given group of points, and the center of gravity is a phrase [12]. For a single point, it is the best representation of data within a concept (the least sum of square spaces from the center of gravity to other samples) while the contrast matrix sample describes the amount of dispersion on various directions. The algorithm used for clustering in this research is DBSCAN.

The process of segmentation includes many steps; the first step is to read images. When the images are read and the image is confirmed as a true color image, then the colors of the incoming image are treated as a primary configuration before they enter the SOM. We normalize these colors using the following equations to reduce the lighting effect on the colors of the image.
()
where r, g, and b denote the color values that have been tweaked (R, G, and B), respectively.
The second step introduces samples of the colors of this image into the self-organization map. A dynamic strategy dependent on SOM is utilized to consequently locate the number of ideal clusters [13]. Before starting the implementation of the neural network, the parameters of this network must be configured, as follows: the grid weights are in dimensions (64   64), each of which is related to three weights corresponding to the three image color (RGB) components. Weights are initialized with small random values within the range (0-1). After that, the radius of the neighborhood is determined in which the weights are updated, and we gave the value (32) for the radius of the neighborhood, and this was done experimentally as other values were tested with the rest of the parameters fixed, and we obtained the best results at this value. The self-organizing map algorithm is implemented as follows:
  • (1)

    For the linear function (α) at the winning unit (0.3) and perimeter of the circular neighborhood region (0.05), these values also came as a result of the experiment to get the best outcomes. As for the reduction factor for the radius of the neighborhood area (0.001%) and the linear acquired function, set it as 0.001%, and these values also came as a result of the experiment to get the best performance and a balance between the accuracy of the results and the speed of implementation, while giving priority to the accuracy of the results

  • (2)

    If the radius value is more than or equal to 10, we perform steps 3-7

  • (3)

    Calculate the distance between weights and input samples by adopting equation (3)

  • (4)

    Find the winning unit and determine its location by adopting equation (1)

  • (5)

    Update the weights within the neighborhood by adopting equation (2)

  • (6)

    Finally, reduce the value of the linear function gained by the reduction factor (0.001)

  • (7)

    Reduce the radius of the neighborhood by the reduction factor specified in step (1)

So using a self-organizing maps into both approaches to distinguish images includes the following steps:
  • (1)

    Define the architecture of a neural network

  • (2)

    Configure learning parameters

  • (3)

    Initialize the weight matrix and then perform the adjustment for this matrix

  • (4)

    Image formatting and adjustment

  • (5)

    Convert images into grid input vectors

3.2. Clustering Algorithms

After completing the training of the neural network, the final weights are the outputs from the neural network. It enters the clustering process that begins with two cluster centers. The determination of cluster centers before starting the cluster is by adopting the following steps: we take the smallest color value and consider it the value of the first position [14]. We take the largest color value and consider it the value of the last position. The rest of the centers take the values between the smallest and the largest with regular repetition. Using one of the two methods that will be mentioned later, the cluster is built on the centers of cluster specified in the previous step.

3.2.1. Minimum Distance

The minimum distance method receives predefined cluster centers. For each point of the image (pixel) matrix weights, repeat steps 3-4 explained in Section 3.1 [15]. Find the difference between the current point value (pixel) and the cluster centers. The point (pixel) is attached to the smallest cluster centers (the minimum distance). Recalculate the rate for the clusters (to determine the color of the clusters).

3.2.2. DBSCAN Algorithm

DBSCAN is presented by Ester et al. and Roma et al. [15, 16] and relies on the conception of clusters based on density. Data points that are dense are grouped into a cluster. Therefore, high-density regions denote the existence of cluster, and as a contrast, low-density regions denote outliers or noise [1719]. DBSCAN algorithm involves the following three parameters:
  • (1)

    “K”: the neighbor list size

  • (2)

    “Eps”: the radius that delimits the neighborhood vicinity of a point (Eps-neighborhood)

  • (3)

    “MinPts”: the minimum number of points that must be present in the Eps-neighborhood

Classification of data points is the basis of the process of clustering using DBSCAN and on the application of the density relations between points (density-reachable, density-associated, and straightforwardly density reachable) with the structure of the clusters [20]. The work of the algorithm can be summed up in the following steps:
  • (1)

    Receive the predetermined cluster centers

  • (2)

    As long as the current cluster centers are not equal to the previous ones, the steps are repeated from 3 to 6

  • (3)

    For each image point (weight matrix), repeat steps 4 and 5

  • (4)

    Find the difference between the current value and the cluster center

  • (5)

    The point is added to the smallest cluster center (the closest distance)

  • (6)

    Recalculate the average for the clusters

4. Results and Discussion

In this research, the results are compared when using the minimum distance algorithm, with and without SOM. Likewise, in the case of using the DBSCAN algorithm, the comparison is done on with and without SOM. It can be observed from Figures 3(a)3(c) that the original image has five colors, but after applying the minimum distance with the self-organizing network (SOM), we see that it has been classified into three colors and is closer to the original image, whereas when using the minimum distance without the self-organizing network (SOM), it has been classified into two colors. Only two colors are black and yellow, implying that the color yellow has been split from the black color due to a significant difference, and the yellow color is regarded an independent item, resulting in a tangled and hazy appearance.

Details are in the caption following the image
Figure 3 (a) Input images
(a–c) Segmentation images using minimum distance with and without SOM.
Details are in the caption following the image
Figure 3 (b) Segmentation using minimum distance
(a–c) Segmentation images using minimum distance with and without SOM.
Details are in the caption following the image
Figure 3 (c) Segmentation using minimum dis. with SOM
(a–c) Segmentation images using minimum distance with and without SOM.

As for Figures 4(a)4(c), when the clustering algorithm is implemented in using the self-organizing network (SOM), it can be seen that it was classified into its original colors very close to the original image. This rating is better than the previous ones. From this comparison, it is clear that the use of the two algorithms, which is the minimum distance and DBSCAN, gives better results in the presence of the self-organizing network (SOM).

Details are in the caption following the image
Figure 4 (a) Input images
(a–c) Segmentation images using DBSCAN with SOM.
Details are in the caption following the image
Figure 4 (b) Clustering using DBSCAN without SOM
(a–c) Segmentation images using DBSCAN with SOM.
Details are in the caption following the image
Figure 4 (c) Clustering using DBSCAN with SOM
(a–c) Segmentation images using DBSCAN with SOM.

If we discuss the use of this algorithm in terms of the time required to implement each algorithm, it becomes evident that the use of the SOM with both algorithms that were used in this study is that the time is less and this increases the efficiency of the proposed algorithm [21] as shown in Table 1, where it shows the run time in seconds using minimum distance alone and with SOM and DBSCAN with and without SOM.

Table 1. Run time in seconds.
Images DBSCAN DBSCAN with SOM Minimum distance Minimum distance with SOM
3-B 0.489
3-C 0.370
4-B 0.332
4-C 0.215

According to the run time presented in Table 1, utilizing the two algorithms (DBSCAN and minimum distance) with SOM reduces the time spent for each operation, and DBSCAN is better than minimum distance [2225], as shown in Figure 5.

Details are in the caption following the image
The time required for each algorithm.
To ensure the quality of the results, the quality factor scale that is normalization correlation coefficient (NCC) is used. NCC is used to measure the strength and direction of the relationship between two groups, meaning that it measures the relationship between the original image and the resulting image, and the value indicates the direction of the link (direct or reverse correlation). In other words, there is a convergence or gap between the two images, with a result in the [-1,1] range. The outcome is better whenever the value is near to 1, which is the connection between the two pictures, and vice versa. Note the findings in Table 2 if the result is near to -1, indicating that there is no convergence and an inverse connection between the two pictures. The correlation coefficient equation is
()
where p(x, y) represents the true image, while p − (x, y) represents the output image.
Table 2. The results of the NCC score between the original and output images, after applying the proposed algorithms.
Methods 3-B 3-C 4-B 4-C
DBSCAN 0.796
DBSCAN with SOM 0.902
Minimum distance 0.749
M.D with SOM 0.825
Table 2 shows that the algorithms presented using SOM are better than traditional approaches when the quality factor (NCC) is applied, with results near to 1, implying that the pictures created using SOM are more accurate than the original image. To indicate the quality of the collected images, mean square error (MSE) is used which represents the process of comparing the results obtained separately with the original pictures. MSE is mathematically the most common measure, which finds the difference between the points of two images before and after processing. According to equation (6), the smaller the MSE scale result, the closer the image is to the real image. The equation of MSE is
()
where “n” and “m” represent the images after processing and the original images, respectively, and “er” represents the error rate.

It is noted from the results of Table 3 that the NCC score corresponds to the MSE score. This means that the proposed algorithms give results closer to the original image.

Table 3. The MSE score using algorithms DBSCAN and minimum distance with and without SOM.
Methods 3-B 3-C 4-B 4-C
DBSCAN 45.712
DBSCAN with SOM 40.462
Minimum distance 22.612
M.D with SOM 21.805

5. Conclusion

In this research, a specific number of images were segmented using two methods, the first method is the minimum distance, and the second method is the clustering of images using the DBSCAN. After that, the images were segmented with the two methods but using the self-organizing network (SOM) for each method. The results showed by comparing the images before they were segmented and after they were segmented using the mentioned methods that using the self-organizing network with the algorithms gives better results in terms of accuracy and time, where the time used in the process of segmentation images using the self-organizing network (SOM) is less in the case of segmentation without using the SOM.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This study was self-financed.

    Data Availability

    The data is available at https://www.kaggle.com/datasets/.

      The full text of this article hosted at iucr.org is unavailable due to technical difficulties.