Lecture 18: Particle Filters
Wei Du
INFO0013 - Computer Vision
Du Particle Filters: Theory and Applications
Objective
from an Engineer’s Point of View
an overview of Particle Filters
applications on visual tracking
Du Particle Filters: Theory and Applications
Introduction
In general, Particle Filter is an extension to Kalman Filter.
it deals with the same problems that Kalman Filter does
but aims at different issues:
Non-Gaussianity
Non-Linearity
The advantages:
easy to implement
a general solution to a large range of problems
Du Particle Filters: Theory and Applications
History of Particle Filters
It was started by physicists and mathematicians in Project
Manhattan, but was forgotten soon.
Kalman filter was proposed in 1960.
It was remembered in 70s and developed in 80s.
It was first introduced into visual tracking by Michael Isard -
“Condensation”, the best paper of ECCV1996.
In 1996 - 2000, Oxford Heritage
Blossom in 2001 - 2002
Du Particle Filters: Theory and Applications
An Abstract View of Tracking
The entity being tracked is a state vector x that cannot be
observed directly.
We have a dynamic model P(xt |xt−1 ) of the state that
predicts how it evolves over time.
Periodically, we obtain an observation vector Y that is a
function of the state.
Using the observation P(yt |xt ), we correct our internal
estimate of the state.
Du Particle Filters: Theory and Applications
Problem Statement
An estimate of xt based on all the measurements y1:t
Z
x̂t = E[xt |y1:t ] = xt P(xt |y1:t ) d xt
xt
How to infer the posterior pdf
P(xt |y1:t )
Du Particle Filters: Theory and Applications
Inference Recursion
Independence assumptions:
Only the immediate past matters(Markov assumption):
P(xt |x1:t−1 ) = P(xt |xt−1 )
Measurements depend only on the current state:
P(yt |x1:t ) = P(yt |xt )
Recursion (Bayes’s law)
P(yt |xt ) P(xt |y1:t−1 )
P(xt |y1:t ) = P(yt ) ∝ P(yt |xt ) P(xt |y1:t−1 )
Z
∝ P(yt |xt ) P(xt |xt−1 ) P(xt−1 |y1:t−1 ) d xt−1
xt−1
Du Particle Filters: Theory and Applications
Inference Recursion
Z
P(xt |y1:t ) ∝ P(yt |xt ) P(xt |xt−1 ) P(xt−1 |y1:t−1 ) d xt−1
xt−1
Z
predict: P(xt |y1:t−1 ) = P(xt |xt−1 ) P(xt−1 |y1:t−1 ) d xt−1
xt−1
correct: P(xt |y1:t ) ∝ P(yt |xt ) P(xt |y1:t−1 )
Du Particle Filters: Theory and Applications
Kalman Filter
linear motion and Gaussian distribution
Z
predict: P(xt |y1:t−1 ) = P(xt |xt−1 ) P(xt−1 |y1:t−1 ) d xt−1
xt−1
correct: P(xt |y1:t ) ∝ P(yt |xt ) P(xt |y1:t−1 )
Du Particle Filters: Theory and Applications
Extended Kalman Filter
non-linear motion and Gaussian distribution
Z
predict: P(xt |y1:t−1 ) = P(xt |xt−1 ) P(xt−1 |y1:t−1 ) d xt−1
xt−1
correct: P(xt |y1:t ) ∝ P(yt |xt ) P(xt |y1:t−1 )
Du Particle Filters: Theory and Applications
Particle Filter
linear or non-linear motion and non-Gaussian distribution
Z
predict: P(xt |y1:t−1 ) = P(xt |xt−1 ) P(xt−1 |y1:t−1 ) d xt−1
xt−1
correct: P(xt |y1:t ) ∝ P(yt |xt ) P(xt |y1:t−1 )
Du Particle Filters: Theory and Applications
The representation of arbitrary distributions
Du Particle Filters: Theory and Applications
The representation of arbitrary distributions
mean+covariance for Gaussian distribution
fail to capture real-world densities.
Du Particle Filters: Theory and Applications
The representation of arbitrary distributions
mixture of Gaussian
other kernel based representations
Mixture models are appealing, but hard to propagate
analytically.
Du Particle Filters: Theory and Applications
The representation of arbitrary distributions
histogram
Du Particle Filters: Theory and Applications
The representation of arbitrary distributions
weighted samples/particles (sti , πti ), πti ∝ p(sti |y1:t )
Du Particle Filters: Theory and Applications
What is Particle Filter?
Particle filters propagate and maintain the posterior pdf of the
target states in time,
p(xt |y1:t )
represented by a set of weighted particles,
(sti , πti )
Condensation – CONditional DENSity propagATION (The first
paper of particle filters in computer vision)
Du Particle Filters: Theory and Applications
Monte Carlo Method
Based on random experiments or trials
Eg. Choose points randomly inside the square
The area under the curve f (x) is
Z b
number of blue points
= f (x) d x ≈ × area of the square
a total number of points
As the total number of random points increase, the
accuracy gets better
Du Particle Filters: Theory and Applications
Factored Sampling
p(xt |y1:t ) ∼ (sti , πti )
An estimate of xt based on all the measurements y1:t
Z X
x̂t = E[xt |y1:t ] = xt P(xt |y1:t ) d xt ≈ sti πti
xt i
Du Particle Filters: Theory and Applications
Overview of Particle Filter Tracking
Du Particle Filters: Theory and Applications
Objective
Du Particle Filters: Theory and Applications
Step 1: Sample
Du Particle Filters: Theory and Applications
Step 2: Predict
Du Particle Filters: Theory and Applications
Step 3: Weight
Du Particle Filters: Theory and Applications
Step 4: Normalize
Du Particle Filters: Theory and Applications
The algorithm
Initialize: Draw N particles s0i ∼ P(x0 ), π0i = 1/N
For t = 1 to end
i
Resample s̃t−1 i
∼ (st−1 i
, πt−1 i
) so that π̃t−1 = 1/N
Predict sti ∼ P(sti |s̃t−1
i i
) = N(f (st−1 ); Σt )
Weight πti ∼ P(yt |sti ) for each particle sti .
Estimate x̂t = sti πti
End For
Du Particle Filters: Theory and Applications
Color-based Particle Filter Tracking
Du Particle Filters: Theory and Applications
Importance Sampling
Draw particles from a proposal function q(sti |yt )
P(sti |yt )
Assign weights πti ∼ q(sti |yt )
to the particles sti
Du Particle Filters: Theory and Applications
Demo
Du Particle Filters: Theory and Applications
Is Particle Filter always better than Kalman Filter?
Particle Filter is an approximation, and the precision depends
on the number of particles sampled.
So it should be the last choice when you don’t have the
analytical representations.
Du Particle Filters: Theory and Applications
How many particles do you need to approximate the
posterior?
Impossible to have a rule to say how many are enough.
The number increases exponentially with the dimension of the
state space.
The more, the better. So sample as many as you can afford.
Du Particle Filters: Theory and Applications
Conclusions
Particle filters are cool.
40 lines in Matlab can do a basic particle filter.
To make your tracker work, 20000 extra lines are required.
Du Particle Filters: Theory and Applications
Particle Filter Recourses
Sequential Monte Carlo Methods Homepage:
http://www-sigproc.eng.cam.ac.uk/smc/index.html
Condensation Homepage
http://www.robots.ox.ac.uk/ misard/condensation.html
Jean-Bernard Hayet’s Homepage
http://www.montefiore.ulg.ac.be/ jbhayet/ltilib.php
Bible of Particle Filters
Sequential Monte Carlo Methods in Practice
Du Particle Filters: Theory and Applications