Thesis Research | Fast Automatic Fuzzy C-Means Clustering Algorithm for Color Image Segmentation

I shared a paper on the application of machine vision defect detection earlier, and today I want to share research on the field of image segmentation. Image segmentation is one of the most important research topics in computer vision and image understanding. This paper proposes a fast and automatic FCM color image segmentation algorithm. The proposed algorithm has low computational complexity, less running time, and higher segmentation accuracy. high.

1 Introduction

slightly.

 2 The proposed algorithm

The traditional FCM algorithm has high computational complexity and cannot automatically determine the number of clusters. This experimental group proposed a fast and automatic FCM color image segmentation algorithm. Firstly, the improved SLIC superpixel algorithm is used to pre-segment the image, and the FCM algorithm based on a single pixel is converted into an FCM algorithm based on a superpixel region, which reduces the computational complexity of the algorithm; secondly, the density peak algorithm is used to automatically determine the number of clusters and improve the algorithm performance. Flexibility; Finally, color image segmentation is done using histogram clustering. The overall framework of the proposed algorithm is shown in Figure 1.

 2.1 Improved superpixel algorithm

The traditional SLIC superpixel algorithm [14] is realized through multiple seed points, and some seed points may come from the same region, so the same region may be divided into multiple superpixel regions, resulting in over-segmentation. This study proposes a new region merging strategy, which is introduced after superpixel segmentation to eliminate the over-segmentation phenomenon. First, the original SLIC superpixel algorithm is used to pre-segment the image to generate superpixel regions. Second, the pixel mean and variance of each superpixel region and its neighbors are computed. Then, merge the area below the minimum number of pixels with its adjacent area (here, the minimum number of pixels is set to 10, and the area below the minimum number of pixels is considered to be a small superpixel area, which is very important for subsequent segmentation. The result has little effect, so it is merged with neighboring pixels), and the pixel mean and variance of the merged region are updated. The expression of the merger probability PA, B of the two areas is

In the formula: SA, B is the similarity measure of region A and region B; Λ A, B is the penalty function of region merging; μ A and μ B are the average values ​​of pixels of regions A and B; σ A and σ B are regions A and B The variance of B; Df is the dynamic range of image f (for example, the dynamic range of 8 bit image is 256); Q is the regular term; | ⋅ | is the number of elements contained; inv is the matrix inverse operation; multiplication operation. From formula (1), it can be seen that the adjacent regions with the smallest PA, B correspond to highly similar regions, and these regions should be merged first. Finally, iterate the above process repeatedly until PA, B ≤ η (η is the merging threshold) to complete the superpixel segmentation process. The merging threshold η is artificially set, and a large number of experimental results show that better segmentation results can be obtained when η = 3.5. Figure 2 shows the results of segmenting three color images using five superpixel algorithms. It can be seen from the figure that over-segmentation exists in the results of linear spectral clustering (LSC) [15], mean shift (Mean shift) [16], watershed transform (WT) [17] and MMGRWT [10]. The proposed improved superpixel algorithm can significantly suppress over-segmentation. [Figure 3(b), (c)] are the color space changes during the segmentation process of the proposed algorithm, [Figure 3(b)] is the color space of the original image, [Figure 3(c)] is the improved superpixel The color space after algorithm segmentation. It can be seen from the figure that the number of superpixel regions after pre-segmentation is much smaller than the number of original pixels, which greatly simplifies the subsequent segmentation process. It can be seen that the traditional single-pixel-based FCM algorithm is transformed into super-pixel-based FCM clustering through superpixel pre-segmentation, and the computational complexity is reduced from H × W × K × T to N × K × T, where H and W is the width and height of the image, K is the number of clusters, T is the number of iterations, and N is the number of superpixel regions, which achieves the purpose of reducing complexity.

 2.2 DP algorithm automatically determines the number of clusters

The DP algorithm can select the number of clusters according to the decision graph to realize automatic clustering, but the similarity matrix generated by this algorithm is huge, resulting in memory overflow and high computational cost. Through the improved superpixel algorithm, the pixels with the same feature in the original image are divided into the same superpixel area, so converting the original pixel-by-pixel based DP algorithm into the superpixel area based DP algorithm can effectively reduce the computational cost of the algorithm. The superpixel region-based DP algorithm assumes that a cluster center is usually denser than its surrounding points, and the distance between a cluster center and other denser cluster centers tends to be larger. According to the above superpixel algorithm and DP algorithm, the expression of local density ρI is

In the formula: I ≥ 1; J ≤ N; DIJ is the Euclidean distance between superpixel regions ∂I and ∂J; SJ is the number of pixels in the Jth superpixel region; dc is the cutoff distance. δI is the minimum distance between region ∂I and other denser regions:

 For the highest density superpixel region δI = maxJ ( DIJ ). In order to speed up the calculation, the expression of DIJ is

 In the formula: xp and xq are the pixel values ​​of points p and q. Finally, the decision map is the product of the local density and the minimum distance:

The number of clusters is automatically determined by the distance between points in the decision graph, and the automatic determination of the number of clusters is realized. [Fig. 3(f)] is a decision diagram generated using DP algorithm , which can automatically determine the number of clusters.

2.3 Objective function

In order to reduce the computational complexity of the FCM algorithm and realize the automatic determination of the number of clusters, the objective function of the proposed fast and automatic fuzzy C-means clustering color image segmentation algorithm is

In the formula: l is the color level, 1 ≤ l ≤ q, q is the number of brightness levels of pixels; K is the number of clusters; Sl is the number of pixels in the lth superpixel region Rl; uli is the lth superpixel The region belongs to the membership degree of the i-th cluster; m is the ambiguity factor, which is generally set to 2; xp is the pixel value of the superpixel area; ci is the cluster center of the i-th cluster. Since l ≪ N, the computational complexity of the proposed algorithm is significantly reduced. ci and uli can be obtained by Lagrange multiplier method:

Update ci and uli through formula (9) and formula (10), output the membership degree matrix, and assign each pixel to the cluster with the largest membership degree to complete the image segmentation. The specific steps of the proposed algorithm are as follows:

1) Set parameters, including the number of superpixels K, the fuzzy membership factor m, the iteration error ε and the maximum number of iterations T;

2) Use equations (1)~(3) to calculate the superpixel image and obtain the superpixel area of ​​the image;

3) Use equations (4)~(6) to generate a decision diagram and determine the number of clusters;

4) Initialize the membership matrix uli;

5) Use formula (9) to calculate the cluster center ci;

6) Use formula (10) to calculate the membership degree matrix u;

7) Use formula (8) to calculate the objective function Jm;

8) Judging whether | J am - J a - 1 m |≤ ε is true, if yes, execute step 9), otherwise return to step 4);

9) Return the degree of membership, and assign all pixels to the cluster with the largest degree of membership to complete the segmentation.

3 Experimental results and analysis

In order to verify the performance of the algorithm, the color images of BSDS500[18], AID[19] and MSRC[20] databases are selected as test images, and the results are compared with FCM[5], SFFCM[10], FCM_SICM[11] and AFCF[ 12] For comparison, the performance indicators are Segmentation Accuracy (SA), Fuzzy Segmentation Coefficient (VPC), Fuzzy Segmentation Entropy (VPE), visual effect and running time.

In the formula: Ai is the pixel set of the i-th cluster in the segmentation result; Ci is the pixel set of the i-th cluster in the reference image. The larger the SA, the better the segmentation performance. The expressions of fuzzy segmentation coefficient and fuzzy segmentation entropy are

 The larger the VPC, the better the segmentation effect, and the smaller the VPE, the better the segmentation effect.

3.1 Results of color image segmentation

The experimental results of different color images are shown in Figure 4 and Figure 5, and the average segmentation performance index of color images in BSDS500 is shown in Table 1.

When segmenting the #124084 image, the worst segmentation performance is the FCM algorithm and the FCM_SICM algorithm. The FCM algorithm mis-segments the background pixels into the target pixels, resulting in false segmentation, while the FCM_SICM algorithm excessively blurs the target pixels, making the segmentation results Blurred edges and blurred objects. In the #145086 image, the SFFCM algorithm mistakenly segmented the background sky and white clouds into one category, resulting in poor visual effects. Also, when segmenting the #28083 image, FCM_SICM mis-segregated green areas and hills into one class, resulting in spurious segmentations. Special attention is that when FCM_SICM segment #48017, the segmentation result is a completely black image. The reason is that the FCM_SICM algorithm is mainly designed for noisy images. The most important point of this algorithm is to properly blur the image during the clustering process, so that The impact of noise on the clustering results is suppressed, and the segmentation performance is significantly reduced when the image is less polluted by noise or not polluted by noise. The proposed algorithm uses the superpixel algorithm to reduce the computational complexity of FCM, and uses the DP algorithm to generate a decision map to automatically determine the number of clusters. The superpixel algorithm can smooth the texture details and retain the structure information of the target, so the proposed algorithm has better segmentation performance.

Table 1 shows the average performance index of five algorithms when segmenting the test image of BSDS500 database. It can be seen from Table 1 that the proposed algorithm is superior to several other algorithms in terms of SA, VPC and VPE, indicating that the performance of the proposed algorithm is better; and in terms of running time, the original FCM algorithm has less running time. The main reason is that other FCM variant algorithms introduce other enhanced operations on the basis of the original FCM, so the running time is longer. It is worth noting that the running time of the SFFCM algorithm is less than the original FCM. The main reason for this result is SFFCM The algorithm not only uses the superpixel algorithm to reduce the complexity of the algorithm, but also converts pixel-based clustering into histogram-based clustering, so the running time is less than the original FCM algorithm. The segmentation results of the remote sensing image of AID database and the color image of MSRC database using the proposed algorithm are shown in Figure 5. It can be seen from the figure that the proposed algorithm has better segmentation results for different types of color images. Therefore, at the application level, the proposed algorithm can better segment remote sensing images with simple targets and color images with sharp contrast. In recent years, the deep learning algorithm has been widely used, and the proposed algorithm is simpler and more efficient, and has lower requirements for hardware.

3.2 Computational complexity analysis

 

Computational complexity is an important indicator for evaluating algorithm performance. However, due to different programming ideas, it is difficult to obtain accurate computational complexity. Therefore, this study evaluates the performance of various algorithms by comparing the time complexity of the objective function of clustering algorithms. The time complexity of the five algorithms is shown in Table 2, where H and W are the width and height of the original image, N is the number of superpixel regions, K is the number of clusters, T is the number of iterations, TM and TW are the MMGRWT calculation steps. It can be seen from Table 5 that the SFFCM with the highest computational complexity has a complexity of O (n5), while the proposed algorithm has a complexity of only O (n3) due to the introduction of the superpixel simplification algorithm.

4 Conclusion

A fast and automatic FCM color image segmentation algorithm is proposed. Aiming at the high computational complexity of the original FCM algorithm, a fast FCM algorithm based on superpixel pre-segmentation is proposed, which converts the traditional FCM algorithm based on a single pixel into an FCM algorithm based on superpixel regions, which reduces the computational complexity. The improved DP algorithm realizes the automatic determination of the number of clusters and improves the flexibility of the algorithm. Finally, the image segmentation is completed through the FCM clustering based on histogram. Experimental results of different types of color image segmentation show that compared with FCM algorithm, SFFCM algorithm, FCM_SICM algorithm and AFCF algorithm, the proposed algorithm has lower computational complexity, less running time and higher segmentation accuracy. However, the proposed algorithm is less robust to noise, and how to improve the anti-noise performance of the algorithm will be the research goal of the next stage.

5 References

slightly.

Interested students can go to Zhiwang to download this paper.


Article source: Wang Chao1*, Wang Yongshun1, Di Fan2. Fast automatic fuzzy C-means clustering color image segmentation algorithm[J]. Advances in Laser and Optoelectronics, 2022,59(22) 


Guess you like

Origin blog.csdn.net/Bella_zhang0701/article/details/128099699