Lecture 3. Least Squares Fitting. Optimization Trinity 2014 P.H.S.Torr. Classic least squares. Total least squares.

Similar documents
Model Fitting, RANSAC. Jana Kosecka

Big Data Analytics. Data Fitting and Sampling. Acknowledgement: Notes by Profs. R. Szeliski, S. Seitz, S. Lazebnik, K. Chaturvedi, and S.

CS 2750 Machine Learning. Lecture 8. Linear regression. CS 2750 Machine Learning. Linear regression. is a linear combination of input components x

Simple Linear Regression

Generative classification models

Kernel-based Methods and Support Vector Machines

Lecture 7. Confidence Intervals and Hypothesis Tests in the Simple CLR Model

Line Fitting and Regression

Lecture Notes Types of economic variables

Analyzing Two-Dimensional Data. Analyzing Two-Dimensional Data

ENGI 3423 Simple Linear Regression Page 12-01

Lecture 3. Sampling, sampling distributions, and parameter estimation

( ) = ( ) ( ) Chapter 13 Asymptotic Theory and Stochastic Regressors. Stochastic regressors model

Econometric Methods. Review of Estimation

Maximum Likelihood Estimation

Module 7. Lecture 7: Statistical parameter estimation

Lecture Notes Forecasting the process of estimating or predicting unknown situations

ESS Line Fitting

Supervised learning: Linear regression Logistic regression

Lecture 1: Introduction to Regression

Objectives of Multiple Regression

Likelihood Ratio, Wald, and Lagrange Multiplier (Score) Tests. Soccer Goals in European Premier Leagues

STK4011 and STK9011 Autumn 2016

{ }{ ( )} (, ) = ( ) ( ) ( ) Chapter 14 Exercises in Sampling Theory. Exercise 1 (Simple random sampling): Solution:

Machine Learning. Introduction to Regression. Le Song. CSE6740/CS7641/ISYE6740, Fall 2012

LECTURE - 4 SIMPLE RANDOM SAMPLING DR. SHALABH DEPARTMENT OF MATHEMATICS AND STATISTICS INDIAN INSTITUTE OF TECHNOLOGY KANPUR

Feature Selection: Part 2. 1 Greedy Algorithms (continued from the last lecture)

KLT Tracker. Alignment. 1. Detect Harris corners in the first frame. 2. For each Harris corner compute motion between consecutive frames

9.1 Introduction to the probit and logit models

Lecture 1: Introduction to Regression

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

Point Estimation: definition of estimators

Multivariate Transformation of Variables and Maximum Likelihood Estimation

Bayes (Naïve or not) Classifiers: Generative Approach

Mean is only appropriate for interval or ratio scales, not ordinal or nominal.

Introduction to local (nonparametric) density estimation. methods

QR Factorization and Singular Value Decomposition COS 323

Linear Regression with One Regressor

Convergence of the Desroziers scheme and its relation to the lag innovation diagnostic

TESTS BASED ON MAXIMUM LIKELIHOOD

Statistics. Correlational. Dr. Ayman Eldeib. Simple Linear Regression and Correlation. SBE 304: Linear Regression & Correlation 1/3/2018


CS 1675 Introduction to Machine Learning Lecture 12 Support vector machines

Unsupervised Learning and Other Neural Networks

Ordinary Least Squares Regression. Simple Regression. Algebra and Assumptions.

Lecture 8: Linear Regression

Lecture Notes 2. The ability to manipulate matrices is critical in economics.

Lecture 9: Tolerant Testing

Chapter 14 Logistic Regression Models

Chapter 4 (Part 1): Non-Parametric Classification (Sections ) Pattern Classification 4.3) Announcements

4. Standard Regression Model and Spatial Dependence Tests

STATISTICAL PROPERTIES OF LEAST SQUARES ESTIMATORS. x, where. = y - ˆ " 1

Part I: Background on the Binomial Distribution

Statistics MINITAB - Lab 5

Chapter Two. An Introduction to Regression ( )

Fitting models to data.

Quantitative analysis requires : sound knowledge of chemistry : possibility of interferences WHY do we need to use STATISTICS in Anal. Chem.?

STA 108 Applied Linear Models: Regression Analysis Spring Solution for Homework #1

Example: Multiple linear regression. Least squares regression. Repetition: Simple linear regression. Tron Anders Moger

Correlation and Simple Linear Regression

Correlation and Regression Analysis

1 Solution to Problem 6.40

12.2 Estimating Model parameters Assumptions: ox and y are related according to the simple linear regression model

Classification : Logistic regression. Generative classification model.

Chapter 3 Sampling For Proportions and Percentages

Simple Linear Regression and Correlation.

Recall MLR 5 Homskedasticity error u has the same variance given any values of the explanatory variables Var(u x1,...,xk) = 2 or E(UU ) = 2 I

Multiple Choice Test. Chapter Adequacy of Models for Regression

STA302/1001-Fall 2008 Midterm Test October 21, 2008

Regression and the LMS Algorithm

Linear Regression Linear Regression with Shrinkage. Some slides are due to Tommi Jaakkola, MIT AI Lab

Chapter 5 Transformation and Weighting to Correct Model Inadequacies

best estimate (mean) for X uncertainty or error in the measurement (systematic, random or statistical) best

Outline. Point Pattern Analysis Part I. Revisit IRP/CSR

Chapter 13 Student Lecture Notes 13-1

Announcements. Recognition II. Computer Vision I. Example: Face Detection. Evaluating a binary classifier

Lecture 2: The Simple Regression Model

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

THE ROYAL STATISTICAL SOCIETY GRADUATE DIPLOMA

Parameter, Statistic and Random Samples

ENGI 4421 Joint Probability Distributions Page Joint Probability Distributions [Navidi sections 2.5 and 2.6; Devore sections

CHAPTER 6. d. With success = observation greater than 10, x = # of successes = 4, and

Binary classification: Support Vector Machines

CLASS NOTES. for. PBAF 528: Quantitative Methods II SPRING Instructor: Jean Swanson. Daniel J. Evans School of Public Affairs

Chapter 8: Statistical Analysis of Simulated Data

Special Instructions / Useful Data

3D Geometry for Computer Graphics. Lesson 2: PCA & SVD

Dimensionality reduction Feature selection

Generalized Minimum Perpendicular Distance Square Method of Estimation

Linear Regression. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

3. Basic Concepts: Consequences and Properties

Idea is to sample from a different distribution that picks points in important regions of the sample space. Want ( ) ( ) ( ) E f X = f x g x dx

Multiple Regression. More than 2 variables! Grade on Final. Multiple Regression 11/21/2012. Exam 2 Grades. Exam 2 Re-grades

Chapter 5 Properties of a Random Sample

Bayesian Classification. CS690L Data Mining: Classification(2) Bayesian Theorem: Basics. Bayesian Theorem. Training dataset. Naïve Bayes Classifier

For combinatorial problems we might need to generate all permutations, combinations, or subsets of a set.

ECONOMETRIC THEORY. MODULE VIII Lecture - 26 Heteroskedasticity

ECON 482 / WH Hong The Simple Regression Model 1. Definition of the Simple Regression Model

Overcoming Limitations of Sampling for Aggregation Queries

PTAS for Bin-Packing

Transcription:

Lecture 3 Optmzato Trt 04 P.H.S.Torr Least Squares Fttg Classc least squares Total least squares Robust Estmato

Fttg: Cocepts ad recpes

Least squares le fttg Data:,,,, Le equato: = m + b Fd m, b to mmze E m b, =m+b

Least squares le fttg Data:,,,, Le equato: = m + b Fd m, b to mmze 0 Y X XB X db de T T XB XB Y XB Y Y XB Y XB Y XB Y b m b m E T T T T Normal equatos: least squares soluto to XB=Y b m E, =m+b Y X XB X T T

Problem wth vertcal least squares Not rotato-varat Fals completel for vertcal les

Total least squares Dstace betwee pot, ad le a+b=d a +b =: a + b d Fd a, b, d to mmze the sum of squared perpedcular dstaces E a b E a b d d, a+b=d Ut ormal: N=a, b

Total least squares Dstace betwee pot, ad le a+b=d a +b =: a + b d Fd a, b, d to mmze the sum of squared perpedcular dstaces d b a E, a+b=d d b a E Ut ormal: N=a, b 0 d b a d E b a b a d UN UN b a b a E T 0 N U U dn de T Soluto to U T UN = 0, subject to N = : egevector of U T U assocated wth the smallest egevalue least squares soluto to homogeeous lear sstem UN = 0

Total least squares U T U U secod momet matr

Total least squares U T U U, N = a, b secod momet matr,

Least squares as lkelhood mamzato Geeratve model: le pots are corrupted b Gaussa ose the drecto perpedcular to the le u v a b ε u, v a+b=d, pot o the le ormal ose: drecto zero-mea Gaussa wth std. dev. σ

Least squares as lkelhood mamzato Geeratve model: le pots are corrupted b Gaussa ose the drecto perpedcular to the le b a v u, u, v ε d b a d b a P d b a P ep,,,,,, Lkelhood of pots gve le parameters a, b, d: d b a d b a L,,,, Log-lkelhood: a+b=d

Probablstc fttg: Geeral cocepts Lkelhood:,, P L P

Probablstc fttg: Geeral cocepts Lkelhood: Log-lkelhood: P P L,, P P L log,, log log

Probablstc fttg: Geeral cocepts Lkelhood: Log-lkelhood:,, P L P log L log P,, log P Mamum lkelhood estmato: ˆ arg ma L

Probablstc fttg: Geeral cocepts Lkelhood: Log-lkelhood:,, P L P log L log P,, log P Mamum lkelhood estmato: ˆ arg ma L Mamum a posteror MAP estmato: ˆ arg ma P,, arg ma L P pror

Least squares for geeral curves We would lke to mmze the sum of squared geometrc dstaces betwee the data pots ad the curve d,, C, curve C

Calculatg geometrc dstace closest pot u 0, v 0, curve taget: C v C u0, v0, u0, v0 u curve Cu,v = 0 The curve taget must be orthogoal to the vector coectg, wth the closest pot o the curve, u 0, v 0 : C v C u, v0 0 0 0 0 v u u, v [ v ] 0 0 C 0 u0, v 0 Must solve sstem of equatos for u 0, v 0

Least squares for cocs Equato of a geeral coc: Ca, = a = a + b + c + d + e + f = 0, a = [a, b, c, d, e, f], = [,,,,, ] Mmzg the geometrc dstace s o-lear eve for a coc Algebrac dstace: Ca, Algebrac dstace mmzato b lear least squares: 0 f e d c b a

Least squares for cocs Least squares sstem: Da = 0 Need costrat o a to prevet trval soluto Dscrmat: b 4ac Negatve: ellpse Zero: parabola Postve: hperbola Mmzg squared algebrac dstace subject to costrats leads to a geeralzed egevalue problem Ma varatos possble For more formato: A. Ftzgbbo, M. Plu, ad R. Fsher, Drect least-squares fttg of ellpses, EEE Trasactos o Patter Aalss ad Mache Itellgece, 5, 476--480, Ma 999

Least squares: Robustess to ose Least squares ft to the red pots:

Least squares: Robustess to ose Least squares ft wth a outler: Problem: squared error heavl pealzes outlers

Robust estmators Geeral approach: mmze r, θ resdual of th pot w.r.t. model parameters θ ρ robust fucto wth scale parameter σ r, ; The robust fucto ρ behaves lke squared dstace for small values of the resdual u but saturates for larger values of u

Choosg the scale: Just rght The effect of the outler s elmated

Choosg the scale: Too small The error value s almost the same for ever pot ad the ft s ver poor

Choosg the scale: Too large Behaves much the same as least squares

Robust estmato: Notes Robust fttg s a olear optmzato problem that must be solved teratvel Least squares soluto ca be used for talzato Adaptve choce of scale: magc umber tmes meda resdual

Optmzato has ma local mma

How ca we deal wth ma local mma?

Fttg a Le Least squares ft

RANSAC-Data drve starts! Select sample of m pots at radom

RANSAC Select sample of m pots at radom Calculate model parameters that ft the data the sample

RANSAC Select sample of m pots at radom Calculate model parameters that ft the data the sample Calculate error fucto for each data pot

RANSAC Select sample of m pots at radom Calculate model parameters that ft the data the sample Calculate error fucto for each data pot Select data that support curret hpothess

RANSAC Select sample of m pots at radom Calculate model parameters that ft the data the sample Calculate error fucto for each data pot Select data that support curret hpothess Repeat samplg

RANSAC Select sample of m pots at radom Calculate model parameters that ft the data the sample Calculate error fucto for each data pot Select data that support curret hpothess Repeat samplg

How Ma Samples? O average N I m umber of pot umber of lers sze of the sample Pgood = mea tme before the success Ek = / Pgood

How Ma Samples? Wth cofdece p

How Ma Samples? Wth cofdece p N I m umber of pot umber of lers sze of the sample Pgood = Pbad = Pgood Pbad k tmes = Pgood k

How Ma Samples? Wth cofdece p Pbad k tmes = Pgood k - p k log Pgood log p k log p / log Pgood

How Ma Samples I / N [%] Sze of the sample m

RANSAC k = log p I I- log - N N- k umber of samples draw N umber of data pots I tme to compute a sgle model p cofdece the soluto.95

RANSAC Robust fttg ca deal wth a few outlers what f we have ver ma? Radom sample cosesus RANSAC: Ver geeral framework for model fttg the presece of outlers Outle Choose a small subset uforml at radom Ft a model to that subset Fd all remag pots that are close to the model ad reject the rest as outlers Do ths ma tmes ad choose the best model M. A. Fschler, R. C. Bolles. Radom Sample Cosesus: A Paradgm for Model Fttg wth Applcatos to Image Aalss ad Automated Cartograph. Comm. of the ACM, Vol 4, pp 38-395, 98.

RANSAC for le fttg Repeat N tmes: Draw s pots uforml at radom Ft le to these s pots Fd lers to ths le amog the remag pots.e., pots whose dstace from the le s less tha t If there are d or more lers, accept the le ad reft usg all lers

Choosg the parameters Ital umber of pots s Tpcall mmum umber eeded to ft the model Dstace threshold t Choose t so probablt for ler s p e.g. 0.95 Zero-mea Gaussa ose wth std. dev. σ: t =3.84σ Number of samples N Choose N so that, wth probablt p, at least oe radom sample s free from outlers e.g. p=0.99 outler rato: e Source: M. Pollefes

Choosg the parameters Ital umber of pots s Tpcall mmum umber eeded to ft the model Dstace threshold t Choose t so probablt for ler s p e.g. 0.95 Zero-mea Gaussa ose wth std. dev. σ: t =3.84σ Number of samples N Choose N so that, wth probablt p, at least oe radom sample s free from outlers e.g. p=0.99 outler rato: e s N e p N p/ log e log s proporto of outlers e s 5% 0% 0% 5% 30% 40% 50% 3 5 6 7 7 3 3 4 7 9 9 35 4 3 5 9 3 7 34 7 5 4 6 7 6 57 46 6 4 7 6 4 37 97 93 7 4 8 0 33 54 63 588 8 5 9 6 44 78 7 77 Source: M. Pollefes

Choosg the parameters Ital umber of pots s Tpcall mmum umber eeded to ft the model Dstace threshold t Choose t so probablt for ler s p e.g. 0.95 Zero-mea Gaussa ose wth std. dev. σ: t =3.84σ Number of samples N Choose N so that, wth probablt p, at least oe radom sample s free from outlers e.g. p=0.99 outler rato: e s N e p N p/ log e log s Source: M. Pollefes

Choosg the parameters Ital umber of pots s Tpcall mmum umber eeded to ft the model Dstace threshold t Choose t so probablt for ler s p e.g. 0.95 Zero-mea Gaussa ose wth std. dev. σ: t =3.84σ Number of samples N Choose N so that, wth probablt p, at least oe radom sample s free from outlers e.g. p=0.99 outler rato: e Cosesus set sze d Should match epected ler rato Source: M. Pollefes

Adaptvel determg the umber of samples Iler rato e s ofte ukow a pror, so pck worst case, e.g. 50%, ad adapt f more lers are foud, e.g. 80% would eld e=0. Adaptve procedure: N=, sample_cout =0 Whle N >sample_cout Choose a sample ad cout the umber of lers Set e = umber of lers/total umber of pots Recompute N from e: N p/ log e log s Icremet the sample_cout b Source: M. Pollefes

RANSAC pros ad cos Pros Smple ad geeral Applcable to ma dfferet problems Ofte works well practce Cos Lots of parameters to tue Ca t alwas get a good talzato of the model based o the mmum umber of samples Sometmes too ma teratos are requred Ca fal for etremel low ler ratos We ca ofte do better tha brute-force samplg

Problem ; cost fucto Eamples of other cost fuctos Least Meda Squares;.e. take the sample that mmzed the meda of the resduals. MLESAC/MLESAC use the posteror or lkelhood of the data. MINPRAN Stewart, makes assumptos about radomess of data

LMS Repeat M tmes: Sample mmal umber of matches to estmate two vew relato. Calculate error of all data. Choose relato to mmze meda of errors.

Pros ad Cos LMS PRO CON Do ot eed a threshold for lers. Caot work for more tha 50% outlers. Problems f a lot of data belogs to a submafold e.g. domate plae the mage

Co: LMS, subspace problem Meda error s same for two solutos.

Co: LMS, subspace problem No good soluto f the umber of outlers >50%

Pros LMS Oe major advatage of LMS s that t ca eld a robust estmate of the varace of the errors. But care should be take to use the rght formula, as ths depeds o the dstrbuto of the errors, ad degrees of freedom the errors codmeso.

Robust Mamum Lkelhood Estmato Radom Samplg ca optmze a fucto: Better, robust cost fucto, MLESAC

Error fucto Red-mture, gree-uform, blue-gaussa.

MAPSAC/MLESAC Ths soluto

MLESAC/MLESAC Is better tha ths soluto

MLESAC Add pror to get to MAP soluto Iterestg thg s that wth MLESAC oe could sample less tha the mmal umber of pots to make a estmate usg pror as etra formato. A posteror ca be optmzed; radom samplg good for matchg AND FUNCTION OPTIMIZATION! e.g. MLESAC s a cheap wa to optmze objectve fuctos regardless of outlers or ot.

MLESAC Oce the beefts of MLESAC are see there s o reaso to cotue to use RANSAC; ma stuatos the mprovemet the soluto ca be marked Especall f wat to use pror formato e.g. the F matr chagg smoothl over tme. Gves a optmzed soluto AT NO EXTRA COST! P.H.S. Torr ad A. Zsserma. MLESAC: A New Robust Estmator wth Applcato to Estmatg Image Geometr. I Joural of Computer Vso ad Image Uderstadg, pages 38 56, 78, 000.