#### Abstract

The FCM (fuzzy -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.

#### 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 -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 -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 -means algorithm combined with its hard version -means to extract brain tumors from MRI (Magnetic Resonance Imaging) images. In order to detect targets from radar images, Gupta [3] extended the fuzzy -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 -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 . 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 -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 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 -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 ) still suffers from a major drawback where achieving the optimal segmentation requires the adjustment of two parameters and .

To improve the robustness to noise of the FCM_S and , Zheng et al. [14] combined their main ideas. Thus, the authors used a modified version of the spatial function proposed for 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 -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 (, , , , , , and ). 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 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 factor 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 Fuzzy -Means Algorithm: FCM

The fuzzy -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 (part of a -dimensional space) and the number of clusters in order to minimize iteratively the following objective function:

is the Euclidean distance, is the number of elements in , and is the fuzziness exponent. is the set of the cluster centers. is the fuzzy partition matrix that satisfies the following condition:

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:

*Algorithm Steps*

*Step 0*. Fix the clustering parameters (the converging error , the fuzziness exponent , and the number of clusters ), input the dataset , and initialize randomly the cluster centers.

*REPEAT*

*Step 1*. Update the partition matrix using (3).

*Step 2*. Update the clusters centers using (4).

*UNTIL*. .

is the set of the cluster centers found in the current iteration, and 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 :

stands for the set of neighbors that exist in a window around and 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:

could be the mean or the median value of the neighbors within a specified window around . 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:

*Algorithm Steps*

*Step 0*. Fix the clustering parameters (the converging error , the fuzziness exponent , the number of clusters , and the new parameter ), input the dataset , and initialize the clusters centers randomly.

*Step 1*. Compute the mean (median, resp.) filtered image in case of the FCM_S1 (FCM_S2, resp.).

*REPEAT*

*Step 2*. Update the partition matrix using (9).

*Step 3*. Update the clusters centers using (10).

*UNTIL*. .

##### 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 defined as follows:

and are defined as in the FCM_S, and represents the spatial Euclidean distance between the pixels and .

The new factor is calculated using the local spatial information (the spatial Euclidean distances ) and the gray level information (the gray levels of the neighboring pixels ). It is defined in a way to be amplified for noisy pixels and minimized for nonnoisy ones. In fact, it is obviously deducible that tends towards a maximum if 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 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 ) 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.

**(a)**

**(b)**

The RFCMLGI algorithm clusters data by minimizing iteratively the following objective function and under the previous condition :

This optimization problem will be solved using Lagrange multiplier:

By taking the first derivative of with respect to and setting the result to zero we find

Solving (14) for ,

As , then

Thus,

Substituting into (15), we find

This time, we take the first derivative of with respect to and setting the result to zero:

Solving for , we find

It is noticeable that the factor 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:

As in FCM_S1 and FCM_S2, could be the mean or the median value of the neighbors within a specified window around .

*Algorithm Steps*

*Step 0*. Fix the clustering parameters (the converging error , the fuzziness exponent , and the number of clusters ), input the dataset , 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 using (11).

*REPEAT*

*Step 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*. .

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: , based on a study presented in [20], and (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:

##### 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, 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.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

From the visual results presented in Figures 2 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 Table 1, 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 fixed 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.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

In Figures 4 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 (Figure 5), 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 Figures 4 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, is fixed to 2. The segmentation results are shown in Figure 6.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

From Figure 6, 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 and are the image dimensions and 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 .

#### 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 factor makes them slower. This drawback will be the main issue of a future work.

#### Competing Interests

The authors declared that there is no conflict of interests regarding the publication of this paper.