# Fuzzy C-Means: Multispectral and Single Channel Algorithms

Segmentation involves dividing an image into distinct classes or types. For example, researchers may segment the brain into three classes: gray matter, white matter, and cerebrospinal fluid. There are two types of segmentation: hard and soft, or fuzzy.

#### Hard segmentation

A pixel is assigned to only one class. In medical images, absolute classification of a pixel is often not possible because of partial volume effects where multiple tissues contribute to a pixel or because a voxel causes intensity blurring across boundaries.

#### Soft, or fuzzy, segmentation

This type allows for the uncertainty in the location of object boundaries. In fuzzy segmentation, a membership function exists for each class at every pixel location. At each pixel location a class membership function has the value of zero if the pixel does not belong to the class. At each pixel location a class membership function has a value of 1 if the pixel belongs, with absolute certainty, to the class. Membership functions can vary from 0 to 1, with the constraint that at any pixel location the sum of the membership functions of all the classes must be 1. The fuzzy membership function reflects the similarity between the data value at that pixel and the value of the class centroid. As a pixel data value becomes closer to the class centroid, the class membership function approaches unity.

### Background

The Fuzzy C-Means algorithm is an unsupervised method. That is, it works without the use of a specialized set of data for determining parameters of an algorithm. This algorithm, which allows for fuzzy segmentation based on fuzzy set theory, generalizes the K-Means algorithm. The technique clusters data by iteratively computing a fuzzy membership function and mean value estimate for each tissue class. The algorithm minimizes the sum over all pixels j and all classes k of:

 (EQ 1) $J = \sum_{j\varepsilon \Omega} \sum_{k=1}^C j^q_{jk} \left \|{y_j - v_k }\right \|^2$

where u'jk is the membership value at pixel location j for class k such that the sum over k from k = 1 to k =C (nClass) for ujk = 1.

q is a weighing exponent on each membership value and determines the amount of "fuzziness" of the resulting segmentation. q must be greater than 1, is typically set to 2.
y'j is the observed single channel or multispectral image intensity at location j.
v'k is the centroid of class k
C is a number of classes (nClass)

Users provide initial centroid values or simply use default evenly spread pixel values generated by:

for (i = 0; i < nClass; i )
centroid[i] = minimum (maximum - minimum)*(i 1)/(nClass 1);

Minimization is achieved by an iterative process that performs two computations. First, the minimization process computes the membership functions using a current estimate of the centroids.

In the single channel case (select Algorithms > Segmentation > Fuzzy C-means > Single channel in the MIPAV window):

 (EQ 2) $u_{jk} = \frac {\left \| {y_j -g_jv_k} \right \|^{- \frac {2} {(q-1)}}} {\sum_{k=1}^C \left \|{y_j-g_jv_k} \right\|^{-\frac{2} {(q-1)}}}$

The minimization process also computes the centroids using current estimates of the membership functions.

In the single channel case:

 (EQ 3) $v_k = \frac {\sum j \epsilon \Omega u^q_{jk}g_jy_i} {\sum j \epsilon \Omega u^q_{jk}g^2_j}$

In the multispectral case:

 (EQ 4) $v_k = \sum_s \sum_{k=1}^C \frac {\sum j \epsilon \Omega u^q_{jk}g_jy_i} {\sum j \epsilon \Omega u^q_{jk}g^2_j}$

where summation is over all classes k and all images s

The iteration continues until the user-specified maximum number of iterations occurs or until convergence is detected. Convergence occurs when all membership functions over all pixel locations j change by less than the tolerance value between two iterations. The default maximum iteration number is 100 for the single channel case and 200 for the multispectral case. The default tolerance is 0.01.

After entering the parameters for the algorithm in the Fuzzy C-Means dialog box (Figure 2), researchers select one of three choices for the output images:

• HARD ONLY
• FUZZY ONLY
• HARD & FUZZY BOTH

Hard segmentation produces only one unsigned-byte output image. Pixels that do not meet threshold requirements are assigned the value of 0. The first class is assigned a value of 255/(nClass); the second class is assigned a pixel value of 2 x 255/(nClass), and so on. The last class has a value of 255.

Fuzzy segmentation produces one image, of the same type as the first source image, for every segmentation class. The membership function is scaled so that the minimum membership value scales to the first source image minimum value and the maximum membership value scales to the first source image maximum value. If boundary cropping is applied, all pixels outside the bounding box are assigned the minimum value of the first source image.

If researchers apply the multispectral version of the algorithm, they can add images to a list.

#### Adding images to the list

To add an image to the list:

1. Click Load. The Open dialog box appears.
2. Select an image.
If the following are true, MIPAV adds the image to the list
• The image has the same dimensionality as the original image.
• The length of each dimension is the same as that of the original image.
Otherwise, an error message appears.

### Removing images from the list

To remove an image from the list, click Remove.

 Note: You cannot remove the original image (the first image in the list) that was present at the time you selected Algorithms > Fuzzy C-means > Multispectral. The Remove Image button is only enabled (active) when at least two images are in the list.

The multispectral case allows color images to be loaded. If the original image is color, then the initial dialog box includes, by default, three selected check boxes for red, green, and blue components. If the original image is not color, then the later loaded images cannot be color.

With the single channel case, the signal threshold value is entered on the initial dialog box and the image centroids are entered on a later dialog box. The multispectral case does not have signal threshold on the initial dialog box. With the multispectral case, a later dialog box appears for every black-and-white image or for every selected component of every color image and the signal thresholds and initial centroids are entered on these later dialog boxes.

#### Image types

The Fuzzy C-means algorithm runs on 2D and 3D datasets and can also be applied to RGB datasets. This algorithms cannot run to complex datasets.

None.