> DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Probabilistic model fitting Marcel LΓΌthi Graphics and Vision Research Group Department of Mathematics and Computer Science University of Basel
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Reminder: Registration as analysis by synthesis Comparison: π π½ π π, π½ π ) Prior π[π] βΌ π(π) π½ π π½ π β π[π] Parameters π Update using π(π|π½ π , π½ π ) Synthesis π[π]
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Reminder: Priors Gaussian process π£ βΌ π»π π, π Represented using first π components π π£ = π + ΰ· π½ π π π π π , π½ π βΌ π(0, 1) π=1 Different GP-s lead to very different deformation models β’ All of them are parametric π£ βΌ π(π) .
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Reminder: Likelihood functions Likelihood function: π π½ π π, π½ π ) Surface / surface Image / image Comparison Landmarks / Surface / image landmark Deviation of image (Distance to) exact Stochastic component Noise on landmark Intensity profiles at intensity from position of surface points surface boundary reference image
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Reminder: Obtaining the posterior parameters MAP-Estimate π β = arg max π π π½ π , π½ π = arg max π π π(π½ π |π, π½ π ) π π MAP Solution π β = arg max π π π(π½ π |π, π½ π ) π π(π|π½ π , π½ π ) π - Solving an optimization problem
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Todays Lecture: Obtaining the posterior distribution Full posterior distribution π π π½ π , π½ π = π π π π½ π π, π½ π π(π½ π ) Infeasible to compute: π(π|π½ π , π½ π ) p (π½ π ) = β« π π π π½ π π ππ π π π π½ π π, π½ π π(π½ π ) π - Doing (approximate) Bayesian inference
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Outline β’ Basic idea: Sampling methods and MCMC β’ The Metropolis-Hastings algorithm β’ The Metropolis algorithm β’ Implementing the Metropolis algorithm β’ The Metropolis-Hastings algorithm β’ Example: 3D Landmark fitting
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Approximate Bayesian Inference Samplin Sa ing methods Varia iati tional l meth thods β’ Numeric approximations through β’ Function approximation π(π) simulation arg max KL(π(π)|π(π|πΈ)) π KL: Kullback- π π Leibler divergence π π
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Sampling Methods β’ Simulate a distribution π through random samples π¦ π β’ Evaluate expectation (of some function π of random variable π ) πΉ π(π) = ΰΆ± π π¦ π π¦ ππ¦ π π = 1 πΉ π(π) β α π π ΰ· π π¦ π , π¦ π ~ π π¦ π 1 π α π(π) ~ π This is s dif diffic icult! π β’ βIndependentβ of dimensionality of π β’ More samples increase accuracy π
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Sampling from a Distribution β’ Easy for standard distributions β¦ is it? Random.nextDouble() Random.nextGaussian() β’ Uniform β’ Gaussian β’ How to sample from more complex distributions? β’ Beta, Exponential, Chi square, Gamma, β¦ β’ Posteriors are very often not in a βniceβ standard text book form β’ We need to sample from an unknown posterior with only unnormalized, expensive point- wise evaluation ο 10
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Markov Chain Monte Carlo Markov Chain Monte Carlo Methods (MCMC) Idea: Design a Markov Chain such that samples π¦ obey the target distribution π Concept: βUse an already existing sample to produce the next oneβ β’ Many successful practical applications β’ Proven: developed in the 1950/1970ies (Metropolis/Hastings) β’ Direct mapping of computing power to approximation accuracy 11
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE MCMC: An ingenious mathematical construction β¦ an aperiodic and irreducable induces If Markov Markov chain MCMC Algorithms Chain is a- periodic and irreducable converges to it β¦ Generate samples from Equilibrium is Distribution π(π¦) distribution No need to understand this now: more details follow!
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE The Metropolis Algorithm Requirements: β’ Proposal distribution π (π β² |π) β must generate samples, symmetric β’ Target distribution π π β with point-wise evaluation Result: β’ Stream of samples approximately from π π β’ Initialize with sample π β’ Generate next sample, with current sample π Draw a sample π β² from π (π β² |π) (βproposalβ) 1. π π β² accept π β² as new state π With probability π½ = min π π , 1 2. 3. Emit current state π as sample 13
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE
ΖΈ University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Example: 2D Gaussian Ξ£ π β 1 2 πβπ π Ξ£ β1 (πβπ) 1 β’ Target: π π = 2π π π β² π = πͺ(π β² | π, π 2 π½ 2 ) β’ Proposal: Random walk Target Sampled Estimate π = 1.5 π = 1.56 1.5 1.68 Ξ£ = 1.09 0.63 Ξ£ = 1.25 0.75 ΰ· 0.75 1.25 0.63 1.07 15
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE 2D Gaussian: Different Proposals π = 0.2 π = 1.0 16
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE The Metropolis-Hastings Algorithm β’ Initialize with sample π β’ Generate next sample, with current sample π Draw a sample π β² from π (π β² |π) (βproposalβ) 1. π π¦ β² π π¦|π¦ β² π π¦ β² |π¦ , 1 accept π β² as new state π With probability π½ = min 2. π π¦ Emit current state π as sample 3. β’ Generalization of Metropolis algorithm to asymmetric Proposal distribution π π β² π β π π π β² π π β² π > 0 β π π π β² > 0 17
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Properties β’ Approximation: Samples π¦ 1 , π¦ 2 , β¦ approximate π(π¦) Unbiased but correlated (not i.i.d. ) β’ No Normalization: π(π¦) does not need to be normalized Algorithm only considers ratios π(π¦β²)/π(π¦) ls: π π¦ β² π¦ depends on current sample π¦ β’ De Dependent Proposals Algorithm adapts to target with simple 1-step memory
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Metropolis - Hastings: Limitations β’ Highly correlated targets β’ Serial correlation β’ Results from rejection Proposal should match target to avoid too many rejections and too small stepping β’ Subsampling Bishop. PRML, Springer, 2006 19
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Propose-and-Verify Algorithm β’ Metropolis algorithm formalizes: propose-and-verify β’ Steps are completely independent. Propose Draw a sample π¦ β² from π (π¦ β² |π¦) Veri rify fy π π¦ β² π π¦|π¦ β² accept π β² as new sample With probability π½ = min π π¦ β² |π¦ , 1 π π¦ 20
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE MH as Propose and Verify β’ Decouples the steps of finding the solution from validating a solution β’ Natural to integrate uncertain proposals Q (e.g. automatically detected landmarks, ...) β’ Possibility to include βlocal optimizationβ (e.g. a ICP or ASM updates, gradient step, β¦) as proposal Anything more βinformedβ than random walk should improve convergence.
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Fitting 3D Landmarks 3D Alignment with Shape and Pose 22
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE 3D Fitting Example right.eye.corner_outer left.eye.corner_outer right.lips.corner left.lips.corner 23
University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE 3D Fitting Setup Goa oal: Find posterior distribution for arbitrary pose and shape Shape transformation Observations π β’ Observed positions π π 1 , β¦ , π π π π π‘ π½ = π π¦ + ΰ· π½ π π π πΈ π (π¦) π β’ Correspondence: π π 1 , β¦ , π π π=1 Parameters Rigid transformation β’ 3 angles (pitch, yaw, roll) π, π, π π = π½, π, π, π, π’ β’ Translation π’ = (π’ π¦ , π’ π§ , π’ π¨ ) Posterior distribution: π β π π π 1 , β¦ , π π 1 , β¦ , π π π |π π(π) π π π π π π π, π, π, π’ = π π π π π π π + π’ Full transformation π π (π¦) = (π π β π π )[π](π¦) 24
Recommend
More recommend