Introduction Problem Preliminaries SWM Conclusion Scaling and Time Warping in Time Series Querying Ada Wai-chee Fu 1 Eamonn Keogh 2 Leo Yung Hang Lau 1 Chotirat Ann Ratanamahatana 2 1 Department of Computer Science and Engineering The Chinese University of Hong Kong 2 Department of Computer Science and Engineering University of California, Riverside VLDB 2005 A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Outline Introduction 1 Problem Definition 2 Preliminaries 3 Scaling and Time Warping 4 Conclusion 5 A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Indexing Video (Sports Data) Query by Humming Introduction Euclidean Distance No alignment Dynamic Time Warping (DTW) Local alignment Uniform Scaling (US) Global scaling Scaled and Warped Matching (SWM) Both global scaling and local alignment are important! A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Indexing Video (Sports Data) Query by Humming Indexing Video (Sports Data) Indexing sports data Euclidean Euclidean Sports fans Find particular types of shots or moves DTW DTW Coaches Analyze athletes’ performance over time Video clips recording an athlete Uniform Scaling Uniform Scaling performing high jump Collect the athlete’s center of mass data from video (automatically) Convert the data into a time series SWM SWM Two examples of an athlete’s trajectories aligned with various 0 0 0 10 10 10 20 20 20 30 30 30 40 40 40 50 50 50 60 60 60 70 70 70 80 80 80 measures A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Indexing Video (Sports Data) Query by Humming Indexing Video (Sports Data) Euclidean Euclidean ✗ Euclidean Distance Mapping part of the flight of one DTW DTW sequence to the takeoff drive in the other ✗ Dynamic Time Warping (DTW) Uniform Scaling Uniform Scaling Trying to explain part of the sequence in one attempt (the bounce from the mat) that simply SWM SWM does not exist in the other sequence 0 0 0 10 10 10 20 20 20 30 30 30 40 40 40 50 50 50 60 60 60 70 70 70 80 80 80 A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Indexing Video (Sports Data) Query by Humming Indexing Video (Sports Data) Euclidean Euclidean ✗ Uniform Scaling (US) Best match when we stretch the DTW DTW shorter sequence by 112% Poor local alignment at takeoff drive ad up-flight Uniform Scaling Uniform Scaling ✓ Scaled and Warped Matching (SWM) Global stretching at 112% allows DTW to align the small local SWM SWM differences 0 0 0 10 10 10 20 20 20 30 30 30 40 40 40 50 50 50 60 60 60 70 70 70 80 80 80 A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Indexing Video (Sports Data) Query by Humming Query by Humming Search large music collections by providing an example of the desired content, by humming (or singing, or tapping) a snippet Humans cannot be expected to reproduce an exact fragment of a song Query must be made invariant to key Wrong tempo Users may insert or delete notes Existing approaches Do DTW multiple times, at different scalings Do DTW with relatively short song snippets Less sensitive to uniform scaling problem Less discriminating power A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Indexing Video (Sports Data) Query by Humming Query by Humming Happy birthday to you C = candidate C = candidate At very different tempos match match DTW doesn’t produce the desired Q = query Q = query alignment 0 0 20 20 40 40 60 60 80 80 100 100 120 120 140 140 No global scaling C C US produces better global alignment, but serious local Q (rescaled 1.54 ) Q (rescaled 1.54 ) misalignments 0 0 20 20 40 40 60 60 80 80 100 100 120 120 140 140 y y No local alignment h h t t p p r r i i p p b b -day -day h h a a t r t r h h b b i i u u y y to to dear dear -day -day u u o o p p you you Only SWM produces the correct o o to to C C h h o o h h y y p p ----- ----- t t y y a a y y t t y y p p t t p p r r -day -day r r -day -day h h i i p p i i p p b b b b a a a a h h h h alignment US aligns globally while DTW Q (rescaled 1.40) Q (rescaled 1.40) corrects the local misalignments 0 0 20 20 40 40 60 60 80 80 100 100 120 120 140 140 A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Problem Definition Given A database D of M variable lengths data sequences A query Q A scaling factor l , l ≥ 1 A time warping constraint r Problem Assume the data sequences can be longer than the query sequence Q. Find the best match to Q in database, for any rescaling in a given range, under the Dynamic Time Warping distance with a global constraint. By best match we mean the data sequence with the smallest distance from Q. A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Time Warping Distance (DTW) Uniform Scaling (US) Time Warping Distance (DTW) Definition (Time Warping Distance (DTW)) Given two sequences C = C 1 , C 2 , · · · , C n and Q = Q 1 , Q 2 , · · · , Q m , the time warping distance DTW is defined recursively as follows: DTW ( φ, φ ) = 0 DTW ( C , φ ) = DTW ( φ, Q ) = ∞ DTW ( C , Rest ( Q )) DTW ( C , Q ) = D base ( First ( C ) , First ( Q )) + min DTW ( Rest ( C ) , Q ) DTW ( Rest ( C ) , Rest ( Q )) where First ( C ) = C 1 , Rest ( C ) = C 2 , C 3 , · · · , C n , φ is the empty sequence, and D base denotes the distance between two entries. A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Time Warping Distance (DTW) Uniform Scaling (US) Warping Matrix An example warping matrix aligning the time series { 1 , 2 , 2 , 4 , 5 } and { 1 , 1 , 2 , 3 , 5 , 6 } 5 27 27 13 5 1 2 4 11 11 4 2 6 1 2 2 2 0 1 10 26 2 1 1 0 1 10 26 1 0 0 1 5 21 46 1 1 2 3 5 6 DTW ( Rest ( C ) , Q ) DTW ( C , Q ) DTW ( Rest ( C ) , Rest ( Q )) DTW ( C , Rest ( Q )) A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Time Warping Distance (DTW) Uniform Scaling (US) Warping Matrix An example warping matrix aligning the time series { 1 , 2 , 2 , 4 , 5 } and { 1 , 1 , 2 , 3 , 5 , 6 } 5 27 27 13 5 1 2 4 11 11 4 2 6 1 2 2 2 0 1 10 26 2 1 1 0 1 10 26 1 0 0 1 5 21 46 1 1 2 3 5 6 The highlighted entries denote the warping path. The DTW distance is 2. (the value at the top-right entry) A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Time Warping Distance (DTW) Uniform Scaling (US) Constraints on the Warping Path Itakura Parallelogram Sakoe-Chiba Band A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Time Warping Distance (DTW) Uniform Scaling (US) Constrained DTW (cDTW) Definition (Constrained DTW (cDTW)) Given two sequences C = C 1 , C 2 , · · · , C n and Q = Q 1 , Q 2 , · · · , Q m , and the time warping constraint r , the constrained time warping distance cDTW is defined recursively as follows: � D base ( C i , Q j ) if | i − j | ≤ r Dist r ( C i , Q j ) = ∞ otherwise cDTW ( φ, φ, r ) = 0 cDTW ( C , φ, r ) = cDTW ( φ, Q , r ) = ∞ cDTW ( C , Rest ( Q ) , r ) cDTW ( C , Q , r ) = Dist r ( First ( C ) , First ( Q )) + min cDTW ( Rest ( C ) , Q , r ) cDTW ( Rest ( C ) , Rest ( Q ) , r ) where φ is the empty sequence, First ( C ) = C 1 , Rest ( C ) = C 2 , C 3 , · · · , C n , and D base denotes the distance between two entries. A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Introduction Problem Preliminaries SWM Conclusion Time Warping Distance (DTW) Uniform Scaling (US) Constraints and Enveloping Sequences A. W. C. Fu, E. Keogh, L. Y. H. Lau and C. A. Ratanamahatana Scaling and Time Warping in Time Series Querying
Recommend
More recommend