# Robust FCM Algorithm with Local and Gray Information for Image Segmentation

Authors: Hanane Barrah; Abdeljabbar Cherkaoui; Driss Sarsri
Journal: Advances in Fuzzy Systems
 (2016)

---

## Abstract

The FCM (fuzzyc-mean) algorithm has been extended and modified in many ways in order to solve the image segmentation problem. However, almost all the extensions require the adjustment of at least one parameter that depends on the image itself. To overcome this problem and provide a robust fuzzy clustering algorithm that is fully free of the empirical parameters and noise type-independent, we propose a new factor that includes the local spatial and the gray level information. Actually, this work provides three extensions of the FCM algorithm that proved their efficiency on synthetic and real images.


---

## Body

## 1. Introduction

Clustering unlabeled data into the most homogeneous groups is a problem that has received extensive attention in many application domains [1–3]. Thus, several clustering methods have been developed. The hard (or crisp), probabilistic, and possibilistic c-means [4] are the well-known partitioning methods that have been extended to many different versions based on the data type and the application purpose. The probabilistic or fuzzy c-means (FCM) is always used to generate fuzzy partitions and, thus, it is widely useful to segment images [2, 5] where the fuzzy data is redundant. In fact, Abdel-Maksoud et al. [6] used the fuzzy c-means algorithm combined with its hard version k-means to extract brain tumors from MRI (Magnetic Resonance Imaging) images. In order to detect targets from radar images, Gupta [3] extended the fuzzy c-means to the fuzzy Gustafson-Kessel algorithm that uses the Mahalanobis distance instead of the Euclidean one. In addition to target detection, the proposed fuzzy Gustafson-Kessel algorithm proved its ability to clutter rejection.Even though the standard FCM algorithm has demonstrated its accuracy in segmenting different kinds of images, it is still inefficient in the presence of noise, where its performance gradually decreases as the image noise increases. This problem is due to the lack of spatial information. To enhance the robustness and the efficiency of the standard FCM algorithm and make it strong enough in the presence of noise, lots of researchers have modified it in different ways; some have modified the objective function, while the others have used different distance metrics. In fact, Pham [7] proposed a Robust Fuzzy C-Means (RFCM) algorithm based on a generalized objective function that includes a spatial penalty on the membership function. Despite its strength in handling noisy pixels, the RFCM algorithm still suffers from many problems. First of all, the penalty term has to be computed in each iteration, which increases the computational burden. Second, the algorithm depends on a crucial parameter β that requires being selected properly in order to achieve the optimal result. Third, the spatial constraint causes a smoothing effect which can remove some fine details.To deal with the intensity inhomogeneity in MRI images, Ahmed et al. [8] also modified the objective function of the standard FCM by including a neighborhood term that biases the labeling of a pixel by the labels of its immediate neighboring pixels. The proposed algorithm (always referred to by FCM_S) outperformed the FCM and demonstrated its usefulness in coping with “Salt and Pepper” noise. However, the FCM_S suffers from the same problems as the RFCM algorithm. In fact, the clustering accuracy depends on the selection of the parameter α that controls the tradeoff between noise elimination and detail preservation; the spatial information causes the blurring of some fine details and computing the neighborhood term in each iteration requires the algorithm to be highly consumer in the running times point of view. To overcome this latter drawback, the FCM_S has been extended to three algorithms: The EnFCM (Enhanced FCM), FCM_S1, and FCM_S2. The first extension EnFCM was proposed by Szilágyi et al. [9] to reduce the required calculations by introducing a new factor γ∈0.51.2. This algorithm consists first of computing a linearly weighted sum image and then clustering it based on the gray level histogram rather than the image pixels. The segmentation quality of this algorithm is comparable to FCM_S, although the EnFCM performs quicker than its ancestors. With the same aim of making the FCM_S fast enough, Chen and Zhang [10] proposed the FCM_S1 and FCM_S2 that calculate the neighborhood term based on the mean filtered and median filtered images, respectively. As the filtered image has to be computed once and before the clustering process, the computations needed to compute the neighborhood term are drastically reduced. In fact, the authors demonstrated the effectiveness of their algorithms in artificial and real-world datasets. In [11], the authors have improved the speed of the FCM_S1 and FCM_S2 by introducing a new parameter that balances between the fastness of the hard clustering and the good quality of the fuzzy clustering. Even though the proposed algorithms have proved their fastness over the FCM_S1 and FCM_S2, they are more parameter-dependent.By combining the main ideas of FCM_S1, FCM_S2, and EnFCM and incorporating the local spatial and the gray information together, Cai et al. [12] came up with a set of Fast Generalized Fuzzy C-Means (FGFCM) clustering algorithms. The authors proved the superiority of the FGFCM over all the aforementioned algorithms, where it overcomes the majority of their drawbacks such as controlling the tradeoff between noise-immunity and detail preserving and removing the empirically adjusted parameter α, although it requires the adjustment of a new parameter λg to achieve better result.In the same context of improving the standard FCM by including the spatial information, Chuang et al. [13] proposed a fuzzy c-means algorithm that integrates the spatial information in a different way. Indeed, the authors introduced a new spatial function that is used to force the membership value of each pixel to be influenced by the membership values of its immediate neighborhood. Despite its robustness to noise and its ability to reduce the spurious blobs, this algorithm (noted by sFCMp,q) still suffers from a major drawback where achieving the optimal segmentation requires the adjustment of two parameters p and q.To improve the robustness to noise of the FCM_S andsFCMp,q, Zheng et al. [14] combined their main ideas. Thus, the authors used a modified version of the spatial function proposed for sFCMp,q to minimize an objective function that is slightly different from the FCM_S’s. The resulting algorithm surpasses all the aforementioned algorithms, but it is more parameter-dependent.In order to deal with noise in MRI images, Ji et al. [15] proposed a Robust Spatially Constrained Fuzzy C-Means (RSCFCM) algorithm that is based on a spatial factor that works as a linear filter for smoothing and restoring noisy images. The RSCFCM algorithm minimizes a fuzzy objective function that integrates the bias field estimation, which makes it effective for intensity inhomogeneity. By testing this algorithm on synthetic and clinical images, the authors realized its better segmentation accuracy over several state-of-the-art algorithms. Nevertheless, the RSCFCM algorithm requires the adjustment of a parameter β.So far, all the aforementioned extensions of the standard FCM have succeeded to different extents in dealing with noise. However, they all share the major drawback of adjusting empirical parameters (α, β, γ, λg, p, q, and h). In case of the FCM_S and its two variants FCM_S1 and FCM_S2, the parameter α controls the tradeoff between noise elimination and detail preservation. In fact, α has to be chosen large enough to remove noise and small enough to preserve fine details. Thus, the selection of this parameter is strongly dependent on the type and the level of noise. As the type and the level of noise are always a priori unknown, choosing the proper value of α remains a very difficult task, where it is always determined using trial-and-error experiments. To overcome this latter problem, this work proposes replacing the parameter α with a new factor S that includes the local spatial and the gray level information. Actually, we propose three Robust FCM algorithms: RFCMLGI (Robust FCM with Local and Gray Information), RFCMLGI_1, and RFCMLGI_2, which are direct extensions of the FCM_S, FCM_S1, and FCM_S2, respectively [10]. The proposed algorithms use the local spatial and the gray level information together to calculate the weight of the neighborhood term; the main idea here is to amplify this weight for noisy pixels and minimize it for nonnoisy ones.In addition to the inherited advantages from FCM_S, FCM_S1, and FCM_S2, the proposed algorithms come up with valuable ones. At first, they are all fully free of the empirical parameters. Second, they control the tradeoff between noise elimination and detail preservation automatically. Third, the RFCMLGI algorithm is noise type-independent. Finally, all the algorithms are easy to be implemented, because the new factorS is proposed in a way to be easily and rapidly computed.


## 2. Material and Methods

The fuzzy clustering is always defined as the process of grouping, with uncertainty, unlabeled data into the most homogeneous groups or clusters as much as possible [16–18], such that the data within the same cluster are the most similar, and data from different clusters are the most dissimilar. It is an unsupervised classification, because it does not have any previous knowledge about the data structure.


### 2.1. Standard FuzzyC-Means Algorithm: FCM

The fuzzyc-means or the FCM is the well-known and the best used fuzzy clustering algorithm that is based on the fuzzy sets theory [19] to create homogeneous clusters. This algorithm considers the clustering as an optimization problem where an objective function must be minimized. It receives through its input the dataset I={xj∈Rd}j=1,…,N (part of a d-dimensional space) and the number of clusters C in order to minimize iteratively the following objective function:(1)JI,U,V=∑i=1C∑j=1Nuijm·xj-vi2.· is the Euclidean distance, N is the number of elements in I, and m is the fuzziness exponent. V=vi is the set of the cluster centers. U=uij is the fuzzy partition matrix that satisfies the following condition:(2)E=uij∈0,1∣∑i=1Cuij=1,∀j,0<∑j=1Nuij<N,∀i.The minimization of the objective function presented in (1) is carried out by updating iteratively the fuzzy partition matrix and the cluster centers as follows:(3)uij=1∑k=1Cxj-vi/xj-vk2/m-1,(4)vi=∑j=1Nuijm·xj∑j=1Nuijm.Algorithm StepsStep 0. Fix the clustering parameters (the converging error ε, the fuzziness exponent m, and the number of clusters C), input the dataset I, and initialize randomly the cluster centers.REPEATStep 1. Update the partition matrix using (3).Step 2. Update the clusters centers using (4).UNTIL. Vnew-Vold<ε.V n e w is the set of the cluster centers found in the current iteration, and Vold represents the previous one.


### 2.2. FCM with Spatial Information and Its Variants: FCM_S, FCM_S1, and FCM_S2

In order to improve the standard FCM and deal with the intensity inhomogeneities in MRI images, Ahmed et al. [8] modified the objective function (1) by introducing a neighborhood term that biases the labeling of a pixel by the labels of its immediate neighboring pixels. Thus, the authors proposed the FCM_S algorithm that minimizes the following objective function (5) using the updating functions (6) and (7) and with respect to condition E:(5)JI,U,V=∑i=1C∑j=1Nuijmxj-vi2+αNR∑i=1C∑j=1Nuijm∑r∈Njxr-vi2,(6)uij=xj-vi2+α/NR∑r∈Njxr-vi2-1/m-1∑k=1Cxj-vk2+α/NR∑r∈Njxr-vk2-1/m-1,(7)vi=∑j=1Nuijmxj+α/NR∑r∈Njxr1+α∑j=1Nuijm.N j stands for the set of neighbors that exist in a window around xj and NR is its cardinality. The parameter α controls the effect of the neighboring term.It is noteworthy that the neighborhood information appears in both updating functions (6) and (7), which means that the neighboring term has to be computed in each iteration; thus the FCM_S algorithm becomes very time-consuming. To get over this drawback, Chen and Zhang [10] simplified the objective function (5) to the following one:(8)JD,U,V=∑i=1C∑j=1Nuijm·xj-vi2+α∑i=1C∑j=1Nuijm·x-j-vi2.x - j could be the mean or the median value of the neighbors within a specified window around xj. Actually, the authors came up with two fuzzy clustering algorithms: the FCM_S1 and FCM_S2 that use the mean filtered and median filtered images, respectively.Like the standard FCM and FCM_S algorithms, the FCM_S1 and FCM_S2 algorithms minimize iteratively the objective function (8) by updating the fuzzy partition matrix and the cluster centers as follows:(9)uij=xj-vi2+αx-j-vi2-1/m-1∑k=1Cxj-vk2+αx-j-vk2-1/m-1,(10)vi=∑j=1Nuijmxj+αx-j1+α∑j=1Nuijm.Algorithm StepsStep 0. Fix the clustering parameters (the converging error ε, the fuzziness exponent m, the number of clusters C, and the new parameter α), input the dataset I, and initialize the clusters centers randomly.Step 1. Compute the mean (median, resp.) filtered image in case of the FCM_S1 (FCM_S2, resp.).REPEATStep 2. Update the partition matrix using (9).Step 3. Update the clusters centers using (10).UNTIL. Vnew-Vold<ε.


### 2.3. Robust FCM with Local and Gray Information: RFCMLGI

Even though the FCM_S, FCM_S1, and FCM_S2 have shown their strength in handling noise, adjusting the parameterα is still their major limitation. It is highly important to note that this parameter α has to be chosen large enough to eliminate noisy pixels and small enough to preserve more fine details. In other words, if the pixel under consideration is noisy, the weight of the neighboring term has to be large enough to bias the pixel’s belongingness by its immediate neighborhood; if it is not, this weight has to be small enough in order not to alter significantly the pixel’s belongingness and preserve it as fine detail. To respect this important note and control automatically the effect of the neighboring term, this work proposes a Robust FCM with Local and Gray Information (RFCMLGI) that is a direct extension of the FCM_S and replaces α with the new factor S defined as follows:(11)Sj=1NR∑r∈Njxj-xrdrj+1.N R and Nj are defined as in the FCM_S, and drj represents the spatial Euclidean distance between the pixels xj and xr.The new factorS is calculated using the local spatial information (the spatial Euclidean distances drj) and the gray level information (the gray levels of the neighboring pixels xr). It is defined in a way to be amplified for noisy pixels and minimized for nonnoisy ones. In fact, it is obviously deducible that Sj tends towards a maximum if xj is noisy and its neighborhood is homogeneous, which increases the effect of the neighborhood term (see example in Figure 1(a)). Similarly, in a homogeneous window, the parameter Sj tends to a minimum, because the central pixel is not noisy; thus, the neighborhood effect decreases (see Figure 1(b)). Moreover, the contribution degree of each neighboring pixel (for calculating Sj) is inversely proportional to its spatial distance from the central pixel, which means that the nearest neighbors to the central pixel contribute more strongly than those more distant.Figure 1
2D square window. (a) The central pixel is noisy. (b) The central pixel is not noisy.
(a) (b)The RFCMLGI algorithm clusters data by minimizing iteratively the following objective function and under the previous conditionE:(12)JI,U,V=∑i=1C∑j=1Nuijm·xj-vi2+1NR∑i=1C∑j=1NSj·uijm·∑r∈Njxr-vi2.This optimization problem will be solved using Lagrange multiplier:(13)J=∑i=1C∑j=1Nuijm·xj-vi2+1NR∑i=1C∑j=1NSj·uijm·∑r∈Njxr-vi2+λ·1-∑i=1Cuij.By taking the first derivative ofJ with respect to uij and setting the result to zero we find(14)m·uijm-1·xj-vi2+m·SjNR·uijm-1·∑r∈Njxr-vi2-λuij=uij∗=0.Solving (14) for uij,(15)uij∗=λm·xj-vi2+Sj/NR·∑r∈Njxr-vi21/m-1.As∑i=1Cuij=1∀j∈1,…,N, then(16)∑i=1Cλm·xj-vi2+Sj/NR·∑r∈Njxr-vi21/m-1=1.Thus,(17)λ=m∑i=1C1/xj-vi2+Sj/NR·∑r∈Njxr-vi21/m-1m-1.Substitutingλ into (15), we find(18)uij∗=xj-vi2+Sj/NR∑r∈Njxr-vi2-1/m-1∑k=1Cxj-vk2+Sj/NR∑r∈Njxr-vk2-1/m-1.This time, we take the first derivative ofJ with respect to vi and setting the result to zero:(19)∑j=1Nuijm·xj-vi+1NR·∑j=1NSj·uijm·∑r∈Njxr-vivi=vi∗=0.Solving forvi, we find(20)vi=∑j=1Nuijm·xj+Sj/NR∑r∈Njxr∑j=1N1+Sj·uijm.It is noticeable that the factorS is independent of the cluster centers and the membership values. Thus, its calculation takes place once at the beginning of the clustering process, which does not require much processing time. Besides, the computation of the neighborhood term is required in each iteration, which makes the algorithm much slower than the standard FCM. To overcome this last shortcoming (and by analogy to FCM_S and its two variants FCM_S1 and FCM_S2) the RFCMLGI algorithm has been extended to two simplified versions. Indeed, by simplifying the objective function presented in (12) to the following one (21) we come up with two algorithms RFCMLGI_1 and RFCMLGI_2 that update the partition matrix and the cluster centers using (22) and (23), respectively:(21)JD,U,V=∑i=1C∑j=1Nuijm·xj-vi2+∑i=1C∑j=1NSj·uijm·x-j-vi2,(22)uij=xj-vi2+Sjx-j-vi2-1/m-1∑k=1Cxj-vk2+Sjx-j-vk2-1/m-1,(23)vi=∑j=1Nuijm·xj+Sj·x-j∑j=1N1+Sj·uijm.As in FCM_S1 and FCM_S2,x-j could be the mean or the median value of the neighbors within a specified window around xj.Algorithm StepsStep 0. Fix the clustering parameters (the converging error ε, the fuzziness exponent m, and the number of clusters C), input the dataset I, and initialize randomly the cluster centers.Step 1. Compute the mean (median, resp.) filtered image in case of the RFCMLGI_1 (RFCMLGI_2, resp.) algorithm.Step 2. Compute the new factor S using (11).REPEATStep 3. In case of RFCMLGI (RFCMLGI_1 or RFCMLGI_2, resp.), update the partition matrix using (18) ((22), resp.).Step 4. In case of RFCMLGI (RFCMLGI_1 or RFCMLGI_2), update the cluster centers using (20) ((23), resp.).UNTIL. Vnew-Vold<ε.The major advantages of the proposed algorithms are summarized as follows:(i)
They are fully free of the empirical parameters.(ii)
Controlling the tradeoff between noise elimination and detail preservation is automatically made.(iii)
They are easy to be implemented.(iv)
The first version of RFCMLGI is noise type-independent.


## 2.1. Standard FuzzyC-Means Algorithm: FCM

The fuzzyc-means or the FCM is the well-known and the best used fuzzy clustering algorithm that is based on the fuzzy sets theory [19] to create homogeneous clusters. This algorithm considers the clustering as an optimization problem where an objective function must be minimized. It receives through its input the dataset I={xj∈Rd}j=1,…,N (part of a d-dimensional space) and the number of clusters C in order to minimize iteratively the following objective function:(1)JI,U,V=∑i=1C∑j=1Nuijm·xj-vi2.· is the Euclidean distance, N is the number of elements in I, and m is the fuzziness exponent. V=vi is the set of the cluster centers. U=uij is the fuzzy partition matrix that satisfies the following condition:(2)E=uij∈0,1∣∑i=1Cuij=1,∀j,0<∑j=1Nuij<N,∀i.The minimization of the objective function presented in (1) is carried out by updating iteratively the fuzzy partition matrix and the cluster centers as follows:(3)uij=1∑k=1Cxj-vi/xj-vk2/m-1,(4)vi=∑j=1Nuijm·xj∑j=1Nuijm.Algorithm StepsStep 0. Fix the clustering parameters (the converging error ε, the fuzziness exponent m, and the number of clusters C), input the dataset I, and initialize randomly the cluster centers.REPEATStep 1. Update the partition matrix using (3).Step 2. Update the clusters centers using (4).UNTIL. Vnew-Vold<ε.V n e w is the set of the cluster centers found in the current iteration, and Vold represents the previous one.


## 2.2. FCM with Spatial Information and Its Variants: FCM_S, FCM_S1, and FCM_S2

In order to improve the standard FCM and deal with the intensity inhomogeneities in MRI images, Ahmed et al. [8] modified the objective function (1) by introducing a neighborhood term that biases the labeling of a pixel by the labels of its immediate neighboring pixels. Thus, the authors proposed the FCM_S algorithm that minimizes the following objective function (5) using the updating functions (6) and (7) and with respect to condition E:(5)JI,U,V=∑i=1C∑j=1Nuijmxj-vi2+αNR∑i=1C∑j=1Nuijm∑r∈Njxr-vi2,(6)uij=xj-vi2+α/NR∑r∈Njxr-vi2-1/m-1∑k=1Cxj-vk2+α/NR∑r∈Njxr-vk2-1/m-1,(7)vi=∑j=1Nuijmxj+α/NR∑r∈Njxr1+α∑j=1Nuijm.N j stands for the set of neighbors that exist in a window around xj and NR is its cardinality. The parameter α controls the effect of the neighboring term.It is noteworthy that the neighborhood information appears in both updating functions (6) and (7), which means that the neighboring term has to be computed in each iteration; thus the FCM_S algorithm becomes very time-consuming. To get over this drawback, Chen and Zhang [10] simplified the objective function (5) to the following one:(8)JD,U,V=∑i=1C∑j=1Nuijm·xj-vi2+α∑i=1C∑j=1Nuijm·x-j-vi2.x - j could be the mean or the median value of the neighbors within a specified window around xj. Actually, the authors came up with two fuzzy clustering algorithms: the FCM_S1 and FCM_S2 that use the mean filtered and median filtered images, respectively.Like the standard FCM and FCM_S algorithms, the FCM_S1 and FCM_S2 algorithms minimize iteratively the objective function (8) by updating the fuzzy partition matrix and the cluster centers as follows:(9)uij=xj-vi2+αx-j-vi2-1/m-1∑k=1Cxj-vk2+αx-j-vk2-1/m-1,(10)vi=∑j=1Nuijmxj+αx-j1+α∑j=1Nuijm.Algorithm StepsStep 0. Fix the clustering parameters (the converging error ε, the fuzziness exponent m, the number of clusters C, and the new parameter α), input the dataset I, and initialize the clusters centers randomly.Step 1. Compute the mean (median, resp.) filtered image in case of the FCM_S1 (FCM_S2, resp.).REPEATStep 2. Update the partition matrix using (9).Step 3. Update the clusters centers using (10).UNTIL. Vnew-Vold<ε.


## 2.3. Robust FCM with Local and Gray Information: RFCMLGI

Even though the FCM_S, FCM_S1, and FCM_S2 have shown their strength in handling noise, adjusting the parameterα is still their major limitation. It is highly important to note that this parameter α has to be chosen large enough to eliminate noisy pixels and small enough to preserve more fine details. In other words, if the pixel under consideration is noisy, the weight of the neighboring term has to be large enough to bias the pixel’s belongingness by its immediate neighborhood; if it is not, this weight has to be small enough in order not to alter significantly the pixel’s belongingness and preserve it as fine detail. To respect this important note and control automatically the effect of the neighboring term, this work proposes a Robust FCM with Local and Gray Information (RFCMLGI) that is a direct extension of the FCM_S and replaces α with the new factor S defined as follows:(11)Sj=1NR∑r∈Njxj-xrdrj+1.N R and Nj are defined as in the FCM_S, and drj represents the spatial Euclidean distance between the pixels xj and xr.The new factorS is calculated using the local spatial information (the spatial Euclidean distances drj) and the gray level information (the gray levels of the neighboring pixels xr). It is defined in a way to be amplified for noisy pixels and minimized for nonnoisy ones. In fact, it is obviously deducible that Sj tends towards a maximum if xj is noisy and its neighborhood is homogeneous, which increases the effect of the neighborhood term (see example in Figure 1(a)). Similarly, in a homogeneous window, the parameter Sj tends to a minimum, because the central pixel is not noisy; thus, the neighborhood effect decreases (see Figure 1(b)). Moreover, the contribution degree of each neighboring pixel (for calculating Sj) is inversely proportional to its spatial distance from the central pixel, which means that the nearest neighbors to the central pixel contribute more strongly than those more distant.Figure 1
2D square window. (a) The central pixel is noisy. (b) The central pixel is not noisy.
(a) (b)The RFCMLGI algorithm clusters data by minimizing iteratively the following objective function and under the previous conditionE:(12)JI,U,V=∑i=1C∑j=1Nuijm·xj-vi2+1NR∑i=1C∑j=1NSj·uijm·∑r∈Njxr-vi2.This optimization problem will be solved using Lagrange multiplier:(13)J=∑i=1C∑j=1Nuijm·xj-vi2+1NR∑i=1C∑j=1NSj·uijm·∑r∈Njxr-vi2+λ·1-∑i=1Cuij.By taking the first derivative ofJ with respect to uij and setting the result to zero we find(14)m·uijm-1·xj-vi2+m·SjNR·uijm-1·∑r∈Njxr-vi2-λuij=uij∗=0.Solving (14) for uij,(15)uij∗=λm·xj-vi2+Sj/NR·∑r∈Njxr-vi21/m-1.As∑i=1Cuij=1∀j∈1,…,N, then(16)∑i=1Cλm·xj-vi2+Sj/NR·∑r∈Njxr-vi21/m-1=1.Thus,(17)λ=m∑i=1C1/xj-vi2+Sj/NR·∑r∈Njxr-vi21/m-1m-1.Substitutingλ into (15), we find(18)uij∗=xj-vi2+Sj/NR∑r∈Njxr-vi2-1/m-1∑k=1Cxj-vk2+Sj/NR∑r∈Njxr-vk2-1/m-1.This time, we take the first derivative ofJ with respect to vi and setting the result to zero:(19)∑j=1Nuijm·xj-vi+1NR·∑j=1NSj·uijm·∑r∈Njxr-vivi=vi∗=0.Solving forvi, we find(20)vi=∑j=1Nuijm·xj+Sj/NR∑r∈Njxr∑j=1N1+Sj·uijm.It is noticeable that the factorS is independent of the cluster centers and the membership values. Thus, its calculation takes place once at the beginning of the clustering process, which does not require much processing time. Besides, the computation of the neighborhood term is required in each iteration, which makes the algorithm much slower than the standard FCM. To overcome this last shortcoming (and by analogy to FCM_S and its two variants FCM_S1 and FCM_S2) the RFCMLGI algorithm has been extended to two simplified versions. Indeed, by simplifying the objective function presented in (12) to the following one (21) we come up with two algorithms RFCMLGI_1 and RFCMLGI_2 that update the partition matrix and the cluster centers using (22) and (23), respectively:(21)JD,U,V=∑i=1C∑j=1Nuijm·xj-vi2+∑i=1C∑j=1NSj·uijm·x-j-vi2,(22)uij=xj-vi2+Sjx-j-vi2-1/m-1∑k=1Cxj-vk2+Sjx-j-vk2-1/m-1,(23)vi=∑j=1Nuijm·xj+Sj·x-j∑j=1N1+Sj·uijm.As in FCM_S1 and FCM_S2,x-j could be the mean or the median value of the neighbors within a specified window around xj.Algorithm StepsStep 0. Fix the clustering parameters (the converging error ε, the fuzziness exponent m, and the number of clusters C), input the dataset I, and initialize randomly the cluster centers.Step 1. Compute the mean (median, resp.) filtered image in case of the RFCMLGI_1 (RFCMLGI_2, resp.) algorithm.Step 2. Compute the new factor S using (11).REPEATStep 3. In case of RFCMLGI (RFCMLGI_1 or RFCMLGI_2, resp.), update the partition matrix using (18) ((22), resp.).Step 4. In case of RFCMLGI (RFCMLGI_1 or RFCMLGI_2), update the cluster centers using (20) ((23), resp.).UNTIL. Vnew-Vold<ε.The major advantages of the proposed algorithms are summarized as follows:(i)
They are fully free of the empirical parameters.(ii)
Controlling the tradeoff between noise elimination and detail preservation is automatically made.(iii)
They are easy to be implemented.(iv)
The first version of RFCMLGI is noise type-independent.


## 3. Results

In this section, we present some experimental results to show the efficiency of the proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 compared to four other fuzzy clustering algorithms: FCM, FCM_S, FCM_S1, and FCM_S2. Thus, several experiments were performed on synthetic and real images and under different types and levels of noise. The clustering parameters were fixed as follows:m=2, based on a study presented in [20], and NR=8 (3 × 3 window centered around each pixel except the central pixel).To evaluate quantitatively the segmentation results, we use the segmentation accuracy (SA) defined as follows:(24)SA=Number  of  correctly  classified  pixelsTotal  number  of  pixels.


### 3.1. Synthetic Image

First, we apply all the algorithms to a synthetic image corrupted by different levels of Gaussian and “Salt and Pepper” noise, respectively. This image is composed of 250 × 250 pixels spanning into three classes with three gray level values taken as 0, 100, and 200; thus,C is fixed at 3. In these experiments, we fixed α to 4. The segmentation accuracies and results of all the algorithms are depicted in Figures 2 and 3 and Table 1, respectively.Table 1
Segmentation accuracies (SA, in %) of seven algorithms on synthetic image.
Algorithm Gaussian Salt and Pepper 9% 12% 15% 9% 12% 15% FCM 91.24 88.73 86.55 97.89 97.76 97.50 FCM_S 98.23 97.94 97.58 98.21 98.18 98.10 RFCMLGI 98.89 98.89 98.89 98.90 98.89 98.89 FCM_S1 98.79 98.61 98.29 98.73 98.58 98.55 RFCMLGI_1 98.76 98.66 98.44 98.91 98.86 98.86 FCM_S2 98.93 98.72 98.33 98.89 98.79 98.77 RFCMLGI_2 98.94 98.76 98.40 99.01 99.01 99.01Figure 2
Segmentation results on synthetic image. (a) Original image corrupted by 15% of Gaussian noise. (b) FCM result. (c) FCM_S result. (d) FCM_S1 result. (e) FCM_S2 result. (f) RFCMLGI result. (g) RFCMLGI_1 result. (h) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h)Figure 3
Segmentation results on synthetic image. (a) Original image corrupted by 15% of Salt and Pepper noise. (b) FCM result. (c) FCM_S result. (d) FCM_S1 result. (e) FCM_S2 result. (f) RFCMLGI result. (g) RFCMLGI_1 result. (h) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h)From the visual results presented in Figures2 and 3, it is clearly noticeable that all the algorithms (except the standard FCM) succeeded to different extent in handling noisy pixels. Moreover, the RFCMLGI performed better in both cases as well as the RFCMLGI_2 under Salt and Pepper noise, which is quantitatively demonstrated in Table 1.From the numerical results depicted in Table1, we could point out the following important notes:(i)
The segmentation accuracy decreases as the level of noise increases for all the algorithms except for the RFCMLGI under both types of noise and RFCMLGI_2 under Salt and Pepper noise.(ii)
For each type and level of noise, the proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 outperformed the FCM_S, FCM_S1, and FCM_S2, respectively. And, more specifically, the segmentation accuracies produced by the RFCMLGI are more or less similar, which means that this algorithm is less dependent on the noise type.(iii)
Under Salt and Pepper noise, the segmentation accuracies performed by the RFCMLGI_2 are equal and tend towards the maximum, which proves the convenience of this algorithm to segment images corrupted by Salt and Pepper noise.(iv)
Under Gaussian noise, RFCMLGI has the best performance.Based on the previous remarks, we conclude that the proposed algorithms surpassed the FCM_S and its two variants. In addition, if the type of noise is unknown the RFCMLGI is the best choice.


### 3.2. Real Images

To validate our methods, we test them on two real images and compare their results with the best results of the FCM_S, FCM_S1, and FCM_S2 that are obtained by seeking the value ofα after which there are no apparent changes in the segmentation accuracy.


#### 3.2.1. Selection ofα

We use the trial-and-error method to select the best values ofα to segment the previous synthetic image corrupted by 30% of Gaussian and Salt and Pepper noise, respectively. Actually, under Gaussian (Salt and Pepper, resp.) noise and for α ≥ 10.2 (α ≥ 6.8, resp.) there are no apparent changes in the segmentation accuracy of the FCM_S and FCM_S1 (FCM_S2, resp.).


#### 3.2.2. Eight Image

This image was corrupted by 30% of Gaussian and Salt and Pepper noise, respectively. Even though this image contains two objects, we fixedC to 3; the third cluster is for the details presented on the coins. The segmentation results of all the algorithms are presented in Figures 4 and 5.Figure 4
Segmentation result oneight image. (a) Originale image. (b) Image corrupted by 30% of Gaussian noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)Figure 5
Segmentation result oneight image. (a) Original image. (b) Image corrupted by 30% of Salt and Pepper noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)In Figures4 and 5, we can see that our algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 performed better (to different extents) than the FCM_S, FCM_S1, and FCM_S2, respectively. Indeed, in case of Gaussian noise (Figure 4), we notice that the RFCMLGI has the best performance followed by the RFCMLGI_1. Thus, these two latter algorithms are the most favorable in the presence of Gaussian noise. The failure of the RFCMLGI_2 to deal correctly with noise is due to the median filter used inside the algorithm which is known by its weakness in removing Gaussian noise [21].Under Salt and Pepper noise (Figure5), we can order the algorithms according to their performances from the best to the worst as follows: RFCMLGI, RFCMLGI_2, FCM_S2, RFCMLGI_1, FCM_S1, FCM_S, and FCM. In addition to their best results, the RFCMLGI and RFCMLGI_2 performed very similarly, which means that they are both very convenient to handle Salt and Pepper noise. The RFCMLGI_1 could not achieve the best performance because of using the mean filter that is not recommended for Salt and Pepper noise.In terms of detail preserving, we notice clearly (from Figures4 and 5) that the RFCMLGI algorithm surpassed all the algorithms, where it found a good balance between noise elimination and detail preserving.As has been concluded in the previous section, the RFCMLGI algorithm is the most convenient one when noise is a priori unknown.


#### 3.2.3. Moon Image

To show the effect of our algorithms on images with mixed noise, we use the “moon” image corrupted at the same time by 20% of Gaussian and Salt and Pepper noise. In this experiment, C is fixed to 2. The segmentation results are shown in Figure 6.Figure 6
Segmentation result onmoon image. (a) Original image. (b) Image corrupted by Gaussian and “Salt and Pepper” noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)From Figure6, we note that the standard FCM has the worst performance. In contrast, the FCM_S, FCM_S1, FCM_S2, RFCMLGI_1, and RFCMLGI_2 succeeded in handling noisy pixels and their performances are close to each other. However, the RFCMLGI algorithm made an exception where it outperformed all the algorithms in handling fuzzy pixels of the intersection region between the moon and the background (see regions circled in red), which proves its ability to retain fine details.Globally, in the experimental results presented in this section we found that the proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 performed better than the FCM_S, FCM_S1, and FCM_S2, respectively, and the RFCMLGI had the best performance. Even though in some cases RFCMLGI_1 and RFCMLGI_2 performed closely to the FCM_S1 and FCM_S2, they remain better because they are free of any parameter selection and they control the effect of the neighboring term automatically.The standard FCM and its extensions FCM_S, FCM_S1, and FCM_S2 have the same time complexity which is O(HWC) [22], where H and W are the image dimensions and C is the number of clusters. The proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 are similar to their antecedents FCM_S, FCM_S1, and FCM_S2, respectively, where the difference lies in the parameter that controls the tradeoff between noise elimination and detail preserving. Thus, the proposed algorithms have also the same time complexity O(HWC) with small variations caused by computing the new factor S.


## 3.1. Synthetic Image

First, we apply all the algorithms to a synthetic image corrupted by different levels of Gaussian and “Salt and Pepper” noise, respectively. This image is composed of 250 × 250 pixels spanning into three classes with three gray level values taken as 0, 100, and 200; thus,C is fixed at 3. In these experiments, we fixed α to 4. The segmentation accuracies and results of all the algorithms are depicted in Figures 2 and 3 and Table 1, respectively.Table 1
Segmentation accuracies (SA, in %) of seven algorithms on synthetic image.
Algorithm Gaussian Salt and Pepper 9% 12% 15% 9% 12% 15% FCM 91.24 88.73 86.55 97.89 97.76 97.50 FCM_S 98.23 97.94 97.58 98.21 98.18 98.10 RFCMLGI 98.89 98.89 98.89 98.90 98.89 98.89 FCM_S1 98.79 98.61 98.29 98.73 98.58 98.55 RFCMLGI_1 98.76 98.66 98.44 98.91 98.86 98.86 FCM_S2 98.93 98.72 98.33 98.89 98.79 98.77 RFCMLGI_2 98.94 98.76 98.40 99.01 99.01 99.01Figure 2
Segmentation results on synthetic image. (a) Original image corrupted by 15% of Gaussian noise. (b) FCM result. (c) FCM_S result. (d) FCM_S1 result. (e) FCM_S2 result. (f) RFCMLGI result. (g) RFCMLGI_1 result. (h) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h)Figure 3
Segmentation results on synthetic image. (a) Original image corrupted by 15% of Salt and Pepper noise. (b) FCM result. (c) FCM_S result. (d) FCM_S1 result. (e) FCM_S2 result. (f) RFCMLGI result. (g) RFCMLGI_1 result. (h) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h)From the visual results presented in Figures2 and 3, it is clearly noticeable that all the algorithms (except the standard FCM) succeeded to different extent in handling noisy pixels. Moreover, the RFCMLGI performed better in both cases as well as the RFCMLGI_2 under Salt and Pepper noise, which is quantitatively demonstrated in Table 1.From the numerical results depicted in Table1, we could point out the following important notes:(i)
The segmentation accuracy decreases as the level of noise increases for all the algorithms except for the RFCMLGI under both types of noise and RFCMLGI_2 under Salt and Pepper noise.(ii)
For each type and level of noise, the proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 outperformed the FCM_S, FCM_S1, and FCM_S2, respectively. And, more specifically, the segmentation accuracies produced by the RFCMLGI are more or less similar, which means that this algorithm is less dependent on the noise type.(iii)
Under Salt and Pepper noise, the segmentation accuracies performed by the RFCMLGI_2 are equal and tend towards the maximum, which proves the convenience of this algorithm to segment images corrupted by Salt and Pepper noise.(iv)
Under Gaussian noise, RFCMLGI has the best performance.Based on the previous remarks, we conclude that the proposed algorithms surpassed the FCM_S and its two variants. In addition, if the type of noise is unknown the RFCMLGI is the best choice.


## 3.2. Real Images

To validate our methods, we test them on two real images and compare their results with the best results of the FCM_S, FCM_S1, and FCM_S2 that are obtained by seeking the value ofα after which there are no apparent changes in the segmentation accuracy.


### 3.2.1. Selection ofα

We use the trial-and-error method to select the best values ofα to segment the previous synthetic image corrupted by 30% of Gaussian and Salt and Pepper noise, respectively. Actually, under Gaussian (Salt and Pepper, resp.) noise and for α ≥ 10.2 (α ≥ 6.8, resp.) there are no apparent changes in the segmentation accuracy of the FCM_S and FCM_S1 (FCM_S2, resp.).


### 3.2.2. Eight Image

This image was corrupted by 30% of Gaussian and Salt and Pepper noise, respectively. Even though this image contains two objects, we fixedC to 3; the third cluster is for the details presented on the coins. The segmentation results of all the algorithms are presented in Figures 4 and 5.Figure 4
Segmentation result oneight image. (a) Originale image. (b) Image corrupted by 30% of Gaussian noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)Figure 5
Segmentation result oneight image. (a) Original image. (b) Image corrupted by 30% of Salt and Pepper noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)In Figures4 and 5, we can see that our algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 performed better (to different extents) than the FCM_S, FCM_S1, and FCM_S2, respectively. Indeed, in case of Gaussian noise (Figure 4), we notice that the RFCMLGI has the best performance followed by the RFCMLGI_1. Thus, these two latter algorithms are the most favorable in the presence of Gaussian noise. The failure of the RFCMLGI_2 to deal correctly with noise is due to the median filter used inside the algorithm which is known by its weakness in removing Gaussian noise [21].Under Salt and Pepper noise (Figure5), we can order the algorithms according to their performances from the best to the worst as follows: RFCMLGI, RFCMLGI_2, FCM_S2, RFCMLGI_1, FCM_S1, FCM_S, and FCM. In addition to their best results, the RFCMLGI and RFCMLGI_2 performed very similarly, which means that they are both very convenient to handle Salt and Pepper noise. The RFCMLGI_1 could not achieve the best performance because of using the mean filter that is not recommended for Salt and Pepper noise.In terms of detail preserving, we notice clearly (from Figures4 and 5) that the RFCMLGI algorithm surpassed all the algorithms, where it found a good balance between noise elimination and detail preserving.As has been concluded in the previous section, the RFCMLGI algorithm is the most convenient one when noise is a priori unknown.


### 3.2.3. Moon Image

To show the effect of our algorithms on images with mixed noise, we use the “moon” image corrupted at the same time by 20% of Gaussian and Salt and Pepper noise. In this experiment, C is fixed to 2. The segmentation results are shown in Figure 6.Figure 6
Segmentation result onmoon image. (a) Original image. (b) Image corrupted by Gaussian and “Salt and Pepper” noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)From Figure6, we note that the standard FCM has the worst performance. In contrast, the FCM_S, FCM_S1, FCM_S2, RFCMLGI_1, and RFCMLGI_2 succeeded in handling noisy pixels and their performances are close to each other. However, the RFCMLGI algorithm made an exception where it outperformed all the algorithms in handling fuzzy pixels of the intersection region between the moon and the background (see regions circled in red), which proves its ability to retain fine details.Globally, in the experimental results presented in this section we found that the proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 performed better than the FCM_S, FCM_S1, and FCM_S2, respectively, and the RFCMLGI had the best performance. Even though in some cases RFCMLGI_1 and RFCMLGI_2 performed closely to the FCM_S1 and FCM_S2, they remain better because they are free of any parameter selection and they control the effect of the neighboring term automatically.The standard FCM and its extensions FCM_S, FCM_S1, and FCM_S2 have the same time complexity which is O(HWC) [22], where H and W are the image dimensions and C is the number of clusters. The proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 are similar to their antecedents FCM_S, FCM_S1, and FCM_S2, respectively, where the difference lies in the parameter that controls the tradeoff between noise elimination and detail preserving. Thus, the proposed algorithms have also the same time complexity O(HWC) with small variations caused by computing the new factor S.


## 3.2.1. Selection ofα

We use the trial-and-error method to select the best values ofα to segment the previous synthetic image corrupted by 30% of Gaussian and Salt and Pepper noise, respectively. Actually, under Gaussian (Salt and Pepper, resp.) noise and for α ≥ 10.2 (α ≥ 6.8, resp.) there are no apparent changes in the segmentation accuracy of the FCM_S and FCM_S1 (FCM_S2, resp.).


## 3.2.2. Eight Image

This image was corrupted by 30% of Gaussian and Salt and Pepper noise, respectively. Even though this image contains two objects, we fixedC to 3; the third cluster is for the details presented on the coins. The segmentation results of all the algorithms are presented in Figures 4 and 5.Figure 4
Segmentation result oneight image. (a) Originale image. (b) Image corrupted by 30% of Gaussian noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)Figure 5
Segmentation result oneight image. (a) Original image. (b) Image corrupted by 30% of Salt and Pepper noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)In Figures4 and 5, we can see that our algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 performed better (to different extents) than the FCM_S, FCM_S1, and FCM_S2, respectively. Indeed, in case of Gaussian noise (Figure 4), we notice that the RFCMLGI has the best performance followed by the RFCMLGI_1. Thus, these two latter algorithms are the most favorable in the presence of Gaussian noise. The failure of the RFCMLGI_2 to deal correctly with noise is due to the median filter used inside the algorithm which is known by its weakness in removing Gaussian noise [21].Under Salt and Pepper noise (Figure5), we can order the algorithms according to their performances from the best to the worst as follows: RFCMLGI, RFCMLGI_2, FCM_S2, RFCMLGI_1, FCM_S1, FCM_S, and FCM. In addition to their best results, the RFCMLGI and RFCMLGI_2 performed very similarly, which means that they are both very convenient to handle Salt and Pepper noise. The RFCMLGI_1 could not achieve the best performance because of using the mean filter that is not recommended for Salt and Pepper noise.In terms of detail preserving, we notice clearly (from Figures4 and 5) that the RFCMLGI algorithm surpassed all the algorithms, where it found a good balance between noise elimination and detail preserving.As has been concluded in the previous section, the RFCMLGI algorithm is the most convenient one when noise is a priori unknown.


## 3.2.3. Moon Image

To show the effect of our algorithms on images with mixed noise, we use the “moon” image corrupted at the same time by 20% of Gaussian and Salt and Pepper noise. In this experiment, C is fixed to 2. The segmentation results are shown in Figure 6.Figure 6
Segmentation result onmoon image. (a) Original image. (b) Image corrupted by Gaussian and “Salt and Pepper” noise. (c) FCM result. (d) FCM_S result. (e) FCM_S1 result. (f) FCM_S2 result. (g) RFCMLGI result. (h) RFCMLGI_1 result. (i) RFCMLGI_2 result.
(a) (b) (c) (d) (e) (f) (g) (h) (i)From Figure6, we note that the standard FCM has the worst performance. In contrast, the FCM_S, FCM_S1, FCM_S2, RFCMLGI_1, and RFCMLGI_2 succeeded in handling noisy pixels and their performances are close to each other. However, the RFCMLGI algorithm made an exception where it outperformed all the algorithms in handling fuzzy pixels of the intersection region between the moon and the background (see regions circled in red), which proves its ability to retain fine details.Globally, in the experimental results presented in this section we found that the proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 performed better than the FCM_S, FCM_S1, and FCM_S2, respectively, and the RFCMLGI had the best performance. Even though in some cases RFCMLGI_1 and RFCMLGI_2 performed closely to the FCM_S1 and FCM_S2, they remain better because they are free of any parameter selection and they control the effect of the neighboring term automatically.The standard FCM and its extensions FCM_S, FCM_S1, and FCM_S2 have the same time complexity which is O(HWC) [22], where H and W are the image dimensions and C is the number of clusters. The proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 are similar to their antecedents FCM_S, FCM_S1, and FCM_S2, respectively, where the difference lies in the parameter that controls the tradeoff between noise elimination and detail preserving. Thus, the proposed algorithms have also the same time complexity O(HWC) with small variations caused by computing the new factor S.


## 4. Conclusion

In order to furnish a fuzzy clustering algorithm that is fully free of empirical parameters and noise type-independent, this work extended the FCM_S and its two variants to three algorithms based on a new factor that uses the local spatial and the gray level information to calculate the weight of the neighboring term. Generally, all the proposed algorithms RFCMLGI, RFCMLGI_1, and RFCMLGI_2 proved their efficiency on synthetic and real images. More specifically, the RFCMLGI algorithm surpassed considerably the others where it showed its noise type-independence and its ability to retain fine details.In spite of their fruitful results, the proposed algorithms need to be improved in the running times point of view, where computing the factorS makes them slower. This drawback will be the main issue of a future work.



---

*Source: 6238295-2016-10-20.xml*