MoAvaAon For conAnuous spaces: oEen no analyAcal formulas for Bayes - - PowerPoint PPT Presentation

moavaaon for conanuous spaces oeen no analyacal formulas
SMART_READER_LITE
LIVE PREVIEW

MoAvaAon For conAnuous spaces: oEen no analyAcal formulas for Bayes - - PowerPoint PPT Presentation

Par$cle Filters Pieter Abbeel UC Berkeley EECS Many slides adapted from Thrun, Burgard and Fox, ProbabilisAc RoboAcs MoAvaAon For conAnuous spaces: oEen no analyAcal formulas for Bayes filter updates SoluAon 1: Histogram Filters: (not


slide-1
SLIDE 1

Par$cle Filters

Pieter Abbeel UC Berkeley EECS

Many slides adapted from Thrun, Burgard and Fox, ProbabilisAc RoboAcs

slide-2
SLIDE 2

§ For conAnuous spaces: oEen no analyAcal formulas for Bayes filter updates § SoluAon 1: Histogram Filters: (not studied in this course) § ParAAon the state space § Keep track of probability for each parAAon § Challenges: § What is the dynamics for the parAAoned model? § What is the measurement model? § OEen very fine resoluAon required to get reasonable results § SoluAon 2: ParAcle Filters: § Represent belief by random samples § Can use actual dynamics and measurement models § Naturally allocates computaAonal resources where required (~ adapAve resoluAon) § Aka Monte Carlo filter, Survival of the fiUest, CondensaAon, Bootstrap filter

MoAvaAon

slide-3
SLIDE 3

Sample-based LocalizaAon (sonar)

slide-4
SLIDE 4

n Given a sample-based representaAon

  • f Bel(xt) = P(xt | z1, …, zt, u1, …, ut)

Find a sample-based representaAon

  • f Bel(xt+1) = P(xt+1 | z1, …, zt, zt+1 , u1, …, ut+1)

Problem to be Solved

St = {xt

1, xt 2,..., xt N}

St+1 = {xt+1

1 , xt+1 2 ,..., xt+1 N }

slide-5
SLIDE 5

n Given a sample-based representaAon

  • f Bel(xt) = P(xt | z1, …, zt, u1, …, ut)

Find a sample-based representaAon

  • f P(xt+1 | z1, …, zt, u1, …, ut+1)

n SoluAon:

n

For i=1, 2, …, N

n

Sample xi

t+1 from P(Xt+1 | Xt = xi t, ut+1)

Dynamics Update

St = {xt

1, xt 2,..., xt N}

slide-6
SLIDE 6

n Given a sample-based representaAon of

P(xt+1 | z1, …, zt) Find a sample-based representaAon of P(xt+1 | z1, …, zt, zt+1) = C * P(xt+1 | z1, …, zt) * P(zt+1 | xt+1)

n SoluAon:

n

For i=1, 2, …, N

n

w(i)

t+1 = w(i) t* P(zt+1 | Xt+1 = x(i) t+1)

n

the distribuAon is represented by the weighted set of samples

ObservaAon Update

{xt+1

1 , xt+1 2 ,..., xt+1 N }

{< xt+1

1 ,wt+1 1 >,< xt+1 2 ,wt+1 2 >,...,< xt+1 N ,wt+1 N >}

slide-7
SLIDE 7

n

Sample x1

1, x2 1, …, xN 1 from P(X1)

n

Set wi

1= 1 for all i=1,…,N

n

For t=1, 2, …

n

Dynamics update:

n For i=1, 2, …, N

n Sample xi

t+1 from P(Xt+1 | Xt = xi t , ut+1)

n

ObservaAon update:

n For i=1, 2, …, N

n wi

t+1 = wi t* P(zt+1 | Xt+1 = xi t+1)

n

At any Ame t, the distribuAon is represented by the weighted set of samples { <xi

t, wi t> ; i=1,…,N}

SequenAal Importance Sampling (SIS) ParAcle Filter

slide-8
SLIDE 8

n The resulAng samples are only weighted by the evidence n The samples themselves are never affected by the evidence

à Fails to concentrate parAcles/computaAon in the high probability areas of the distribuAon P(xt | z1, …, zt)

SIS parAcle filter major issue

slide-9
SLIDE 9

n At any Ame t, the distribuAon is represented by the weighted

set of samples { <xi

t, wi t> ; i=1,…,N}

à Sample N Ames from the set of parAcles à The probability of drawing each parAcle is given by its

importance weight à More parAcles/computaAon focused on the parts of the state space with high probability mass

SequenAal Importance Resampling (SIR)

slide-10
SLIDE 10
  • 1. Algorithm particle_filter( St-1, ut , zt):

2.

  • 3. For Generate new samples

4. Sample index j(i) from the discrete distribution given by wt-1 5. Sample from using and 6. Compute importance weight 7. Update normalization factor 8. Insert

  • 9. For
  • 10. Normalize weights
  • 11. Return St

, = ∅ = η

t

S

n i … 1 = } , { > < ∪ =

i t i t t t

w x S S

i t

w + =η η

i t

x p(xt | xt−1,ut)

) ( 1 i j t

x − ) | (

i t t i t

x z p w = n i … 1 = η /

i t i t

w w = ut

SequenAal Importance Resampling (SIR) ParAcle Filter

slide-11
SLIDE 11

ParAcle Filters

slide-12
SLIDE 12

Sensor InformaAon: Importance Sampling

slide-13
SLIDE 13

Robot MoAon

slide-14
SLIDE 14

Sensor InformaAon: Importance Sampling

slide-15
SLIDE 15

Robot MoAon

slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34

Noise Dominated by MoAon Model

[Grisetti, Stachniss, Burgard, T-RO2006]

à Most particles get (near) zero weights and are lost.

slide-35
SLIDE 35

n TheoreAcal jusAficaAon: for any funcAon f we have: n f could be: whether a grid cell is occupied or not, whether the

posiAon of a robot is within 5cm of some (x,y), etc.

Importance Sampling

slide-36
SLIDE 36

n Task: sample from density p(.) n SoluAon:

n sample from “proposal density” π(.) n Weight each sample x(i) by p(x(i)) / π(x(i))

n E.g.: n Requirement: if π(x) = 0 then p(x) = 0.

Importance Sampling

p π

slide-37
SLIDE 37

ParAcle Filters Revisited

  • 1. Algorithm particle_filter( St-1, ut , zt):

2.

  • 3. For Generate new samples

4. Sample index j(i) from the discrete distribution given by wt-1 5. Sample from 6. Compute importance weight 7. Update normalization factor 8. Insert

  • 9. For

10. Normalize weights

  • 11. Return St

, = ∅ = η

t

S

n i … 1 = } , { > < ∪ =

i t i t t t

w x S S

i t

w + =η η

i t

x π(xt | x j(i)

t−1,ut, zt)

wt

i = p(zt | xt i)p(xt i | xt−1 i ,ut )

π(xt

i | xt−1 i ,ut , zt )

n i … 1 = η /

i t i t

w w =

slide-38
SLIDE 38

n OpAmal

= à

n Applying Bayes rule to the denominator gives: n SubsAtuAon and simplificaAon gives

OpAmal SequenAal Proposal π(.)

π(xt | xi

t−1,ut, zt)

p(xt | xi

t−1,ut, zt)

p(xi

t|xi t−1, ut, zt) = p(zt|xi t, ut, xi t−1)p(xi t|xi t−1, ut)

p(zt|xi

t−1, ut)

wi

t = p(zt|xi t)p(xi t|xi t−1, ut)

π(xi

t|xi t−1, ut, zt)

= p(zt|xi

t)p(xi t|xi t−1, ut)

p(xi

t|xi t−1, ut, zt)

slide-39
SLIDE 39

n OpAmal

= à

n Challenges:

n Typically difficult to sample from n Importance weight: typically expensive to compute integral

π(xt | xi

t−1,ut, zt)

p(xt | xi

t−1,ut, zt)

p(xt | xi

t−1,ut, zt)

OpAmal SequenAal Proposal π(.)

slide-40
SLIDE 40

n Nonlinear Gaussian State Space Model: n Then:

with

n And:

Example 1: π(.) = OpAmal Proposal Nonlinear Gaussian State Space Model

slide-41
SLIDE 41

Example 2: π(.) = MoAon Model

à the “standard” parAcle filter

slide-42
SLIDE 42

Example 3: ApproximaAng OpAmal π for LocalizaAon

[Grisetti, Stachniss, Burgard, T-RO2006]

n One (not so desirable solution): use smoothed likelihood such

that more particles retain a meaningful weight --- BUT information is lost

n Better: integrate latest observation z into proposal π

slide-43
SLIDE 43

1.

IniAal guess

2.

Execute scan matching starAng from the iniAal guess , resulAng in pose esAmate .

3.

Sample K points in region around .

4.

Proposal distribuAon is Gaussian with mean and covariance:

  • 5. Sample from (approximately opAmal) sequenAal proposal distribuAon.
  • 6. Weight =

Example 3: ApproximaAng OpAmal π for LocalizaAon: GeneraAng One Weighted Sample

Z

x0 p(zt|x0, m)p(x0|xi t1, ut)dx0 ≈ ηi

Build Gaussian Approximation to Optimal Sequential Proposal

slide-44
SLIDE 44

Example 3: Example ParAcle DistribuAons

[Grisetti, Stachniss, Burgard, T-RO2006]

Particles generated from the approximately optimal proposal

  • distribution. If using the standard motion model, in all three

cases the particle set would have been similar to (c).

slide-45
SLIDE 45

n

Consider running a parAcle filter for a system with determinisAc dynamics and no sensors

n

Problem:

n While no informaAon is obtained that favors one parAcle over another, due to

resampling some parAcles will disappear and aEer running sufficiently long with very high probability all parAcles will have become idenAcal.

n On the surface it might look like the parAcle filter has uniquely determined the

state.

n

Resampling induces loss of diversity. The variance of the parAcles decreases, the variance of the parAcle set as an esAmator of the true belief increases.

Resampling

slide-46
SLIDE 46

n EffecAve sample size: n Example:

n All weights = 1/N à EffecAve sample size = N n All weights = 0, except for one weight = 1 à EffecAve sample size = 1

n Idea: resample only when effecAve sampling size is low

Resampling SoluAon I

Normalized weights

slide-47
SLIDE 47

Resampling SoluAon I (ctd)

slide-48
SLIDE 48

n

M = number of parAcles

n r in [0, 1/M]

n

Advantages:

n More systemaAc coverage of space of samples n If all samples have same importance weight, no samples are lost n Lower computaAonal complexity

Resampling SoluAon II: Low Variance Sampling

slide-49
SLIDE 49

n Loss of diversity caused by resampling from a discrete

distribuAon

n SoluAon: “regularizaAon”

n Consider the parAcles to represent a conAnuous density n Sample from the conAnuous density n E.g., given (1-D) parAcles

sample from the density:

Resampling SoluAon III

slide-50
SLIDE 50

n

= when there are no parAcles in the vicinity of the correct state

n

Occurs as the result of the variance in random sampling. An unlucky series of random numbers can wipe out all parAcles near the true state. This has non-zero probability to happen at each Ame à will happen eventually.

n

Popular soluAon: add a small number of randomly generated parAcles when resampling.

n

Advantages: reduces parAcle deprivaAon, simplicity.

n

Con: incorrect posterior esAmate even in the limit of infinitely many parAcles.

n

Other benefit: iniAalizaAon at Ame 0 might not have goUen anything near the true state, and not even near a state that over Ame could have evolved to be close to true state now; adding random samples will cut out parAcles that were not very consistent with past evidence anyway, and instead gives a new chance at geung close the true state.

ParAcle DeprivaAon

slide-51
SLIDE 51

n Simplest: Fixed number. n BeUer way:

n Monitor the probability of sensor measurements

which can be approximated by:

n Average esAmate over mulAple Ame-steps and compare to typical

values when having reasonable state esAmates. If low, inject random parAcles.

ParAcle DeprivaAon: How Many ParAcles to Add?

slide-52
SLIDE 52
slide-53
SLIDE 53

n Consider a measurement obtained with a noise-free sensor,

e.g., a noise-free laser-range finder---issue?

n All parAcles would end up with weight zero, as it is very unlikely to have

had a parAcle matching the measurement exactly.

n SoluAons:

n ArAficially inflate amount of noise in sensors n BeUer proposal distribuAon (e.g., opAmal sequenAal proposal)

Noise-free Sensors

slide-54
SLIDE 54

n E.g., typically more parAcles need at the beginning of

localizaAon run

n Idea:

n ParAAon the state-space n When sampling, keep track of number of bins occupied n Stop sampling when a threshold that depends on the number of

  • ccupied bins is reached

n If all samples fall in a small number of bins à lower threshold

AdapAng Number of ParAcles: KLD-Sampling

slide-55
SLIDE 55

n

z_{1-±}: the upper 1-± quanAle of the standard normal distribuAon

n

± = 0.01 and ² = 0.05 works well in pracAce

slide-56
SLIDE 56

KLD-sampling

slide-57
SLIDE 57

KLD-sampling