As applied in the field of
computer vision
Computer vision is an Interdisciplinarity, interdisciplinary scientific field that deals with how computers can gain high-level understanding from digital images or videos. From the perspective of engineering, it seeks to understand and automate t ...
,
graph cut optimization can be employed to
efficiently solve a wide variety of low-level computer vision problems (''early vision''), such as image
smoothing
In statistics and image processing, to smooth a data set is to create an approximating function that attempts to capture important patterns in the data, while leaving out noise or other fine-scale structures/rapid phenomena. In smoothing, the data ...
, the stereo
correspondence problem
The correspondence problem refers to the problem of ascertaining which parts of one image correspond to which parts of another image, where differences are due to movement of the camera, the elapse of time, and/or movement of objects in the photo ...
,
image segmentation
In digital image processing and computer vision, image segmentation is the process of partitioning a digital image into multiple image segments, also known as image regions or image objects ( sets of pixels). The goal of segmentation is to simpl ...
,
object co-segmentation, and many other computer vision problems that can be formulated in terms of
energy minimization. Many of these energy minimization problems can be approximated by solving a
maximum flow problem
In optimization theory, maximum flow problems involve finding a feasible flow through a flow network that obtains the maximum possible flow rate.
The maximum flow problem can be seen as a special case of more complex network flow problems, such ...
in a
graph
Graph may refer to:
Mathematics
*Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory, the study of such graphs and their properties
*Graph (topology), a topological space resembling a graph in the sense of discre ...
(and thus, by the
max-flow min-cut theorem
In computer science and optimization theory, the max-flow min-cut theorem states that in a flow network, the maximum amount of flow passing from the ''source'' to the ''sink'' is equal to the total weight of the edges in a minimum cut, i.e., th ...
, define a minimal
cut of the graph). Under most formulations of such problems in computer vision, the minimum energy solution corresponds to the
maximum a posteriori estimate of a solution. Although many computer vision algorithms involve cutting a graph (e.g., normalized cuts), the term "graph cuts" is applied specifically to those models which employ a max-flow/min-cut optimization (other graph cutting algorithms may be considered as
graph partition
In mathematics, a graph partition is the reduction of a graph to a smaller graph by partitioning its set of nodes into mutually exclusive groups. Edges of the original graph that cross between the groups will produce edges in the partitioned graph ...
ing algorithms).
"Binary" problems (such as denoising a binary image) can be solved exactly using this approach; problems where pixels can be labeled with more than two different labels (such as stereo correspondence, or denoising of a
grayscale
In digital photography, computer-generated imagery, and colorimetry, a grayscale image is one in which the value of each pixel is a single sample representing only an ''amount'' of light; that is, it carries only intensity information. Graysc ...
image) cannot be solved exactly, but solutions produced are usually near the global optimum.
History
The theory of
graph cuts used as
an optimization method was first applied in
computer vision
Computer vision is an Interdisciplinarity, interdisciplinary scientific field that deals with how computers can gain high-level understanding from digital images or videos. From the perspective of engineering, it seeks to understand and automate t ...
in the seminal paper by Greig, Porteous and Seheult
[D.M. Greig, B.T. Porteous and A.H. Seheult (1989), ]
Exact maximum a posteriori estimation for binary images
', Journal of the Royal Statistical Society, Series B, 51, 271–279. of
Durham University. Allan Seheult and Bruce Porteous were members of Durham's lauded statistics group of the time, led by
Julian Besag
Julian Ernst Besag FRS (26 March 1945 – 6 August 2010) was a British statistician known chiefly for his work in spatial statistics (including its applications to epidemiology, image analysis and agricultural science), and Bayesian inference ...
and
Peter Green (statistician), with the optimisation expert
Margaret Greig
Dorothy Margaret Greig née Hannah (1922–1999) was an English mathematician who worked upon the theory of worsted spinning, especially the superdraft system invented by Geoffrey Ambler. During WW2, she worked on the analysis of strategic bomb ...
notable as the first ever female member of staff of the Durham Mathematical Sciences Department.
In the
Bayesian statistical context of
smoothing
In statistics and image processing, to smooth a data set is to create an approximating function that attempts to capture important patterns in the data, while leaving out noise or other fine-scale structures/rapid phenomena. In smoothing, the data ...
noisy (or corrupted) images, they showed how the
maximum a posteriori estimate of a
binary image
A binary image is one that consists of pixels that can have one of exactly two colors, usually black and white. Binary images are also called ''bi-level'' or ''two-level'', Pixelart made of two colours is often referred to as ''1-Bit'' or ''1b ...
can be obtained ''exactly'' by maximizing the
flow through an associated image network, involving the introduction of a ''source'' and ''sink''. The problem was therefore shown to be efficiently solvable. Prior to this result, ''approximate'' techniques such as
simulated annealing
Simulated annealing (SA) is a probabilistic technique for approximating the global optimum of a given function. Specifically, it is a metaheuristic to approximate global optimization in a large search space for an optimization problem. ...
(as proposed by the
Geman brothers), or
iterated conditional modes (a type of
greedy algorithm
A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locall ...
as suggested by
Julian Besag
Julian Ernst Besag FRS (26 March 1945 – 6 August 2010) was a British statistician known chiefly for his work in spatial statistics (including its applications to epidemiology, image analysis and agricultural science), and Bayesian inference ...
) were used to solve such image smoothing problems.
Although the general
-colour problem remains unsolved for
the approach of Greig, Porteous and Seheult
has turned out
[Y. Boykov, O. Veksler and R. Zabih (2001),]
Fast approximate energy minimisation via graph cuts
, ''IEEE Transactions on Pattern Analysis and Machine Intelligence'', 29, 1222–1239. to have wide applicability in general computer vision problems. Greig, Porteous and Seheult approaches are often applied iteratively to a sequence of binary problems, usually yielding near optimal solutions.
In 2011, C. Couprie et al. proposed a general image segmentation framework, called the "Power Watershed", that minimized a real-valued indicator function from
,1over a graph, constrained by user seeds (or unary terms) set to 0 or 1, in which the minimization of the indicator function over the graph is optimized with respect to an exponent
. When
, the Power Watershed is optimized by graph cuts, when
the Power Watershed is optimized by shortest paths,
is optimized by the
Random walker algorithm and
is optimized by the
Watershed (image processing) In the study of image processing, a watershed is a transformation defined on a grayscale image. The name refers metaphorically to a geological ''watershed'', or drainage divide, which separates adjacent drainage basins. The watershed transformation ...
algorithm. In this way, the Power Watershed may be viewed as a generalization of graph cuts that provides a straightforward connection with other energy optimization segmentation/clustering algorithms.
Binary segmentation of images
Notation
* Image:
* Output: Segmentation (also called opacity)
(soft segmentation). For hard segmentation
*
Energy function:
where C is the color parameter and λ is the coherence parameter.
*
* Optimization: The segmentation can be estimated as a global minimum over S:
Existing methods
* Standard Graph cuts: optimize energy function over the segmentation (unknown S value).
* Iterated Graph cuts:
# First step optimizes over the color parameters using K-means.
# Second step performs the usual graph cuts algorithm.
:These 2 steps are repeated recursively until convergence.
* Dynamic graph cuts:
Allows to re-run the algorithm much faster after modifying the problem (e.g. after new seeds have been added by a user).
Energy function
:
where the energy
is composed of two different models (
and
):
Likelihood / Color model / Regional term
— unary term describing the likelihood of each color.
* This term can be modeled using different local (e.g. ) or global (e.g. histograms, GMMs, Adaboost likelihood) approaches that are described below.
= Histogram
=
* We use intensities of pixels marked as seeds to get histograms for object (foreground) and background intensity distributions: P(I, O) and P(I, B).
* Then, we use these histograms to set the regional penalties as negative log-likelihoods.
= GMM (Gaussian mixture model)
=
* We usually use two distributions: one for background modelling and another for foreground pixels.
* Use a Gaussian mixture model (with 5–8 components) to model those 2 distributions.
* Goal: Try to pull apart those two distributions.
= Texon
=
* A (or ) is a set of pixels that has certain characteristics and is repeated in an image.
* Steps:
# Determine a good natural scale for the texture elements.
# Compute non-parametric statistics of the model-interior , either on intensity or on Gabor filter responses.
* Examples:
*
Deformable-model based Textured Object Segmentation*
Contour and Texture Analysis for Image Segmentation
Prior / Coherence model / Boundary term
— binary term describing the coherence between neighborhood pixels.
* In practice, pixels are defined as neighbors if they are adjacent either horizontally, vertically or diagonally (4 way connectivity or 8 way connectivity for 2D images).
* Costs can be based on local intensity gradient, Laplacian zero-crossing, gradient direction, color mixture model,...
* Different energy functions have been defined:
** Standard
Markov random field
In the domain of physics and probability, a Markov random field (MRF), Markov network or undirected graphical model is a set of random variables having a Markov property described by an undirected graph. In other words, a random field is said to b ...
: Associate a penalty to disagreeing pixels by evaluating the difference between their segmentation label (crude measure of the length of the boundaries). See Boykov and Kolmogorov ICCV 2003
**
Conditional random field
Conditional random fields (CRFs) are a class of statistical modeling methods often applied in pattern recognition and machine learning and used for structured prediction. Whereas a classifier predicts a label for a single sample without consi ...
: If the color is very different, it might be a good place to put a boundary. See Lafferty et al. 2001; Kumar and Hebert 2003
Criticism
Graph cuts methods have become popular alternatives to the level set-based approaches for optimizing the location of a contour (see for an extensive comparison). However, graph cut approaches have been criticized in the literature for several issues:
* Metrication artifacts: When an image is represented by a 4-connected lattice, graph cuts methods can exhibit unwanted "blockiness" artifacts. Various methods have been proposed for addressing this issue, such as using additional edges or by formulating the max-flow problem in continuous space.
* Shrinking bias: Since graph cuts finds a minimum cut, the algorithm can be biased toward producing a small contour. For example, the algorithm is not well-suited for segmentation of thin objects like blood vessels (see for a proposed fix).
* Multiple labels: Graph cuts is only able to find a global optimum for binary labeling (i.e., two labels) problems, such as foreground/background image segmentation. Extensions have been proposed that can find approximate solutions for multilabel graph cuts problems.
* Memory: the memory usage of graph cuts increases quickly as the image size increases. As an illustration, the Boykov-Kolmogorov max-flow algorithm v2.2 allocates
bytes (
and
are respectively the number of nodes and edges in the graph). Nevertheless, some amount of work has been recently done in this direction for reducing the graphs before the maximum-flow computation.
Algorithm
* Minimization is done using a standard minimum cut algorithm.
* Due to the
Max-flow min-cut theorem
In computer science and optimization theory, the max-flow min-cut theorem states that in a flow network, the maximum amount of flow passing from the ''source'' to the ''sink'' is equal to the total weight of the edges in a minimum cut, i.e., th ...
we can solve energy minimization by maximizing the flow over the network. The Max Flow problem consists of a directed graph with edges labeled with capacities, and there are two distinct nodes: the source and the sink. Intuitively, it is easy to see that the maximum flow is determined by the bottleneck.
Implementation (exact)
The Boykov-Kolmogorov algorithm is an efficient way to compute the max-flow for computer vision related graph.
Implementation (approximation)
The Sim Cut algorithm approximates the graph cut. The algorithm implements a solution by simulation of an electrical network. This is the approach suggested by
Cederbaum's maximum flow theorem Cederbaum's theorem defines hypothetical analog electrical networks which will automatically produce a solution to the Cut_(graph_theory)#Definitions, minimum s–t cut problem. Alternatively, Graph_cuts_in_computer_vision#Implementation (approxim ...
.
[I.T. Frisch, "On Electrical analogs for flow networks," Proceedings of IEEE, 57:2, pp. 209-210, 1969] Acceleration of the algorithm is possible through parallel computing.
Software
http://pub.ist.ac.at/~vnk/software.html— An implementation of the maxflow algorithm described in "An Experimental Comparison of Min-Cut/Max-Flow Algorithms for Energy Minimization in Computer Vision" by Vladimir Kolmogorov
http://vision.csd.uwo.ca/code/— some graph cut libraries and MATLAB wrappers
http://gridcut.com/— fast multi-core max-flow/min-cut solver optimized for grid-like graphs
http://virtualscalpel.com/— An implementation of the Sim Cut; an algorithm for computing an approximate solution of the minimum s-t cut in a massively parallel manner.
References
{{DEFAULTSORT:Graph Cuts In Computer Vision
Bayesian statistics
Computer vision
Computational problems in graph theory
Image segmentation