You are on page 1of 28

79

CHAPTER 4

SEGMENTATION

4.1 PROLOGUE

Image segmentation may be defined as the process of dividing an


image into disjoint homogeneous regions. These homogeneous regions
usually contain similar objects of interest or part of them. The extent of
homogeneity of the segmented regions can be measured using some image
property (e. g. pixel intensity). On the other hand, clustering can be defined as
the optimal partitioning of a given set of n data points into c subgroups, such
that data points belonging to the same group are as similar to each other as
possible whereas data points from two different groups share the maximum
difference.

The goal of segmentation is to simplify the representation of an


image into different segments that is more meaningful and easier to analyze.
Image segmentation is typically used to locate objects and boundaries in
images. It is also the process of assigning a label to every pixel in an image
such that pixels with the same label share certain visual characteristics. The
result of image segmentation is a set of segments that collectively cover the
entire image. Image segmentation is nothing but the process of dividing an
image into disjoint homogenous regions. These regions usually contain
similar objects of interest. The homogeneity of the segmented regions can be
measured using pixel intensity.
80

Some of the practical applications of image segmentation are


Medical Imaging, Locate objects in satellite images (roads, forests, etc.), Face
recognition, Fingerprint recognition, Traffic control systems, and Machine
vision. A Several general-purpose algorithms and techniques have been
developed for image classification. Since there is no general solution to the
image segmentation problem, these techniques often have to be combined
with domain knowledge in order to effectively solve an image segmentation
problem for a problem domain.

MRI segmentation has been proposed for a number of clinical


inspections of varying complexity. In the clinical background, medical image
processing is generally related to radiology or medical imaging and the
medical practitioner responsible for meaning the image is a radiologist.
Diagnostic radiography nominates the methodological conditions of medical
imaging and in appropriates the learning of medical images. The radiographer
is normally answerable for acquiring medical images of diagnostic aspect,
although some radiological intervention is performed by radiologists.

A metaheuristic is a high-level problem-independent algorithmic


framework that provides a set of guidelines or strategies to develop
heuristic optimization algorithms.

Metaheuristics are often divided into two sets.

1. Algorithms handling a single point, making it evolve towards


a solution.

2. Algorithms handling a population, i.e., a finite set of points,


and computing a new population at each iteration.
81

Population-based metaheuristics find good solutions by iteratively


selecting and then combining existing solutions from a set, usually called the
population. The most important members of this class are evolutionary
algorithms because they imitate the principles of natural evolution. The term
evolutionary algorithms as an umbrella term to encompass the wide range of
metaheuristics based on evolution.

Evolutionary algorithms (EAs) are search methods that take their


inspiration from natural selection and survival of the fittest in the biological
world. EAs differ from more traditional optimization techniques in that they
involve a search from a "population" of solutions, not from a single point.
Each iteration of an EA involves a competitive selection that weeds out poor
solutions. The solutions with high "fitness" are "recombined" with other
solutions by swaping parts of a solution with another. Solutions are also
"mutated" by making a small change to a single element of the solution.

Image segmentation has been approached from a wide variety of


perspectives such as region-based approach, morphological operation, multi-
scale analysis and fuzzy approaches and stochastic approaches have been used
for MRI image but with some limitations as discussed in Chapter 2. In this
section, Fuzzy C Means, Modified PSO and MRF hybrid with modified PSO
is implemented for brain MRI image segmentation.

A Modified Particle Swarm Optimization with Fuzzy C Means


based Segmentation process to detect Brain Tumor was implemented. In that
performance of the MRI Image in terms of Weight vector, execution time and
Tumor pixels detected using the Modified PSO with FCM approach, it can be
concluded that the proposed approach has lower tumor value and lesser
execution time. There is a decrease in both the values when compared to any
other existing approaches.
82

4.2 MARKOV RANDOM FILED

The MRI image is stored in a two-dimensional matrix and a kernel


is extracted for each pixel. A unique label is assigned to the kernels having
similar patterns. In the labeling process, a label matrix is initialized with
zeros. The size of the label matrix is equal to the size of the mammogram
image. For each pixel in the image, the label value is stored in the label matrix
at the location corresponding to its central pixel coordinates in the gray level
image.

A pattern matrix is maintained to store the dissimilar patterns in the


image. For each pixel, a kernel is extracted and the kernel is compared with
the patterns available in the pattern matrix. Once it finds any matches the
same label value is assigned to the currently extracted kernel. Otherwise the
next label value is assigned to the kernel and the kernel is added to the pattern
matrix. The labels are assigned integer values starting with one and
incremented by one whenever a new pattern occurs.

Finally the pattern matrix contains all the dissimilar patterns in the
image and the corresponding label values are also extracted from the label
matrix. For each pattern in the pattern matrix, the posterior energy function
value is calculated using the MRF formula. The challenge of finding the MAP
estimate of the segmentation is to search for the optimum label which
minimizes the posterior energy function U(x). In this section a new effective
approach, modified PSO is proposed for the minimization of MAP estimation.
83

4.3 SEGMENTATION OF MRI IMAGE USING FUZZY C


MEANS (FCM)

Clustering is a process for classifying objects or patterns in such a


way that samples of the same group are more similar to one another than
samples belonging to different groups. Many clustering strategies have been
used, such as the hard clustering scheme and the fuzzy clustering scheme,
each of which has its own special characteristics.

The conventional hard clustering method restricts each point of the


data set to exclusively just one cluster. As a consequence, with this approach
the segmentation results are often very crisp, i.e., each pixel of the image
belongs to exactly just one class. However, in many real situations, for
images, issues such as limited spatial resolution, poor contrast, overlapping
intensities, noise and intensity in homogeneities variation make this hard
(crisp) segmentation a difficult task.

The fuzzy set theory was proposed, which produced the idea of
partial membership of belonging described by a membership function; fuzzy
clustering as a soft segmentation method has been widely studied and
successfully applied in image segmentation. Among the fuzzy clustering
methods, fuzzy c-means (FCM) algorithms the most popular method used in
image segmentation because it has robust characteristics for ambiguity and
can retain much more information than hard segmentation methods. Although
the conventional FCM algorithm works well on most noise-free images, it has
a serious limitation: it does not incorporate any information about spatial
context, which cause it to be sensitive to noise and imaging artifacts.
84

The Fuzzy C-Means (FCM) clustering algorithm was first


introduced by Dunn and later was extended by Bezdek. The aim of FCM
algorithm is an iterative clustering method that produces an optimal c
partition (cluster centers or centroids) by minimizing the dissimilarity
function.

c
The membership matrix (U) is randomly initialized as i 1
U ij 1

Where i is the number of cluster

j is the image data point

The dissimilarity function can be calculated with this equation

c c n
Ci Ji Uij n dij 2
i 1 i 1 j 1 (4.1)

Where Uij is between 0 and 1

Ci is the centroid of cluster i

dij is the Euclidean distance between ith and centriod (Ci ) and jth
data point

M is a weighiting exponent.

To calculate Euclidean distance (dij)

Euclidean distance (dij) = Cluster center pixels - current neuron

Dij = CCp – Cn (4.2)

where CCp is the Cluster center pixels

Cn is the current neuron


85

i.e. Number of clusters is computed as

C = (N/2)1/2, N= no of pixels in image

To find the Minimum dissimilarity function can be computed as

1
U ij = 2 / (m-1)
c
d ij

d kj
k=1
(4.3)

where dij=|| xi -cj|| and dkj=|| xi –ck||

xi is the ith of d- dimensional data

cj is the d-dimensional center of the cluster

||**|| is the similarity between any measured data and center

so these iteration will stop when the condition

Max ij { Uij(k+1)-Uijk } <€ is satisfied

where € is a termination criterion between 0 and 1, K is the iteration step

The step of the FCM Algorithm has been listed

Step 1: Initialize U = Uij matrix

Step 2: At K step initialize centre vector C (k) = C j taken from Clustering


Algorithm

Step 3: Update U (k), U (k+1), then compute the dissimilarity function

1
U ij = 2 / (m-1)
c
d ij

k=1 d kj

If || U (k+1) - U (k) || < € then stop. Otherwise return to step3.


86

In the first step, the algorithm selects the initial cluster from
Clustering Algorithm. Then, in later step after several iteration of the
algorithm, the final result converges to actual cluster of FCM. The aim of
FCM is to detect the suspicious region from the background region in the
MRI brain Image. If the Maximum Adaptive threshold is used to compare the
current neuron value. If the current value is less than the Adaptive Thresholds
neglects the region set to black and the suspicious region is look like bright.

Input: MRI Brain Image


Output: Segmented Image contain only Tumor (suspicious reign)
Step 1: randomly choose cluster centroids
Step 2: Calculate the cluster centers.
C = (N/2)1/2
Step 3: Compute the Euclidean distances
Dij = CCp – Cn
Step 4: Update the partition matrix
1
U ij = 2 / (m-1)
c
d ij

k=1 d kj

(Repeat the step 4)


Until Max[ Uij(k+1)-Uijk ] <€ is satisfied
Step 5: Calculate the average clustering points.
c c n
Ci Ji Uij n dij 2
i 1 i 1 j 1

Step 6: Compute the adaptive threshold


Adaptive threshold =max (Adaptive threshold, ci) i=1...n
If the Maximum Adaptive threshold is used to compare the current
neuron value. If the current value is less than the Adaptive Thresholds then
the region set to black and the suspicious region is look like bright

Figure 4.1 Algorithm of FCM


87

4.4 SEGMENTATION OF MRI IMAGE WITH MODIFIED PSO

4.4.1 Preliminaries on PSO

PSO is a robust stochastic optimization technique based on the


movement and intelligence of swarms. PSO applies the concept of social
interaction to Extracting suspicious region from background tissue through
MRI images. It was basically developed in 1995 by James Kennedy and
Russell Eberhart.

In optimizing a problem, it is found that if it is possible to


determine whether a problem is separable or non-separable prior to
attempting to solve the problem. Then it is determined as a reliable
solution is more effectively and efficiently. For a separable problem, the
Successive Interval Search (SIS) method is the best solver compared with
other heuristic evolutionary algorithms. However, for a non-separable
problem, the mutual dependence among the variables cripples the
fundamental structures of the SIS, which is thus not an appropriate solver
for the problem. For a non-separable problem, one usually resorts to
employing a heuristic evolutionary algorithm.

Among all of the types of well-known algorithms, the PSO is a


simple, fast and easily implemented evolution algorithm, but its
performance usually provides an unreliable result when a complicated
problem is solved, such as a multi-modal problem or a problem with a
large number of variables. Therefore, many variants of PSOs have been
developed to improve its performance on complicated problems by
modifying the parameters defined in the PSO or by introducing local
88

search methods or cooperating with other computational algorithms.


Because the SIS is well suited for separable problems, the possibility of
combining the SIS with the PSO for problems that are either separable or
non-separable is proposed here. Moreover, the mechanisms for applying
the solution obtained by the SIS are given, and a helpful guidance strategy
for the particles in the population of the PSO is also created. Therefore, the
proposed algorithm is called Modified Particle Swarm Optimization
(MPSO), which begins with distinguishing a problem type by figures and
then follows the improvement of the PSO performance with the assistance
of the SIS.

The each 3 x 3 window of the image is treated as an agent


(particles) that constitute a swarm moving around in the MRI image matrix
looking for the optimal threshold value.Each particle is treated as a point in
a two dimensional MRI image which adjusts its “flying” according to its
own flying experience as well as the flying experience of other particles.
Each particle keeps track of its coordinates in the image which are
associated with the best solution (fitness) that has achieved so far by that
particle. This value is called personal best, pbest. Another best value that is
tracked by the PSO is the best value obtained so far by any particle in the
neighborhood grey value of that particle. This value is called gbest. The
basic concept of PSO lies in accelerating each particle toward its pbest and
the gbest locations, with a random weighted acceleration at each time step
as shown in Figure 4.2
89

s k + 1
v k

v k + 1
v g b e s t

v p b e s t
s k

Figure.4.2 Concept of modification of a searching point by PSO

sk : current searching point.

sk+1: modified searching point.

vk: current velocity.

vk+1: modified velocity.

vpbest : velocity based on pbest.

vgbest : velocity based on gbest

Each particle tries to modify its position using the following


information:

the current positions,

the current velocities,

the distance between the current position and pbest,

the distance between the current position and the gbest.

The modification of the particle’s position can be mathematically


modeled according the following equation :

Vik+1 = wVik +c1 rand1(…) x (pbesti-sik) + c2 rand2(…) x (gbest-sik) (4.4)


90

where, vik : velocity of agent i at iteration k,

w : weighting function,

cj : weighting factor,

rand : uniformly distributed random number between 0 and 1,

sik : current position of agent i at iteration k,

pbesti : pbest of agent i,

gbest : gbest of the group.

The following weighting function is usually utilized in (4.4)

w = wMax-[(wMax-wMin) x iter]/maxIter (4.5)

where wMax= initial weight,

wMin = final weight,

maxIter = maximum iteration number,

iter = current iteration number.

sik+1 = sik + Vik+1 (4.6)

Comments on the Inertial weight factor:

A large inertia weight (w) facilitates a global search while a


small inertia weight facilitates a local search. By linearly decreasing the
inertia weight from a relatively large value to a small value through the
course of the PSO run gives the best PSO performance compared with
fixed inertia weight settings.
91

Larger w ----------- greater global search ability

Smaller w ------------ greater local search ability

Figure 4.3: Flow diagram for the PSO Algorithm


92

4.4.2 PSO Algorithm

Step 1: Initialization of the swarm: For a population size p, the particles are
randomly generated.

Step 2: Evaluation of the objective function: The objective function values


of the particles are evaluated using the objective functions given by
equation (2).

Step 3: Initialization of pbest and gbest: The objective values obtained


above for the initial particles of the swarm are set as the initial
pbest values of the particles. The best value among all the pbest
values is identified as gbest.

Step 4: Evaluation of velocity: The new velocity for each particle is


computed using equation (3).

Step 5: Update the swarm: The particle position is updated using equation
(4). The values of the objective function are calculated for the
updated positions of the particles. If the new value is better than
the previous pbest, the new value is set to pbest. Similarly, gbest
value is also updated as the best pbest.

Step 6: Stopping criteria: If the stopping criteria are met, the positions of
particles represented by gbest are the optimal threshold values.
Otherwise, the procedure is repeated from step 4.

Three different position vectors

In the proposed algorithm, the three creative positions, which are


denoted by xpbest avg , xSIS and xDisturb , to replace the three poorest
fitness particles among the population of particles in the PSO. This
93

replacement aims to improve both the exploitation and the exploration of the
particles, which stay in a stagnant situation.

Parameters set in the MPSO

When implementing the MPSO, the parameters used in the PSO


must be specified for the weight coefficient w, the learning coefficients c1
and c2, and the number of particles in the population Np; in SIS, the
replacement rate Nrplc and the number of points ndi to divide the search
space for each variable must be used. Additionally, the convergence
conditions, the maximum number of generations Nmax , and the convergence
criterion e are included as well. In the computation, the relevant parameters
were given values as follows: the number of particles in the population
Np=80; the weight coefficient w = 0:6; the learning coefficients c1 = 1:5 and
c2 = 2:0; the number of subintervals ndi=9 ; the replacement rate Nrplc=250;
the maximum number of generations Nmax=50,000; and the convergence
criteria e = 10 6. There are three different numbers of variables that were
used for the comparison: n = 30, n = 50, and n = 100.

This Chapter deals with the population based optimization modified


PSO with FCM. Modified PSO yield optimum threshold value is used to
select the initial cluster point for FCM implementation. Medical image
Segmentation is the partitioning of image data into related sections or regions.
This thesis has led to the development of a wide range of segmentation
methods addressing specific problems in medical applications. Some methods
proposed in the literature are extensions of methods originally proposed for
generic image segmentation.

In this thesis, a hybrid cluster algorithm using partial swarm


optimization is proposed to improve the FCM algorithm. As described in
evolutionary techniques, PSO also uses a population of potential solutions to
94

search the search space. However, PSO differs from other evolutionary
algorithms such that there are no DNA inspired operators in order to
manipulate the population. Instead, in PSO, the population dynamics
resembles the movement of a “birds‘ flock” while searching for food, where
social sharing of information takes place and individuals can gain from the
discoveries and previous experience of all other companions. Thus, each
companion (called particle) in the population (called swarm) is assumed to
‘fly’ over the search space in order to find promising regions of the landscape.
In the case of minimizing a function, such regions possess lower function
values than other visited previously.

In this context, each particle is treated as a point in a D dimensional


space, which adjusts its own ‘flying’ according to its flying experience as well
as the flying experience of other particles (companions). In our experiments, a
version of this algorithm is used adding an inertia weight to the original PSO
dynamics. Image segmentation can be treated as a clustering problem where
the features describing each pixel correspond to a pattern, and each
image region (i.e. a segment) corresponds to a cluster. Therefore many
clustering algorithms have widely been used to solve the segmentation
problem (e.g., K-means, FCM, ISODATA and Snob).

The fuzzy c-means (FCM) seems to be the most popular algorithm


in the field of fuzzy clustering. Many researchers have attempted
modifications of the classical FCM and applications to image segmentation in
the past few years.

Nevertheless, most of the existing clustering algorithms assume a


priori knowledge of the number of classes, c, while in many practical
situations, the appropriate number of classes is unknown or impossible to
determine even approximately.
95

Finding an optimal number of clusters in a large dataset is usually a


challenging task. Several researchers have investigated the problem.
However, the outcome is still unsatisfactory. Works on automatic clustering
with evolutionary strategies (ES), evolutionary programming (EP) and
variable string-length genetic algorithm (VGA) have been reported in.

Compared to a huge number of clustering algorithms based on


different kinds of evolutionary algorithms, not much work has been reported
on algorithms like Particle Swarm Optimization (PSO) or Differential
Evolution (DE) for clustering image pixels. To the best of my knowledge,
PSO has not been applied to the automatic fuzzy clustering till date.

Clustering can be defined as the optimal partitioning of a given set


of n data points into c subgroups, such that data points belonging to the same
group are as similar to each other as possible. The data points from two
different groups share the maximum difference. Image segmentation is also
considered as a clustering problem where the features describing each pixel
correspond to a pattern, and each image region corresponds to a cluster. Many
clustering algorithms have widely been used to solve the segmentation
problem like K-means, FCM etc. Some hard clustering approaches do not
consider overlapping of classes which occur in many practical image
segmentation problems.

4.5 SEGMENTATION OF MRI IMAGE WITH PSO WITH


FUZZY C MEANS (FCM)

PSO is applied to find the optimum label from the pattern matrix.
Initially, the dissimilar patterns, the corresponding labels and the MAP values
are stored in a solution matrix and the parameters such as number of iterations
(NI), number of particles (Np).
96

The posterior energy function value for all the selected kernels
from each particle is extracted from the solution matrix. Compare the
posterior energy function value for all the selected kernels from each particle,
to select the minimum value from the set, which is known as ‘Local
Minimum’ (Lmin) or ‘Iterations best’ solution. This local minimum value is
again compared with the ‘Global Minimum’ (Gmin). If the local minimum is
less than the global minimum, then the local minimum is assigned with the
current global minimum.

At the final iteration, the Gbest has the optimum label of the image.
The corresponding kernel is selected from the pattern matrix. The intensity
value of the center pixel in the kernel is selected as optimum threshold value
for segmentation. In the MRI image, the pixels having lower intensity values
than the threshold value are changed to zero. The entire procedure is repeated
for any number of times to obtain the more approximated value.

The three different methods such as FCM, PSO, and FCM with
PSO techniques for MRI image segmentation have been implemented.

The suspicious region was extracted from the MRI image based on
the combination of Markov Random Field with PSO. In MRF the image
pixels are labeled and their posterior function values were computed.FCM,
PSO and FCM with PSO were used to find the optimum label that minimizes
the Maximizing a Posterior estimate to segment the image.

Implementation of Modified PSO with FCM

The optimal value of Modified PSO is used to find out the initial
cluster point. The aim of FCM is to find cluster centers (centroids) that
minimize dissimilarity function.
97

c
The membership matrix (U) is randomly initialized as i 1
U ij 1

where i is the number of cluster

j is the image data point

The dissimilarity function can be calculated with this equation

c c n
Ci Ji Uij n dij 2
i 1 i 1 j 1

where Uij is between 0 and 1

Ci is the centroid of cluster i

dij is the Euclidean distance between ith and centriod (Ci ) and jth
data point

M is a weighiting exponent.

To calculate Euclidean distance (dij)

Euclidean distance (dij) = Cluster center pixels - current neuron

Dij = CCp – Cn

where CCp is the Cluster center pixels

Cn is the current neuron

i.e. Number of clusters is computed as

C = (N/2)1/2
98

N= no. of pixels in image

To find the Minimum dissimilarity function can be computed as

1
U ij = 2 / (m-1)
c
d ij

k=1 d kj

where dij=|| xi -cj|| and dkj=|| xi –ck||

xi is the ith of d- dimensional data

cj is the d-dimensional center of the cluster

||**|| is the similarity between any measured data and center

so these iteration will stop when the condition

Max ij { Uij(k+1)-Uijk } <€ is satisfied

where € is a termination criterion between 0 and 1

K is the iteration step

The step of the FCM Algorithm has been listed

Step 1: Initialize U = Uij matrix

(k)
Step 2: At K step initialize centre vector C =C j taken cluster center
point from Modified PSO optimal threshold value.

Step 3: Update U (k), U (k+1), then compute the dissimilarity function

1
U ij = 2 / (m-1)
c
d ij

k=1 d kj

If || U (k+1) - U (k) || < € then stop. Otherwise return to step3.


99

In the first step, the algorithm selects the initial cluster from
Modified PSO Algorithm. After several iteration of the algorithm, the final
result converges to actual cluster of Modified PSO with FCM. The aim of
Modified PSO with FCM adaptive threshold value is used to detect the tumor
region from the background region. In the MRI image, the pixels having
lower intensity values than the adaptive threshold value are changed to zero.
The entire procedure is repeated for any number of times to obtain the more
approximated value.

Step 1: The optimal value of Modified PSO giving input to the FCM.
FCM- Modified PSO Algorithm is the following:
Step 2: Calculate the cluster centers. C = (N/2)1/2
Step 3: Compute the Euclidean distances
Dij = CCp – Cn
Step 4: Update the partition matrix
1
U ij = 2 / (m-1)
c
d ij

k=1 d kj

(Repeat the step 4)


Until Max[ Uij(k+1)-Uijk ] <€ is satisfied
Step 5: Calculate the average clustering points.
c c n
Ci Ji Uij n dij 2
i 1 i 1 j 1

Step 6: Compute the adaptive threshold


Adaptive threshold =max (Adaptive threshold, ci ) i=1...n
In the MRI image, the pixels having lower intensity values than the
adaptive threshold value are changed to zero. The entire procedure is repeated
for any number of times to obtain the more approximated value.

Figure 4.4 Algorithm of modified PSO with FCM


100

4.6 EXPERIMENTS AND RESULTS

Detection of Brain Tumour Tissue from MRI using FCM

Figure 4.5 Original brain MRI

Figure 4.6 Preprocessing stage in brain tumor detection


101

Figure 4.7 Enhanced MRI

Figure 4.8 Segmented MRI using FCM


102

Detection of Brain Tumour Tissue from MRI using MPSO

Figure 4.9 MRI from database

Figure 4.10 Brain MRI in Preprocessing


103

Figure 4.11 Enhanced MRI

Figure 4.12 Segmented MRI using MPSO


104

Figure 4.13 Segmentation using MPSO -FCM

Figure 4.14 User interaction screen


105

Figure 4.15 Segmentation page on automatic system

4.7 SUMMARY AND CONCLUSION

The Meta heuristics algorithms for MRI image segmentation have


been implemented. The image segmentation has been designed to detect
tumor automatically in MRI using the FCM, Modified PSO and Modified
PSO with FCM. The following intelligent system results show the Modified
Particle swarm optimization with FCM is an extremely simple and accurate
algorithm for brain tumor detection. MPSO with FCM gives 98.4% of
accurate detection than existing algorithms. so seems to be effective for
optimizing a wide range of functions.
106

To evaluate the performance of the segmentation algorithms the


ROC curve was generated. The experimental results show that the MPSO
with FCM approach produces 0.984 as Az value. It was observed that the
Modified Particle Swarm Optimization with Fuzzy C Means algorithm
performed well.

You might also like