Professional Documents
Culture Documents
TSIM - Graph Cuts
TSIM - Graph Cuts
• Outline
– Segmentation of medical images
– Classical methods
– Morphological methods
– 1st exercise, image segmentation
– Active contours
– Graph-based methods
– Active shape models (ASM)
– Machine learning: Clustering
– 2nd exercise, clustering segmentation
Graph G=(V,E)
Abstract representation of a set of objects where some pairs are
connected by links
– Vertices or nodes (V)
– Edges (E)
V E
i j
w(i,j)
• Undirected graph
– Edges have no orientation
i j
w(i,j)=w(j,i)
• Directed graph
– Arcs, directed edges or arrow
i j i j
w(i,j)≠w(j,i)
TSIM (2022-2023) - Segmentation of medical images 4
Introduction to graphs
4-connected 8-connected
Neighbor connectivity
Gerenalized connectivity
(
w ( i , j ) = exp − ( I ( i ) − I ( j ) ) 2 g2
2
)
– Affinity matrix: Generalized Adjacency matrix with weights
• Affinity matrix W
– Is a weighted adjacency matrix
– Non connected pixels -> wi,j= 0 Neighboring pixels (Small kernel)
i = 0,..., N − 1
j
w
Neighboring pixels (Large kernel)
Wi , j = w ( i , j )
w
TSIM (2022-2023) - Segmentation of medical images 11
Affinity matrix
w
Neighboring pixels (Large kernel)
• Superpixels:
– Atomic regions, which can be used to replace the rigid
structure of the pixel grid
Buyssens P, et al. “Eikonal based region growing for superpixels generation: Application to semi-
supervised real time organ segmentation in CT images”. IRBM, vol. 35(1),pp. 20-26, 2014.
(
w ( i , j ) = exp − d ( i , j ) 2 d2
2
)
– Histogram-based affinity: d(i , j) = Lki − Lkj
k
• Advantages:
– Dimensionality
• Set of pixels instead of individual pixels
– Complex statistics to compute affinity
• Graph cut
– Remove a subset of edges to partition the weighted graph G(V,E) into
two disjoint sets of nodes A,B (two sub-graphs):
A B = V ; A B =
– Cut: sum of weights for the edges that have been removed
(also known as capacity)
cut ( A, B ) = w ( i , j )
iA , jB
• Minimum cut
– Cut that minimizes the sum of weights w
• Maximizes the similarity within sets.
min-cut(G) = argmin w ( i , j )
cut ( A ,B )
iA , jB
• Markers
– Additional nodes with “infinity” weights
– Associated to segments
w=
• Markers
min-cut(G) = argmin w(i ,S) + w(j,T) + w ( i , j )
cut ( A ,B )
iA jA iA , jB
• Min-cut/max-flow theorem:
– The maximum flow passing from the source to the sink is
equal to the total weight of the edges in the minimum cut
Boykov algorithm
– Max-flow algorithm for undirected graphs
– Two markers (source and sink)
– Solved in polynomial time
Min-cut == max-flow:
the maximum source-to-sink flow is equal to the capacity of
the minimum cut
Boykov et al. An Experimental Comparison of Min-Cut/Max-Flow Algorithms for Energy
Minimization in Vision, IEEE Transactions on PAMI, (26) 9, 2004
• Drawbacks of min-cuts:
• Not normalized, so can segment small objects (e.g., noise)
• Compute inter-cluster difference, but not intra-cluster
similarity
V assoc(A,V)
cut(A,B) assoc(B,V)
V A B assoc(A,V)
J. Shi and J. Malik. Normalized Cuts and Image Segmentation. IEEE Trans.
Pattern Analysis and Machine Intelligence,vol. 22(8)8, 2000
assoc(B,B)
assoc(A,A) cut(A,B)
• Subject to: yT y = 1
– Eigenvalue problem: Wy = y yT W y = yT y
Thoracic CT
• Bone segmentation in CT
• https://cs.uwaterloo.ca/~yboykov/pubs.html