Graphical Models Henrik I. Christensen Robotics & Intelligent - - PowerPoint PPT Presentation

graphical models
SMART_READER_LITE
LIVE PREVIEW

Graphical Models Henrik I. Christensen Robotics & Intelligent - - PowerPoint PPT Presentation

Introduction Bayes Nets Independence MRF Example P Graphical Models Henrik I. Christensen Robotics & Intelligent Machines @ GT Georgia Institute of Technology, Atlanta, GA 30332-0280 hic@cc.gatech.edu Henrik I. Christensen (RIM@GT)


slide-1
SLIDE 1

Introduction Bayes Nets Independence MRF Example P

Graphical Models

Henrik I. Christensen

Robotics & Intelligent Machines @ GT Georgia Institute of Technology, Atlanta, GA 30332-0280 hic@cc.gatech.edu

Henrik I. Christensen (RIM@GT) Graphical Models 1 / 55

slide-2
SLIDE 2

Introduction Bayes Nets Independence MRF Example P

Outline

1

Introduction

2

Bayesian Networks

3

Conditional Independence

4

Markov Random Fields

5

Small Example

6

Summary

Henrik I. Christensen (RIM@GT) Graphical Models 2 / 55

slide-3
SLIDE 3

Introduction Bayes Nets Independence MRF Example P

Introduction

Basically we can describe Bayesian inference through repeated use of the sum and product rules Using a graphical / diagrammatical representation is often useful

1

A way to visualize structure and consider relations

2

Provides insights into a model and possible independence

3

Allow us to leverage of the many graphical algorithms available

Will consider both directed and undirected models This is a very rich areas with numerous good references

Henrik I. Christensen (RIM@GT) Graphical Models 3 / 55

slide-4
SLIDE 4

Introduction Bayes Nets Independence MRF Example P

Outline

1

Introduction

2

Bayesian Networks

3

Conditional Independence

4

Markov Random Fields

5

Small Example

6

Summary

Henrik I. Christensen (RIM@GT) Graphical Models 4 / 55

slide-5
SLIDE 5

Introduction Bayes Nets Independence MRF Example P

Bayesian Networks

Consider the joint probability p(a, b, c) Using product rule we can rewrite it as p(a, b, c) = p(c|a, b)p(a, b) Which again can be changed to p(a, b, c) = p(c|a, b)p(b|a)p(a) We can illustrate this as a b c

Henrik I. Christensen (RIM@GT) Graphical Models 5 / 55

slide-6
SLIDE 6

Introduction Bayes Nets Independence MRF Example P

Bayesian Networks

Nodes represent variables Arcs/links represent conditional dependence We can use the decomposition for any joint distribution. The direct / brute-force application generates fully connected graphs We can represent much more general relations

Henrik I. Christensen (RIM@GT) Graphical Models 6 / 55

slide-7
SLIDE 7

Introduction Bayes Nets Independence MRF Example P

Example with ”sparse” connections

We can represent relations such as p(x1)p(x2)p(x3)p(x4|x1, x2, x3)p(x5|x1, x3)p(x6|x4)p(x7|x4, x5) Which is shown below x1 x2 x3 x4 x5 x6 x7

Henrik I. Christensen (RIM@GT) Graphical Models 7 / 55

slide-8
SLIDE 8

Introduction Bayes Nets Independence MRF Example P

The general case

We can think of this as coding the factors p(xk|pak) where pak is the set of parents to a variable xk The inference is then p(x) =

  • k

p(xk|pak) we will refer to this as factorization There can be no directed cycles in the graph The general form is termed a directed acyclic graph - DAG

Henrik I. Christensen (RIM@GT) Graphical Models 8 / 55

slide-9
SLIDE 9

Introduction Bayes Nets Independence MRF Example P

Basic example

We have seen the polynomial regression before p(t, w) = p(w)

  • n

p(tn|w) Which can be visualized as

w t1 tN

Henrik I. Christensen (RIM@GT) Graphical Models 9 / 55

slide-10
SLIDE 10

Introduction Bayes Nets Independence MRF Example P

Bayesian Regression

We can make the parameters and variables explicit p(t, w|x, α, σ2) = p(w|α)

  • n

p(tn|w, xn, σ2) as shown here

tn xn N w α σ2

Henrik I. Christensen (RIM@GT) Graphical Models 10 / 55

slide-11
SLIDE 11

Introduction Bayes Nets Independence MRF Example P

Bayesian Regression - Learning

When entering data we can condition inference on it p(w|t) ∝ p(w)

  • n

p(tn|w)

tn xn N w α σ2

Henrik I. Christensen (RIM@GT) Graphical Models 11 / 55

slide-12
SLIDE 12

Introduction Bayes Nets Independence MRF Example P

Generative Models - Example Image Synthesis

Image Object Orientation Position

Henrik I. Christensen (RIM@GT) Graphical Models 12 / 55

slide-13
SLIDE 13

Introduction Bayes Nets Independence MRF Example P

Discrete Variables - 1

General joint distribution has K 2 − 1 parameters (for K possible

  • utcomes)

x1 x2 p(x1, x2|µ) =

K

  • i=1

K

  • j=1

µx1ix2j

ij

Independent joint distributions have 2(K − 1) parameters x1 x2 p(x1, x2|µ) =

K

  • i=1

µx1i

1i K

  • j=1

µx2j

2j

Henrik I. Christensen (RIM@GT) Graphical Models 13 / 55

slide-14
SLIDE 14

Introduction Bayes Nets Independence MRF Example P

Discrete Variables - 2

General joint distribution over M variables will have K M − 1 parameters A Markov chain with M nodes will have K − 1 + (M − 1)K(K − 1) parameters x1 x2 xM

Henrik I. Christensen (RIM@GT) Graphical Models 14 / 55

slide-15
SLIDE 15

Introduction Bayes Nets Independence MRF Example P

Discrete Variables - Bayesian Parms

x1 x2 xM µ1 µ2 µM

The parameters can be modelled explicitly p({xm, µm}) = p(x1|µ1)p(µ1)

M

  • m=2

p(xm|xm−1, µm)p(µm) It is assumed that p(µm) is a Dirachlet

Henrik I. Christensen (RIM@GT) Graphical Models 15 / 55

slide-16
SLIDE 16

Introduction Bayes Nets Independence MRF Example P

Discrete Variables - Bayesian Parms (2)

x1 x2 xM µ1 µ

For shared paraemeters the situation is simpler p({xm}, µ1, µ) = p(x1|µ1)p(µ1)

M

  • m=2

p(xm|xm−1, µ)p(µ)

Henrik I. Christensen (RIM@GT) Graphical Models 16 / 55

slide-17
SLIDE 17

Introduction Bayes Nets Independence MRF Example P

Extension to Linear Gaussian Models

The model can be extended to have each node as a Gaussian process/variable that is a linear function of its parents p(xi|pai) = N  xi

  • j∈pai

wijxj + bi, vi  

Henrik I. Christensen (RIM@GT) Graphical Models 17 / 55

slide-18
SLIDE 18

Introduction Bayes Nets Independence MRF Example P

Outline

1

Introduction

2

Bayesian Networks

3

Conditional Independence

4

Markov Random Fields

5

Small Example

6

Summary

Henrik I. Christensen (RIM@GT) Graphical Models 18 / 55

slide-19
SLIDE 19

Introduction Bayes Nets Independence MRF Example P

Conditional Independence

Considerations of independence is important as part of the analysis and setup of a system As an example a is independent of b given c p(a|b, c) = p(a|c) Or equivalently p(a, b|c) = p(a|b, c)p(b|c) = p(a|c)p(b|c) Frequent notation in statistics a ⊥ ⊥ b|c

Henrik I. Christensen (RIM@GT) Graphical Models 19 / 55

slide-20
SLIDE 20

Introduction Bayes Nets Independence MRF Example P

Conditional Independence - Case 1

c a b

p(a, b, c) = p(a|c)p(b|c)p(c) p(a, b) =

  • c

p(a|c)p(b|c)p(c) a / ⊥ ⊥b | ∅

Henrik I. Christensen (RIM@GT) Graphical Models 20 / 55

slide-21
SLIDE 21

Introduction Bayes Nets Independence MRF Example P

Conditional Independence - Case 1

c a b

p(a, b|c) = p(a, b, c) p(c) = p(a|c)p(b|c) a ⊥ ⊥ b | c

Henrik I. Christensen (RIM@GT) Graphical Models 21 / 55

slide-22
SLIDE 22

Introduction Bayes Nets Independence MRF Example P

Conditional Independence - Case 2

a c b

p(a, b, c) = p(a)p(c|a)p(b|c) p(a, b) = p(a)

  • c

p(c|a)p(b|c) = p(a)p(b|a) a / ⊥ ⊥b|∅

Henrik I. Christensen (RIM@GT) Graphical Models 22 / 55

slide-23
SLIDE 23

Introduction Bayes Nets Independence MRF Example P

Conditional Independence - Case 2

a c b

p(a, b|c) = p(a, b, c) p(c) = p(a)p(c|a)p(b|c) p(c) = p(a|c)p(b|c) a⊥ ⊥b|c

Henrik I. Christensen (RIM@GT) Graphical Models 23 / 55

slide-24
SLIDE 24

Introduction Bayes Nets Independence MRF Example P

Conditional Independence - Case 3

c a b

p(a, b, c) = p(a)p(b)p(c|a, b) p(a, b) = p(a)p(b) a ⊥ ⊥ b | ∅ This is the opposite of Case 1 - when c unobserved

Henrik I. Christensen (RIM@GT) Graphical Models 24 / 55

slide-25
SLIDE 25

Introduction Bayes Nets Independence MRF Example P

Conditional Independence - Case 3

c a b

p(a, b|c) = p(a, b, c) p(c) = p(a)p(b)p(c|a, b) p(c) a / ⊥ ⊥b | c This is the opposite of Case 1 - when c observed

Henrik I. Christensen (RIM@GT) Graphical Models 25 / 55

slide-26
SLIDE 26

Introduction Bayes Nets Independence MRF Example P

Diagnostics - Out of fuel?

G B F

B = Battery F = Fuel Tank G = Fuel Gauge p(G = 1|B = 1, F = 1) = 0.8 p(G = 1|B = 1, F = 0) = 0.2 p(G = 1|B = 0, F = 1) = 0.2 p(G = 1|B = 0, F = 0) = 0.1 p(B = 1) = 0.9 p(F = 1) = 0.9 ⇒ p(F = 0) = 0.1

Henrik I. Christensen (RIM@GT) Graphical Models 26 / 55

slide-27
SLIDE 27

Introduction Bayes Nets Independence MRF Example P

Diagnostics - Out of fuel?

G B F

p(F = 0|G = 0) = p(G = 0|F = 0)p(F = 0) p(G = 0) ≈ 0.257 Observing G=0 increased the probability of an empty tank

Henrik I. Christensen (RIM@GT) Graphical Models 27 / 55

slide-28
SLIDE 28

Introduction Bayes Nets Independence MRF Example P

Diagnostics - Out of fuel?

G B F

p(F = 0|G = 0, B = 0) = p(G = 0|B = 0, F = 0)p(F = 0) p(G = 0|B = 0, F)p(F) ≈ 0.111 Observing B=0 implies less likely empty tank

Henrik I. Christensen (RIM@GT) Graphical Models 28 / 55

slide-29
SLIDE 29

Introduction Bayes Nets Independence MRF Example P

D-separation

Consider non-intersecting subsets A, B, and C in a directed graph A path between subsets A and B is considered blocked if it contains a node such that:

1

the arcs are head-to-tail or tail-to-tail and in the set C

2

the arcs meet head-to-head and neither the node or its descendents are in the set C.

If all paths between A and B are blocked then A is d-separated from B by C. If there is d-separation then all the variables in the graph satisfies A ⊥ ⊥ B|C

Henrik I. Christensen (RIM@GT) Graphical Models 29 / 55

slide-30
SLIDE 30

Introduction Bayes Nets Independence MRF Example P

D-Separation - Discussion

f e b a c f e b a c

Henrik I. Christensen (RIM@GT) Graphical Models 30 / 55

slide-31
SLIDE 31

Introduction Bayes Nets Independence MRF Example P

Outline

1

Introduction

2

Bayesian Networks

3

Conditional Independence

4

Markov Random Fields

5

Small Example

6

Summary

Henrik I. Christensen (RIM@GT) Graphical Models 31 / 55

slide-32
SLIDE 32

Introduction Bayes Nets Independence MRF Example P

Markov Random Fields

The causal dependency is not always clear. Markov Random Fields (MRF) considers undirected graphs Dependency is here basically consideration of how “cliques” of nodes connect to other “cliques” Consider connectivity and trying to identify possible “connected” groups of nodes

Henrik I. Christensen (RIM@GT) Graphical Models 32 / 55

slide-33
SLIDE 33

Introduction Bayes Nets Independence MRF Example P

Undirected graph example

A C B

Henrik I. Christensen (RIM@GT) Graphical Models 33 / 55

slide-34
SLIDE 34

Introduction Bayes Nets Independence MRF Example P

Cliques and Maximum Cliques

x1 x2 x3 x4

Henrik I. Christensen (RIM@GT) Graphical Models 34 / 55

slide-35
SLIDE 35

Introduction Bayes Nets Independence MRF Example P

Joint Distribution for Cliques

p(x) = 1 Z

  • C

ψC(xC) where ψc(xC) is the potential over the clique C and the normalization factor is defined by Z =

  • x
  • C

ψC(xC) The potential is defined by the Boltzmann distribution ψC(xC) = e−E(xc) and E is an energy

Henrik I. Christensen (RIM@GT) Graphical Models 35 / 55

slide-36
SLIDE 36

Introduction Bayes Nets Independence MRF Example P

Image De-noising

See details in the book for formulation & results

Henrik I. Christensen (RIM@GT) Graphical Models 36 / 55

slide-37
SLIDE 37

Introduction Bayes Nets Independence MRF Example P

Outline

1

Introduction

2

Bayesian Networks

3

Conditional Independence

4

Markov Random Fields

5

Small Example

6

Summary

Henrik I. Christensen (RIM@GT) Graphical Models 37 / 55

slide-38
SLIDE 38

Introduction Bayes Nets Independence MRF Example P

Outline of SLAM problem

Prediction of pose & map features Update of map & pose estimate World Model

Pose estimate Corrected pose est

Ensure the robot does not get lost!

Henrik I. Christensen (RIM@GT) Graphical Models 38 / 55

slide-39
SLIDE 39

Introduction Bayes Nets Independence MRF Example P

The basics for SLAM

State of robot is modelled as the pose

  • xR =
  • x

y θ T Map features can be represented as points or lines, i.e.:

  • xi =
  • xi

yi T

Henrik I. Christensen (RIM@GT) Graphical Models 39 / 55

slide-40
SLIDE 40

Introduction Bayes Nets Independence MRF Example P

Estimation as a Kalman Problem

Prediction by odometric modelling Updating as a Kalman process, with the state

  • xstate =

    

  • xR
  • x1

. . .

  • xn

    

Henrik I. Christensen (RIM@GT) Graphical Models 40 / 55

slide-41
SLIDE 41

Introduction Bayes Nets Independence MRF Example P

Why is SLAM difficult?

The number of map hypotheses is very large Often the signal to noise ratio for features is ≈ 1 Robust discriminative features are not common The “process” is often approximated

Henrik I. Christensen (RIM@GT) Graphical Models 41 / 55

slide-42
SLIDE 42

Introduction Bayes Nets Independence MRF Example P

Problems?

1 Flexible inclusion/exclusion of measurements? 2 Handling of linearization? 3 Dealing with topological constraints?

Loop closing etc.

Henrik I. Christensen (RIM@GT) Graphical Models 42 / 55

slide-43
SLIDE 43

Introduction Bayes Nets Independence MRF Example P

Data handling

Easy inclusion and/or exclusion of data at any time in the process. How to avoid too early a commitment to a particular map hypothesis. Design of a representation that allow any-time inclusion/exclusion of data?

Henrik I. Christensen (RIM@GT) Graphical Models 43 / 55

slide-44
SLIDE 44

Introduction Bayes Nets Independence MRF Example P

Linearizations?

Linearization might cause divergence in the data. Reported by several, e.g. Julier et al (2001) and Castellanos et al (2004) Consistent handling of non-linearities

Start by exact handling of non-linearities As data matures a linearization is permitted Identification of major non-linearities to include them

Henrik I. Christensen (RIM@GT) Graphical Models 44 / 55

slide-45
SLIDE 45

Introduction Bayes Nets Independence MRF Example P

Topological constraints?

Consistent inclusion of topological constraints Two step strategy:

1

Close approximation of system in a trivial way

2

Fine tune full model by adding “smaller” corrections

Henrik I. Christensen (RIM@GT) Graphical Models 45 / 55

slide-46
SLIDE 46

Introduction Bayes Nets Independence MRF Example P

Problem statement

{xi} the robot path (set of poses), (i ∈ {1 . . . Np}) {zj} feature coordinates (j ∈ {1..Nm}) {di} dead reckoning measurements, between feature measurements {fk} feature measurements, (k ∈ {1..Nf }) Λ the f ↔ z association P(x, z, d, f , Λ) = P(d, f |x, z, Λ)P(x, z, Λ)

Henrik I. Christensen (RIM@GT) Graphical Models 46 / 55

slide-47
SLIDE 47

Introduction Bayes Nets Independence MRF Example P

Probabilistic model

P(x, z, d, f , Λ) ∝ P(d, f |x, z, Λ)P(x, z, Λ) P(d, f |x, z, Λ) ∝ P(d|x)P(f |x, z, Λ) P(x, z, Λ) ∝ P(λ) = P(Nf ) ∝ e−λNf P(x, z, d, f , Λ) ∝ P(d|x)P(f |x, z, Λ)e−λNf

Henrik I. Christensen (RIM@GT) Graphical Models 47 / 55

slide-48
SLIDE 48

Introduction Bayes Nets Independence MRF Example P

An energy model

Definition of energy/entropy of the model: E(x, z, d, f , Λ) = − log(P(d|x)) − log(P(f |x, z, Λ)) + λNf Or E(x, z, d, f , Λ) = Ed + Ef + EΛ Or: . . .

Henrik I. Christensen (RIM@GT) Graphical Models 48 / 55

slide-49
SLIDE 49

Introduction Bayes Nets Independence MRF Example P

An energy model

E(x, z, d, f , Λ) = Ed(x) + Ef (x, z) + EΛ(nj) (1) Ed = −

Np

  • i=1

log(P(di|xi−1, xi)) = 1 2

Np

  • i=1

ξT

i kiξi (2)

Ef = − log(P(f |x, z, Λ)) = 1 2

Nm

  • k=1

ηT

k kkηk

(3) EΛ = −

Nf

  • j=1

λ(nj − 1) (4) ξi = T(xi|xi−1) − di ηk = h(T(zj|xi)) − fk

Henrik I. Christensen (RIM@GT) Graphical Models 49 / 55

slide-50
SLIDE 50

Introduction Bayes Nets Independence MRF Example P

Organizing a model

Graph representation Two types of nodes:

1

State notes

Poses (xi) Features (zj)

2

Energy Nodes (Computation of Eqn (1))

Connected to the state nodes needed for computation Movement (di, ki)

Henrik I. Christensen (RIM@GT) Graphical Models 50 / 55

slide-51
SLIDE 51

Introduction Bayes Nets Independence MRF Example P

Starting a model

Ef Ef Ed X1 Z1 Z0 X0

Henrik I. Christensen (RIM@GT) Graphical Models 51 / 55

slide-52
SLIDE 52

Introduction Bayes Nets Independence MRF Example P

Entering more data

X0 Z0 Z1 X1 X2 X3 X4

Henrik I. Christensen (RIM@GT) Graphical Models 52 / 55

slide-53
SLIDE 53

Introduction Bayes Nets Independence MRF Example P

A graphical model example

Z4 Z2 Z3 X10 X9 X8 X7 X6 X5 X4 X3 X2 X1 Z1 Z0 X0

Henrik I. Christensen (RIM@GT) Graphical Models 53 / 55

slide-54
SLIDE 54

Introduction Bayes Nets Independence MRF Example P

Map updating

Optimal solution to Eq. (1): (argminE) is not realistic. Relaxation techniques allow iterative updating In a time step:

1

Add a new state node (pose)

2

Any new features/measurements?

3

Update the rest of the map – minimize energy

Henrik I. Christensen (RIM@GT) Graphical Models 54 / 55

slide-55
SLIDE 55

Introduction Bayes Nets Independence MRF Example P

Outline

1

Introduction

2

Bayesian Networks

3

Conditional Independence

4

Markov Random Fields

5

Small Example

6

Summary

Henrik I. Christensen (RIM@GT) Graphical Models 55 / 55