MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/31/15.

Slides:



Advertisements
Similar presentations
POSE–CUT Simultaneous Segmentation and 3D Pose Estimation of Humans using Dynamic Graph Cuts Mathieu Bray Pushmeet Kohli Philip H.S. Torr Department of.
Advertisements

Mean-Field Theory and Its Applications In Computer Vision1 1.
O BJ C UT M. Pawan Kumar Philip Torr Andrew Zisserman UNIVERSITY OF OXFORD.
SOFT SCISSORS: AN INTERACTIVE TOOL FOR REALTIME HIGH QUALITY MATTING International Conference on Computer Graphics and Interactive Techniques ACM SIGGRAPH.
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/15/11 “The Double Secret”, Magritte.
Introduction to Markov Random Fields and Graph Cuts Simon Prince
I Images as graphs Fully-connected graph – node for every pixel – link between every pair of pixels, p,q – similarity w ij for each link j w ij c Source:
GrabCut Interactive Image (and Stereo) Segmentation Carsten Rother Vladimir Kolmogorov Andrew Blake Antonio Criminisi Geoffrey Cross [based on Siggraph.
Hidden Variables, the EM Algorithm, and Mixtures of Gaussians Computer Vision CS 143, Brown James Hays 02/22/11 Many slides from Derek Hoiem.
GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK.
GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK.
Graph-Based Image Segmentation
Stephen J. Guy 1. Photomontage Photomontage GrabCut – Interactive Foreground Extraction 1.
Hidden Variables, the EM Algorithm, and Mixtures of Gaussians Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/15/12.
Graph-based image segmentation Václav Hlaváč Czech Technical University in Prague Faculty of Electrical Engineering Department of Cybernetics Prague, Czech.
GrabCut Interactive Image (and Stereo) Segmentation Joon Jae Lee Keimyung University Welcome. I will present Grabcut – an Interactive tool for foreground.
CS 691 Computational Photography Instructor: Gianfranco Doretto Cutting Images.
Markov Random Fields (MRF)
Lecture 6 Image Segmentation
Learning to Detect A Salient Object Reporter: 鄭綱 (3/2)
Robust Higher Order Potentials For Enforcing Label Consistency
Predictive Automatic Relevance Determination by Expectation Propagation Yuan (Alan) Qi Thomas P. Minka Rosalind W. Picard Zoubin Ghahramani.
Stereo & Iterative Graph-Cuts Alex Rav-Acha Vision Course Hebrew University.
Announcements Readings for today:
Stereo Computation using Iterative Graph-Cuts
What Energy Functions Can be Minimized Using Graph Cuts? Shai Bagon Advanced Topics in Computer Vision June 2010.
An Iterative Optimization Approach for Unified Image Segmentation and Matting Hello everyone, my name is Jue Wang, I’m glad to be here to present our paper.
Image Segmentation Today’s Readings Forsyth & Ponce, Chapter 14
Measuring Uncertainty in Graph Cut Solutions Pushmeet Kohli Philip H.S. Torr Department of Computing Oxford Brookes University.
Computer vision: models, learning and inference
Perceptual Organization: Segmentation and Optical Flow.
Automatic User Interaction Correction via Multi-label Graph-cuts Antonio Hernández-Vela, Carlos Primo and Sergio Escalera Workshop on Human Interaction.
Graph-based Segmentation
Image Segmentation Rob Atlas Nick Bridle Evan Radkoff.
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/14/10 “The Double Secret”, Magritte.
Graph Cut & Energy Minimization
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/24/10.
Segmentation: MRFs and Graph Cuts Computer Vision CS 143, Brown James Hays 10/07/11 Many slides from Kristin Grauman and Derek Hoiem.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Object Stereo- Joint Stereo Matching and Object Segmentation Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on Michael Bleyer Vienna.
Graph Cuts Marc Niethammer. Segmentation by Graph-Cuts A way to compute solutions to the optimization problems we looked at before. Example: Binary Segmentation.
Markov Random Fields Probabilistic Models for Images
Lecture 19: Solving the Correspondence Problem with Graph Cuts CAP 5415 Fall 2006.
Associative Hierarchical CRFs for Object Class Image Segmentation
O BJ C UT M. Pawan Kumar Philip Torr Andrew Zisserman UNIVERSITY OF OXFORD.
Gaussian Mixture Models and Expectation-Maximization Algorithm.
Markov Random Fields & Conditional Random Fields
CS654: Digital Image Analysis Lecture 28: Advanced topics in Image Segmentation Image courtesy: IEEE, IJCV.
Object Recognition by Integrating Multiple Image Segmentations Caroline Pantofaru, Cordelia Schmid, Martial Hebert ECCV 2008 E.
A global approach Finding correspondence between a pair of epipolar lines for all pixels simultaneously Local method: no guarantee we will have one to.
Computational Photography lecture 8 – segmentation CS (future 572) Spring 2016 Prof. Alex Berg (Credits to many other folks on individual slides)
Hidden Variables, the EM Algorithm, and Mixtures of Gaussians Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/22/11.
Markov Random Fields in Vision
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/20/12 “The Double Secret”, Magritte.
Image segmentation.
1 Kernel Machines A relatively new learning methodology (1992) derived from statistical learning theory. Became famous when it gave accuracy comparable.
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/27/12.
Markov Random Fields Tomer Michaeli Graduate Course
Cutting Images: Graphs and Boundary Finding
GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK.
Nonparametric Semantic Segmentation
Markov Random Fields and Segmentation with Graph Cuts
Integration and Graphical Models
Automatic User Interaction Correction via Multi-label Graph-cuts
Lecture 31: Graph-Based Image Segmentation
“grabcut”- Interactive Foreground Extraction using Iterated Graph Cuts
Segmentation (continued)
“Traditional” image segmentation
Presentation transcript:

MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/31/15

Logistics HW 3 grades released HW 4 due next Monday Final project proposals due Friday (by )

Today’s class Review/Finish EM MRFs Segmentation with Graph Cuts i j w ij

Missing Data Problems: Segmentation Challenge: Segment the image into figure and ground without knowing what the foreground looks like in advance. Three subproblems: 1.If we had labels, how could we model the appearance of foreground and background? MLE: maximum likelihood estimation 2.Once we have modeled the fg/bg appearance, how do we compute the likelihood that a pixel is foreground? Probabilistic inference 3.How can we get both labels and appearance models at once? Hidden data problem: Expectation Maximization Foreground Background

EM: Mixture of Gaussians 1.Initialize parameters 2.Compute likelihood of hidden variables for current parameters 3.Estimate new parameters for each component, weighted by likelihood Given by normal distribution

Gaussian Mixture Models: Practical Tips Design decisions – Number of components Select by hand based on knowledge of problem Select using cross-validation or sample data Usually, not too sensitive and safer to use more components – Variance “Spherical covariance”: dimensions within each component are independent with equal variance (1 parameter but usually too restrictive) “Diagonal covariance”: dimensions within each component are not independent with difference variances (N parameters for N-D data) “Full covariance”: no assumptions (N*(N+1)/2 parameters); for high N might be expensive to do EM, to evaluate, and may overfit Typically use “Full” if lots of data, few dimensions; Use “Diagonal” otherwise Can get stuck in local minima – Use multiple restarts – Choose solution with greatest data likelihood

“Hard EM” Same as EM except compute z* as most likely values for hidden variables K-means is an example Advantages – Simpler: can be applied when cannot derive EM – Sometimes works better if you want to make hard predictions at the end But – Generally, pdf parameters are not as accurate as EM

EM Demo GMM with images demos

What’s wrong with this prediction? P(foreground | image)

Solution: encode dependencies between pixels P(foreground | image) Labels to be predictedIndividual predictions Pairwise predictions Normalizing constant called “partition function”

Writing Likelihood as an “Energy” Cost of assignment y i Cost of pairwise assignment y i, y j -log

Notes on energy-based formulation Primarily used when you only care about the most likely solution (not the confidences) Can think of it as a general cost function Can have larger “cliques” than 2 – Clique is the set of variables that go into a potential function

Markov Random Fields Node y i : pixel label Edge: constrained pairs Cost to assign a label to each pixel Cost to assign a pair of labels to connected pixels

Markov Random Fields Example: “label smoothing” grid Unary potential K 1 K 0 Pairwise Potential 0: -logP(y i = 0 | data) 1: -logP(y i = 1 | data) K>0

Solving MRFs with graph cuts Source (Label 0) Sink (Label 1) Cost to assign to 1 Cost to assign to 0 Cost to split nodes

Solving MRFs with graph cuts Source (Label 0) Sink (Label 1) Cost to assign to 1 Cost to assign to 0 Cost to split nodes

GrabCut segmentation User provides rough indication of foreground region. Goal: Automatically provide a pixel-level segmentation.

Grab cuts and graph cuts Grab cuts and graph cuts User Input Result Magic Wand (198?) Intelligent Scissors Mortensen and Barrett (1995) GrabCut Regions Boundary Regions & Boundary Source: Rother

Colour Model Colour Model Gaussian Mixture Model (typically 5-8 components) Foreground & Background Background G R Source: Rother

Graph cuts Boykov and Jolly (2001) Image Min Cut Min Cut Cut: separating source and sink; Energy: collection of edges Min Cut: Global minimal energy in polynomial time Foreground (source) Background (sink) Source: Rother

Colour Model Colour Model Gaussian Mixture Model (typically 5-8 components) Foreground & Background Background Foreground Background G R G R Iterated graph cut Source: Rother

GrabCut segmentation 1.Define graph – usually 4-connected or 8-connected Divide diagonal potentials by sqrt(2) 2.Define unary potentials – Color histogram or mixture of Gaussians for background and foreground 3.Define pairwise potentials 4.Apply graph cuts 5.Return to 2, using current labels to compute foreground, background models

What is easy or hard about these cases for graphcut- based segmentation?

Easier examples GrabCut – Interactive Foreground Extraction 10

More difficult Examples Camouflage & Low Contrast Harder Case Fine structure Initial Rectangle Initial Result GrabCut – Interactive Foreground Extraction 11

Notes look at GraphCut.m in provided code (skip README) – if you have trouble using package get help from TA Use poly2mask to convert the polygon to a foreground mask

Lazy Snapping (Li et al. SG 2004)

Graph cuts with multiple labels

Using graph cuts for recognition TextonBoost (Shotton et al IJCV)

Using graph cuts for recognition TextonBoost (Shotton et al IJCV) Unary Potentials from classifier Alpha Expansion Graph Cuts (note: edge potentials are from input image also; this is illustration from paper)

Limitations of graph cuts Associative: edge potentials penalize different labels If not associative, can sometimes clip potentials Graph cut algorithm applies to only 2-label problems – Multi-label extensions are not globally optimal (but still usually provide very good solutions) Must satisfy

Graph cuts: Pros and Cons Pros – Very fast inference – Can incorporate data likelihoods and priors – Applies to a wide range of problems (stereo, image labeling, recognition) Cons – Not always applicable (associative only) – Need unary terms (not used for bottom-up segmentation, for example) Use whenever applicable

More about MRFs/CRFs Other common uses – Graph structure on regions – Encoding relations between multiple scene elements Inference methods – Loopy BP or BP-TRW Exact for tree-shaped structures Approximate solutions for general graphs More widely applicable and can produce marginals but often slower

Further reading and resources Graph cuts – – Classic paper: What Energy Functions can be Minimized via Graph Cuts? (Kolmogorov and Zabih, ECCV '02/PAMI '04)What Energy Functions can be Minimized via Graph Cuts? Belief propagation Yedidia, J.S.; Freeman, W.T.; Weiss, Y., "Understanding Belief Propagation and Its Generalizations”, Technical Report, 2001:

Next section: Object Recognition Face recognition Image categorization and general classification methods Object category detection Tracking objects