Some slides and illustrations from D. Forsyth, …

Slides:



Advertisements
Similar presentations
Clustering. How are we doing on the pass sequence? Pretty good! We can now automatically learn the features needed to track both people But, it sucks.
Advertisements

Clustering Beyond K-means
1 12. Principles of Parameter Estimation The purpose of this lecture is to illustrate the usefulness of the various concepts introduced and studied in.
Fitting: The Hough transform. Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not.
Computing 3-view Geometry Class 18
Computer Vision - A Modern Approach Set: Probability in segmentation Slides by D.A. Forsyth Missing variable problems In many vision problems, if some.
MASKS © 2004 Invitation to 3D vision Lecture 7 Step-by-Step Model Buidling.
Computer Vision - A Modern Approach Set: Model-based Vision Slides by D.A. Forsyth Recognition by Hypothesize and Test General idea –Hypothesize object.
Segmentation and Fitting Using Probabilistic Methods
Visual Recognition Tutorial
Lecture 6 Image Segmentation
Projective structure from motion
Motion Detection And Analysis Michael Knowles Tuesday 13 th January 2004.
Computer Vision Fitting Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel, A. Zisserman,...
Computer Vision Fitting Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel, A. Zisserman,...
Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.
Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth Fitting Choose a parametric object/some objects to represent a set of tokens Most.
Problem Sets Problem Set 3 –Distributed Tuesday, 3/18. –Due Thursday, 4/3 Problem Set 4 –Distributed Tuesday, 4/1 –Due Tuesday, 4/15. Probably a total.
Segmentation Divide the image into segments. Each segment:
Fitting. We’ve learned how to detect edges, corners, blobs. Now what? We would like to form a higher-level, more compact representation of the features.
Prénom Nom Document Analysis: Data Analysis and Clustering Prof. Rolf Ingold, University of Fribourg Master course, spring semester 2008.
Many slides and illustrations from J. Ponce
Computer Vision Segmentation Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel,...
Image Segmentation Some slides: courtesy of O. Capms, Penn State, J.Ponce and D. Fortsyth, Computer Vision Book.
Triangulation and Multi-View Geometry Class 9 Read notes Section 3.3, , 5.1 (if interested, read Triggs’s paper on MVG using tensor notation, see.
CS664 Lecture #19: Layers, RANSAC, panoramas, epipolar geometry Some material taken from:  David Lowe, UBC  Jiri Matas, CMP Prague
Computer Vision Non-linear tracking Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, M. Isard, T. Darrell …
Fitting. Choose a parametric object/some objects to represent a set of tokens Most interesting case is when criterion is not local –can’t tell whether.
Lecture 8: Image Alignment and RANSAC
Multiple View Reconstruction Class 23 Multiple View Geometry Comp Marc Pollefeys.
Automatic Image Alignment (feature-based) : Computational Photography Alexei Efros, CMU, Fall 2006 with a lot of slides stolen from Steve Seitz and.
Tracking with Linear Dynamic Models. Introduction Tracking is the problem of generating an inference about the motion of an object given a sequence of.
Algorithm Evaluation and Error Analysis class 7 Multiple View Geometry Comp Marc Pollefeys.
Clustering with Bregman Divergences Arindam Banerjee, Srujana Merugu, Inderjit S. Dhillon, Joydeep Ghosh Presented by Rohit Gupta CSci 8980: Machine Learning.
Lecture 10: Robust fitting CS4670: Computer Vision Noah Snavely.
Computer Vision Segmentation Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel,...
Computer Vision Calibration Marc Pollefeys COMP 256 Read F&P Chapter 2 Some slides/illustrations from Ponce, Hartley & Zisserman.
Computer Vision - A Modern Approach Set: Segmentation Slides by D.A. Forsyth Segmentation and Grouping Motivation: not information is evidence Obtain a.
Fitting.
Image Segmentation Image segmentation is the operation of partitioning an image into a collection of connected sets of pixels. 1. into regions, which usually.
Feature and object tracking algorithms for video tracking Student: Oren Shevach Instructor: Arie nakhmani.
1 Lesson 8: Basic Monte Carlo integration We begin the 2 nd phase of our course: Study of general mathematics of MC We begin the 2 nd phase of our course:
CSCE 643 Computer Vision: Structure from Motion
EM and model selection CS8690 Computer Vision University of Missouri at Columbia Missing variable problems In many vision problems, if some variables.
Motion Segmentation By Hadas Shahar (and John Y.A.Wang, and Edward H. Adelson, and Wikipedia and YouTube) 1.
EECS 274 Computer Vision Model Fitting. Fitting Choose a parametric object/some objects to represent a set of points Three main questions: –what object.
Presented by: Idan Aharoni
Visual Tracking by Cluster Analysis Arthur Pece Department of Computer Science University of Copenhagen
Notes on HW 1 grading I gave full credit as long as you gave a description, confusion matrix, and working code Many people’s descriptions were quite short.
Model fitting ECE 847: Digital Image Processing Stan Birchfield Clemson University.
Advanced Artificial Intelligence Lecture 8: Advance machine learning.
Fitting.
Hough Transform CS 691 E Spring Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik.
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Model fitting ECE 847: Digital Image Processing Stan Birchfield
Fitting.
Line Fitting James Hayes.
Classification of unlabeled data:
Motion Detection And Analysis
Latent Variables, Mixture Models and EM
A special case of calibration
Segmentation and Grouping
Computer Vision - A Modern Approach
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
Missing variable problems
Calibration and homographies
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Parameter estimation class 6
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
Presentation transcript:

Some slides and illustrations from D. Forsyth, … EM and model selection Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, …

Tentative class schedule Jan 16/18 - Introduction Jan 23/25 Cameras Radiometry Jan 30/Feb1 Sources & Shadows Color Feb 6/8 Linear filters & edges Texture Feb 13/15 Multi-View Geometry Stereo Feb 20/22 Optical flow Project proposals Feb27/Mar1 Affine SfM Projective SfM Mar 6/8 Camera Calibration Segmentation Mar 13/15 Springbreak Mar 20/22 Fitting Prob. Segmentation Mar 27/29 Silhouettes and Photoconsistency Linear tracking Apr 3/5 Project Update Non-linear Tracking Apr 10/12 Object Recognition Apr 17/19 Range data Apr 24/26 Final project

Project Update and Final project presentation Project update: 4 minute presentation (send to Talha by April 2 for compilation) Final presentation: Presentation and/or Demo (your choice, but let me know) Short paper (Due April 22 by 23:59) (preferably Latex IEEE proc. style) Final presentation/demo April 24 and 26

Last tuesday: Fitting Hough transform RANSAC K-means fitting M-estimators RANSAC Do generate hypothesis (from minimal data) verify hypothesis (on all the rest of data) Until good enough influence function

Missing variable problems In many vision problems, if some variables were known the maximum likelihood inference problem would be easy fitting; if we knew which line each token came from, it would be easy to determine line parameters segmentation; if we knew the segment each pixel came from, it would be easy to determine the segment parameters fundamental matrix estimation; if we knew which feature corresponded to which, it would be easy to determine the fundamental matrix etc. This sort of thing happens in statistics, too

Missing variable problems Strategy estimate appropriate values for the missing variables plug these in, now estimate parameters re-estimate appropriate values for missing variables, continue e.g. guess which line gets which point now fit the lines now reallocate points to lines, using our knowledge of the lines now refit, etc. We’ve seen this line of thought before (k-means)

Missing variables - strategy We have a problem with parameters, missing variables This suggests: Iterate until convergence replace missing variable with expected values, given fixed values of parameters fix missing variables, choose parameters to maximise likelihood given fixed values of missing variables e.g., iterate till convergence allocate each point to a line with a weight, which is the probability of the point given the line refit lines to the weighted set of points Converges to local extremum Somewhat more general form is available

Lines and robustness We have one line, and n points Some come from the line, some from “noise” This is a mixture model: We wish to determine line parameters p(comes from line) P(comes from noise)=(1-P(comes from line))

Estimating the mixture model Introduce a set of hidden variables, d, one for each point. They are one when the point is on the line, and zero when off. If these are known, the negative log-likelihood becomes (the line’s parameters are f, c): Here K is a normalising constant, kn is the noise intensity (we’ll choose this later).

Substituting for delta We shall substitute the expected value of d, for a given q recall q=(f, c, l) E(d_i)=1. P(d_i=1|q)+0.... Notice that if kn is small and positive, then if distance is small, this value is close to 1 and if it is large, close to zero

Algorithm for line fitting Obtain some start point Now compute d’s using formula above Now compute maximum likelihood estimate of f, c come from fitting to weighted points l comes by counting Iterate to convergence

The expected values of the deltas at the maximum (notice the one value close to zero).

Closeup of the fit

Choosing parameters What about the noise parameter, and the sigma for the line? several methods from first principles knowledge of the problem (seldom really possible) play around with a few examples and choose (usually quite effective, as precise choice doesn’t matter much) notice that if kn is large, this says that points very seldom come from noise, however far from the line they lie usually biases the fit, by pushing outliers into the line rule of thumb; its better to fit to the better fitting points, within reason; if this is hard to do, then the model could be a problem

Other examples Segmentation Fitting multiple lines a segment is a gaussian that emits feature vectors (which could contain colour; or colour and position; or colour, texture and position). segment parameters are mean and (perhaps) covariance if we knew which segment each point belonged to, estimating these parameters would be easy rest is on same lines as fitting line Fitting multiple lines rather like fitting one line, except there are more hidden variables easiest is to encode as an array of hidden variables, which represent a table with a one where the i’th point comes from the j’th line, zeros otherwise rest is on same lines as above

Issues with EM Local maxima Starting can be a serious nuisance in some problems no guarantee that we have reached the “right” maximum Starting k means to cluster the points is often a good idea

Local maximum Things can go wrong with EM, too -

which is an excellent fit to some points

and the deltas for this maximum

A dataset that is well fitted by four lines

Result of EM fitting, with one line (or at least, one available local maximum).

Result of EM fitting, with two lines (or at least, one available local maximum).

Seven lines can produce a rather logical answer

Segmentation with EM This is figure 16.2 - story in the caption Figure from “Color and Texture Based Image Segmentation Using EM and Its Application to Content Based Image Retrieval”,S.J. Belongie et al., Proc. Int. Conf. Computer Vision, 1998, c1998, IEEE

Motion segmentation with EM Model image pair (or video sequence) as consisting of regions of parametric motion affine motion is popular Now we need to determine which pixels belong to which region estimate parameters Likelihood assume Straightforward missing variable problem, rest is calculation

Three frames from the MPEG “flower garden” sequence Story in figure 16.5 Figure from “Representing Images with layers,”, by J. Wang and E.H. Adelson, IEEE Transactions on Image Processing, 1994, c 1994, IEEE

Grey level shows region no. with highest probability Figure 16.6 Segments and motion fields associated with them Figure from “Representing Images with layers,”, by J. Wang and E.H. Adelson, IEEE Transactions on Image Processing, 1994, c 1994, IEEE

If we use multiple frames to estimate the appearance of a segment, we can fill in occlusions; so we can re-render the sequence with some segments removed. Story in fig 16.7 Figure from “Representing Images with layers,”, by J. Wang and E.H. Adelson, IEEE Transactions on Image Processing, 1994, c 1994, IEEE

Structure from motion without correspondences Dellaert et al.00 EM MCMC Chain Flipping

Some generalities Many, but not all problems that can be attacked with EM can also be attacked with RANSAC need to be able to get a parameter estimate with a manageably small number of random choices. RANSAC is usually better Didn’t present in the most general form in the general form, the likelihood may not be a linear function of the missing variables in this case, one takes an expectation of the likelihood, rather than substituting expected values of missing variables Issue doesn’t seem to arise in vision applications.

Model Selection We wish to choose a model to fit to data Issue e.g. is it a line or a circle? e.g is this a perspective or orthographic camera? e.g. is there an aeroplane there or is it noise? Issue In general, models with more parameters will fit a dataset better, but are poorer at prediction This means we can’t simply look at the negative log-likelihood (or fitting error)

Top is not necessarily a better fit than bottom (actually, almost always worse) A general principle here; it’s usually a good idea to accept some fitting error, because your fitted object may then reflect the behaviour of data points that you haven’t seen rather better. Equivalently, if you fit a “simple” object to a lot of points, your estimate of that object’s parameters is accurate, even though it may not represent those points as well as a “complex” object does; in the case of the complex object, your estimate of the object’s parameters may be very unreliable, so new data points are poorly represented. This is sometimes thought of as a tradeoff between bias --- the model doesn’t represent the data perfectly --- and variance --- but I can estimate its parameters accurately, meaning that it will handle future data points well.

We expect a picture that looks like this; more flexible things fit better (but usually predict worse).

We can discount the fitting error with some term in the number of parameters in the model.

Discounts AIC (an information criterion) choose model with smallest value of p is the number of parameters BIC (Bayes information criterion) choose model with smallest value of N is the number of data points Minimum description length same criterion as BIC, but derived in a completely different way

Example: Dominant planes in USfM (Pollefeys et al., ECCV’2002) Two or three views only sharing points in a plane cause problem for uncalibrated structure from motion Solution: Detect problem through model selection Delay computation of ambiguous parameters until more information is available

GRIC: Geometric Robust Information Criterion (Torr et al., ICCV’98) (inspired from Kanatani’s GIC) structure complexity model complexity robust! (otherwise outliers will make you get the most expensive model every time, i.e. the model is never good enough for them) co-dimension (2D or 3D) (6 for points in 3 views) (11x3-15 (PPP) or 8x2(HH))

F vs. H PPP vs. HH

PPPgric HHgric

Farmhouse 3D models Strategy: Detect problem using model selection Reconstruct planes and 3D separately Perform self-calibration Assemble reconstruction compute poses (for planar parts) Refine complete reconstruction (bundle adjustment)

Key-frame selection in video (Repko and Pollefeys, 3DIM05) Algorithm Compare models for F and H using GRIC Continue tracking as long as #inliers>90% H-GRIC F-GRIC 100% 90%

Cross-validation Split data set into two pieces, fit to one, and compute negative log-likelihood on the other Average over multiple different splits Choose the model with the smallest value of this average The difference in averages for two different models is an estimate of the difference in KL divergence of the models from the source of the data

Model averaging Very often, it is smarter to use multiple models for prediction than just one e.g. motion capture data there are a small number of schemes that are used to put markers on the body given we know the scheme S and the measurements D, we can estimate the configuration of the body X We want If it is obvious what the scheme is from the data, then averaging makes little difference If it isn’t, then not averaging underestimates the variance of X --- we think we have a more precise estimate than we do.

Next class: Shape from silhouettes and photo-consistency