Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Prefix and Suffix Invariant Dynamic Time Warping
Search
nel215
February 11, 2017
Science
1
2k
Prefix and Suffix Invariant Dynamic Time Warping
nel215
February 11, 2017
Tweet
Share
More Decks by nel215
See All by nel215
Presto Connector を自作した話
nel215
3
1.3k
Other Decks in Science
See All in Science
Lean4による汎化誤差評価の形式化
milano0017
1
250
2025-06-11-ai_belgium
sofievl
1
130
Transport information Geometry: Current and Future II
lwc2017
0
160
機械学習 - ニューラルネットワーク入門
trycycle
PRO
0
820
データベース06: SQL (3/3) 副問い合わせ
trycycle
PRO
1
550
LayerXにおける業務の完全自動運転化に向けたAI技術活用事例 / layerx-ai-jsai2025
shimacos
2
1.2k
アナログ計算機『計算尺』を愛でる Midosuji Tech #4/Analog Computing Device Slide Rule now and then
quiver
1
190
Explanatory material
yuki1986
0
330
「美は世界を救う」を心理学で実証したい~クラファンを通じた新しい研究方法
jimpe_hitsuwari
1
140
データベース02: データベースの概念
trycycle
PRO
2
770
地表面抽出の方法であるSMRFについて紹介
kentaitakura
1
760
SciPyDataJapan 2025
schwalbe10
0
240
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
It's Worth the Effort
3n
185
28k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
Designing for humans not robots
tammielis
253
25k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
740
Transcript
Prefix and Suffix Invariant Dynamic Time Warping NIPS・ICDM 2016論文輪読会 大友
雄平 (@nel215)
論文概要 (1/2) • Prefix and Suffix Invariant Dynamic Time Warping
• ICDM 2016 Accepted Short Paper • Session A6: Sequences and Time Series • 論文URL: http://www.cs.ucr.edu/~eamonn/psi_DTW_10pages.pdf • ICDM版の加筆 • 資料内の画像は上記より引用 • Prefix and Suffix Invariant Dynamic Time Warping → PSI-DTW → Ψ-DTW
論文概要 (2/2) • Dynamic Time Warping [Berndt DJ, Clifford J
1994] • 時系列データ間の類似度 (Similarity) を計算する手法 • 異なる長さの時系列にも適用可能 • 高速化のためのLower Boundを計算する手法がある • Prefix and Suffix Invariant • DTWを区切り位置が明確ではない時系列データ(ストリームデータなど) に適用すると分類問題などの正解率が悪くなる • DTW を suffix と prefix に対して不変性を与えるアルゴリズムに修正 • Lower Boundについても同様な修正を考案
目次 • 論文概要 • Dynamic Time Warping (DTW) • アルゴリズム
• 問題点・例 • Prefix and Suffix Invariant Dynamic Time Warping (Ψ-DTW) • アルゴリズム • Prefix, Suffixの与える影響 • 比較実験 • Lower Bound • アルゴリズム • 比較実験 • まとめ
Dynamic Time Warping (1/3) • 入力: • 出力: • 漸化式:
時系列データ = 1 , 2 , … , , = 1 , 2 , … , , ∈ ℝ for any ∈ [1, ], ∈ [1, ] 類似度 DTW , = dtw(, ) ※ c(.,.) はコスト関数
Dynamic Time Warping (2/3) 0 1 2 3 4 5
6 0 0 ∞ ∞ ∞ ∞ ∞ ∞ 1 ∞ 2 ∞ 3 ∞ 4 ∞ 5 ∞ 6 ∞ = =
Dynamic Time Warping (3/3) 0 1 2 3 4 5
6 0 0 ∞ ∞ ∞ ∞ ∞ ∞ 1 ∞ 2 ∞ 3 ∞ 4 ∞ 5 ∞ 6 ∞ = = dtw(3,2)=c(3 , 2 )+minቐ dtw(2,2) dtw(3,1) dtw(2,1) DTW(, )=dtw(6,6)
Dynamic Time Warping の問題点 • 区切り位置が明確でない場合にPrefixやSuffixの影響を受ける
Ψ-DTW (1/3) • 入力: • 出力: • 漸化式: 時系列データ =
1 , 2 , … , , = 1 , 2 , … , Relaxation Factor ∈ ℕ , ∈ ℝ for any ∈ [1, ], ∈ [1, ] 類似度
Ψ-DTW (2/3) 0 1 2 3 4 5 6 0
0 0 0 ∞ ∞ ∞ ∞ 1 0 2 0 3 ∞ 4 ∞ 5 ∞ 6 ∞ = = ※r=2の場合
Ψ-DTW (3/3) 0 1 2 3 4 5 n 0
0 0 0 ∞ ∞ ∞ ∞ 1 0 2 0 3 ∞ 4 ∞ 5 ∞ m ∞ = = ※r=2の場合 Ψ-DTW(x,y,2)=min dtw(4,6) dtw(5,6) dtw(6,4) (6,5) (6,6)
Suffixの与える影響 • suffixを加えた場合の分類正解率 • ※cDTW、Ψ-cDTWは比較位置に制限を加えたバージョン
比較実験 (1/3) • 各データセットに対する分類タスクの Accuracy を評価 • 学習データは端点が分からない状況を想定して 時系列データを連結、k近傍法用の辞書作成の前処理を実施 •
辞書が結果に影響を与えないように辞書作成に使う類似度計算は cDTWで統一
比較実験 (2/3) • Motor Current Data • 特によかったデータセット • 既存手法のAccuracy12%に対して40%以上を達成
※横軸は辞書時系列の長さ
比較実験 (3/3) • その他データセット • 各手法で最も良かった辞書時系列長の結果 • 4/6のデータセットで提案手法が良好な結果
Lower Bound • k近傍法などで高速化のために利用 ※KDD2016 Tutorial(http://www.cs.unm.edu/~mueen/DTW2.pdf)より引用
LB_Keogh (1/2) • ベースとなる既存手法 [E. Keogh, et. al. 2005] •
一方の時系列qに対してenvelop U, Lを計算する ※nは時系列の長さ
LB_Keogh (2/2) • 他方の時系列tがenvelopからはみ出た部分をLower Boundとする LB_Keogh(, )=σ =1 ቐ −
2, if > − 2, if < 0 otherwise ※コスト関数が差の2乗の場合
Ψ-LB_Keogh • 前後 r 個を計算せずPrefixとSuffixに対してInvariantにする Ψ-LB_Keogh(, , )=σ =1+ −
ቐ − 2, if > − 2, if < 0 otherwise ※ r : Relaxation Factor ※コスト関数が差の2乗の場合
Tightness • 各 Lower Bound/DTW で計算した値を比較 • 既存手法と同様の傾向 • 既存手法より良かったケースが1つ
まとめ • 課題 • 区切りが明確ではないデータに対してDTWの性能が良くない • 手法 • PrefixとSuffixに対してInvariantなΨ-DTWを提案 •
Lower Boundについても同様にΨ-LB_Keoghを提案 • Relaxation FactorでInvariantを制御 • 結果 • 4/6のデータセットでAccuracyが改善 • Motor Current Data データセットでは約30ポイントの改善
参考資料等 • DTW/LB_Keogh の出典 • Berndt DJ, Clifford J (1994)
Using dynamic time warping to find patterns in time series. In: KDD workshop, pp 359–370 • Keogh EJ, Ratanamahatana CA (2005) Exact indexing of dynamic time warping. Knowl Inf Syst 7(3): 358–386 • DTW等の性能比較論文 • http://didawikinf.di.unipi.it/lib/exe/fetch.php/dm/time_series_comp arison_2012.pdf • KDD2016のDTWに関するチュートリアル • http://www.cs.unm.edu/~mueen/DTW1.pdf • http://www.cs.unm.edu/~mueen/DTW2.pdf