Some links between min-cuts, optimal spanning forests and watersheds
Cédric Allène, Jean-Yves Audibert, Michel Couprie, Jean Cousty & Renaud Keriven
ENPC – CERTIS
ESIEE – A²SI
Université Paris-Est - France
Some links between min-cuts, optimal spanning forests and watersheds
1) Motivation
Outline
2) Usual algorithms in graph a) Min-cuts
b) Watersheds c) Shortest-path spanning forests cuts (SPSF cuts) d) Comparisons of results
3) Links
a) Link between watersheds and SPSF cuts b) Link between min-cuts and watersheds
4) Conclusion
Some links between min-cuts, optimal spanning forests and watersheds
- 1 Motivation: graph segmentation
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Image segmentation
An image
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Image segmentation
A set of markers on the image
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Image segmentation
How to find a good segmentation?
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Energy to minimize Let I be an image. Let s and t be two pixels of I. We denote by: : the value of the pixel s; : the neighbourhood of the pixel s; : the label given to the pixel s. Example of energy to minimize for the segmentation:
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
What about graphs? A graph G is composed of: a set of nodes, denoted by V,
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
What about graphs? A graph G is composed of: a set of nodes, denoted by V,
a set of edges linking a couple of nodes, denoted by E.
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
What about graphs? A graph G is composed of: a set of nodes, denoted by V,
a set of edges linking a couple of nodes, denoted by E.
Edge weighted graph: Application
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Image to graph
Building of the graph: • Each pixel → node • Pixels s and t are neighbours → edge e={s,t} of weight
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Image to graph
Edge-weighted graph
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Markers
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Result: frontier
Link to energy: minimization of the sum of the dashed edges
Some links between min-cuts, optimal spanning forests and watersheds
1 – Motivation: graph segmentation
Result: partition
Link to energy: maximization of the sum of the bold edges
Some links between min-cuts, optimal spanning forests and watersheds
- 2 Usual algorithms in graph segmentation
Some links between min-cuts, optimal spanning forests and watersheds
1 – Graph segmentation
Vocabulary on graphs
Marker M subgraph of G
Some links between min-cuts, optimal spanning forests and watersheds
1 – Graph segmentation
Vocabulary on graphs
Marker M
Extension relative to M subgraph of G for which each connected component contains exactly one connected component of M
Some links between min-cuts, optimal spanning forests and watersheds
1 – Graph segmentation
Vocabulary on graphs
Marker M
Extension
Spanning extension relative to M extension relative to M which contains all the nodes of G
Some links between min-cuts, optimal spanning forests and watersheds
1 – Graph segmentation
Vocabulary on graphs
Marker M
Extension
Spanning extension
Maximal extension relative to M spanning extension relative to M which can’t be strictly contained by another extension relative to M
Some links between min-cuts, optimal spanning forests and watersheds
1 – Graph segmentation
Vocabulary on graphs
Marker M
Extension
Spanning extension
Maximal extension
Spanning forest relative to M spanning extension relative to M from which you can’t remove any edge without loosing the spanning extension property
Some links between min-cuts, optimal spanning forests and watersheds
Vocabulary on graphs 1 – Graph segmentation
Maximal extension
Marker M
Extension
Spanning extension Spanning forest
Cut relative to M set of edges linking two different connected components of a spanning extension relative to M
Some links between min-cuts, optimal spanning forests and watersheds
Vocabulary on graphs 1 – Graph segmentation
Maximal extension
Marker M
Extension
Spanning extension
Cut Spanning forest
Correspondance with image
Some links between min-cuts, optimal spanning forests and watersheds
2 – Usual algorithms in graph segmentation a - Min-cuts
Min-cuts
Minimizing the cut’s weight = Maximizing the maximal extension’s weight Searching the maximum flow (Ford & Fulkerson, 1962) = Searching the min-cut of a marker with 2 connected components Computing complexity : polynomial Drawback: for more than two connected components in the marker, can only give an approximated result through successive cuts… (NP-complete)
Some links between min-cuts, optimal spanning forests and watersheds
2 – Usual algorithms in graph segmentation b - Watersheds
Watersheds
Origin: S. Beucher & C. Lantuéjoul, 1979 Searching a watershed = Searching the cut induced by a spanning forest of minimum weight relative to the minima of the graph Computing complexity: linear (J. Cousty & al., 2007) Drawback: doesn’t take into account all the edges of the maximal extension…
2 – Usual algorithms in graph segmentation c – SPSF cuts
Some links between min-cuts, optimal spanning forests and watersheds
Shortest-path spanning forest cuts (SPSF cuts) Let M be a subgraph of G, x be a node of G\M and π be a path in G from x to M. We define: Length of a path: Connection value of x: Definition: A subgraph F of G is a SPSF if and only if F is a spanning forest and for any node x of F there exists a path π in F from x to M such that P(x)=P(π).
2 – Usual algorithms in graph segmentation c – SPSF cuts
Some links between min-cuts, optimal spanning forests and watersheds
Shortest-path spanning forest cuts (SPSF cuts)
Origin: J.K. Udupa & al., 2002; A.X. Falcao & al., 2004; R. Audigier & R.A. Lotufo, 2006 Computing complexity: quasi-linear Drawback: doesn’t take into account all the edges of the maximal extension…
Some links between min-cuts, optimal spanning forests and watersheds
2 – Usual algorithms in graph segmentation b - Watersheds
Remark about comparison
Min-cuts are of low value whereas watersheds or SPSF cuts are of high value. In the objective to compare min-cuts with watersheds or SPSF cuts working on the same data, we consider a strictly decreasing function applied to the weights of the graph before computation of a watershed or a SPSF cut.
2 – Usual algorithms in graph segmentation d - Comparisons of results
Some links between min-cuts, optimal spanning forests and watersheds
Comparisons of results
Min-cut
Watershed / SPSF cut
Similar results between watershed and SPSF cut, but differences with min-cut.
2 – Usual algorithms in graph segmentation d - Comparisons of results
Some links between min-cuts, optimal spanning forests and watersheds
Comparisons of results
Markers
Min-cut
Watershed / SPSF cut
"Best": min-cut
Drawback of watershed / SPSF cut: leak point
2 – Usual algorithms in graph segmentation d - Comparisons of results
Some links between min-cuts, optimal spanning forests and watersheds
Comparisons of results
Markers
Min-cut
Watershed / SPSF cut
"Best": watershed / SPSF cut Drawback of min-cut: as a global minimum, the cut is minimum with a few edges of high value rather than lots of edges of low value…
Some links between min-cuts, optimal spanning forests and watersheds
- 3 Links
3 – Links a - Link between watersheds and SPSF cuts
Some links between min-cuts, optimal spanning forests and watersheds
Link between watersheds and SPSF cuts Theorem 1: A spanning forest of minimum weight is a SPSF.
3 – Links a - Link between watersheds and SPSF cuts
Some links between min-cuts, optimal spanning forests and watersheds
Link between watersheds and SPSF cuts Theorem 1: A spanning forest of minimum weight is a SPSF. Theorem 2: A SPSF relative to the minima of the graph is a spanning forest of minimum weight relative to the minima of the graph.
3 – Links a - Link between watersheds and SPSF cuts
Some links between min-cuts, optimal spanning forests and watersheds
Link between watersheds and SPSF cuts Theorem 1: A spanning forest of minimum weight is a SPSF. Theorem 2: A SPSF relative to the minima of the graph is a spanning forest of minimum weight relative to the minima of the graph. Consequence: A SPSF cut relative to the minima of the graph is a watershed. (found by us and independently by R. Audigier & al., 2007)
3 – Links a - Link between watersheds and SPSF cuts
Some links between min-cuts, optimal spanning forests and watersheds
Link between min-cut and watershed We denote by P[n] the application of weight risen to power n. Theorem: There exists a real number m such that for any n ≥ m, any min-cut relative to the marker M for P[n] is the cut induced by a maximum spanning forest relative to the marker M for P[n]. Consequently, if M is the maxima of the graph, this min-cut is a watershed. Remark: The value of n acts like a smoothing parameter for the cut.
3 – Links a - Link between watersheds and SPSF cuts
Some links between min-cuts, optimal spanning forests and watersheds
Link between min-cut and watershed We denote by P[n] the application of weight risen to power n. Theorem: There exists a real number m such that for any n ≥ m, any min-cut relative to the marker M for P[n] is the cut induced by a maximum spanning forest relative to the marker M for P[n]. Consequently, if M is the maxima of the graph, this min-cut is a watershed. Remark: The value of n acts like a smoothing parameter for the cut.
Some links between min-cuts, optimal spanning forests and watersheds
3 – Links b - Link between min-cuts and watersheds
Link between min-cut and watershed: Rise of the power of graph weights for min-cuts Min-cut
Watershed
Rise to square: min cut = watershed
Some links between min-cuts, optimal spanning forests and watersheds
3 – Links b - Link between min-cuts and watersheds
Link between min-cut and watershed: Rise of the power of graph weights for min-cuts Min-cut
Marker
Watershed
Power n = 1
Power n = 1,4
Power n = 2
Power n = 3
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Intuitively… Let Cn be the min-cut for the weight at power n. Weight of the cut:
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Intuitively… Let Cn be the min-cut for the weight at power n. Weight of the cut: Looks like n-norm:
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Intuitively… Let Cn be the min-cut for the weight at power n. Weight of the cut: Looks like n-norm: When n is rising you converge towards infinity-norm:
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Intuitively… Let Cn be the min-cut for the weight at power n. Weight of the cut: Looks like n-norm: When n is rising you converge towards infinity-norm:
Consequently:
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Intuitively… Min-cut
Watershed
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Intuitively… Min-cut
Watershed
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Intuitively… Min-cut
Watershed
Some links between min-cuts, optimal spanning forests and watersheds
- 4 Conclusion
Some links between min-cuts, optimal spanning forests and watersheds
Conclusion
4 – Conclusion
Equivalence between watersheds and SPSF cuts relative to minima Link from min-cuts to watersheds Rise of the power for min-cuts ≈ smoothing parameter of the cut
Some links between min-cuts, optimal spanning forests and watersheds
Conclusion
4 – Conclusion
Equivalence between watersheds and SPSF cuts relative to minima Link from min-cuts to watersheds Rise of the power for min-cuts ≈ smoothing parameter of the cut Watersheds: fast but isn’t global (leak points) Min-cuts: slow but global minimum (for a marker with 2 connected components) and has smoothness parameter
Future work: link from watersheds to min-cuts?
Some links between min-cuts, optimal spanning forests and watersheds
Thank you for your attention! Any question?
Marker
Min-cut (power p = 1)
Min-cut (power p = 1,4)
Min-cut Watershed, SPSF cut (power p = 2) and min-cut (power p = 3)
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Scheme of proof
F: spanning forest of maximum weight (MaxSF) for the graph risen to power n C: min-cut for the graph risen to power n F’: MaxSF for the graph complementary of C risen to power n
We just have to prove that P(F) = P(F’).
Let p1,…,pk be the different values of weight in the graph with p1>…>pk. Let nh(X) be the number of edges of weight ph in the subgraph X. k k So we have: P(F ) = ∑h =1 nh (F )× ph and P(F ') = ∑h =1 nh (F ')× ph
Which comes to proving that for any h: nh (F ) = nh (F ')
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Leveling (thresholding)
Let Xh be the subgraph of X composed with only the edges of weight greater or equal to ph.
G2 (p2 = 8)
G3 (p3 = 7)
G4 (p4 = 6)
G6 (p6 = 4)
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Lemma 1
For any h, Fh is a spanning forest relative to the markers for Gh.
G3 (p3 = 7)
F3 (p3 = 7)
G6 (p6 = 4)
F6 (p6 = 4)
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Lemma 2
For any h, F’h is a spanning forest relative to the markers for Gh.
G3 (p3 = 7)
F’3 (p3 = 7)
G6 (p6 = 4)
F’6 (p6 = 4)
3 – Links b - Link between min-cuts and watersheds
Some links between min-cuts, optimal spanning forests and watersheds
Lemma 3 and epilogue
Lemma 3: Any spanning forest for a subgraph X has a constant number of edges.
We deduce that n1(F1)=n1(F’1).
By induction: for all h, nh(Fh)=nh(F’h).
Consequently, P(F)=P(F’) and finally F’ is a MaxSF!