25
Particle filters (continued…)

Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Particle filters (continued…)

Page 2: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Recall

• Particle filters – Track state sequence xi given the measurements (y0,

y1, …., yi)

– Non-linear dynamics

– Non-linear measurements

iilinearnoni xfx )(1

iilinearnoni xgy )(

Non-Gaussian

Non-Gaussian

Page 3: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Recall

• Maintain a representation of • Two stages

– Prediction

– Correction (Bayesian)

),,( 0 ii yyxP

),,( 101 ii yyxP ),,( 10 ii yyxP

),,( 0 ii yyxP ),,( 10 ii yyxP

Dynamic model (Markov)

Likelihood

Prior Posterior)( ii xyP

)( 1ii xxP

Page 4: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

3 Useful tools

• Importance sampling

– Tool 1: Representing a distribution– Tool 2: Marginalizing– Tool 3: Transforming prior to posterior

Page 5: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Tool 1: Representing a distribution

• Have a set of samples ui with weights wi

• (ui, wi ): Sampled representation of f(u)

• Expectation under f(u)

• Samples used only as a means to evaluate expectations (Not true samples!)

iu iw)(us)(

)(

us

uf~

N

i

i

N

i

ii

w

wugduufug

1

1

)()()(

Page 6: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Tool 2: Marginalization

• Marginalization

• Sampled representation

• Just retain the required components and ignore the rest!

dNNMfMf ),()(

),(~)}),,{(( 1 nmfwnm Ni

iii )(~)},{( 1 mfwm N

iii

Drop ni

Page 7: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Tool 3: From Prior to Posterior)(~)},{( 1 ufwu N

iii

)(~)}~,{( 1 uzwu Ni

ii

)(

)(

)(

)(

)(

)(

)(

)(~i

ii

i

i

i

i

i

ii

uf

uzw

uf

uz

us

uf

us

uzw

Prior

Posteriorww ii ~

)(

)( 0

i

ii

uP

vvuPw

)( 0ii uvvPw

• Modify the weights to transform from one distribution to another

• Similarly for going from prior to posterior

?

To

From

To

From

Scale factor is the same for all the samples

Page 8: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Simple Particle filter

• Prediction

• 2 steps– Sampling from joint distribution

– Marginalization

),,()(),,,( 1011101 iiiiiii yyxPxxPyyxxP

),,( 101 ii yyxP ),,( 10 ii yyxP Dynamic model (Markov)

)( 1ii xxP

)},{( 11ki

ki wu )}1,)({( 1

li

kiuf )}),,)({(( 111

ki

ki

li

ki wuuf

),,,( 101 iii yyxxP ),,( 10 ii yyxP

)}),,)({(( 111ki

ki

li

ki wuuf )},)({( 11

ki

li

ki wuf Drop

kiu 1

(Notation: Chapter 2)

Page 9: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Simple Particle filter

• Correction

• Modify weights

)},)({( 11ki

li

ki wuf

),,( 0 ii yyxP ),,( 10 ii yyxP Likelihood

Prior Posterior)( ii xyP

)})(,{( ,,, ki

kiii

ki wsxyPs

)},{( ,, ki

ki ws

)},{( ,, ki

ki ws

Let

Likelihood

)( , kiii sxyP

Page 10: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Improved Particle filter

• Simple Particle filter– Many samples have small weights– Number of samples increases at every step– Lots of samples wasted

• Resample (Sampling-Importance -Resampling)– Prior:– Predictions:

• Resampling also takes care of increasing number of samples

),,( 101 ii yyxP ),,( 10 ii yyxP

Page 11: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Tracking interacting targets*

• Using partilce filters to track multiple interacting targets (ants)*Khan et al., “MCMC-Based Particle Filtering for Tracking a Variable Number of Interacting Targets”, PAMI, 2005.

Page 12: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Independent Particle filters

• Targets lose identity

• Identical appearance– Multiple peaks in the likelihood– Best peak “hijacks” all the nearby targets

Page 13: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Alternate view of Particle filters

• Notation*

11

11 )()()()( tt

ttttt

t

t dXZXPXXPXZcPZXP

*Khan et al., “MCMC-Based Particle Filtering for Tracking a Variable Number of Interacting Targets”, PAMI, 2005.

tX State at time t

tZ Measurement at time t

tZ All measurements upto time t

Posterior Prior

Marginalization

Likelihood

Page 14: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Alternate view of Particle filters

• Sampled representation of prior

• Monte-Carlo approximation

)|(~},{ 11111

tt

Nr

rt

rt ZXPX

1111 )()()()( tttttttt

t dXZXPXXPXZcPZXP

r

rtt

rttt

t

t XXPXZcPZXP )()()( 11

Page 15: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Alternate view of Particle filters

• Sequential Importance Resampling (SIR)

• Particles at time t

• Weights (easy to verify!)

• Prediction and correction in one step

r

rtt

rttt

t

t XXPXZcPZXP )()()( 11

r

rtt

rtt

st XXPXqX )|()(~ 11

Particles sampled from a mixture distribution formed by previous particle set

)|( stt

st XZP

Page 16: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Independent vs. Joint filters

• Multiple targets– Joint state space: Union of individual state spaces

• Independent targets– Predictions are made independently from respective

spaces

• Interacting targets– Predictions are from the joint state space– High dimensionality: MCMC better than Importance

sampling?

),,,( 21 ntttt XXXX

n

itiittt XXPXXP

1)1(1 )|()|(

Page 17: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Interacting targets

• Targets influence the dynamics of others• Particles cannot be propagated independently

• Model interactions between targets using Markov Random Fields (MRF)

n

itiittt XXPXXP

1)1(1 )|()|(

n

i Ejijtittiittt XXXXPXXP

1 ,)1(1 ),()|()|(

Individual dynamics

Pair wise interactions

Page 18: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

MRF

• Interaction potential

• g(Xit , Xjt) penalizes overlap between targets

• Takes care of “hijacking”

)),(exp(),( jtitjtit XXgXX

Edges are formed only when templates overlap

Overlap is penalized by the interaction potential

Page 19: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Joint MRF Particle filter

• Sequential Importance Resampling

• Particles at time t

• Weights

• Interactions affect only the weights

r

n

i

rtiit

rt

Ejijtittt

t

t XXPXXXZcPZXP1

)1(1,

)(),()()(

r

n

i

rtiit

rtt

st XXPXqX

1)1(1 )|()(~

Eji

sjt

sit

stt

st XXXZP

,

),()|(

Equivalent to independent particle filters

Page 20: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Target overlap

• Targets overlap on each other and then segregate

• Overlapped target state “hijacked”• Probably hard to model this?

Page 21: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Why MCMC?

• Joint MRF Particle filter– Importance sampling in high dimensional

spaces– Weights of most particles go to zero– MCMC is used to sample particles directly

from the posterior distribution )|( tt ZXP

Page 22: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

MCMC Joint MRF Particle filter

• True samples (no weights) at each step

• Stationary distribution for MCMC

• Proposal density for Metropolis Hastings (MH)– Select a target randomly– Sample from the single target state proposal density

r

n

i

rtiit

Ejijtittt

t

t XXPXXXZcPZXP1

)1(,

)(),()()(

)|(~}{ 1111

tt

Nr

rt ZXPX

Page 23: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

MCMC Joint MRF Particle filter

• MCMC-MH iterations are run every time step to obtain particles

• “One target at a time” proposal has advantages:– Acceptance probability is simplified– One likelihood evaluation for every MH iteration– Computationally efficient

• Requires fewer samples compared to SIR

Page 24: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Variable number of targets

• Target identifiers kt is a state variable

• Each kt determines a corresponding state space

• State space is the union of state spaces indexed by kt

• Particle filtering

• RJMCMC to jump across state spaces

)|,( 11 1

tkt ZXkP

t)|,( t

kt ZXkPt

tkX

Prediction + Correction

Page 25: Particle filters (continued…). Recall Particle filters –Track state sequence x i given the measurements ( y 0, y 1, …., y i ) –Non-linear dynamics –Non-linear

Thank you!