2.41k likes | 2.61k Views
GraphCut -based Optimisation for Computer Vision. Ľubor Ladický. Overview. Motivation Min-Cut / Max-Flow (Graph Cut) Algorithm Markov and Conditional Random Fields Random Field Optimisation using Graph Cuts Submodular vs. Non-Submodular Problems Pairwise vs. Higher Order Problems
E N D
GraphCut-based Optimisation for Computer Vision Ľubor Ladický
Overview • Motivation • Min-Cut / Max-Flow (Graph Cut) Algorithm • Markov and Conditional Random Fields • Random Field Optimisation using Graph Cuts • Submodular vs. Non-Submodular Problems • Pairwise vs. Higher Order Problems • 2-Label vs. Multi-Label Problems • Recent Advances in Random Field Optimisation • Conclusions
Overview • Motivation • Min-Cut / Max-Flow (Graph Cut) Algorithm • Markov and Conditional Random Fields • Random Field Optimisation using Graph Cuts • Submodular vs. Non-Submodular Problems • Pairwise vs. Higher Order Problems • 2-Label vs. Multi-Label Problems • Recent Advances in Random Field Optimisation • Conclusions
Image Labelling Problems Assign a label to each image pixel Geometry Estimation Image Denoising Object Segmentation Depth Estimation Sky Building Tree Grass
Image Labelling Problems • Labellings highly structured Unprobable labelling Impossible labelling Possible labelling
Image Labelling Problems • Labellings highly structured • Labels highly correlated with very complex dependencies • Neighbouring pixels tend to take the same label • Low number of connected components • Classes present may be seen in one image • Geometric / Location consistency • Planarity in depth estimation • … many others (task dependent)
Image Labelling Problems • Labelling highly structured • Labels highly correlated with very complex dependencies • Independent label estimation too hard
Image Labelling Problems • Labelling highly structured • Labels highly correlated with very complex dependencies • Independent label estimation too hard • Whole labelling should be formulated as one optimisation problem
Image Labelling Problems • Labelling highly structured • Labels highly correlated with very complex dependencies • Independent label estimation too hard • Whole labelling should be formulated as one optimisation problem • Number of pixels up to millions • Hard to train complex dependencies • Optimisation problem is hard to infer
Image Labelling Problems • Labelling highly structured • Labels highly correlated with very complex dependencies • Independent label estimation too hard • Whole labelling should be formulated as one optimisation problem • Number of pixels up to millions • Hard to train complex dependencies • Optimisation problem is hard to infer Vision is hard !
Image Labelling Problems • You can • either • Change the subject from the Computer Vision to the History of Renaissance Art Vision is hard !
Image Labelling Problems • You can • either • Change the subject from the Computer Vision to the History of Renaissance Art • or • Learn everything about Random Fields and Graph Cuts Vision is hard !
Foreground / Background Estimation Rother et al. SIGGRAPH04
Foreground / Background Estimation Data term Smoothness term Data term Estimated using FG / BG colour models Smoothness term where Intensity dependent smoothness
Foreground / Background Estimation Data term Smoothness term
Foreground / Background Estimation Data term Smoothness term • How to solve this optimisation problem?
Foreground / Background Estimation Data term Smoothness term • How to solve this optimisation problem? • Transform into min-cut / max-flow problem • Solve it using min-cut / max-flow algorithm
Overview • Motivation • Min-Cut / Max-Flow (Graph Cut) Algorithm • Markov and Conditional Random Fields • Random Field Optimisation using Graph Cuts • Submodular vs. Non-Submodular Problems • Pairwise vs. Higher Order Problems • 2-Label vs. Multi-Label Problems • Applications • Conclusions
Max-Flow Problem source 9 5 4 2 2 5 3 2 3 1 1 5 6 3 2 5 6 8 sink • Task : • Maximize the flow from the sink to the source such that • 1) The flow it conserved for each node • 2) The flow for each pipe does not exceed the capacity
Max-Flow Problem source 9 5 4 2 2 5 3 2 3 1 1 5 6 3 2 5 6 8 sink
Max-Flow Problem flow from the source source flow from node i to node j 9 5 capacity 4 2 2 set of edges 5 3 2 3 1 1 5 6 3 2 set of nodes conservation of flow 5 6 8 sink
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 9 5 4 2 2 5 3 2 3 1 1 5 6 3 2 5 6 8 sink
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 9 5 4 2 2 5 3 2 3 1 1 5 6 3 2 5 6 8 sink
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 9 5 4 2 2 5 3 2 3 1 1 5 6 3 2 5 6 8 sink flow = 3
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 9 5-3 4 2+3 2 5 3-3 2 3 1 1 6-3 5 +3 3 2 5 6 8-3 sink flow = 3
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 9 2 4 5 2 5 2 3 1 1 3 5 3 3 2 5 6 5 sink flow = 3
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 9 2 4 5 2 5 2 3 1 1 3 5 3 3 2 5 6 5 sink flow = 3
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 9 2 4 5 2 5 2 3 1 1 3 5 3 3 2 5 6 5 sink flow = 6
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 9-3 2 4 5 2 5 2 +3 3-3 1 1 3 5 3 3-3 2 +3 5 6 5-3 sink flow = 6
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 6 2 4 5 2 5 2 3 1 1 3 5 3 3 2 5 6 2 sink flow = 6
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 6 2 4 5 2 5 2 3 1 1 3 5 3 3 2 5 6 2 sink flow = 6
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 6 2 4 5 2 5 2 3 1 1 3 5 3 3 2 5 6 2 sink flow = 11
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 6-5 2 4 5 2+5 5-5 2 3 1+5 1 3 5-5 3 3 2 5-5 6 2 sink flow = 11
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 2 4 5 7 2 3 1 6 3 3 3 2 6 2 sink flow = 11
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 2 4 5 7 2 3 1 6 3 3 3 2 6 2 sink flow = 11
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 2 4 5 7 2 3 1 6 3 3 3 2 6 2 sink flow = 13
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 2-2 4 5 7 2-2 3 +2 1 6 3 3 +2 3 2-2 6 2-2 sink flow = 13
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 4 5 7 3 2 1 6 3 3 2 3 6 sink flow = 13
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 4 5 7 3 2 1 6 3 3 2 3 6 sink flow = 13
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 4 5 7 3 2 1 6 3 3 2 3 6 sink flow = 15
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 4-2 5 7 3 2 1 3-2 6 3+2 2-2 3 +2 6-2 sink flow = 15
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 2 5 7 3 2 1 6 1 5 3 2 4 sink flow = 15
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 2 5 7 3 2 1 6 1 5 3 2 4 sink flow = 15
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the path in the residual graph End 1 2 5 7 3 2 1 6 1 5 3 2 4 sink flow = 15
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Why is the solution globally optimal ? 1 2 5 7 3 2 1 6 1 5 3 2 4 sink flow = 15
Max-Flow Problem S source Ford & Fulkerson algorithm (1956) Why is the solution globally optimal ? 1. Let S be the set of reachable nodes in the residual graph 1 2 5 7 3 2 1 6 1 5 3 2 4 sink flow = 15
Max-Flow Problem S source Ford & Fulkerson algorithm (1956) Why is the solution globally optimal ? 1. Let S be the set of reachable nodes in the residual graph 2. The flow from S to V - S equals to the sum of capacities from S to V – S 9 5 4 2 2 5 3 2 3 1 1 5 6 3 2 5 6 8 sink
Max-Flow Problem A source Ford & Fulkerson algorithm (1956) Why is the solution globally optimal ? 1. Let S be the set of reachable nodes in the residual graph 2. The flow from S to V - S equals to the sum of capacities from S to V – S 3. The flow from any A to V - A is upper bounded by the sum of capacities from A to V – A 9 5 4 2 2 5 3 2 3 1 1 5 6 3 2 5 6 8 sink
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Why is the solution globally optimal ? 1. Let S be the set of reachable nodes in the residual graph 2. The flow from S to V - S equals to the sum of capacities from S to V – S 3. The flow from any A to V - A is upper bounded by the sum of capacities from A to V – A 4. The solution is globally optimal 5/5 8/9 2/4 0/2 0/2 5/5 3/3 2/2 3/3 0/1 0/1 5/6 5/5 3/3 0/2 5/5 2/6 8/8 sink flow = 15 Individual flows obtained by summing up all paths
Max-Flow Problem source Ford & Fulkerson algorithm (1956) Why is the solution globally optimal ? 1. Let S be the set of reachable nodes in the residual graph 2. The flow from S to V - S equals to the sum of capacities from S to V – S 3. The flow from any A to V - A is upper bounded by the sum of capacities from A to V – A 4. The solution is globally optimal 5/5 8/9 2/4 0/2 0/2 5/5 3/3 2/2 3/3 0/1 0/1 5/6 5/5 3/3 0/2 5/5 2/6 8/8 sink flow = 15