Announcements  Project 3 will be posted ASAP: hunting ghosts with sonar.

Slides:



Advertisements
Similar presentations
State Estimation and Kalman Filtering CS B659 Spring 2013 Kris Hauser.
Advertisements

Junction Trees And Belief Propagation. Junction Trees: Motivation What if we want to compute all marginals, not just one? Doing variable elimination for.
Dynamic Bayesian Networks (DBNs)
Lirong Xia Hidden Markov Models Tue, March 28, 2014.
Lirong Xia Approximate inference: Particle filter Tue, April 1, 2014.
Rao-Blackwellised Particle Filtering Based on Rao-Blackwellised Particle Filtering for Dynamic Bayesian Networks by Arnaud Doucet, Nando de Freitas, Kevin.
Hidden Markov Models Reading: Russell and Norvig, Chapter 15, Sections
Advanced Artificial Intelligence
1 Reasoning Under Uncertainty Over Time CS 486/686: Introduction to Artificial Intelligence Fall 2013.
HMMs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
GS 540 week 6. HMM basics Given a sequence, and state parameters: – Each possible path through the states has a certain probability of emitting the sequence.
Probabilistic Robotics Bayes Filter Implementations Particle filters.
10/28 Temporal Probabilistic Models. Temporal (Sequential) Process A temporal process is the evolution of system state over time Often the system state.
CS 188: Artificial Intelligence Fall 2009 Lecture 20: Particle Filtering 11/5/2009 Dan Klein – UC Berkeley TexPoint fonts used in EMF. Read the TexPoint.
Particle Filters Pieter Abbeel UC Berkeley EECS Many slides adapted from Thrun, Burgard and Fox, Probabilistic Robotics TexPoint fonts used in EMF. Read.
Graphical Models for Mobile Robot Localization Shuang Wu.
Introduction to Kalman Filter and SLAM Ting-Wei Hsu 08/10/30.
SLAM: Simultaneous Localization and Mapping: Part I Chang Young Kim These slides are based on: Probabilistic Robotics, S. Thrun, W. Burgard, D. Fox, MIT.
Particle Filters for Mobile Robot Localization 11/24/2006 Aliakbar Gorji Roborics Instructor: Dr. Shiri Amirkabir University of Technology.
Probabilistic Robotics Bayes Filter Implementations Particle filters.
CS 188: Artificial Intelligence Spring 2007 Lecture 14: Bayes Nets III 3/1/2007 Srini Narayanan – ICSI and UC Berkeley.
11/14  Continuation of Time & Change in Probabilistic Reasoning Project 4 progress? Grade Anxiety? Make-up Class  On Monday?  On Wednesday?
CS 188: Artificial Intelligence Fall 2006 Lecture 17: Bayes Nets III 10/26/2006 Dan Klein – UC Berkeley.
Announcements Homework 8 is out Final Contest (Optional)
CS 188: Artificial Intelligence Fall 2009 Lecture 19: Hidden Markov Models 11/3/2009 Dan Klein – UC Berkeley.
Particle Filtering. Sensors and Uncertainty Real world sensors are noisy and suffer from missing data (e.g., occlusions, GPS blackouts) Use sensor models.
QUIZ!!  T/F: The forward algorithm is really variable elimination, over time. TRUE  T/F: Particle Filtering is really sampling, over time. TRUE  T/F:
Computer vision: models, learning and inference Chapter 19 Temporal models.
CSE 573: Artificial Intelligence Autumn 2012
Simultaneous Localization and Mapping Presented by Lihan He Apr. 21, 2006.
Recap: Reasoning Over Time  Stationary Markov models  Hidden Markov models X2X2 X1X1 X3X3 X4X4 rainsun X5X5 X2X2 E1E1 X1X1 X3X3 X4X4 E2E2 E3E3.
CS 188: Artificial Intelligence Fall 2008 Lecture 19: HMMs 11/4/2008 Dan Klein – UC Berkeley 1.
CS 188: Artificial Intelligence Fall 2006 Lecture 18: Decision Diagrams 10/31/2006 Dan Klein – UC Berkeley.
UIUC CS 498: Section EA Lecture #21 Reasoning in Artificial Intelligence Professor: Eyal Amir Fall Semester 2011 (Some slides from Kevin Murphy (UBC))
Dynamic Bayesian Networks and Particle Filtering COMPSCI 276 (chapter 15, Russel and Norvig) 2007.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Bayes’ Nets: Sampling [These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available.
Mobile Robot Localization (ch. 7)
Processing Sequential Sensor Data The “John Krumm perspective” Thomas Plötz November 29 th, 2011.
CS 416 Artificial Intelligence Lecture 17 Reasoning over Time Chapter 15 Lecture 17 Reasoning over Time Chapter 15.
CSE 473: Artificial Intelligence Spring 2012 Reasoning about Uncertainty & Hidden Markov Models Daniel Weld Many slides adapted from Dan Klein, Stuart.
The famous “sprinkler” example (J. Pearl, Probabilistic Reasoning in Intelligent Systems, 1988)
Representing hierarchical POMDPs as DBNs for multi-scale robot localization G. Thocharous, K. Murphy, L. Kaelbling Presented by: Hannaneh Hajishirzi.
QUIZ!!  In HMMs...  T/F:... the emissions are hidden. FALSE  T/F:... observations are independent given no evidence. FALSE  T/F:... each variable X.
CS 188: Artificial Intelligence Bayes Nets: Approximate Inference Instructor: Stuart Russell--- University of California, Berkeley.
CPSC 422, Lecture 17Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 17 Oct, 19, 2015 Slide Sources D. Koller, Stanford CS - Probabilistic.
Bayes Nets & HMMs Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell,
CS Statistical Machine learning Lecture 25 Yuan (Alan) Qi Purdue CS Nov
Reasoning over Time  Often, we want to reason about a sequence of observations  Speech recognition  Robot localization  User attention  Medical monitoring.
CSE 473: Artificial Intelligence Spring 2012 Reasoning about Uncertainty & Hidden Markov Models Daniel Weld Many slides adapted from Dan Klein, Stuart.
CSE 573: Artificial Intelligence Autumn 2012 Particle Filters for Hidden Markov Models Daniel Weld Many slides adapted from Dan Klein, Stuart Russell,
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
CSE 473: Artificial Intelligence Spring 2012 Reasoning about Uncertainty & Hidden Markov Models Daniel Weld Many slides adapted from Dan Klein, Stuart.
CS 541: Artificial Intelligence Lecture VIII: Temporal Probability Models.
CS 541: Artificial Intelligence Lecture VIII: Temporal Probability Models.
HMM: Particle filters Lirong Xia. HMM: Particle filters Lirong Xia.
Probabilistic Robotics
Artificial Intelligence
CS 4/527: Artificial Intelligence
Probabilistic Reasoning Over Time
Introduction to particle filter
CAP 5636 – Advanced Artificial Intelligence
CS 188: Artificial Intelligence Spring 2007
Introduction to particle filter
CS 188: Artificial Intelligence
Computational Physiology for Critical Care Monitoring
Hidden Markov Models Markov chains not so useful for most agents
CS 188: Artificial Intelligence Fall 2008
Hidden Markov Models Lirong Xia.
HMM: Particle filters Lirong Xia. HMM: Particle filters Lirong Xia.
Presentation transcript:

Announcements  Project 3 will be posted ASAP: hunting ghosts with sonar

2

3

CS 188: Artificial Intelligence Dynamic Bayes Nets and Particle Filters Instructor: Stuart Russell University of California, Berkeley

Today  Dynamic Bayes nets  Relationship to HMMs  Application: ICU monitoring  Particle filtering  And maybe some cool demos

Dynamic Bayes Nets

Dynamic Bayes Nets (DBNs)  We want to track multiple variables over time, using multiple sources of evidence  Idea: Repeat a fixed Bayes net structure at each time  Variables from time t can condition on those from t-1 G1aG1a E1aE1a E1bE1b G1bG1b G2aG2a E2aE2a E2bE2b G2bG2b t =1t =2 G3aG3a E3aE3a E3bE3b G3bG3b t =3

DBNs and HMMs  Every HMM is a single-variable DBN  Every discrete DBN is an HMM  HMM state is Cartesian product of DBN state variables  Sparse dependencies => exponentially fewer parameters  E.g., 20 state variables, 3 parents each; DBN has 20 x 2 3 = 160 parameters, HMM has 2 20 x 2 20 =~ parameters

Exact Inference in DBNs  Variable elimination applies to dynamic Bayes nets  Offline: “unroll” the network for T time steps, then eliminate variables to find P(X T |e 1:T )  Online: eliminate all variables from the previous time step; store factors for current time only  Problem: largest factor contains all variables for current time (plus a few more) t =1t =2t =3 G1aG1a E1aE1a E1bE1b G1bG1b G2aG2a E2aE2a E2bE2b G2bG2b G3aG3a E3aE3a E3bE3b G3bG3b G3bG3b [Demo: pacman sonar ghost DBN model (L15D6)]

Video of Demo Pacman Sonar Ghost DBN Model

Application: ICU monitoring  State: variables describing physiological state of patient  Evidence: values obtained from monitoring devices  Transition model: physiological dynamics, sensor dynamics  Query variables: pathophysiological conditions (a.k.a. bad things) 11

Toy DBN: heart rate monitoring parameter variable state variable sensor variable sensor state variable

Vasculature Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge Brain Neurotransmitters Heart Blood flow

Vasculature Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Cardiac contrac- tility Venous tone Arterio- lar tone Cardiac preload Capillary pressure Barorecep- tor discharge Brain Neurotransmitters Heart Blood flow Heart rate Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure

Vasculature Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge MAP sensor model Heart rate sensor model Central venous pressure sensor model Brain Neurotransmitters Heart Blood flow

Vasculature Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge ABP sensor model Heart rate sensor model Central venous pressure sensor model Brain Neurotransmitters Heart Blood flow

Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Blood [volume] Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge Intracranial physiology Tissues- NOS [perfusion] MAP sensor model GI/Liver [perfusion] Heart rate sensor model Central venous pressure sensor model Blood [transu- dation] Setpoint inputs from ANS, CNS, intracranial, blood Pulm. [intra- thoracic press.] Brain Neurotransmitters Heart Blood flow Vasculature

Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge Intracranial physiology Tissues- NOS [perfusion] MAP sensor model GI/Liver [perfusion] Heart rate sensor model Central venous pressure sensor model Blood [transu- dation] Setpoint inputs from ANS, CNS, intracranial, blood Pulm. [intra- thoracic press.] Brain Neurotransmitters Heart Blood flow Vasculature Blood [volume]

Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Blood [volume] Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge Intracranial physiology Tissues- NOS [perfusion] MAP sensor model GI/Liver [perfusion] Heart rate sensor model Central venous pressure sensor model PK [conc. of phenyl- ephrine] Blood [transu- dation] Setpoint inputs from ANS, CNS, intracranial, blood Pulm. [intra- thoracic press.] Brain Neurotransmitters Heart Blood flow Vasculature

Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Blood [volume] Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge Intracranial physiology Tissues- NOS [perfusion] MAP sensor model GI/Liver [perfusion] Heart rate sensor model Central venous pressure sensor model PK [conc. of phenylephrine] Blood [transu- dation] Setpoint inputs from ANS, CNS, intracranial, blood Pulm. [intra- thoracic press.] Brain Neurotransmitters Heart Blood flow Vasculature

Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Blood [volume] Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge Intracranial physiology Tissues- NOS [perfusion] MAP sensor model GI/Liver [perfusion] Heart rate sensor model Central venous pressure sensor model PK [conc. of phenyl- ephrine] Blood [transu- dation] Setpoint inputs from ANS, CNS, intracranial, blood Pulm. [intra- thoracic press.] Medullary cardiovascular center Cardiac parasympathetic output Cardiac sympathetic output Card. M2 Card. β1 Card. β2 Vasc. α1 Vasc. α2 Vasc. β2 Heart rate Cardiac contrac- tility Venous tone Blood [volume] Arterio- lar tone Cardiac preload Capillary pressure Cardiac stroke volume Cardiac output Vascular resistance Mean arterial blood pressure Barorecep- tor discharge Intracranial physiology Tissues- NOS [perfusion] MAP sensor model GI/Liver [perfusion] Heart rate sensor model Central venous pressure sensor model PK [conc. of phenyl- ephrine] Blood [transu- dation] Setpoint inputs from ANS, CNS, intracranial, blood Pulm. [intra- thoracic press.] Brain Neurotransmitters Heart Blood flow Vasculature

Human physiology v0.1

Other people have done a lot of work! 10% of Guyton 1972

ICU data: 22 variables, 1min ave

27

ICP closeup

1s diastolic/systolic/mean ABP

Blood pressure measurement

ALARM

Particle Filtering

We need a new algorithm!  When |X| is more than 10 6 or so (e.g., 3 ghosts in a 10x20 world), exact inference becomes infeasible  Likelihood weighting fails completely – number of samples needed grows exponentially with T X1X1 X0X0 X2X2 X3X3 E1E1 E2E2 E3E3

We need a new idea!  The problem: sample state trajectories go off into low-probability regions, ignoring the evidence; too few “reasonable” samples  Solution: kill the bad ones, make more of the good ones  This way the population of samples stays in the high-probability region  This is called resampling or survival of the fittest t=2t=7

Particle Filtering  Represent belief state by a set of samples  Samples are called particles  Time per step is linear in the number of samples  But: number needed may be large  This is how robot localization works in practice

Representation: Particles  Our representation of P(X) is now a list of N particles (samples)  Generally, N << |X|  Storing map from X to counts would defeat the point  P(x) approximated by number of particles with value x  So, many x may have P(x) = 0!  More particles, more accuracy  Usually we want a low-dimensional marginal  E.g., “Where is ghost 1?” rather than “Are ghosts 1,2,3 in {2,6], [5,6], and [8,11]?”  For now, all particles have a weight of 1 Particles: (3,3) (2,3) (3,3) (3,2) (3,3) (3,2) (1,2) (3,3) (2,3)

Particle Filtering: Propagate forward  A particle in state x t is moved by sampling its next position directly from the transition model:  x t+1 ~ P(X t+1 | x t )  Here, most samples move clockwise, but some move in another direction or stay in place  This captures the passage of time  If enough samples, close to exact values before and after (consistent) Particles: (3,3) (2,3) (3,3) (3,2) (3,3) (3,2) (1,2) (3,3) (2,3) Particles: (3,2) (2,3) (3,2) (3,1) (3,3) (3,2) (1,3) (2,3) (3,2) (2,2)

 Slightly trickier:  Don’t sample observation, fix it  Similar to likelihood weighting, weight samples based on the evidence  W = P(e t | x t )  Normalize the weights: particles that fit the data better get higher weights, others get lower weights Particle Filtering: Observe Particles: (3,2) w=.9 (2,3) w=.2 (3,2) w=.9 (3,1) w=.4 (3,3) w=.4 (3,2) w=.9 (1,3) w=.1 (2,3) w=.2 (3,2) w=.9 (2,2) w=.4 Particles: (3,2) (2,3) (3,2) (3,1) (3,3) (3,2) (1,3) (2,3) (3,2) (2,2)

Particle Filtering: Resample  Rather than tracking weighted samples, we resample  N times, we choose from our weighted sample distribution (i.e., draw with replacement)  Now the update is complete for this time step, continue with the next one Particles: (3,2) w=.9 (2,3) w=.2 (3,2) w=.9 (3,1) w=.4 (3,3) w=.4 (3,2) w=.9 (1,3) w=.1 (2,3) w=.2 (3,2) w=.9 (2,2) w=.4 (New) Particles: (3,2) (2,2) (3,2) (2,3) (3,3) (3,2) (1,3) (2,3) (3,2)

Summary: Particle Filtering  Particles: track samples of states rather than an explicit distribution Particles: (3,3) (2,3) (3,3) (3,2) (3,3) (3,2) (1,2) (3,3) (2,3) Propagate forwardWeightResample Particles: (3,2) (2,3) (3,2) (3,1) (3,3) (3,2) (1,3) (2,3) (3,2) (2,2) Particles: (3,2) w=.9 (2,3) w=.2 (3,2) w=.9 (3,1) w=.4 (3,3) w=.4 (3,2) w=.9 (1,3) w=.1 (2,3) w=.2 (3,2) w=.9 (2,2) w=.4 (New) Particles: (3,2) (2,2) (3,2) (2,3) (3,3) (3,2) (1,3) (2,3) (3,2) [Demos: ghostbusters particle filtering (L15D3,4,5)] Consistency: see proof in AIMA Ch. 15

Particle filtering on umbrella model 46

Robot Localization  In robot localization:  We know the map, but not the robot’s position  Observations may be vectors of range finder readings  State space and readings are typically continuous so we cannot usually represent or compute an exact posterior  Particle filtering is a main technique

Particle Filter Localization (Sonar) [Video: global-sonar-uw-annotated.avi]

Robot Mapping  SLAM: Simultaneous Localization And Mapping  We do not know the map or our location  State consists of position AND map!  Main techniques: Kalman filtering (Gaussian HMMs) and particle methods DP-SLAM, Ron Parr [Demo: PARTICLES-SLAM-mapping1-new.avi]

Particle Filter SLAM – Video 1 [Demo: PARTICLES-SLAM-mapping1-new.avi]

Particle Filter SLAM – Video 2 [Demo: PARTICLES-SLAM-fastslam.avi]