Intelligent Fuzzy System Based Dermoscopic Segmentation for Melanoma Detection
CHAPTER 3 PROPOSED FUZZY LOGIC BASED SEGMENTATION...
Transcript of CHAPTER 3 PROPOSED FUZZY LOGIC BASED SEGMENTATION...
45
CHAPTER 3
PROPOSED FUZZY LOGIC BASED SEGMENTATION
APPROACHES
3.1 INTRODUCTION
Fuzzy logic is a form of multi-valued logic derived from fuzzy set
theory to deal with reasoning, which is approximate rather than precise. Unlike
binary set with crisp logic, fuzzy set has its output membership values ranging
from 0 to 1. This membership value corresponds to the degree of truth. When
membership value is high it is nearer to the expected result, and when it is low
the result is negligible. Need of fuzzy system is inevitable because Fuzzy
techniques are powerful tools for knowledge representation, processing, and has
the ability to manage the vagueness and ambiguity efficiently (Zadeh 1968).
Since echocardiographic images are noisy, ambiguity in delineating
endocardium borders can be resolved effectively using fuzzy logic.
3.2 FUZZY IMAGE PROCESSING
Fuzzy image processing is the collection of all approaches that
understand, represent and process the images, its segments and features as
fuzzy sets. The representation and processing depend on the selected fuzzy
techniques and on the problem to be solved (Hamid R Tizhoosh 2009).
Fuzzy image processing has three main stages: image
fuzzification, modification of membership values, and if necessary, image
defuzzification as given in Figure 3.1.
46
Figure 3.1 Structure of fuzzy based image processing
The fuzzification and defuzzification steps are required to
stimulate fuzzy hardware. Therefore, the coding of image data (fuzzification)
and decoding of the results (defuzzification) are steps that make it possible to
process images with fuzzy techniques. The main power of fuzzy image
processing is in its middle step (modification of membership values). After
the image data are transformed from gray-level plane to the membership
plane (fuzzification), appropriate fuzzy techniques can be applied on the
membership values to obtain desirable results. This can be a fuzzy clustering,
a fuzzy rule-based approach, a fuzzy integration approach and so on (Hamid
R Tizhoosh 2009). In this thesis, fuzzy rule based approach has been
implemented.
In many image processing applications, it is required to use expert
knowledge to overcome the difficulties (e.g. object recognition, scene
analysis). Fuzzy set theory and fuzzy logic offer powerful tools to represent
and process human knowledge in the form of fuzzy if-then rules. On the other
side, many difficulties in image processing arise because the data are
uncertain. This uncertainty, however, is not always due to the randomness but
Expert
Knowledge
Membership
modification
Fuzzy logic
fuzzy set theory
Image
defuzzificationImage
fuzzification
Input
image Result
47
due to the ambiguity and vagueness. This can be resolved by applying fuzzy
rules.
3.3 SEGMENTATION OF ECHOCARDIOGRAPHIC IMAGES
USING FUZZY LOGIC
In echocardiographic images, the transition in texture properties of
blood pool and myocardium is unique to a particular echocardiographic image
due to acoustic impedance (Issac Bankman 2008). This property is utilized to
track the endocardium. However, in presence of speckle noise and poor image
acquisition ambiguity pose a great challenge in segmentation. This thesis
presents a novel technique using Texture transition guided by fuzzy logic to
resolve ambiguity and to produce accurate results. A more generalized
technique is proposed in this thesis coined as Fuzzyshed, which combines the
flexibility of fuzzy logic and edge characteristics of gradients for efficient
image segmentation. In the proposed fuzzyshed, fuzzy rules are formulated
based on edge characteristics present in the image. This approach tries to root
out the complexity of morphological operations and gives better results when
compared with the traditional watersheds.
3.4 PROPOSED TRANSTEXTURE BASED SEGMENTATION
USING FUZZY LOGIC
3.4.1 System Overview
The proposed system starts with the key frame selected from
echocardiographic video. Pre-processing of the image is done for removing
the noise and to enhance the image quality. After pre-processing,
segmentation and tracking are performed by formulating the fuzzy rules with
the help of texture properties. Figure 3.2 shows the overall system flow
diagram of proposed Transtexture based segmentation with fuzzy logic.
48
Figure 3.2 System Flow Diagram of Proposed Transtexture
3.4.2 Forming Fuzzy Sets (Fuzzification)
In this proposed work, fuzzification of image is done using texture
properties of the image. Texture properties are calculated using Gray Level
Co-occurrence Matrix (GLCM) at desired direction. The gray-level co-
occurrence matrix P[i, j] is defined by first specifying a displacement vector
d = (dx, dy) and counting all pairs of pixels separated by ‘d’ having gray
levels ‘i’ and ‘j’ in the direction ‘s’. Any texture properties like energy,
homogeneity, Entropy and Contrast (Haralick et al 1973) can be used for
segmentation. Each texture property constitutes an input membership function
for the Fuzzy Inference System (FIS). However, running time of fuzzy based
Calculating texture
properties
Gaussian Smoothening Adaptive Thresholding
Forming the Contour
Pre-processing
Key Frame Selection
Formulating
Fuzzy Membership
Functions
Framing Fuzzy RulesFuzzy System
Evaluation
Identifying Edge Points
Segmented Output
Building Fuzzy
Inference
System
Boundary
Tracking
Input Video
49
algorithm increases with number of inputs. Hence, it is important to choose
appropriate inputs for fuzzy system.
Segmentation methods like active contours (Jierong Cheng et al
2004) and watershed (Ivana Mikic et al 1988) have proven that energy
component of an image contribute more towards edge detection.
Homogeneity is the measure of closeness in distribution of elements in Gray
Level Co-occurrence Matrix (GLCM), which assists in determining the
transitions in image at ambiguous regions. Hence energy and homogeneity
were used in this technique.
Energy = デ デ P態托棚 [i , j]択辿 (3.1)
Homogeneity =デ デ 沢渡宕 [辿 ,棚]登套怠袋|辿貸棚| (3.2)
where P - Gray Level Co-occurrence Matrix for current pixel under
consideration
The proposed fuzzy system is shown in Figure.3.3,
Figure 3.3 Fuzzy system overview
50
3.4.3 Fuzzy Rule Formation
In this proposed work, input membership functions are chosen to
be Gaussian as these curves have the advantage of being symmetric and
nonzero at all points. Output membership functions are opted to be triangular
because these straight line membership functions have the advantage of
simplicity and produces crisp output. The Gaussian membership function is
given by the equation
Gaussian(x: ヅ,ぴ ) = e貼 (灯貼ヅ )鉄鉄涜鉄 (3.3)
Mean of the image is the average of all pixels as given in equation
(3.4). Standard deviation of the image is average deviation of one pixel from
another, as given in equation (3.5).
µ =怠朝 デ 捲沈朝沈退怠 (3.4)
j = 謬怠択 デ (x辿 伐 µ)態択辿退怠 (3.5)
where 捲沈 – Current pixel texture value.
µ – Mean of input membership function.
j – Standard deviation of input membership function.
In equation 3.3 determining µ is important in defining membership properties
which can be done using texture transition.
Any echocardiographic image can be segmented in three regions
namely endocardium, myocardium and epicardium. Texture properties of
myocardium and blood pool are constant throughout the region, therefore
µmyocardium, µBlood-pool can be assigned directly to the Gaussian input
membership function. By heart’s anatomy, endocardium is the tissue
separating myocardium and blood pool. Hence endocardium shows a
transition in texture characteristics which is illustrated in Figure 3.4. However,
51
the transition is not clear due to ambiguity caused by acoustic impedance
mismatch during acquisition. Hence, µendocardium is computed as an average of
transition values.
Figure 3.4 Transition Characteristics of LV
Figure 3.5 a, b shows the plots for input membership functions energy and
homogeneity
(a) (b)
Figure 3.5 (a) Gaussian membership functions for Energy
(b) Gaussian membership functions for Homogeneity
Figure 3.6 shows the plot for triangular membership function.
1 2 2 1
Blood-Pool
MyocardiumMyocardium
Endocardium Endocardium
52
Figure 3.6 Triangular membership functions for pixel classification
Fuzzy rules were formulated based on the knowledge of heart’s
anatomy. The rules were to exhibit the transition phenomenon explained
above. Based on input membership values the fuzzy rules guide the fuzzy
system to produce the output as edge or non edge pixel.
1. If the energy value belongs to blood pool and the
Homogeneity value belongs to blood pool then current pixel is
not an edge pixel.
2. If the energy value belongs to blood pool and the
Homogeneity value belongs to endocardium then current pixel
is not an edge pixel.
3. If the energy value belongs to blood pool and the
Homogeneity value belongs to myocardium then current pixel
is not an edge pixel.
4. If the energy value belongs to endocardium and the
Homogeneity value belongs to blood pool then current pixel is
not an edge pixel.
5. If the energy value belongs to endocardium and the
Homogeneity value belongs to endocardium then current pixel
is an edge pixel.
- - -Non-edge
___Edge
53
6. If the energy value belongs to endocardium and the
Homogeneity value belongs to myocardium then current pixel
is not an edge pixel.
7. If the energy value belongs to myocardium and the
Homogeneity value belongs to blood pool then current pixel is
not an edge pixel.
8. If the energy value belongs to myocardium and the
Homogeneity value belongs to endocardium then current pixel
is not an edge pixel.
9. If the energy value belongs to myocardium and the
Homogeneity value belongs to myocardium then current pixel
is not an edge pixel.
Figure 3.7 Fuzzy rules for Defuzzification
The fuzzy rules formation is described in Figure 3.7 and 3D-
simulation of membership rules is shown in Figure 3.8
54
Figure 3.8 3D- Simulation of membership rules
3.4.4 Results of Transtexture
Analysis of heart function was done with various views of
echocardiographic images; experiments were conducted over different views.
Several meaningful quantifications could be derived from the segmented
results; the process of quantification was given in chapter 6. Table 3.1 gives
error with respect to manual segmentation.
Table 3.1 Absolute Error Calculation for Transtexture
Axis View Number of
expert
selected
points
Number of
matching points in
Texture
based fuzzy
Absolute
error
(in
pixels)
Percentage
Error
Apical four
chamber150 133 18 12%
Apical two
chamber150 136 14 9%
Parasternal
short axis150 134 16 11%
Parasternal
long axis150 132 18 12%
55
The segmentation results of Transtexture for various views of
echocardiography are shown in Figure 3.9. For clarity, the segmented
results are overlapped over the input image.
Figure 3.9 (a) Short axis view end diastole
Figure 3.9 (b) Parasternal long axis view end diastole
56
Figure 3.9 (c) Parasternal Long axis view end systole
Figure 3.9 (d) Apical two chamber view end diastole
Figure 3.9 Segmentation results of Transtexture
57
3.4.5 Noise Resistance
Once the boundary has been tracked it is necessary to check the
robustness of the method. Speckle noise is the common noise present in the
ultrasound images (Gary Jacob et al 2002), the proposed method’s robustness
towards speckle noise needs to be analysed. Hence, to check the noise
resistance of the proposed Transtexture method, speckle noise has been added
at random (ranging from 1% to 30%) to the images and segmentation has
been performed with different edge detection methods.
Figure 3.10 a) Segmentation results of various methods on a sample
image without noise b) c) d) Segmentation results of various
methods over a sample image with noise at 10% 20% and
30% respectively.
58
The segmented curve is compared with that of experts curve and
error in segmentation due to noise is computed using the Euclidean distance
measure (Borgefors 1986). Figure 3.11, plots the error rate of various edge
detection methods against noise levels. Result shows that integration of
texture properties and fuzzy logic makes the delineation reliable up to 20% of
speckle noise. The Error Rate (ER) is calculated as,
継迎 =
軽憲兼決結堅"剣血"結捲喧結堅建"嫌結健結潔建結穴"喧剣件券建嫌 伐 軽剣┻ 剣血"兼欠建潔月件券訣"喧剣件券建嫌"決検"建月結 喧堅剣喧剣嫌結穴兼結建月剣穴軽憲兼決結堅"剣血"結捲喧結堅建"嫌結健結潔建結穴"喧剣件券建嫌 "捲 100
Figure 3.11 Error rates of various segmentation methods against noise
levels
From Figure 3.11 it can be observed that the proposed Transtexture
based segmentation is resistive to noise level up to 15% and produces
acceptable results. Hence, the proposed system is adaptable to noisy images
which are common in ultrasound imaging.
0.0
10.0
20.0
30.0
40.0
50.0
60.0
70.0
80.0
90.0
5 10 15 20 25 30
Erro
r Rat
e
Noise added (%)
Proposed Transtexture
Canny
Sobel
Prewitt
59
3.5 PROPOSED FUZZYSHEDS - A NOVEL WATERSHED
SEGMENTATION
3.5.1 Watershed Definition and Principles
The basic idea of watershed segmentation has been to consider the
object as catchment basins in topography. Image data can be interpreted as a
topographic surface where the gradient image gray-level represent altitudes.
Region edges correspond to high watersheds and low-gradient region interiors
correspond to catchment basins. Figure 3.12, illustrates the one dimensional
view of watersheds formation (Han Sun et al 2005).
Figure 3.12 Illustration of One dimensional watershed
3.5.2 Watershed Lines
Watershed lines are those regions which do not correspond to any
catchment basins in an image. Each region formed within a watershed line
must contain only one catchment basin. Figure 3.13 is the illustration of
watershed lines.
Inte
nsit
y
Image size
Catchment
Basin た2
Catchment
Basin た1
た1 た2
Watersheds
Minima
60
(a) (b)
Figure 3.13 a) Sample image b) Watershed lines superimposed on
original image
3.5.3 Proposed System Overview
The process had started with pre-processing step to remove
acquisition noise which is done by Gaussian filtering technique. Gradient
image was generated using Sobel mask, followed by the fuzzy flooding stage
for creating watersheds; final output will be the image with segmented
objects. Figure 3.14, shows the overall system diagram of the proposed fuzzy
shed.
Figure 3.14 System Flow Diagram of Proposed Fuzzyshed
Watershed Lines
Image
Pre-processing
Gradient image
Object detection
phase
Fuzzy flooding
Segmented
Image
Fuzzy
System
61
3.5.4 Forming Fuzzy Sets
The Gaussian membership function is given by the equation,
Gaussian(捲┺ 航┸ 購 ) 噺 結貼 (猫貼杯 )鉄鉄配鉄 (3.6)
where x – Current pixel’s intensity value.
µ – Gradient value of the object under flooding.
j – Local standard deviation of the image.
Standard deviation of the image is average deviation of one pixel
from another. Figure 3.15 shows the fuzzy system structure of proposed
Fuzzyshed.
Figure 3.15 Fuzzy system structure of the proposed Fuzzyshed method
62
3.5.5 Fuzzy Flooding Phase
If g(x) is gradient over the image function f(x), then first change in
gradient magnitude represents the first object boundary. Fuzzy system
processes all neighbouring pixels and evaluates whether they belong to same
object or not. This allows object boundary detection in all possible directions.
Evaluation process is again performed on those neighbours who passed
previous evaluation and for a neighbour identified as a boundary pixel,
evaluation is not performed. This enables to end the process when entire
boundary of current object is detected. In a digital space with eight connected
neighbours there is a strong chance for a pixel to be evaluated more than
once, hence possesses a complexity of O(n2), where n is the number of pixels
in the image. So to reduce the computational complexity, evaluation is done
only to those pixels which were not processed earlier.
This evaluation process is called as fuzzy flooding, as this process
explores the entire object and stops when detecting object boundary and
avoids retracing of objects. Thus only unexplored neighbours are evaluated
there by restricting the time complexity to O(n). Figure 3.16, illustrates the
fuzzy flooding process for a sample object.
3.5.6 Iterative Phase
Fuzzy system evaluates neighbours of the first boundary pixel
identified during the previous flooding phase. Flooding phase is resumed on a
pixel which passes the evaluation. Therefore if no pixel passes the evaluation
then one of the failed neighbours is chosen as current pixel with a condition
that preferred neighbour must not belong to a set, processed in earlier
flooding phases. Before resuming the flooding process the mean value of
input membership function is set as gradient value of current pixels
neighbourhood that passed evaluation.
63
(a) (b) (c)
(d) (e) (f)
Figure 3.16 Result of fuzzy flooding on a sample image. a) Original
image (b – f) Objects identified at each flooding phase.
3.5.7 Fuzzyshed – Pseudocode.
Input : Gradient of input image, f
Output : Labeled image, L
MF: mirror of f // used to avoid repeated processing.
p: current pixel; N(p): Neighbour pixel of p;
1. f(p) 柑 Gradient of p;
2. ヅ = f(p);
3. ぴ = standard deviation of image
4. Q丹,Q脱,Q嘆 柑 FIFO QUEUE;
5. p = f(1,1);
6. MF = 0; // initialize all pixels to 0;
7. while ( All pixels in f are not processed)
8. {
9. While (Q丹 塙 empty) // object detection phase
64
10. {
11. p = dequeue 盤Q丹匪;12. if (MF(p) = = 0 )
13. {
14. if(Fuzzy evaluation of p is true)
15. {
16. enqueue岾Q丹,N(p)峇 ;
17. enqueue(Q嘆,p);
18. MF(p) = 1;
19. } // end of inner if
20. else
21. {
22. enqueue(p,Q脱) ;
23. } // end of else
24. }// end of outer if
25. } // end of while
26. while(Q嘆 塙 empty) // Fuzzy flooding
27. {
28. p = dequeue(Q嘆) ;
29. L(p) = label;
30. }
31. label = label + 1;
32. p = dequeue(Q脱) ;
33. enqueue (Q丹,p) ;
34. µ = p; // reinitialize input membership function to current
object’s mean value.
35. }
65
Segmentation results of Fuzzyshed for echocardiographic images
for different axes views are shown in Figure 3.17. Table 3.2 gives error with
respect to manual segmentation and Table 3.3 gives Comparison of Proposed
fuzzy methods with existing methods.
3.5.8 Results of Proposed Fuzzyshed
(a) (b)
Figure 3.17 a) Sample image b) Results of proposed Fuzzyshed
Table 3.2 Absolute Error Calculation for Fuzzyshed
Axis ViewNumber of
expert
selected points
Number of
matching points
in Fuzzyshed
Absolute
error
(in pixels)
Percentage
Error
Apical four
chamber150 136 14 9%
Apical two
chamber150 142 8 6%
Parasternal
short axis150 136 14 9%
Parasternal
long axis150 138 12 8%
66
Table 3.3 Comparison of proposed fuzzy based methods with existing
methods
MethodACC if
APD<2
CA if
APD<2-2.5ACC+CA
Rejected
if APD>2.5
Canny 82.80% 2.80% 85.60% 14.40%
Prewitt 80.20% 1.60% 81.80% 18.20%
Sobel 79.00% 0.70% 79.70% 20.30%
Traditional Watershed 80.60% 1.20% 81.80% 18.20%
Texture Based Fuzzy 83.00% 2.80% 85.80% 14.20%
Transtexture 84.92% 4.40% 89.32% 10.68%
Fuzzyshed 87.24% 5.40% 92.64% 7.36%
ACC-Acceptable, CA-Conditionally Accepted, APD- Average Pixel Difference
3.6 CONCLUSION
In this chapter two novel fuzzy logic based segmentation techniques
have been proposed and discussed. The first proposed Transtexutre based
segmentation method uses endocardial border model to segment the
endocardium of Left Ventricle. Fuzzy rules were framed based on endocardial
border model and combination of texture properties such as energy and
homogeneity. This proposed fuzzy system effectively segmented
endocardium at ambiguous regions which can be observed from segmentation
results. It can be inferred from the results that Texture properties coupled with
fuzzy logic produced good segmentation results with error percentage as low
as 10.68%. Experimental results show that the novel Transtexture based fuzzy
system is highly robust to noise and produces acceptable results up to 15% of
noise. The second proposed Fuzzyshed has the unique way of stimulating
flooding process of watersheds using dynamic fuzzy rules. The novel
Fuzzyshed method overcomes the problem of over-segmentation existing in
morphological watershed, by avoiding creation of watershed lines.
Experimental results proved that proposed Fuzzyshed based segmentation is
adaptable to echocardiographic images and produces good segmentation
results with an accuracy of 92%.