07 edit distance dtw
DESCRIPTION
Edit Distance DTW, to fnd the matching among wordsTRANSCRIPT
![Page 1: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/1.jpg)
1
Presented by
Dr Khurram Khurshid
DYNAMIC TIME WARPING (Application in Pattern Recognition)
![Page 2: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/2.jpg)
2
DTW Compare 2 sequences varying in time (speech)
• Different sizes
• Extended in time
0 0 1 1 0 0 1 1 1 1 0
0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 0
![Page 3: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/3.jpg)
3
Using DTW
x1 x2 x3 x4 x5 x6 x7
( 0 1 1 0 0 0 1 )
1 y5
1 y4
1 y3
1 y2
0 y1
![Page 4: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/4.jpg)
4
Steps:• D (1,1) = d (x1,y1)
• For m = 2 to 7
• D (m,1) = D (m-1, 1) + d (xm,y1)
• For n = 2 to 5
• D (1,n) = D (1, n –1) + d (x1,yn)
DTW
![Page 5: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/5.jpg)
5
D(i, j –1)
D (i , j) = min D(i-1, j) + d (x i,yi)D (i-1, j-1)
Here for d (xi , yi), we can just use the Euclidean distance. d
d (xi , yi) = ∑ (x i,k - y j,k)2
K=1
DTW
![Page 6: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/6.jpg)
6
Using DTW
4 0 0 1 2 2 2
3 0 0 1 2 2 2
2 0 0 1 2 2 2
1 0 0 1 2 2 2
0 1 2 2 2 3 4
x1 x2 x3 x4 x5 x6 x7
( 0 1 1 0 0 1 1 )
1 y5
1 y4
1 y3
1 y2
0 y1
![Page 7: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/7.jpg)
7
STRING COMPARISON
![Page 8: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/8.jpg)
8
ISSUES
Scale Invariance
Translation Invariance
![Page 9: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/9.jpg)
9
EDIT / LEVENSHTEIN DISTANCE Given strings s and t
Distance is shortest sequence of edit commands that transform s to t, (or equivalently t to s).
Simple set of operations: Copy character from s over to t (cost 0) Delete a character in s (cost 1) Insert a character in t (cost 1) Substitute one character for another (cost 1)
![Page 10: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/10.jpg)
10
EDIT / LEVENSHTEIN DISTANCE
![Page 11: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/11.jpg)
11
EDIT / LEVENSHTEIN DISTANCE
Distance between SATURDAY and SUNDAY?
![Page 12: 07 Edit Distance DTW](https://reader036.vdocuments.mx/reader036/viewer/2022062410/5695d2fe1a28ab9b029c73ed/html5/thumbnails/12.jpg)
12
EDIT / LEVENSHTEIN DISTANCE