chap 7 image segmentation. edge-based segmentation the edge information is used to determine...
TRANSCRIPT
Chap 7
Image Segmentation
Image Segmentation
Edge-Based Segmentation The edge information is used to determine
boundaries of objects Pixel-based direct classification methods
The estimation methods derived from the histogram statistics of the image are used
Region-based methods Pixels are analyzed directly for a region growing
process based on a pre-defined similarity criterion
Edge-based image segmentation -Edge Detection Operations
The gradient magnitude and directional information can be obtained by convolving the edge detection masks with the image
yxyx
y
x
GGGGM
G
G
operationSobel
22
121
000
121
101
202
101
111
181
111
010
141
010
)(
)8(
)4(
L
L
G
G
LaplaciangradientorderSecond
Edge-based image segmentation -Edge Detection Operations
Laplacian is very sensitive to noise It is beneficial to apply a smoothing
filter(Gaussian) first before taking a Laplacian of the image
Laplacian of Gaussian (LOG) The image obtained by convolving the LOG mask
with the original image is analyzed for zero-crossing to detect edges.
yxfeyx
yxfyxg
yxfyxgyxh
yx
,2
,,
,,),(
22
22
4
222
2
2
[Gonzalez]
Edge-based image segmentation -Edge Detection Operations
LOG operation
[Gonzalez]Threshold = 0Threshold = 0
SobelSobel
LoGLoG
Edge-based image segmentation -Boundary Tracking
The closed regions can be formed by the edge-linking procedures following the edge-detection
The neighborhood bj+1 of edge point bj can be found to be a boundary point if it satisfied the following conditions.
31
21
11
1
2mod Tbb
Tbebe
Tbe
Tbe
jj
jj
j
j
Where e is the magnitude and the edge orientation
Edge-based image segmentationHough Transform
iiii yaxbbaxy
yx
spaceparameter space -
Haugh Transform
[Gonzalez]
Edge-based image segmentationHough Transform
O
Gradient e
r
p
Figure 7.2. A model of the object shape to be detected in the image using Hough transform. The vector r connects the Centroid and a tangent point p. The magnitude and angle of the vector r are stored in the R-table at a location indexed by the gradient of the tangent point p.
Gray-Level Thesholding
Tyxf
Tyxfyxg
),( if 0
),( if 1),(
Optimal Global Thresholding
The parametric distribution based methods can be applied to the histogram of an image Assume the histogram has two Gaussian distributions
)()()( 2211 zpPzpPzp
objectBackground
P(z)
z
Optimal Global Thresholding
TyxfbackgroundClass
TyxfobjectClassyxg
x,ygclass class x,yf
PP
zp
zp
zpPzpPzp
),( if )( 2
),( if )( 1 ),(
)( image segmented theof 2or 1 toclassified becan )( pixel a
1
2 class ofon distributiGaussian The:)(
1 class ofon distributiGaussian The:)(
)()()(
21
2
1
2211
)()()(
threshold theusingtion classifica pixelin error ofy probabilit overall The
1 topixel 2 a gclassifyiny erroneousl ofy probabilit The : )()(
2 topixel 1 a gclassifyiny erroneousl ofy probabilit The : )()(
pixel a yingmisclassif of iesprobabiliterror The
2112
22
11
TEPTEPTE
T
class class dzzpTE
class class dzzpTE
T
T
objectBackgroundP(z)
z
Class 2P2(z)
Class 1P1(z)
T
E1 E2
)()()()()( 2211 TETPTETPTE Mistake in textbook
Optimal Global Thresholding
For image segmentation, the objective is to find an optimal threshold T that minimizes the overall probability of error in pixel classification.
The process requires the parameterization of the probability density distributions to find the 1, 1, and 2, 2
The optimal global threshold T can be determined by finding a general solution the minimizes the equation (7.14) with mixture distribution in Equation (7.15)
)15.7( 22
)(22
22
21
21 2)(
2
22)(
1
1
zz e
Pe
Pzp
(7.14) )()()( 2112 TEPTEPTE
Optimal Global Thresholding (7.14) thus satisfies the following quadratic expression
If the variances of both classes can be assumed to be equal to 2
)/ln(2
)(2
0
211222
21
21
22
22
21
212
221
22
21
2
PPC
B
A
where
CBTAT
1
2
21
221 ln
2 P
PT
The determined threshold
Pixel Classification Through Clustering
The approach is useful when images with pixels representing a feature vector consisting of multiple parameters of interest are to be segmented. Parameters: Gray value, RGB components, contrast
and local texture measurements for each pixel Clustering may produce disjoint regions with holes or
regions with a single pixel Post-processing algorithm is usually applied region growing, pixel connectivity or rule-based
algorithm
Pixel Classification Through Clustering
k-means Clustering
Partition d-dimentional data into k clusters The objective function providing the desired properties
of the distribution of feature vectors of clusters
The algorithm is quite sensitive to the initial cluster assignment and the choice of the distance measure. (See the following algorithm for more)
Pixel Classification Through Clustering
k-means Clustering
Algorithm1. Select the number of clusters k with initial cluster centroids vi ;
i=1,2,…,k2. Partition the input data points into k clusters by assigning
each data point xj to the closest cluster centroid vi .(ex. Euclidean distance)
3. Compute a cluster assignment matrix U representing the partition of the data points with the binary membership value of the jth data point to the ith cluster such that U=[uij], where
ijij vxd
inuju
jiu
n
jij
k
iij
ij
allfor 0 and allfor 1
, allfor 1,0
11
1000
0110
0001
)clusters(
)points(
k
nuij
Pixel Classification Through Clustering
k-means Clustering
Algorithm (cont.)4. Re-computer the centroids using the membership values
as
5. If cluster centroids does not change, stop; otherwise go to step 2
i
u
xu
vn
jij
n
jjij
i allfor
1
1
The k-means clustering method optimizes the sum-of-squared-error based objective function Jw(U,v)
k
i
n
jijw vxvUJ
1 1
2),(
1000
0110
0001
)clusters(
)points(
k
nuij
Pixel Classification Through Clustering
Fuzzy k-means Clustering
Utilize an adaptable membership value (uij) that can be updated
inuju
i,ju
m
u
n
c
vxuduvUJ
n
jij
c
iij
ij
ij
c
i
n
jij
mij
c
i
n
jij
mijw
allfor 0 and allfor 1
allfor 10
index fuzziness the:
membershipfuzzy the:
vectorsdata ofnumber the:
clusters ofnumber the:
),(
11
1 1
2
1 1
2
Region Growing
Examine pixels in the neighborhood based on a pre-defined similarity criterion
The neighborhood pixels with similar properties are merged to form closed regions for segmentation
Guarantee the segmented regions of connected pixels
Region Growing
Two criteria A similarity criterion that defines the basis for
inclusion of pixels in the growth of the region A stopping criterion stops the growth of the region
1. Determine the seed for each region ( the pixels with gray 255 are selected to be seeds in this case)
2. Choose criteria for region growing• The absolute gray-level difference
between any pixels and seed• The detected pixel had to be 8-
connected to at least one pixel in that region
[Gonzalez]
Region Growing
Center Pixel
Pixels satisfying the similarity
criterion Pixels not satisfying similarity criterion
3x3 neighborhood, 100% (9/9) growth satisfied
5x5 neighborhood , 56%(9/16) growth satisfied
7x7 neighborhood, %(6/24) growth satisfied
Segmented region
1st iteration
2nd iteration
3rd iteration
The stopping criterion : the minimum percentage is 30%
An image is partitioned into a large number of potential homogeneous regions Be examined for homogeneity of pre-defined
property as gray values, contrast, texture… Two neighborhood regions with similar property are
merged
Region -Merging
Case 1 Case 2
Region -Splitting
Examine the heterogeneity of a predefined property of the entire region in terms of its distribution and the mean, variance, minimum and maximum values. Heterogeneous region R is split into two or more
regions R1, R2, …, Rn
Rule-based splitting and quad-tree based splitting
.region on thecriterion y homogeneit for the predicate logical a is )( where
,for )( 5.
.21for )( .4
.;, allfor .3
. 2.
connected. is 21; region,Each .1
1
ii
ji
i
ji
n
i
i
i
RRH
jiFALSERRH
,...,n,iTRUERH
jijiORR
RR
,...,n,iR
Region -Splitting
An image with quad region-splitting process
R1
R3
R21
R23
R22
R24
R41
R43
R42
R44
R
R1 R2 R3 R4
R21 R22 R23 R24 R41 R42 R43 R44
Quad-tree structure
Recent advances in segmentation
The large variability in anatomical structures needs of a reliable, accurate, and diagnostically useful segmentation
Model-based estimation methods Rule-based methods
Estimation-Model Based Adaptive Segmentation
-Multi-level Adaptive Segmentation (MAS)
Define Classes
Determination of Model Parameters
(From a set ofmanually segmented and labeled images)
Classification of ImagePixels Using Model
Signatures
Identification of TissueClasses and Pathology
Formation ofa New ClassNecessary?
All pixelsclassified?
ParameterRelaxation
Yes
Yes
No
No
Image Segmentation Using Neural Networks
-Neural Network
Neural Network do not require underlying class probability distribution for accurate classification
The decision boundaries for pixel classification are adapted through an iterative training process (supervised neural network)
Neural Network paradigms Backpropagation, Radial Basis Function, and Self-
Organizing Feature Maps
Image Segmentation Using Neural Networks
-Neural Network
Important works for neural network Selection of a useful set of features as input data for
classification Selection of the training examples The structure of the network
Artificial Neural Network: Backpropagation
Input Features
Output Results
Hidden Layer Neurons
Output Layer Neurons
Ly1
x1 x2 x3 xn 1
Ly2 Lny
Layer 1
.
.
.
Layer L
Image Segmentation Using Neural Networks
-Backpropropagation Neural Network
y
n
inii
eyF
yF
wxwFy
1
1
function sigmoidal a as defined becan )(1
1
Figure 7.11. A basic computational neural element or Perceptron for classification
bias
x1
xn
x2
1
n
inii wxwFy
11
wn+1
w1
w2
wn Non-Linear Activation Function F
Image Segmentation Using Neural Networks
-Backpropropagation Neural Network
.
.
.....
.
.
1
.y ;
1
.y
layerth theofoutput theis where
,...2,1for
121
1222221
1111211
2
1
2
1
0
1
knn
knn
kn
kn
kn
kn
kk
kn
kn
kk
k
kn
k
k
k
n
k
kkk
wwww
wwww
wwww
W
and
y
y
y
x
x
x
ky
LkyWFy
Inputlayer
Hiddenlayer
Outputlayer
Architectural graph
y0=-1
yi(n)
wj0(n)
wji(n)vj(n) yj(n)F
Signal-flow graph
Layer k Layer k+1
Image Segmentation Using Neural Networks
-Backpropropagation Neural Network
Least Mean Squared(LMS) error algorithm for training the neural network
1. Assign random weights in the range of [-1,+1] to all weights wij
k
2. For each classified pattern pair {y(0),yL} in the train set, do the following steps:
a. Compute the output values of each neural element using the current weight matrix.
b. Find the error e(k) between the computed output vector and the desired out vector.
c. Adjust the weight matrix using the change dW(k) computed as dW(k) =e(k)[y(k-1)] for all layers =1,…,L, where is the learning rate that can be set between 0 and 1.
3. Repeat Step 2 for all classified pattern pairs in the training set until the error vector for each training example is sufficiently low or zero.
RBF Network
RBF Unit 1
RBF Unit 2
RBF Unit n
Input ImageSliding
Image Window
Output
Linear Combiner
RBF Layer
RBF Network
The final output of the network f(x)
K
j j
j
i
i
k
ii
cx
cx
i
iwxf
1
1
2exp
2exp
),(
),()(
x with
x
ci : the K centerswi : the K weighted connections from the hidden layer units to the output unit.
RBF Network
Within the basic topology, the system can be represented in state-space from y=(F,w), where F is the matrix of activation functions
yFIFFw
Kxx
Kxx
F
TT
NN
1
11
),(...)1,(
.........
),(...)1,(
The weight van be calculated from the Moore-Penrose inverse
where is a small value such as 0.1
RBF NN Based Segmentation