ch10 ( DTW).ppt

advertisement
4.7 TIME ALIGNMENT AND NORMALIZATION
X  (x1 , x 2 , . . . , xTx ) and
Y  (y1 , y 2 , . . . , y Ty ),
Linear time normalization:
Tx
Tx
i x 1
i x 1
d ( X , Y )   d (x ix , y i y )   d (ix , i y ),
iy 
Ty
Tx
ix .
1
4.7 TIME ALIGNMENT AND NORMALIZATION
2
4.7 TIME ALIGNMENT AND
NORMALIZATION
ix  x (k ),
k  1,2, . . . , T
i y   y (k ),
k  1,2, . . . , T
T
d (  ,  )   d ( x (k ),  y (k )) m(k ) / M 
k 1

d (  ,  )  min d (  ,  ),

m(k): a nonnegative (path) weighting factor
Mϕ: a (path) normalizing factor
3
4.7 TIME ALIGNMENT AND NORMALIZATION
4
4.7.1 Dynamic Programming-Basic Considerations
According to Bellman:
An optimal policy has the property that, whatever the initial state and
decisions are, the remaining decisions must constitute an optimal policy with
regard to the state resulting from the first decision
For every pair of points (i,j) We define  (i, j ) to be a nonnegative
cost that represents the cost of moving directly from the ith point to the
jth point in one step.
We are interested in obtaining the optimal sequence of moves and
the associated minimum cost from any point i to any other point j in
As many points as necessary.
 (i, j )  min [ (i, )   (, j )],

5
4.7.1 Dynamic Programming-Basic Considerations
To determine the minimum cost path between points i and j,
the following dynamic program is used:
1 (i, )   (i, )
  1,2, . . . , N
 2 (i, )  min (1 (i, k )   (k , )),
k
3 (i, )  min ( 2 (i, k )   (k , )),
k
k  1,2, . . . , N
  1,2, . . . , N
k  1,2, . . . , N
  1,2, . . . , N

 s (i, )  min ( s 1 (i, k )   (k , )),
k
k  1,2, . . . , N
  1,2, . . . , N
 (i, j )  min  s (i, j )
1 s  S
6
4.7.1 Dynamic Programming-Basic
Considerations
 m1 (i, n)  min [ m (i, )   (, n)]

A recursion allowing the optimal path search to be conducted incrementally
7
4.7.1 Dynamic Programming-Basic Considerations
8
4.7.1 Dynamic Programming-Basic
Considerations
1- Initialization
1 (i, n)   (i, n)
 1 ( n)  i
for n  1,2, . . ., N .
2- Recursion
 m 1 (i, n)  min [ m (i, )   (, n)]
1   N
 m 1 (n)  arg min [ m (i, )   (, n)]
1   N
for n  1,2, . . . , N and m  1,2, . . . , M  2
9
4.7.1 Dynamic Programming-Basic Considerations
3- Termination
 M (i, j )  min [ M 1 (i, )   (, j )]
1   N
 M ( j )  arg min [ M 1 (i, )   (, j )]
1   N
4- Path backtracking
optimal path  (i, i1 , i2 , . . . , i M 1 , j ),
where
im   m 1 (im 1 ),
with
i M  j.
m  M  1, M  2, . . . ,1
10
Time-Normalization Constraints





Endpoint constraints
Monotonicity constraints
Local continuity constraints
Global path constraints
Slope weighting
11
4.7.2.1 Endpoint Constraints
beginning po int
 x (1)  1
 y (1)  1
ending po int
 x (T )  Tx  y (T )  Ty
12
4.7.2.2 Monotonicity Conditions
 x (k  1)  x (k )
 y (k  1)   y (k ).
13
4.7.2.3 Local Continuity Constraints
It can take many forms.
an example proposed by Sakoe and Chiba :
 x (k  1)   x (k )  1
 y (k  1)   y (k )  1
We define a path P as a sequence of moves, each specified by a
pair of coordinate increments,
  ( p1 , q1 )( p2 , q2 )...( pT , qT )
14
4.7.2.3 Local Continuity Constraints
For a path that begins at (1,1), which point we designate k=1, we
normally set
p1  q1  1 (as if the path originates from (0,0))
and have:
k
k
 x (k )   pi
 y (k )   qi .
i 1
T
p
k 1
k
 Tx
i 1
T
q
k 1
k
 Ty
15
4.7.2.3 Local Continuity Constraints
16
4.7.2.4 Global Path Constraints
For each type of local constraints, the allowable regions can be
Defined using the following two parameters:
Qmax

()
 max  pi

 i 1

q 

i 1

Qmin
 T (  )
 min  pi

 i 1

q ,

i 1

T
T
T
()
i
()
i
Normally, Qmax=1/Qmin
17
Values of
TYPE
Qmaxand Qmin
for different types of paths
Qmax
Qmin
I

II
2
III
2
IV
2
V
3
1
VI
3
2
VII
3
1
ITAKURA
2
1
2
0
1
2
1
2
1
2
3
3
3
2
18
4.7.2.4 Global Path Constraints
We can define the global path constraints as follows:
[ x (k )  1]
1
  y (k )  1  Qmax [ x (k )  1]
Qmax
[ x (k )  Tx ]
T y  Qmax [ x (k )  Tx ]   y (k )  T y 
Qmax
The first equation specifies the range of the points in the (i x, iy) plane that
can be reached from the beginning point (1,1) via the allowable path
according to the local constraints.
The second equation specifies the range of points that have a legal path
to the ending pint (Tx , Ty)
19
4.7.2.5 Slope Weighting
20
4.7.2.4 Global Path Constraints
21
4.7.2.5 Slope Weighting
The weighting function can be designed to implement an optimal
discriminant analysis for improved recognition accuracy.
Set of four types of slope weighting proposed by Sakoe and Chiba
Type (a)
m(k )  min[  x (k )   x (k  1),  y (k )   y (k  1) ]
Type (b)
m(k )  max[  x (k )   x (k  1),  y (k )   y (k  1) ]
Type (c)
m(k )   x (k )   x (k  1)
Type (d)
m(k )   x (k )   x (k  1)   y (k )   y (k  1)
It is assumed, for initializa tion purposes that :  x (0)   y (0)  0
22
4.7.2.5 Slope Weighting
23
4.7.2.5 Slope Weighting
The Accumulated distortion also requires an overall normalization.
Customarily:
T
M    m (k ).
k 1
For type (c) and (d) slope weighting,
T
M    [ x (k )   x (k  1)]  x (T )   x (0)  Tx
(c)
k 1
T
(d )
M
  [ x (k )   x (k  1)   x (k )   x (k  1)]
k 1
  x (T )   x (0)   y (T )   y (0) T x T y
Typically, for types (a) and (b) slope weightings, we arbitrarily set:
M   M   Tx
(a)
(b )
24
4.7.3 Dynamic Time-Warping Solution
Due to endpoint constraints, we can write:

M  d ( x, y )  D(Tx ,Ty )
T
 min  d ( x (k ),  y (k )) m(k )
 x , y
k 1
25
4.7.3 Dynamic Time-Warping Solution
Similarly, the minimum partial accumulated distortion along a path
Connecting (1,1) and (ix, iy) is:

D(i x , i y )  min
 x , y ,T 
T
 d (
k 1
x
(k ),  y (k )) m(k ),
where  x (T )  i x and  y (T )  i y
D(i x , i y )  min [ D(i x , i y )   ((i x , i y ), (i x , i y ))]
( ix ,i y )
Ls
 ((i x , i y ), (i x , i y ))   d ( x (T   ),  y (T   )) m(T   )
 0
with Ls being the number of moves in the path from
(i x , i y ) to (i x , i y ) according to  x and  y
Also  x (T   Ls )  i x and  y (T   Ls )  i y .
26
4.7.3 Dynamic Time-Warping
Solution
27
4.7.3 Dynamic Time-Warping
Solution
1. DA (1,1)  d (1,1)m(1).
2. For 1  ix  Tx ,1  i y  Ty
DA (ix , i y )  min [ DA (ix , iy )   ((ix , iy ), (ix , i y ))],
( i x ,iy )
3. d ( X , Y ) 
DA (Tx , Ty )
M
28
4.7.3 Dynamic Time-Warping
Solution
29
4.7.3 Dynamic Time-Warping
Solution
The ratio of grid allowable grid points to
all grid points, when a k-to-1 time scale
expansion and contraction is allowed:




T
T
k  x k  x 



T
T
y 
y 

R
.
2
(k  1)
30
Download