Graph Cuts based segmentation methods: Daniel Heilper, CS Department, Haifa University.

Slides:



Advertisements
Similar presentations
Liang Shan Clustering Techniques and Applications to Image Segmentation.
Advertisements

Introduction to Markov Random Fields and Graph Cuts Simon Prince
Information Networks Graph Clustering Lecture 14.
Normalized Cuts and Image Segmentation
Online Social Networks and Media. Graph partitioning The general problem – Input: a graph G=(V,E) edge (u,v) denotes similarity between u and v weighted.
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:
Graph-Based Image Segmentation
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
1 s-t Graph Cuts for Binary Energy Minimization  Now that we have an energy function, the big question is how do we minimize it? n Exhaustive search is.
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
10/11/2001Random walks and spectral segmentation1 CSE 291 Fall 2001 Marina Meila and Jianbo Shi: Learning Segmentation by Random Walks/A Random Walks View.
Lecture 6 Image Segmentation
CS448f: Image Processing For Photography and Vision Graph Cuts.
Lecture 21: Spectral Clustering
Hierarchical Region-Based Segmentation by Ratio-Contour Jun Wang April 28, 2004 Course Project of CSCE 790.
CS 376b Introduction to Computer Vision 04 / 08 / 2008 Instructor: Michael Eckmann.
Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.
Today: Image Segmentation Image Segmentation Techniques Snakes Scissors Graph Cuts Mean Shift Wednesday (2/28) Texture analysis and synthesis Multiple.
2010/5/171 Overview of graph cuts. 2010/5/172 Outline Introduction S-t Graph cuts Extension to multi-label problems Compare simulated annealing and alpha-
Stereo & Iterative Graph-Cuts Alex Rav-Acha Vision Course Hebrew University.
EDA (CS286.5b) Day 6 Partitioning: Spectral + MinCut.
Cutting complete weighted graphs Jameson Cahill Ido Heskia Math/CSC 870 Spring 2007.
Stereo Computation using Iterative Graph-Cuts
Comp 775: Graph Cuts and Continuous Maximal Flows Marc Niethammer, Stephen Pizer Department of Computer Science University of North Carolina, Chapel Hill.
Image Segmentation A Graph Theoretic Approach. Factors for Visual Grouping Similarity (gray level difference) Similarity (gray level difference) Proximity.
Presentation By Michael Tao and Patrick Virtue. Agenda History of the problem Graph cut background Compute graph cut Extensions State of the art Continued.
Graph-Cut Algorithm with Application to Computer Vision Presented by Yongsub Lim Applied Algorithm Laboratory.
Perceptual Organization: Segmentation and Optical Flow.
Segmentation via Graph Cuts
Graph-based Segmentation
Tal Mor  Create an automatic system that given an image of a room and a color, will color the room walls  Maintaining the original texture.
Image Segmentation Image segmentation is the operation of partitioning an image into a collection of connected sets of pixels. 1. into regions, which usually.
Image Segmentation Rob Atlas Nick Bridle Evan Radkoff.
Presenter : Kuang-Jui Hsu Date : 2011/5/3(Tues.).
Graph Cut & Energy Minimization
Graph-based Segmentation. Main Ideas Convert image into a graph Vertices for the pixels Vertices for the pixels Edges between the pixels Edges between.
CSSE463: Image Recognition Day 34 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:
Segmentation using eigenvectors Papers: “Normalized Cuts and Image Segmentation”. Jianbo Shi and Jitendra Malik, IEEE, 2000 “Segmentation using eigenvectors:
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/24/10.
Graph Cut Algorithms for Binocular Stereo with Occlusions
Advanced Algorithms Piyush Kumar (Lecture 4: MaxFlow MinCut Applications) Welcome to COT5405.
Graph Cut 韋弘 2010/2/22. Outline Background Graph cut Ford–Fulkerson algorithm Application Extended reading.
EE 492 ENGINEERING PROJECT LIP TRACKING Yusuf Ziya Işık & Ashat Turlibayev Yusuf Ziya Işık & Ashat Turlibayev Advisor: Prof. Dr. Bülent Sankur Advisor:
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N-D Images (Fri) Young Ki Baik, Computer Vision Lab.
Graph Cuts Marc Niethammer. Segmentation by Graph-Cuts A way to compute solutions to the optimization problems we looked at before. Example: Binary Segmentation.
1 Markov Random Fields with Efficient Approximations Yuri Boykov, Olga Veksler, Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
Jad silbak -University of Haifa. What we have, and what we want: Most segmentations until now focusing on local features (K-Means). We would like to extract.
Lecture 19: Solving the Correspondence Problem with Graph Cuts CAP 5415 Fall 2006.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Presenter : Kuang-Jui Hsu Date : 2011/3/24(Thur.).
Gaussian Mixture Models and Expectation-Maximization Algorithm.
Image Segmentation Superpixel methods Speaker: Hsuan-Yi Ko.
CS654: Digital Image Analysis Lecture 28: Advanced topics in Image Segmentation Image courtesy: IEEE, IJCV.
A global approach Finding correspondence between a pair of epipolar lines for all pixels simultaneously Local method: no guarantee we will have one to.
 In the previews parts we have seen some kind of segmentation method.  In this lecture we will see graph cut, which is a another segmentation method.
Example Apply hierarchical clustering with d min to below data where c=3. Nearest neighbor clustering d min d max will form elongated clusters!
Prof. Swarat Chaudhuri COMP 382: Reasoning about Algorithms Fall 2015.
Markov Random Fields in Vision
Normalized Cuts and Image Segmentation Patrick Denis COSC 6121 York University Jianbo Shi and Jitendra Malik.
Energy minimization Another global approach to improve quality of correspondences Assumption: disparities vary (mostly) smoothly Minimize energy function:
::Network Optimization:: Minimum Spanning Trees and Clustering Taufik Djatna, Dr.Eng. 1.
Graph Cut Weizhen Jing
Grouping.
Lecture 31: Graph-Based Image Segmentation
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Algorithms (2IL15) – Lecture 7
Announcements Project 4 out today (due Wed March 10)
Announcements Project 1 is out today help session at the end of class.
“Traditional” image segmentation
Presentation transcript:

Graph Cuts based segmentation methods: Daniel Heilper, CS Department, Haifa University

Topics: Segmentation as Graph cuts problems. MIN-CUT and Normalized CUT approaches Examples of Cost/Energy functions Performance issues – feasibility and approximations Relations to Clustering and other methods

Motivation: Human perception takes into account several perceptual aspects and “blends” them together: Proximity:

Human perception Proximity: Closure:

Human perception Similarity Continuation

Early segmentation methods Boundary based methods - based on local information and cannot guarantee continuous closed edge contours (Derivatives kernels, Harris, Canny) Region based methods + statistics inside the region. - often generates irregular boundaries and small Holes.

Boundary based methods Original text Canny:

Boundary based methods Derivatives:

Region based methods

Global optimization approaches based on energy functions Construct a heuristic energy function which take into account both the local information and the global information.

Graph Representation: The set of points in an arbitrary feature space are represented as a weighted undirected graph G = (V,E,w) where the nodes of the graph are the points in the feature space, and an edge is formed between every pair of nodes. The weight on each edge, Wij is a function of the similarity between nodes i and j.

Graph Representation:

Energy cost functions: Energy Function is heuristic for quantization of a combination of Data Features on an N-D Image. Simple Examples: Distance metric – Image is sent as a binary image, graph is represented as points in the plane

Energy functions for Graph Cuts In some cases, energy minimization is NP-Hard, or has high polynomial order which make the method impractical Choosing a good energy function is not “Pure” science

Energy functions for Graph Cuts The most Natural Energy form is: V - Boundary Penalty caused by choosing labels for 2 pixels D – Regional Penalty for assigning a pixel to some label.

First approach: Max-Flow Min-Cut Refresher: Flow Networks:

Network flow graphs Given A flow Networks where: is a directed graph is a source (not necessary belongs to G) is a sink (not necessary belongs to G) a non-negative capacity function on the edges (if we can assume )

Network flow graphs Function is a valid flow function if holds: Capacity constraints:, counter symmetry: for each, flow conservation:, where, are the edge set that leave V. Similarly are the sedge set that enters V

Network flow graphs The value of the flow function is

Network flow graphs

Max-Flow – Min-Cut Theorem: The maximum amount of flow is equal to the capacity of a minimum cut

Interactive Segmentation application using Graph Cuts: Motivation: for some applications: Fully automatic segmentation does not give sufficient results. for example, in medical diagnostics, Doctors handlings a medical scan images where soft tissues, blood vessels, and bones are “blended” together, are very difficult to segment.

Above: CAT scan of Pancreas.

Interactive Segmentation application using Graph Cuts In a nutshell: User marks some pixels as seeds of “Background” and “Object”, and runs the application several times until a satisfactory result achieved. Interactive inputs: “seeds” pixels the ratio between regional importance VS boundary importance Energy function (Intensities, distances, textures, etc..)

Seeds in the flow graph

Interactive Segmentation application using Graph Cuts First run, application fully solves max-flow task Each time the application outputs an insufficient result, the user adds more “seeds”, (changes the ratio ) and rerun the application. The segmentation is improved until satisfactory by user. Only the first run is computationally heavy, while the consecutive runs are fast, and can be seen as an addition to capacities, and hence finding additional “augmenting paths” in the flow function

Past Interactive tools for segmentation: intelligent scissors live wire “shortest path” between certain pixels using some energy function Difficulties: the user inputs have to be very accurately positioned at the desired boundary can not be easily generalized to 3D data.

Energy function: General form of the energy function: Where

Energy function: R(A) stands for the sum of the regional penalties of a given labeling Similarly B(A) is the sum of the boundry penalties of the labeling

3D - Data Video sequence is treated as a 3D volume image:

Second Method: Normalized Cut: The normalized cut criterion measures both the total dissimilarity between the different groups as well as the total similarity within the groups. The key point is that image partitioning is to be done from the big picture downward, rather like a painter first marking out the major areas and then filling in the details.

Normalized Cut Unfortunately, minimizing normalized cut exactly is NP-complete, even for the special case of graphs on grids(Papadimitriou). However, an approximate discrete solution can be found efficiently

MINCut problem Why minimum cut isn’t always favorable? the minimum cut criteria favors cutting small sets of isolated nodes in the graph. (for example when cost function is inverse to the distance between nodes)

A case where minimum cut gives a bad partition.

Definition: Normalized cut where assoc(A,V) is the total connection from nodes in A to all nodes in the graph

Normalized cut It is easy to see that single nodded cuts produce MINCut value of at least 1, so minimum normal cut is not likely to be single nodded.

Definition: Normalized Association: In the same spirit, we can define a measure for total normalized association within groups for a given partition:

NAssoc vs NCut A direct conclusion: NCut(A,B) = 2 – Nassoc(A,B) Ncut is normalized measure of disassociation minimizing Ncut is equivalent to maximizing association

Computing the Optimal Partition An approximate discrete solution can be found efficiently by converting the problem into a generalized eigenvector problem

NCut as Eigenvector system Matrix representation W is the cost Matrix D is the sum of the costs from node i: The Partition is a binary matrix size |P|XK where |P| is the number of pixels and K is the number of labels

NCut as Eigenvector system The Segmentation matrix y: Each column is a label vector NCut can be written as:

Recursive two-way Ncut grouping algorithm 1. Given an image or image sequence, set up a weighted graph G=(V, E) and set the weight on the edge connection two nodes to be a measure of the similarity between the two nodes. 2. Solve for eigenvectors with the smallest eigenvalues

Recursive two-way Ncut grouping algorithm 3. Use the eigenvector with the second smallest eigenvalue to bipartition the graph 4. Decide if the current partition should be subdivided and recursively repartition the segmented parts if necessary.

Experiments on energy functions: where X(i) is the spatial location of node i, and F(i) is a feature vector based on intensity, color, or texture information If can separate the regional weight from the boundary weight using log operation

(a) A synthetic image showing a noisy ªstepº image. Intensity varies from 0 to 1, and Gaussian noise with sigma = 0.2 is added. (b) eigenvector with the second smallest eigenvalue (c) resulting partition.

Performance and optimality Solving an eigenvector system takes at least (|P|^3) time Using iterative power method we can find the second lowest eigenvector in a O(|P|*|n|) where |P| is #pixels, and |n| is #iterative steps The NCut at the end of the algorithm has proven constant proximity to the MIN NCut

Finding the Minimum Normalized Cut VS interactive MINCut finding: Min NCut Pros: Avoids segmenting isolated small sections (VS “blind” calculation of MINCut) This NP-Hard can be well approximated Min NCut cons: Difficult to control and analyse

Finding the Minimum Normalized Cut VS interactive MINCut finding interactive MINCut Pros: Allows a fast correction of the result in an interactively manner, and converges Easy to control

Energy Minimization Techniques for Graph Cuts Goal: giving a faster algorithm to the MIN- Cut problem or a general K-Labeling partition of an Image Some energy functions makes the MinCut problem to be NP-Hard Other functions reach optimal solution in impractical polynomial time

Known algorithms for energy minimization: Simmulated Anealing – converges well but for small temperature delta’s is exponential in time, and for large deltas it converges to local minimum which may be far from the minimum Combinatorial Max flow – Min cut algorithms. Combinatorial algorithms solves the problem in at least O(|P|^3) time (Tarjan & Goldberg). dynamic programming – restricted to 1-D energy function

linear time algorithm for finding the Max-Flow-Min-Cut/ Updating the labeling function: two types of large moves: α-expansion and α-β-swap

α-Exapnsion Take a subset of pixels which are not labeled to have that label Works for a metric energy function:

α-β swap Changing a label α of some pixels to label β Works for semimetric Energy functions:

α-Exapnsion

α-Exapnsion and {α, β}–Swap

these moves allow large number of pixels to change their labels simultaneously Note that a move which assigns a given label α to a single pixel is both an α-β swap and an α-expansion. (α-β swap can be seen as a private case of α-Exapnsion)

{ α} Expansion 1. Start with an arbitrary labeling f 2. Set success := 0 3. For each label α belongs L 3.1. Find ˆ f = argminE(f0) among f0 within one α-expansion of f 3.2. If E(f*) < E(f), set f := f* and success := 1 4. If success = 1 goto 2 5. Return f

{α, β} – Swap algorithm 1. Start with an arbitrary labeling f 2. Set success := 0 3. For each pair of labels {α, β} belongs to L 3.1. Find f* = argminE(f’) among f’ within one α-β swap of f 3.2. If E(f*) < E(f), set f := f* and success := 1 4. If success = 1 goto 2 5. Return f

Algorithms summary A cycle is successful if a strictly better labeling is found at any iteration. The algorithms stop after the first unsuccessful cycle since no further improvement is possible. α-Exapnsion much faster than α-β swap : |L| VS o(|L|^2) iterations (L is the labeling)

Benchmark results (Results of running the algorithms on the previous image)

References: [1] J. Shi and J.Malik, “Normalized Cuts and Image Segmentation,” Proc. CVPR [2] Boykov, Y., Jolly, M., " Interactive graph cuts for optimal boundary and region segmentation of objects in N-D images." In: International Conference on Computer Vision, Vancouver, BC. (2001) 105–112 [3] Boykov, Y., Veksler, O., Zabih, R.: Fast approximate energy minimization via graph cuts. IEEE Trans. Pattern Anal. Mach. Intell. 23 (2001) 1222–1239 [4] Goro Obinata, Ashish Dutta: Vision Systems: Segmentation and Pattern Recognition, I-Tech Education and Publishing, Vienna, Austria