Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 3, No. 3, 2022 70 Research on Clustering Methods for Color Image Segmentation Qingzhen Gong1, 2, * 1 School of Physics and Electronic Information Engineering, Jining Normal University, Ulanqab City, Inner Mongolia, 012000, China 2 Center for International Education, Philippine Christian University, Manila City, 1004 Metro Manila, Philippines * Corresponding Email: xunuo1314_2012@163.com Abstract: The research of image segmentation mainly includes: how to select the appropriate color space, reduce the complexity of segmentation algorithm, improve the noise resistance and universality of segmentation algorithm, etc. Fuzzy clustering is an unsupervised classification method, which can classify samples with similar properties without prior knowledge. This paper briefly describes the working principle and performance comparison of these algorithms. Keywords: Color image segmentation, Fuzzy clustering, Fuzzy C-Means, K-Means. 1. Introduction On clustering and segmentation is a basic step of image processing. The purpose of this operation is to separate different homogeneous areas in the image, so as to organize objects into groups (clusters) whose members have different common attributes (intensity, color, texture, etc.). Segmentation methods can be divided into two categories: Fuzzy C-Means and K-Means. Firstly, the algorithms of these two methods and their characteristics are introduced. Secondly, the difficulties and defects of Fuzzy C-Means algorithm in image segmentation are analyzed. Finally, we will implement these two algorithms through a series of examples of testing functions realized by MATLAB. 2. Algorithm Description Fuzzy C-Means is the most commonly used image segmentation method based on fuzzy theory and cluster analysis. It is a clustering method based on the idea of partition, which makes the samples belonging to the same area have the greatest similarity through partition, while the samples divided into different areas are the ones with the smallest similarity. 2.1. K-Means Means algorithm is Fuzzy C-Means. The main idea of this algorithm is to divide N samples xj(1,2...,n) into C groups Gi(i=1,2...,c), so as to minimize the objective function and obtain the cluster center ci of each group. Usually, the function d(xk,ci) is used to represent the dissimilarity between samples, and the objective function is defined as:      c i xk c i k ik cxdJiJ 1 G,1 ))(( i (1) When the value of the function d(xk,ci) is the Euclidean distance between the sample xk in group I and the cluster center ci of the category to which it belongs, the objective function can be expressed as:      c i xk c i k ik cxJiJ 1 G, 2 1 i )( (2) If ci is the nearest cluster center to the sample xj, then xj belongs to the i-th group. The divided group can be represented by a c×n two-dimensional membership matrix U. When the sample xj belongs to the i-th group, the element uij in U is 1, otherwise it takes 0, which can make the objective function J reach the minimum value. If the cluster center ci is determined, U is determined according to the following formula:     0 1 jiu else cxcxik kjij 22 ,  (3) Since each sample can only belong to one group, uij should satisfy the following two formulas: ,1 1   c i iju nj ,...,1 (4) nu c i n j ij   1 1 (5) If the membership matrix U is determined, then the cluster center ci of each group that minimizes the objective function J is the average value of the samples in the i-th group expressed by the following formula.    ik k i i Gxk x G c , 1 (6) Where |Gi| is the number of samples in Group I of the following formula.    n j iji uG 1 (7) 71 Means algorithm is to repeatedly iterate the above process, namely: Step1: Selecting c values from a sample space as initial clustering centers; Step 2: Calculate the membership matrix U by Formula 2- 3; Step 3: Find the objective function J from formula 2-2, and when its change is less than a certain threshold, the iteration ends; Step 4: Get a new cluster center from Formula 2-6, and go to Step 2. 2.2. Fuzzy C-Means Fuzzy C-Means algorithm divides n samples xj(1,2...,n) into c fuzzy groups Gi(i=1,2,...,c) to minimize the objective function and obtain the cluster center ci of each group. The difference between it and hard C partition is that the Fuzzy C- Means algorithm uses the value in the interval [0,1] to indicate the degree to which each sample belongs to a certain group, but the sum of a sample's membership degree to each group must be 1, as follows: njij c i u ,...,1,1 1    (8) The objective function is changed from Formula 2-2 to the following formula:     c i n j ij m ij c i i duJccUJ 1 1 2 1 21 ),...,,( (9) Where dij=||ci-xj|| is the Euclidean distance between the j-th sample xj and the i-th cluster center ci; The value of uij is in the interval [0,1]; The weighted index m=2 is usually taken. Find each cluster center ci and each element uij in the membership matrix U with the minimum value of the objective function J through the functions in the following construction formula.      n j c i ijjcnc uccUJccUJ 1 1 111 )1(),...,,(),...,,,...,,(       n j c i ijjij c i n j m ij udu 1 1 2 1 )1( (10) Where j (j=1...n) is n Lagrangian factors, and we find the conditions for varying the input parameters to obtain the minimum value of J, that is:     n j m ij n j j m ij i u xu c 1 1 (11)         c k m kj ij ij d d u 1 )1/(2 1 (12) Fuzzy C-Means algorithm steps are similar to K-Means. Step 1: Initializing the membership matrix U, and taking any value in the interval [0,1] for the elements in U, while meeting the requirements of 2-8; Step 2: Calculating the CI of each cluster center from 2 to 11; Step 3: Find the objective function J from 2-9, and when its change is less than a certain threshold, the iteration ends; Step 4: Get a new membership matrix U from 2-12, and go to step 2. 3. Algorithm Characteristics K-Means Advantages: K-Means algorithm is a classical algorithm to solve clustering problems, which is simple and fast; For large data sets, the algorithm is relatively scalable and efficient, because its complexity is about O(nkt), where n is the number of all objects, k is the number of clusters, and t is the number of iterations. Generally k