Hidden Markov Models: A Brief Introduction - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Hidden Markov Models: A Brief Introduction

Description:

I(y1)O(x1,y1)T(y1,y2)O(x2,y3)...T(yk-1,yk)O(xk,yk) ... log(I(y1)) log(O(x1,y1)) log(T(y1,y2)) log(O(x2,y3)) ... log(O(xk,yk) ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 19
Provided by: scie205
Category:

less

Transcript and Presenter's Notes

Title: Hidden Markov Models: A Brief Introduction


1
Hidden Markov Models A Brief Introduction
2
Introduction
  • Most of the methods weve looked at
  • Have examined images and tried to compute a few
    pieces of information
  • These give us observations that tell us about the
    world in some way
  • Hidden Markov Models (HMMs)
  • Provide a way of representing a model of what
    happens to cause these observations
  • We can use this to explain a sequence of
    observations, such as those made from a sequence
    of images

3
Hidden, Markov, Model
  • Hidden
  • We cant observe the model directly, but we know
    that it is there, and we can observe things
    related to it
  • Markov
  • The state of the model at any time depends only
    on the previous state, and not on those before
    (is Markovian c.f. CONDENSATION)

4
Hidden Markov Models
  • A HMM consists of two sets and three functions
  • The sets
  • A set of n states, Ss1, s2, , sn
  • A set of m symbols that can be observed, Aa1,
    a2, , am
  • The functions
  • A start state function, I(si), giving the prob.
    of starting in state si
  • A transition function, T(si, sj), giving the
    prob. of going from state si to state sj
  • An observation function, O(ak , si) giving the
    prob. of seeing symbol ak in state si

5
Example
  • Suppose we have a camera watching some people
  • We segment the scene into individuals
  • We track each person to class their speed into
    still, slow, or fast
  • We use stereo to class their height as being low,
    or high
  • We expect people to have several actions
  • Sitting, standing, walking, or running
  • Each of these is a state in our HMM for that
    person
  • Each state has an expected observation (eg
    sitting people are still and appear low)

6
Eg Sets and Start States
  • The sets
  • The set of states, S, is sitting, standing,
  • walking, running
  • The observations, A, are
  • (still, low),
  • (still, high),
  • (slow, low),
  • The function I tells us how people enter the
    scene
  • I(sitting) 0
  • I(standing) 0
  • I(walking) 0.9
  • I(running) 0.1

7
Eg Transition Function
  • Tells us how peoples actions change
  • Given that we saw someone sitting in the last
    frame what are they likely to be doing now?
  • Thell probably still be sitting, might have
    stood up or walked off, but wont have run
  • Eg
  • T(sit, sit) 0.7
  • T(sit, stand) 0.2
  • T(sit, walk) 0.1
  • T(sit, run) 0
  • We repeat this for all other pairs of actions.
    Note that T(x,x) is often high

8
Eg Transition Function
9
Eg Observation Function
  • Tells us how each state looks
  • Often a bit uncertain because of errors in
    measurements
  • We assume there are a discrete set of
    measurements made (not necessary, but simpler)
  • Eg A sitting person is almost certainly low
    and probably still but not fast
  • O(sit, (low, still)) 0.6
  • O(sit, (low, slow)) 0.3
  • O(sit, (low, fast)) 0
  • O(sit, (high, still)) 0.1
  • O(sit, (high, slow)) 0
  • O(sit, (high, fast)) 0

10
Three Problems
  • Given a set of observations, what set of
    parameters is the model likely to have?
  • Given the model, what is the chance of some event
    happening?
  • Given the model and an observation, what is the
    most likely sequence of states to explain that
    observation?

11
The Viterbi Algorithm
  • We can view the problem as a graph search problem
  • Suppose our observation is x1x2xk
  • We make a graph with k columns of vertices, each
    column has a vertex for each state in the HMM
  • It makes it easier to add a start vertex S and a
    finish vertex F
  • With the right weighting we can find the optimal
    sequence of states as the shortest path from S to
    F

12
The Viterbi Algorithm
S
F




x1
x2
x3
xk
13
Weighting the Arcs
  • Given a (partial) path through the graph,
    S,y1,y2,,yj, the probability of taking this path
    and getting the observations x1x2xj is
  • I(y1)O(x1,y1)T(y1,y2)O(x2,y3)T(yk-1,yk)O(xk,yk)
  • But graph search algorithms use the sum of the
    weights through the graph, and this is a product
    we need to convert it into a sum

14
Weighting the Arcs
  • We can convert the product into a sum using
    log(xy) log(x) log(y)
  • We take the log of the weight to give
  • log(I(y1)) log(O(x1,y1)) log(T(y1,y2))
    log(O(x2,y3)) log(O(xk,yk))
  • This will be high if the probability is high, and
    algorithms find the shortest path, we multiply by
    -1 giving
  • -log(I(y1)) - log(O(x1,y1)) - log(T(y1,y2)) -
    log(O(x2,y3)) - - log(O(xk,yk))

15
The Viterbi Algorithm
log(I(y1)
log(O(xi,yi) log(T(yi,yi1))
-log(O(xk,yk)
S
F




x1
x2
x3
xk
16
Graph Search
  • We can now find the shortest path from S to F
    through the graph
  • Since all the arcs point left to right, we can
    find the shortest path to all the vertices in the
    first column, then all the vertices in the second
    column, and so on
  • At each stage we keep track of the total path
    length and the arcs that lead to these shortest
    paths

17
Gesture Recognition
The fish was this big..
  • http//research.microsoft.com/awilson/papers/ijpr
    ai.pdf

18
For More Information
  • HMMs have been used for a number of tasks, both
    in vision and in artificial intelligence (notably
    NLP)
  • Dugad and Desai give a good tutorial, available
    online at
  • http//uirvli.ai.uiuc.edu/dugad/hmm_tut.html
Write a Comment
User Comments (0)
About PowerShow.com