Computer vision: models, learning and inference

Slides:



Advertisements
Similar presentations
Bayes rule, priors and maximum a posteriori
Advertisements

Active Appearance Models
CSCE643: Computer Vision Bayesian Tracking & Particle Filtering Jinxiang Chai Some slides from Stephen Roth.
Pattern Recognition and Machine Learning
Computer vision: models, learning and inference Chapter 8 Regression.
Computer vision: models, learning and inference Chapter 18 Models for style and identity.
An Overview of Machine Learning
Lecture Pose Estimation – Gaussian Process Tae-Kyun Kim 1 EE4-62 MLCV.
Chapter 4: Linear Models for Classification
Computer vision: models, learning and inference
Foreground Modeling The Shape of Things that Came Nathan Jacobs Advisor: Robert Pless Computer Science Washington University in St. Louis.
Multiple People Detection and Tracking with Occlusion Presenter: Feifei Huo Supervisor: Dr. Emile A. Hendriks Dr. A. H. J. Stijn Oomes Information and.
Bayesian Robust Principal Component Analysis Presenter: Raghu Ranganathan ECE / CMR Tennessee Technological University January 21, 2011 Reading Group (Xinghao.
Tracking Objects with Dynamics Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 04/21/15 some slides from Amin Sadeghi, Lana Lazebnik,
Project 4 out today –help session today –photo session today Project 2 winners Announcements.
Computer Vision I Instructor: Prof. Ko Nishino. Today How do we recognize objects in images?
Computer vision: models, learning and inference Chapter 10 Graphical Models.
Computer vision: models, learning and inference
Computer vision: models, learning and inference Chapter 3 Common probability distributions.
Part I: Classification and Bayesian Learning
Computer vision: models, learning and inference Chapter 5 The Normal Distribution.
Crash Course on Machine Learning
Computer vision: models, learning and inference Chapter 6 Learning and Inference in Vision.
Binary Variables (1) Coin flipping: heads=1, tails=0 Bernoulli Distribution.
Computer vision: models, learning and inference
BraMBLe: The Bayesian Multiple-BLob Tracker By Michael Isard and John MacCormick Presented by Kristin Branson CSE 252C, Fall 2003.
TP15 - Tracking Computer Vision, FCUP, 2013 Miguel Coimbra Slides by Prof. Kristen Grauman.
SVCL Automatic detection of object based Region-of-Interest for image compression Sunhyoung Han.
Human-Computer Interaction Human-Computer Interaction Tracking Hanyang University Jong-Il Park.
Computer vision: models, learning and inference Chapter 19 Temporal models.
Computer vision: models, learning and inference Chapter 19 Temporal models.
Mixture Models, Monte Carlo, Bayesian Updating and Dynamic Models Mike West Computing Science and Statistics, Vol. 24, pp , 1993.
Probability Course web page: vision.cis.udel.edu/cv March 19, 2003  Lecture 15.
Expectation-Maximization (EM) Case Studies
Final Review Course web page: vision.cis.udel.edu/~cv May 21, 2003  Lecture 37.
Tracking with dynamics
Computer vision: models, learning and inference Chapter 2 Introduction to probability.
Fitting normal distribution: ML 1Computer vision: models, learning and inference. ©2011 Simon J.D. Prince.
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Bayesian Decision Theory Case Studies CS479/679 Pattern Recognition Dr. George Bebis.
PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 1: INTRODUCTION.
MCMC Output & Metropolis-Hastings Algorithm Part I
Computer vision: models, learning and inference
Logistic Regression Gary Cottrell 6/8/2018
Tracking Objects with Dynamics
CH 5: Multivariate Methods
Computer vision: models, learning and inference
Computer vision: models, learning and inference
Statistical Models for Automatic Speech Recognition
Computer vision: models, learning and inference
Probabilistic Robotics
Dynamical Statistical Shape Priors for Level Set Based Tracking
Chapter 3: Maximum-Likelihood and Bayesian Parameter Estimation (part 2)
Computer vision: models, learning and inference
Lecture 26: Faces and probabilities
Brief Review of Recognition + Context
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.
Matching Words with Pictures
Pattern Recognition and Machine Learning
Announcements Project 2 artifacts Project 3 due Thursday night
Announcements Project 4 out today Project 2 winners help session today
Parametric Methods Berlin Chen, 2005 References:
Announcements Artifact due Thursday
Multivariate Methods Berlin Chen
Machine learning overview
Multivariate Methods Berlin Chen, 2005 References:
Mathematical Foundations of BME Reza Shadmehr
Announcements Artifact due Thursday
Chapter 3: Maximum-Likelihood and Bayesian Parameter Estimation (part 2)
The “Margaret Thatcher Illusion”, by Peter Thompson
Presentation transcript:

Computer vision: models, learning and inference Chapter 6 Learning and inference in vision Please send errata to s.prince@cs.ucl.ac.uk

Structure Computer vision models Worked example 1: Regression Three types of model Worked example 1: Regression Worked example 2: Classification Which type should we choose? Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 2

Computer vision models Observe measured data, x Draw inferences from it about state of world, w Examples: Observe adjacent frames in video sequence Infer camera motion Observe image of face Infer identity Observe image of human body Infer pose Observe images of people in motion Infer action/activity Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Regression vs. Classification Observe measured data, x Draw inferences from it about world, w When the world state w is continuous we’ll call this regression When the world state w is discrete we call this classification Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Ambiguity of visual world Unfortunately visual measurements may be compatible with more than one world state w Measurement process is noisy Inherent ambiguity in visual data Conclusion: the best we can do is compute a probability distribution Pr(w|x) over possible states of world Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Refined goal of computer vision Take observations x Return probability distribution Pr(w|x) over possible worlds compatible with data (not always tractable – might have to settle for an approximation to this distribution, samples from it, or the best (MAP) solution for w) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Components of solution We need A model that mathematically relates the visual data x to the world state w. Model specifies family of relationships, particular relationship depends on parameters q A learning algorithm: fits parameters q from paired training examples xi,wi An inference algorithm: uses model to return Pr(w|x) given new observed data x. Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Types of Model The model mathematically relates the visual data x to the world state w. Every model falls into one of three categories Model contingency of the world on the data Pr(w|x) Model joint occurrence of world and data Pr(x,w) Model contingency of data on world Pr(x|w) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Generative vs. Discriminative Model contingency of the world on the data Pr(w|x) (DISCRIMINATIVE MODEL) 2. Model joint occurrence of world and data Pr(x,w) 3. Model contingency of data on world Pr(x|w) (GENERATIVE MODELS) Generative as probability model over data and so when we draw samples from model, we GENERATE new data Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 1: Model Pr(w|x) - Discriminative How to model Pr(w|x)? Choose an appropriate form for Pr(w) Make parameters a function of x Function takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: just evaluate Pr(w|x) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 2: Model Pr(x,w) - Generative How to model Pr(x,w)? Concatenate x and w to make z= [xT wT]T Model the pdf of z Pdf takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: compute Pr(w|x) using Bayes rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 3: Pr(x|w) - Generative How to model Pr(x|w)? Choose an appropriate form for Pr(x) Make parameters a function of w Function takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: Define prior Pr(w) and then compute Pr(w|x) using Bayes’ rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Summary Three different types of model depend on the quantity of interest: Pr(w|x) Discriminative Pr(w,y) Generative Pr(w|y) Generative Inference in discriminative models easy as we directly model posterior Pr(w|x). Generative models require more complex inference process using Bayes’ rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Computer vision models Worked example 1: Regression Three types of model Worked example 1: Regression Worked example 2: Classification Which type should we choose? Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 14

Regression application 1: Pose from Silhouette Extract the silhouette from an image A 100-dimensional vector x describes the silhouette Estimate vector w describing the locations and the angles of the major joints of the body Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Regression application 2: Changing face pose Learn a model p(x,w) by paired examples of frontal (x) and quarter-left faces (w) Predict the quarter-left face p(w/x) given a new frontal image x. Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Regression application 3: Head pose estimation Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Worked example 1: Regression Consider simple case where we make a univariate continuous measurement x use this to predict a univariate continuous state w (regression as world state is continuous) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 1: Model Pr(w|x) - Discriminative How to model Pr(w|x)? Choose an appropriate form for Pr(w) Make parameters a function of x Function takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: just evaluate Pr(w|x) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 1: Model Pr(w|x) - Discriminative How to model Pr(w|x)? Choose an appropriate form for Pr(w) Make parameters a function of x Function takes parameters q that define its shape Choose normal distribution over w Make mean m linear function of x (variance constant) Parameter are f0, f1, s2. This model is called linear regression. Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Parameters are y-offset, slope and variance Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Learning algorithm: learn q from training data x,y. E.g. MAP Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Inference algorithm: just evaluate Pr(w|x) for new data x Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 2: Model Pr(x,y) - Generative How to model Pr(x,w)? Concatenate x and w to make z= [xT wT]T Model the pdf of z Pdf takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: compute Pr(w|x) using Bayes rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 2: Model Pr(x,y) - Generative How to model Pr(x,w)? Concatenate x and w to make z= [xT wT]T Model the pdf of z Pdf takes parameters q that define its shape Concatenate x and w to make z= [xT wT]T Model the pdf of z as normal distribution. Pdf takes parameters m and S that define its shape Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Learning algorithm: learn parameters q from training data x,w Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Inference algorithm: compute Pr(w|x) using Bayes rule (normalize each column in figure) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 3: Pr(x|w) - Generative How to model Pr(x|w)? Choose an appropriate form for Pr(x|w) Make parameters a function of w Function takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: Define prior Pr(w) and then compute Pr(w|x) using Bayes’ rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 3: Pr(x|w) - Generative How to model Pr(x|w)? Choose an appropriate form for Pr(x) Make parameters a function of w Function takes parameters q that define its shape Choose normal distribution over x Make mean m linear function of w (variance constant) Parameter are f0, f1, s2. Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Learning algorithm: learn q from training data x,w. e.g. MAP Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Pr(x|w) x Pr(w) = Pr(x,w) Can get back to joint probability Pr(x,y) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Inference algorithm: compute Pr(w|x) using Bayes rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Computer vision models Worked example 1: Regression Three types of model Worked example 1: Regression Worked example 2: Classification Which type should we choose? Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 33

Classification Example 1: Face Detection Learn face representations by a probabilistic model Examine a small window at different scaless to decide if it contains a face (w=1) or not (w=0) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Classification Example 2: Pedestrian Detection Learn pedestrian representations by a probabilistic model Examine a small window at different scaless to decide if it contains a pedestrian (w=1) or not (w=0) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Classification Example 3: Face Recognition Learn a person’s facial representation Classify a new face to a person Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Classification Example 4: Semantic Segmentation Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Worked example 2: Classification Consider simple case where we make a univariate continuous measurement x use this to predict a discrete binary world w (classification as world state is discrete) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 1: Model Pr(w|x) - Discriminative How to model Pr(w|x)? Choose an appropriate form for Pr(w) Make parameters a function of x Function takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: just evaluate Pr(w|x) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 1: Model Pr(w|x) - Discriminative How to model Pr(w|x)? Choose an appropriate form for Pr(w) Make parameters a function of x Function takes parameters q that define its shape Choose Bernoulli dist. for Pr(w) Make parameters a function of x The sigmoid ensures that the Bernoulli parameter is between 0 and 1 Function takes parameters f0 and f1 It is confusingly called logistic regression although it is a classification model Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Learning θ using standard methods (ML,MAP, Bayesian) Two parameters Learning θ using standard methods (ML,MAP, Bayesian) Inference: Just evaluate Pr(w|x) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 2: Model Pr(x,y) - Generative How to model Pr(x,w)? Concatenate x and w to make z= [xT wT]T Model the pdf of z Pdf takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: compute Pr(w|x) using Bayes rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 2 Model Can’t build this model very easily: Concatenate continuous vector x and discrete w to make z No obvious probability distribution to model joint probability of discrete and continuous Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 3: Pr(x|w) - Generative How to model Pr(x|w)? Choose an appropriate form for Pr(x) Make parameters a function of w Function takes parameters q that define its shape Learning algorithm: learn parameters q from training data x,w Inference algorithm: Define prior Pr(w) and then compute Pr(w|x) using Bayes’ rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Type 3: Pr(x|w) - Generative How to model Pr(x|w)? Choose an appropriate form for Pr(x) Make parameters a function of w Function takes parameters q that define its shape Choose a Gaussian distribution for Pr(x) Make parameters a function of discrete binary w 3. Function takes parameters m0, m1, s20, s21 that define its shape Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Learn parameters m0, m0, s20, s21 that define its shape Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Inference algorithm: Define prior Pr(w) and then compute Pr(w|x) using Bayes’ rule Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Computer vision models Worked example 1: Regression Three types of model Worked example 1: Regression Worked example 2: Classification Which type should we choose? Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 48

Which type of model to use? In generative methods, many complex aspects of data may have no influence on the posterior In the example here the prior is uniform Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Which type of model to use? Inference simple in discriminative models In reality, data is generated from world – a generative model matches this aspect If missing data in training or testing, then generative models are preferred They model the joint distribution over all data dimensions and can interpolate missing data Generative models allow imposition of prior knowledge specified by user Harder to impose priors on discriminative models Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Computer vision models Worked example 1: Regression Three types of model Worked example 1: Regression Worked example 2: Classification Which type should we choose? Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 51

Application: Skin Detection Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 52

Application: Skin Detection Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 53

Application: Background subtraction Model the background (w=0) at the n-th pixel and use a number of empty scenes to learn the model parameters Model the foreground (w=1) at the n-th pixel as uniform because it is rare to have have objects changing appearance Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 54

Application: Background subtraction Shadows are often misclassified as foreground Solution: classify using only the hue Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 55

Application: Background subtraction Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 56

Application: Background subtraction The foliage is blowing in the wind. A normal distribution is not good enough! Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 57

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

Conclusion To do computer vision we build a model relating the image data x to the world state that we wish to estimate w Three types of model Model Pr(w|x) -- discriminative Model Pr(w,x) -- generative Model Pr(w|x) – generative Computer vision: models, learning and inference. ©2011 Simon J.D. Prince