probabilistic model fitting

Probabilistic model fitting Marcel Lthi Graphics and Vision - PowerPoint PPT Presentation

> DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Probabilistic model fitting Marcel Lthi Graphics and Vision Research Group Department of Mathematics and Computer Science University of Basel University of Basel > DEPARTMENT OF


  1. > 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

  2. University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Reminder: Registration as analysis by synthesis Comparison: π‘ž 𝐽 π‘ˆ πœ„, 𝐽 𝑆 ) Prior πœ’[πœ„] ∼ π‘ž(πœ„) 𝐽 π‘ˆ 𝐽 𝑆 ∘ πœ’[πœ„] Parameters πœ„ Update using π‘ž(πœ„|𝐽 π‘ˆ , 𝐽 𝑆 ) Synthesis πœ’[πœ„]

  3. 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 𝑣 ∼ π‘ž(πœ„) .

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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 πœ„ πœ„

  9. 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 πœ„

  10. 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

  11. 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

  12. 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!

  13. 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

  14. University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE

  15. ΖΈ 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

  16. University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE 2D Gaussian: Different Proposals 𝜏 = 0.2 𝜏 = 1.0 16

  17. 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

  18. 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

  19. 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

  20. 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

  21. 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.

  22. University of Basel > DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE Fitting 3D Landmarks 3D Alignment with Shape and Pose 22

  23. 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

  24. 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