SlideShare una empresa de Scribd logo
1 de 80
Descargar para leer sin conexión
Computer vision:
models, learning and inference
              Chapter 10
           Graphical Models



      Please send errata to s.prince@cs.ucl.ac.uk
Models for grids
•   Consider models where one unknown world state
    at each pixel in the image – takes the form of a grid.
•   Loops in the graphical model so cannot use dynamic
    programming or belief propagation
•   Define probability distributions that favour certain
    configurations of world states
    –   Called Markov random fields
    –   Inference using a set of techniques called graph cuts



                                                                                        2
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Binary Denoising




            Before                                                   After
Image represented as binary discrete variables. Some proportion of pixels
                      randomly changed polarity.
                                                                                     3
          Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Multi-label Denoising




            Before                                                   After
   Image represented as discrete variables representing intensity. Some
proportion of pixels randomly changed according to a uniform distribution.
                                                                                     4
          Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Denoising Goal




Observed Data                                            Uncorrupted Image




                                                                             5
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Denoising Goal




         Observed Data                               Uncorrupted Image

• Most of the pixels stay the same
• Observed image is not as smooth as original

Now consider pdf over binary images that
  encourages smoothness – Markov random field
                                                                                   6
        Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Markov random fields




This is just the typical property of an undirected model.
We’ll continue the discussion in terms of undirected models




                                                                                         7
              Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Markov random fields




Normalizing constant
 (partition function)                    Potential function
                                      Returns positive number
                                                                                            Subset of variables
                                                                                                 (clique)


                                                                                                              8
                 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Markov random fields




Normalizing constant                              Cost function
 (partition function)                          Returns any number

                                                                                            Subset of variables
            Relationship                                                                         (clique)

                                                                                                              9
                 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Smoothing example




Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   10
Smoothing Example




Smooth solutions (e.g. 0000,1111) have high probability
Z was computed by summing the 16 un-normalized probabilities
          Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   11
Smoothing Example




    Samples from larger grid -- mostly smooth
Cannot compute partition function Z here - intractable
         Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   12
Denoising Goal




Observed Data                                            Uncorrupted Image




                                                                             13
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Denoising overview
Bayes’ rule:


Likelihoods:                                                                       Probability
                                                                                   of flipping
                                                                                   polarity




Prior: Markov random field (smoothness)
MAP Inference: Graph cuts
                                                                                            14
        Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Denoising with MRFs
                                                                                        MRF Prior (pairwise cliques)




Original image, w


                                                                                           Likelihoods




Observed image, x

        Inference :

                                                                                                              15
                      Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
MAP Inference




         Unary terms                                          Pairwise terms
(compatability of data with label y)                (compatability of neighboring labels)
                                                                                            16
       Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Graph Cuts Overview
 Graph cuts used to optimise this cost function:



              Unary terms                                          Pairwise terms
     (compatability of data with label y)                (compatability of neighboring labels)


Three main cases:




                                                                                                 17
                Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Graph Cuts Overview
Graph cuts used to optimise this cost function:


             Unary terms                                          Pairwise terms
    (compatability of data with label y)                (compatability of neighboring labels)


Approach:

Convert minimization into the form of a standard CS problem,

        MAXIMUM FLOW or MINIMUM CUT ON A GRAPH

Polynomial-time methods for solving this problem are known

                                                                                                18
               Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Max-Flow Problem




Goal:

To push as much ‘flow’ as possible through the directed graph from the source
to the sink.

Cannot exceed the (non-negative) capacities cij associated with each edge.
                                                                                        19
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Saturated Edges




When we are pushing the maximum amount of flow:

•   There must be at least one saturated edge on any path from source to sink
          (otherwise we could push more flow)

•   The set of saturated edges hence separate the source and sink
                                                                                        20
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Augmenting Paths




Two numbers represent: current flow / total capacity
                                                                                       21
            Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Augmenting Paths




Choose any route from source to sink with spare capacity and push as much flow as
you can. One edge (here 6-t) will saturate.                                     22
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Augmenting Paths




Choose another route, respecting remaining capacity. This time edge 5-6 saturates.
                                                                                        23
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Augmenting Paths




A third route. Edge 1-4 saturates
                                                                                        24
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Augmenting Paths




A fourth route. Edge 2-5 saturates
                                                                                        25
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Augmenting Paths




A fifth route. Edge 2-4 saturates
                                                                                        26
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Augmenting Paths




There is now no further route from source to sink – there is a saturated edge along
every possible route (highlighted arrows)                                          27
             Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Augmenting Paths




The saturated edges separate the source from the sink and form the min-cut solution.
Nodes either connect to the source or connect to the sink.                        28
              Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Graph Cuts: Binary MRF
Graph cuts used to optimise this cost function:




               Unary terms                                          Pairwise terms
     (compatability of data with label w)                 (compatability of neighboring labels)


 First work with binary case (i.e. True label w is 0 or 1)

 Constrain pairwise costs so that they are “zero-diagonal”




                                                                                                  29
                 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Graph Construction
•   One node per pixel (here a 3x3 image)
•   Edge from source to every pixel node
•   Edge from every pixel node to sink
•   Reciprocal edges between neighbours
                                                                     Note that in the minimum cut
                                                                     EITHER the edge connecting to
                                                                     the source will be cut, OR the
                                                                     edge connecting to the sink, but
                                                                     NOT BOTH (unnecessary).

                                                                     Which determines whether we
                                                                     give that pixel label 1 or label 0.

                                                                     Now a 1 to 1 mapping between
                                                                     possible labelling and possible
                                                                     minimum cuts
                                                                                                   30
               Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Graph Construction
                                          Now add capacities so that
                                          minimum cut, minimizes our cost
                                          function

                                          Unary costs U(0), U(1) attached
                                          to links to source and sink.

                                          •      Either one or the other is paid.

                                          Pairwise costs between pixel
                                          nodes as shown.

                                          •      Why? Easiest to understand
                                                 with some worked examples.
                                                                         31
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Example 1




                                                                           32
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Example 2




                                                                           33
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Example 3




                                                                           34
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
35
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Graph Cuts: Binary MRF
Graph cuts used to optimise this cost function:




               Unary terms                                         Pairwise terms
     (compatability of data with label w)                (compatability of neighboring labels)



 Summary of approach

      •   Associate each possible solution with a minimum cut on a graph
      •   Set capacities on graph, so cost of cut matches the cost function
      •   Use augmenting paths to find minimum cut
      •   This minimizes the cost function and finds the MAP solution

                                                                                                 36
                Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
General Pairwise costs



Modify graph to

•   Add P(0,0) to edge s-b
     • Implies that solutions 0,0 and
        1,0 also pay this cost
•   Subtract P(0,0) from edge b-a
     • Solution 1,0 has this cost
        removed again

Similar approach for P(1,1)



                                                                                             37
                  Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Reparameterization

The max-flow / min-cut algorithms
require that all of the capacities are
non-negative.

However, because we have a
subtraction on edge a-b we cannot
guarantee that this will be the
case, even if all the original unary and
pairwise costs were positive.

The solution to this problem is
reparamaterization: find new graph
where costs (capacities) are different
but choice of minimum solution is the
same (usually just by adding a constant
to each solution)
                                                                                             38
                  Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Reparameterization 1




The minimum cut chooses the same links in these two graphs
 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Reparameterization 2




The minimum cut chooses the same links in these two graphs                  40
 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Submodularity

                                                       Subtract constant


                                                       Add constant,




                                   Adding together implies


                                                                           41
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Submodularity


If this condition is obeyed, it is said that the problem is “submodular” and it can
be solved in polynomial time.

If it is not obeyed then the problem is NP hard.

Usually it is not a problem as we tend to favour smooth solutions.




                                                                                          42
               Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Denoising Results
                                       Pairwise costs increasing
Original




                     Pairwise costs increasing                                  43
     Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Plan of Talk
•   Denoising problem
•   Markov random fields (MRFs)
•   Max-flow / min-cut
•   Binary MRFs – submodular (exact solution)
•   Multi-label MRFs – submodular (exact solution)
•   Multi-label MRFs - non-submodular (approximate)




                                                                                      44
           Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Multiple Labels
                                          Construction for two pixels
                                          (a and b) and four labels
                                          (1,2,3,4)

                                          There are 5 nodes for each
                                          pixel and 4 edges between
                                          them have unary costs for
                                          the 4 labels.

                                          One of these edges must be
                                          cut in the min-cut solution
                                          and the choice will
                                          determine which label we
                                          assign.                          45
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Constraint Edges

                                                              The edges with infinite
                                                              capacity pointing upwards
                                                              are called constraint
                                                              edges.

                                                              They prevent solutions
                                                              that cut the chain of
                                                              edges associated with a
                                                              pixel more than once (and
                                                              hence given an ambiguous
                                                              labelling)



                                                                                   46
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Multiple Labels
                                   Inter-pixel edges have costs
                                   defined as:




                                 Superfluous terms :



                                             For all i,j where K is number of labels47
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Example Cuts




Must cut links from before cut on pixel a to after cut on pixel b.            48
   Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Pairwise Costs
  Must cut links from before cut on
  pixel a to after cut on pixel b.

  Costs were carefully chosen so
  that sum of these links gives
  appropriate pairwise term.

If pixel a takes label I and pixel b takes label J




                                                                                            49
                 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Reparameterization




                                                                           50
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Submodularity
We require the remaining inter-pixel links to be
positive so that


or



By mathematical induction we can get the more
general result

                                                                                    51
         Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Submodularity




If not submodular then the problem is NP hard.                               52
  Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Convex vs. non-convex costs




Quadratic                       Truncated Quadratic                                Potts Model
• Convex                        • Not Convex                                       • Not Convex
• Submodular                    • Not Submodular                                   • Not Submodular
                                                                                               53
        Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
What is wrong with convex costs?
     Observed noisy image                                        Denoised result




• Pay lower price for many small changes than one large one
• Result: blurring at large changes in intensity           54
         Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Plan of Talk
•   Denoising problem
•   Markov random fields (MRFs)
•   Max-flow / min-cut
•   Binary MRFs - submodular (exact solution)
•   Multi-label MRFs – submodular (exact solution)
•   Multi-label MRFs - non-submodular (approximate)




                                                                                      55
           Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Alpha Expansion Algorithm
• break multilabel problem into a series of binary problems
• at each iteration, pick label and expand (retain original or change to )




   Initial                                                                                Iteration 1
 labelling                                                                                  (orange)




 Iteration 2                                                                              Iteration 3
   (yellow)                                                                                   (red)

                                                                                                        56
               Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Alpha Expansion Ideas
• For every iteration
   – For every label
   – Expand label using optimal graph cut solution

Co-ordinate descent in label space.
Each step optimal, but overall global maximum not guaranteed
Proved to be within a factor of 2 of global optimum.
Requires that pairwise costs form a metric:




                                                                                      57
           Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Alpha Expansion Construction




                          Binary graph cut – either cut link to source
                          (assigned to ) or to sink (retain current label)

                                 Unary costs attached to links between
                                                                                58
                                 source, sink andSimon J.D.nodes appropriately.
   Computer vision: models, learning and inference. ©2011
                                                          pixel Prince
Alpha Expansion Construction




                                  Graph is dynamic. Structure of inter-pixel links
                                  depends on and the choice of labels.

                                  There are four cases.
                                                                              59
   Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Alpha Expansion Construction




                                  Case 1:

                                  Adjacent pixels both have label already.
                                  Pairwise cost is zero – no need for extra edges.
                                                                              60
   Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Alpha Expansion Construction




                                  Case 2: Adjacent pixels are     .
                                  Result either
                                      •         (no cost and no new edge).
                                      •         (P( ), add new edge).
                                                                              61
   Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Alpha Expansion Construction




                                  Case 3: Adjacent pixels are   . Result either
                                      •       (no cost and no new edge).
                                      •       (P( ), add new edge).
                                      •       (P( ), add new edge).
                                                                              62
   Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Alpha Expansion Construction




                                   Case 4: Adjacent pixels are . Result either
                                          •           (P( ), add new edge).
                                          •           (P( ), add new edge).
                                          •            (P( ), add new edge).
                                                                                     63
                                          •            (no cost Prince no new edge).
   Computer vision: models, learning and inference. ©2011 Simon J.D.
                                                                     and
Example Cut 1




                                                                           64
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Example Cut 1
                                                                       Important!




                                                                                    65
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Example Cut 2




                                                                           66
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Example Cut 3




                                                                           67
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Denoising
 Results




                                                                                 68
      Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
Conditional Random Fields




  Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   69
Directed model for grids




Cannot use graph cuts as three-wise term. Easy to draw samples.
     Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   70
Applications
• Background subtraction




        Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   71
Applications
• Grab cut




        Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   72
Applications
• Stereo vision




         Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   73
Applications
• Shift-map image editing




        Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   74
Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   75
Applications
• Shift-map image editing




        Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   76
Applications
• Super-resolution




        Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   77
Applications
• Texture synthesis




         Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   78
Image Quilting




Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   79
Applications
• Synthesizing faces




         Computer vision: models, learning and inference. ©2011 Simon J.D. Prince   80

Más contenido relacionado

Destacado

Lecture14
Lecture14Lecture14
Lecture14zukun
 
Lecture27
Lecture27Lecture27
Lecture27zukun
 
Skiena algorithm 2007 lecture20 satisfiability
Skiena algorithm 2007 lecture20 satisfiabilitySkiena algorithm 2007 lecture20 satisfiability
Skiena algorithm 2007 lecture20 satisfiabilityzukun
 
Lecture24
Lecture24Lecture24
Lecture24zukun
 
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVzukun
 
My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009zukun
 

Destacado (6)

Lecture14
Lecture14Lecture14
Lecture14
 
Lecture27
Lecture27Lecture27
Lecture27
 
Skiena algorithm 2007 lecture20 satisfiability
Skiena algorithm 2007 lecture20 satisfiabilitySkiena algorithm 2007 lecture20 satisfiability
Skiena algorithm 2007 lecture20 satisfiability
 
Lecture24
Lecture24Lecture24
Lecture24
 
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCV
 
My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009
 

Similar a 12 cv mil_models_for_grids

Common Probability Distibution
Common Probability DistibutionCommon Probability Distibution
Common Probability DistibutionLukas Tencer
 
Introduction to Probability
Introduction to ProbabilityIntroduction to Probability
Introduction to ProbabilityLukas Tencer
 
03 cv mil_probability_distributions
03 cv mil_probability_distributions03 cv mil_probability_distributions
03 cv mil_probability_distributionszukun
 
17 cv mil_models_for_shape
17 cv mil_models_for_shape17 cv mil_models_for_shape
17 cv mil_models_for_shapezukun
 
09 cv mil_classification
09 cv mil_classification09 cv mil_classification
09 cv mil_classificationzukun
 
15 cv mil_models_for_transformations
15 cv mil_models_for_transformations15 cv mil_models_for_transformations
15 cv mil_models_for_transformationszukun
 
13 cv mil_preprocessing
13 cv mil_preprocessing13 cv mil_preprocessing
13 cv mil_preprocessingzukun
 
08 cv mil_regression
08 cv mil_regression08 cv mil_regression
08 cv mil_regressionzukun
 
05 cv mil_normal_distribution
05 cv mil_normal_distribution05 cv mil_normal_distribution
05 cv mil_normal_distributionzukun
 
14 cv mil_the_pinhole_camera
14 cv mil_the_pinhole_camera14 cv mil_the_pinhole_camera
14 cv mil_the_pinhole_camerazukun
 
20 cv mil_models_for_words
20 cv mil_models_for_words20 cv mil_models_for_words
20 cv mil_models_for_wordszukun
 
02 cv mil_intro_to_probability
02 cv mil_intro_to_probability02 cv mil_intro_to_probability
02 cv mil_intro_to_probabilityzukun
 
06 cv mil_learning_and_inference
06 cv mil_learning_and_inference06 cv mil_learning_and_inference
06 cv mil_learning_and_inferencezukun
 

Similar a 12 cv mil_models_for_grids (13)

Common Probability Distibution
Common Probability DistibutionCommon Probability Distibution
Common Probability Distibution
 
Introduction to Probability
Introduction to ProbabilityIntroduction to Probability
Introduction to Probability
 
03 cv mil_probability_distributions
03 cv mil_probability_distributions03 cv mil_probability_distributions
03 cv mil_probability_distributions
 
17 cv mil_models_for_shape
17 cv mil_models_for_shape17 cv mil_models_for_shape
17 cv mil_models_for_shape
 
09 cv mil_classification
09 cv mil_classification09 cv mil_classification
09 cv mil_classification
 
15 cv mil_models_for_transformations
15 cv mil_models_for_transformations15 cv mil_models_for_transformations
15 cv mil_models_for_transformations
 
13 cv mil_preprocessing
13 cv mil_preprocessing13 cv mil_preprocessing
13 cv mil_preprocessing
 
08 cv mil_regression
08 cv mil_regression08 cv mil_regression
08 cv mil_regression
 
05 cv mil_normal_distribution
05 cv mil_normal_distribution05 cv mil_normal_distribution
05 cv mil_normal_distribution
 
14 cv mil_the_pinhole_camera
14 cv mil_the_pinhole_camera14 cv mil_the_pinhole_camera
14 cv mil_the_pinhole_camera
 
20 cv mil_models_for_words
20 cv mil_models_for_words20 cv mil_models_for_words
20 cv mil_models_for_words
 
02 cv mil_intro_to_probability
02 cv mil_intro_to_probability02 cv mil_intro_to_probability
02 cv mil_intro_to_probability
 
06 cv mil_learning_and_inference
06 cv mil_learning_and_inference06 cv mil_learning_and_inference
06 cv mil_learning_and_inference
 

Más de zukun

ETHZ CV2012: Information
ETHZ CV2012: InformationETHZ CV2012: Information
ETHZ CV2012: Informationzukun
 
Siwei lyu: natural image statistics
Siwei lyu: natural image statisticsSiwei lyu: natural image statistics
Siwei lyu: natural image statisticszukun
 
Lecture9 camera calibration
Lecture9 camera calibrationLecture9 camera calibration
Lecture9 camera calibrationzukun
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionzukun
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluationzukun
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-softwarezukun
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptorszukun
 
Modern features-part-1-detectors
Modern features-part-1-detectorsModern features-part-1-detectors
Modern features-part-1-detectorszukun
 
Modern features-part-0-intro
Modern features-part-0-introModern features-part-0-intro
Modern features-part-0-introzukun
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video searchzukun
 
Lecture 01 internet video search
Lecture 01 internet video searchLecture 01 internet video search
Lecture 01 internet video searchzukun
 
Lecture 03 internet video search
Lecture 03 internet video searchLecture 03 internet video search
Lecture 03 internet video searchzukun
 
Icml2012 tutorial representation_learning
Icml2012 tutorial representation_learningIcml2012 tutorial representation_learning
Icml2012 tutorial representation_learningzukun
 
Advances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionAdvances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionzukun
 
Gephi tutorial: quick start
Gephi tutorial: quick startGephi tutorial: quick start
Gephi tutorial: quick startzukun
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysiszukun
 
Object recognition with pictorial structures
Object recognition with pictorial structuresObject recognition with pictorial structures
Object recognition with pictorial structureszukun
 
Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities zukun
 
Icml2012 learning hierarchies of invariant features
Icml2012 learning hierarchies of invariant featuresIcml2012 learning hierarchies of invariant features
Icml2012 learning hierarchies of invariant featureszukun
 
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...zukun
 

Más de zukun (20)

ETHZ CV2012: Information
ETHZ CV2012: InformationETHZ CV2012: Information
ETHZ CV2012: Information
 
Siwei lyu: natural image statistics
Siwei lyu: natural image statisticsSiwei lyu: natural image statistics
Siwei lyu: natural image statistics
 
Lecture9 camera calibration
Lecture9 camera calibrationLecture9 camera calibration
Lecture9 camera calibration
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer vision
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluation
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-software
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptors
 
Modern features-part-1-detectors
Modern features-part-1-detectorsModern features-part-1-detectors
Modern features-part-1-detectors
 
Modern features-part-0-intro
Modern features-part-0-introModern features-part-0-intro
Modern features-part-0-intro
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video search
 
Lecture 01 internet video search
Lecture 01 internet video searchLecture 01 internet video search
Lecture 01 internet video search
 
Lecture 03 internet video search
Lecture 03 internet video searchLecture 03 internet video search
Lecture 03 internet video search
 
Icml2012 tutorial representation_learning
Icml2012 tutorial representation_learningIcml2012 tutorial representation_learning
Icml2012 tutorial representation_learning
 
Advances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionAdvances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer vision
 
Gephi tutorial: quick start
Gephi tutorial: quick startGephi tutorial: quick start
Gephi tutorial: quick start
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysis
 
Object recognition with pictorial structures
Object recognition with pictorial structuresObject recognition with pictorial structures
Object recognition with pictorial structures
 
Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities
 
Icml2012 learning hierarchies of invariant features
Icml2012 learning hierarchies of invariant featuresIcml2012 learning hierarchies of invariant features
Icml2012 learning hierarchies of invariant features
 
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
 

Último

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 

Último (20)

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 

12 cv mil_models_for_grids

  • 1. Computer vision: models, learning and inference Chapter 10 Graphical Models Please send errata to s.prince@cs.ucl.ac.uk
  • 2. Models for grids • Consider models where one unknown world state at each pixel in the image – takes the form of a grid. • Loops in the graphical model so cannot use dynamic programming or belief propagation • Define probability distributions that favour certain configurations of world states – Called Markov random fields – Inference using a set of techniques called graph cuts 2 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 3. Binary Denoising Before After Image represented as binary discrete variables. Some proportion of pixels randomly changed polarity. 3 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 4. Multi-label Denoising Before After Image represented as discrete variables representing intensity. Some proportion of pixels randomly changed according to a uniform distribution. 4 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 5. Denoising Goal Observed Data Uncorrupted Image 5 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 6. Denoising Goal Observed Data Uncorrupted Image • Most of the pixels stay the same • Observed image is not as smooth as original Now consider pdf over binary images that encourages smoothness – Markov random field 6 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 7. Markov random fields This is just the typical property of an undirected model. We’ll continue the discussion in terms of undirected models 7 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 8. Markov random fields Normalizing constant (partition function) Potential function Returns positive number Subset of variables (clique) 8 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 9. Markov random fields Normalizing constant Cost function (partition function) Returns any number Subset of variables Relationship (clique) 9 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 10. Smoothing example Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 10
  • 11. Smoothing Example Smooth solutions (e.g. 0000,1111) have high probability Z was computed by summing the 16 un-normalized probabilities Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 11
  • 12. Smoothing Example Samples from larger grid -- mostly smooth Cannot compute partition function Z here - intractable Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 12
  • 13. Denoising Goal Observed Data Uncorrupted Image 13 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 14. Denoising overview Bayes’ rule: Likelihoods: Probability of flipping polarity Prior: Markov random field (smoothness) MAP Inference: Graph cuts 14 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 15. Denoising with MRFs MRF Prior (pairwise cliques) Original image, w Likelihoods Observed image, x Inference : 15 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 16. MAP Inference Unary terms Pairwise terms (compatability of data with label y) (compatability of neighboring labels) 16 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 17. Graph Cuts Overview Graph cuts used to optimise this cost function: Unary terms Pairwise terms (compatability of data with label y) (compatability of neighboring labels) Three main cases: 17 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 18. Graph Cuts Overview Graph cuts used to optimise this cost function: Unary terms Pairwise terms (compatability of data with label y) (compatability of neighboring labels) Approach: Convert minimization into the form of a standard CS problem, MAXIMUM FLOW or MINIMUM CUT ON A GRAPH Polynomial-time methods for solving this problem are known 18 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 19. Max-Flow Problem Goal: To push as much ‘flow’ as possible through the directed graph from the source to the sink. Cannot exceed the (non-negative) capacities cij associated with each edge. 19 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 20. Saturated Edges When we are pushing the maximum amount of flow: • There must be at least one saturated edge on any path from source to sink (otherwise we could push more flow) • The set of saturated edges hence separate the source and sink 20 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 21. Augmenting Paths Two numbers represent: current flow / total capacity 21 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 22. Augmenting Paths Choose any route from source to sink with spare capacity and push as much flow as you can. One edge (here 6-t) will saturate. 22 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 23. Augmenting Paths Choose another route, respecting remaining capacity. This time edge 5-6 saturates. 23 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 24. Augmenting Paths A third route. Edge 1-4 saturates 24 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 25. Augmenting Paths A fourth route. Edge 2-5 saturates 25 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 26. Augmenting Paths A fifth route. Edge 2-4 saturates 26 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 27. Augmenting Paths There is now no further route from source to sink – there is a saturated edge along every possible route (highlighted arrows) 27 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 28. Augmenting Paths The saturated edges separate the source from the sink and form the min-cut solution. Nodes either connect to the source or connect to the sink. 28 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 29. Graph Cuts: Binary MRF Graph cuts used to optimise this cost function: Unary terms Pairwise terms (compatability of data with label w) (compatability of neighboring labels) First work with binary case (i.e. True label w is 0 or 1) Constrain pairwise costs so that they are “zero-diagonal” 29 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 30. Graph Construction • One node per pixel (here a 3x3 image) • Edge from source to every pixel node • Edge from every pixel node to sink • Reciprocal edges between neighbours Note that in the minimum cut EITHER the edge connecting to the source will be cut, OR the edge connecting to the sink, but NOT BOTH (unnecessary). Which determines whether we give that pixel label 1 or label 0. Now a 1 to 1 mapping between possible labelling and possible minimum cuts 30 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 31. Graph Construction Now add capacities so that minimum cut, minimizes our cost function Unary costs U(0), U(1) attached to links to source and sink. • Either one or the other is paid. Pairwise costs between pixel nodes as shown. • Why? Easiest to understand with some worked examples. 31 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 32. Example 1 32 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 33. Example 2 33 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 34. Example 3 34 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 35. 35 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 36. Graph Cuts: Binary MRF Graph cuts used to optimise this cost function: Unary terms Pairwise terms (compatability of data with label w) (compatability of neighboring labels) Summary of approach • Associate each possible solution with a minimum cut on a graph • Set capacities on graph, so cost of cut matches the cost function • Use augmenting paths to find minimum cut • This minimizes the cost function and finds the MAP solution 36 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 37. General Pairwise costs Modify graph to • Add P(0,0) to edge s-b • Implies that solutions 0,0 and 1,0 also pay this cost • Subtract P(0,0) from edge b-a • Solution 1,0 has this cost removed again Similar approach for P(1,1) 37 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 38. Reparameterization The max-flow / min-cut algorithms require that all of the capacities are non-negative. However, because we have a subtraction on edge a-b we cannot guarantee that this will be the case, even if all the original unary and pairwise costs were positive. The solution to this problem is reparamaterization: find new graph where costs (capacities) are different but choice of minimum solution is the same (usually just by adding a constant to each solution) 38 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 39. Reparameterization 1 The minimum cut chooses the same links in these two graphs Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 40. Reparameterization 2 The minimum cut chooses the same links in these two graphs 40 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 41. Submodularity Subtract constant Add constant, Adding together implies 41 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 42. Submodularity If this condition is obeyed, it is said that the problem is “submodular” and it can be solved in polynomial time. If it is not obeyed then the problem is NP hard. Usually it is not a problem as we tend to favour smooth solutions. 42 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 43. Denoising Results Pairwise costs increasing Original Pairwise costs increasing 43 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 44. Plan of Talk • Denoising problem • Markov random fields (MRFs) • Max-flow / min-cut • Binary MRFs – submodular (exact solution) • Multi-label MRFs – submodular (exact solution) • Multi-label MRFs - non-submodular (approximate) 44 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 45. Multiple Labels Construction for two pixels (a and b) and four labels (1,2,3,4) There are 5 nodes for each pixel and 4 edges between them have unary costs for the 4 labels. One of these edges must be cut in the min-cut solution and the choice will determine which label we assign. 45 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 46. Constraint Edges The edges with infinite capacity pointing upwards are called constraint edges. They prevent solutions that cut the chain of edges associated with a pixel more than once (and hence given an ambiguous labelling) 46 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 47. Multiple Labels Inter-pixel edges have costs defined as: Superfluous terms : For all i,j where K is number of labels47 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 48. Example Cuts Must cut links from before cut on pixel a to after cut on pixel b. 48 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 49. Pairwise Costs Must cut links from before cut on pixel a to after cut on pixel b. Costs were carefully chosen so that sum of these links gives appropriate pairwise term. If pixel a takes label I and pixel b takes label J 49 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 50. Reparameterization 50 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 51. Submodularity We require the remaining inter-pixel links to be positive so that or By mathematical induction we can get the more general result 51 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 52. Submodularity If not submodular then the problem is NP hard. 52 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 53. Convex vs. non-convex costs Quadratic Truncated Quadratic Potts Model • Convex • Not Convex • Not Convex • Submodular • Not Submodular • Not Submodular 53 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 54. What is wrong with convex costs? Observed noisy image Denoised result • Pay lower price for many small changes than one large one • Result: blurring at large changes in intensity 54 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 55. Plan of Talk • Denoising problem • Markov random fields (MRFs) • Max-flow / min-cut • Binary MRFs - submodular (exact solution) • Multi-label MRFs – submodular (exact solution) • Multi-label MRFs - non-submodular (approximate) 55 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 56. Alpha Expansion Algorithm • break multilabel problem into a series of binary problems • at each iteration, pick label and expand (retain original or change to ) Initial Iteration 1 labelling (orange) Iteration 2 Iteration 3 (yellow) (red) 56 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 57. Alpha Expansion Ideas • For every iteration – For every label – Expand label using optimal graph cut solution Co-ordinate descent in label space. Each step optimal, but overall global maximum not guaranteed Proved to be within a factor of 2 of global optimum. Requires that pairwise costs form a metric: 57 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 58. Alpha Expansion Construction Binary graph cut – either cut link to source (assigned to ) or to sink (retain current label) Unary costs attached to links between 58 source, sink andSimon J.D.nodes appropriately. Computer vision: models, learning and inference. ©2011 pixel Prince
  • 59. Alpha Expansion Construction Graph is dynamic. Structure of inter-pixel links depends on and the choice of labels. There are four cases. 59 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 60. Alpha Expansion Construction Case 1: Adjacent pixels both have label already. Pairwise cost is zero – no need for extra edges. 60 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 61. Alpha Expansion Construction Case 2: Adjacent pixels are . Result either • (no cost and no new edge). • (P( ), add new edge). 61 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 62. Alpha Expansion Construction Case 3: Adjacent pixels are . Result either • (no cost and no new edge). • (P( ), add new edge). • (P( ), add new edge). 62 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 63. Alpha Expansion Construction Case 4: Adjacent pixels are . Result either • (P( ), add new edge). • (P( ), add new edge). • (P( ), add new edge). 63 • (no cost Prince no new edge). Computer vision: models, learning and inference. ©2011 Simon J.D. and
  • 64. Example Cut 1 64 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 65. Example Cut 1 Important! 65 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 66. Example Cut 2 66 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 67. Example Cut 3 67 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 68. Denoising Results 68 Computer vision: models, learning and inference. ©2011 Simon J.D. Prince
  • 69. Conditional Random Fields Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 69
  • 70. Directed model for grids Cannot use graph cuts as three-wise term. Easy to draw samples. Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 70
  • 71. Applications • Background subtraction Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 71
  • 72. Applications • Grab cut Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 72
  • 73. Applications • Stereo vision Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 73
  • 74. Applications • Shift-map image editing Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 74
  • 75. Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 75
  • 76. Applications • Shift-map image editing Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 76
  • 77. Applications • Super-resolution Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 77
  • 78. Applications • Texture synthesis Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 78
  • 79. Image Quilting Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 79
  • 80. Applications • Synthesizing faces Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 80