JP2009199507A - Similar partial sequence detecting method, similar partial sequence detection program, and similar partial sequence detecting device - Google Patents
Similar partial sequence detecting method, similar partial sequence detection program, and similar partial sequence detecting device Download PDFInfo
- Publication number
- JP2009199507A JP2009199507A JP2008042633A JP2008042633A JP2009199507A JP 2009199507 A JP2009199507 A JP 2009199507A JP 2008042633 A JP2008042633 A JP 2008042633A JP 2008042633 A JP2008042633 A JP 2008042633A JP 2009199507 A JP2009199507 A JP 2009199507A
- Authority
- JP
- Japan
- Prior art keywords
- partial sequence
- similar
- similar partial
- similarity score
- time warping
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本発明は、ストリームマイニングにおいて類似部分シーケンスペアを検出する技術に関する。 The present invention relates to a technique for detecting similar partial sequence pairs in stream mining.
データストリーム(以下、単に「ストリーム」ともいう。)とは、ネットワークから高速に流れてくる大量のデータのことである。ストリームマイニングとは、時系列として表現されるデータストリームから役に立つ情報を素早く見つけ出す技術である。ストリームマイニングは、単にデータベースに蓄えられた大規模データを分析するものではなく、増え続けるデータの流れをリアルタイムに分析し、監視するための技術である。そして、増え続ける大規模なデータを分析するため、またユーザに情報をリアルタイムに提供するため、ストリームマイニングの技術は高速化と省メモリ化を図る必要がある。 A data stream (hereinafter also simply referred to as a “stream”) is a large amount of data flowing from a network at high speed. Stream mining is a technique for quickly finding useful information from a data stream expressed as a time series. Stream mining is not just a technique for analyzing large-scale data stored in a database, but a technique for analyzing and monitoring an increasing flow of data in real time. In order to analyze ever-increasing large-scale data and to provide information to users in real time, it is necessary to increase the speed and memory saving of stream mining technology.
ストリーム監視においては、シーケンスマッチング技術が必要とされる。シーケンスマッチングでは、2つのデータシーケンス間の類似度を距離値として表し、この距離値を用いて類似度を判断する。また、各データストリームのサンプリングレートが異なる場合や、データ送受信の周期が変化する場合があるが、これらに柔軟に対応するよう、タイムワーピングを考慮することが重要となる。このタイムワーピングを考慮する距離関数としては、ダイナミックタイムワーピング(DTW: Dynamic Time Warping)が広く用いられている。 In stream monitoring, a sequence matching technique is required. In sequence matching, the similarity between two data sequences is expressed as a distance value, and the similarity is determined using this distance value. In addition, the sampling rate of each data stream may be different or the data transmission / reception cycle may change. However, it is important to consider time warping so as to flexibly cope with these. As a distance function considering this time warping, dynamic time warping (DTW) is widely used.
DTWは、蓄積されたシーケンスに対して用いられる距離関数であり、2つのシーケンス間の距離を最小化するように時間軸方向に伸長を行い、各要素同士をマッチングさせた計算により距離値を求め、類似か否かを、距離値と閾値εによって判定する。この距離値はDTW距離と呼ばれ、最適にシーケンス長を調整した後の距離の合計値で表され、動的計画法に基づくマトリックス(タイムワーピング行列)によって計算される。DTW距離の値が小さいほど2つのシーケンスは類似度が高く、0の場合は完全に一致していることを意味する。 DTW is a distance function that is used for the stored sequence. The DTW is extended in the time axis direction so as to minimize the distance between the two sequences, and the distance value is obtained by calculation that matches each element. Whether or not they are similar is determined by the distance value and the threshold value ε. This distance value is called a DTW distance, is represented by the total value of the distance after optimally adjusting the sequence length, and is calculated by a matrix (time warping matrix) based on dynamic programming. The smaller the value of the DTW distance, the higher the similarity between the two sequences, and 0 means that they are completely matched.
図14はDTWの説明図である。図14(a)に示すように、2つのシーケンスX=(x1,x2,…,xn)とシーケンスY=(y1,y2,…,ym)とは、DTW距離を求める際、DTW距離が最小になるように対応付けがなされる。2つのシーケンスの長さが同じ場合でも異なる場合でも、DTWは各要素を適切に対応付けることができる。 FIG. 14 is an explanatory diagram of DTW. As shown in FIG. 14A, two sequences X = (x 1 , x 2 ,..., X n ) and sequence Y = (y 1 , y 2 ,..., Y m ) obtain a DTW distance. At this time, the association is performed so that the DTW distance is minimized. Whether the two sequences have the same length or different lengths, the DTW can associate each element appropriately.
図14(b)に示すように、DTW距離の計算に用いられるマトリックス(タイムワーピング行列)において、2つのシーケンス間で対応付けられたその組み合わせ(集合)はタイムワーピングパスと呼ばれ、ここでは色付け(黒塗り)されたセルとして示している。 As shown in FIG. 14B, in the matrix (time warping matrix) used for calculating the DTW distance, the combination (set) associated between the two sequences is called a time warping path. It is shown as a (blacked) cell.
DTWについて、図15を用いてさらに説明する。図15は、DTWによるタイムワーピング行列を例示した図である。図15において、シーケンスYは、固定長m(ここでは4)のデータであり、シーケンスの類似判断の元となるデータである。データストリームであるシーケンスXは、時々刻々と伸張している(データ量が増えている)シーケンスであり、シーケンスYに対する類似判断の対象となるデータである。 DTW will be further described with reference to FIG. FIG. 15 is a diagram illustrating a time warping matrix by DTW. In FIG. 15, a sequence Y is data of a fixed length m (4 in this case) and is data that is a source of sequence similarity determination. The sequence X, which is a data stream, is a sequence that is constantly expanding (the amount of data is increasing), and is data that is subjected to similarity determination with respect to the sequence Y.
DTW距離は、タイムワーピング行列に基づいて計算することができる。ここで、長さnのシーケンスX=(x1,x2,…,xn)と長さmのシーケンスY=(y1,y2,…,ym)において、これらのDTW距離D(X,Y)は以下のように定義される。なお、i=1,2,…,n、j=1,2,…,mとする。 The DTW distance can be calculated based on a time warping matrix. Here, the length n sequence X = (x 1, x 2 , ..., x n) and length sequence Y = (y 1, y 2 , ..., y m) of the m in, these DTW distance D ( X, Y) is defined as follows. Note that i = 1, 2,..., N, j = 1, 2,.
D(X,Y)=f(n,m) ・・・式(9)
f(i,j)=‖xi−yj‖+min{f(i,j−1),f(i−1,j),
f(i−1,j−1)} ・・・式(10)
f(0,0)=0 ・・・式(11)
f(i,0)=f(0,j)=∞ ・・・式(12)
D (X, Y) = f (n, m) (9)
f (i, j) = ‖x i −y j ‖ + min {f (i, j−1), f (i−1, j),
f (i-1, j-1)} Expression (10)
f (0,0) = 0 Expression (11)
f (i, 0) = f (0, j) = ∞ (12)
式(9)は、DTW距離の定義である。式(10)は、具体的な計算式である。式(10)において、‖xi−yj‖は、2つの数値(xiとyj)の距離を表すものであり、例えば、ユークリッド距離やマンハッタン距離(L1距離)などが挙げられる。n次元空間において、a、bという2つの点の座標をa(a1,a2,…,an)、b(b1,b2,…,bn)とし、また、(1≦k≦n)とすると、ユークリッド距離とは√(Σ(ak−bk)2)、マンハッタン距離とはΣ|ak−bk|で表される距離のことである。以下の具体例では、計算を容易にするために、‖xi−yj‖として、ユークリッド距離の二乗の値を使用する。なお、本発明は、ユークリッド距離の二乗の値を使用する場合に限定されず、他の距離を使用してもかまわない。 Equation (9) is a definition of the DTW distance. Formula (10) is a specific calculation formula. In the formula (10), ‖x i -y j ‖ is representative of the distance of the two numbers (x i and y j), for example, Euclidean distance or the Manhattan distance (L1 distance), and the like. In the n-dimensional space, the coordinates of two points a and b are a (a 1 , a 2 ,..., a n ), b (b 1 , b 2 ,..., b n ), and (1 ≦ k ≦ n), the Euclidean distance is √ (Σ (a k −b k ) 2 ), and the Manhattan distance is a distance represented by Σ | a k −b k |. In the following specific example, a square value of the Euclidean distance is used as ‖x i -y j ‖ for easy calculation. Note that the present invention is not limited to the case where the square value of the Euclidean distance is used, and other distances may be used.
式(10)において、min{f(i,j−1),f(i−1,j),f(i−1,j−1)}は、{}内の3つの値のうち、最小のものを採用する、という意味である。式(11)および式(12)は、これらの3つの値を計算する際に使用する、タイムワーピング行列における境界条件である。このDTW距離を用いたタイムワーピング行列によれば、シーケンスYと類似するシーケンXの部分シーケンスを検出することができる。 In equation (10), min {f (i, j-1), f (i-1, j), f (i-1, j-1)} is the smallest of the three values in {}. Means to adopt. Equations (11) and (12) are boundary conditions in the time warping matrix used when calculating these three values. According to the time warping matrix using this DTW distance, a partial sequence of sequence X similar to sequence Y can be detected.
例えば、シーケンスY=(11,6,9,4)と、シーケンスX=(12,6,10,6,5,1,…)のそれぞれとのDTW距離を計算すると、図15のタイムワーピング行列に示す値となる。ここで、図15のタイムワーピング行列のハッチング部分は、DTW距離「6」を計算するために辿ってきたルート(タイムワーピングパス)であり、このルートを辿ることで、DTW距離の計算の開始位置が分かる。つまり、このDTW距離の値が比較的小さいものが連なったタイムワーピングパスを見つけることで、シーケンスX=(12,6,10,6,5,1,…)から、シーケンスY=(11,6,9,4)に類似する部分シーケンス(ここでは部分シーケンス(12,6,10,6))を検出することができる。 For example, if the DTW distance between the sequence Y = (11, 6, 9, 4) and the sequence X = (12, 6, 10, 6, 5, 1,...) Is calculated, the time warping matrix of FIG. It becomes the value shown in. Here, the hatched portion of the time warping matrix in FIG. 15 is a route (time warping path) followed to calculate the DTW distance “6”, and the start position of the calculation of the DTW distance by following this route. I understand. That is, by finding a time warping path in which the DTW distance values are relatively small, a sequence Y = (11, 6) from the sequence X = (12, 6, 10, 6, 5, 1,...). , 9, 4) can be detected (partial sequence (12, 6, 10, 6) here).
このように、タイムワーピング行列は、DTWの関数の値(すなわち、式(10)におけるf(i,j)の値)を保持しており、これがDTWの基礎をなす。長さnのシーケンスXと長さmのシーケンスYの距離を求めようとすると、DTWはO(nm)の時間を要する。これは、DTWが2つのシーケンスのすべての要素を対応付けて計算を行うためであり、特に長いシーケンスを扱う場合には計算コストが著しく大きくなる。 Thus, the time warping matrix holds the value of the DTW function (that is, the value of f (i, j) in equation (10)), which forms the basis of DTW. When the distance between the sequence X having the length n and the sequence Y having the length m is to be obtained, the DTW requires a time of O (nm). This is because the DTW performs the calculation by associating all elements of the two sequences, and the calculation cost is significantly increased particularly when a long sequence is handled.
つまり、この従来の手法を用いる場合、データストリームから類似部分シーケンスを検出するとき、あらゆるパターンの部分シーケンスとの比較を行う必要があるので、時刻が経過してデータストリームのデータが到着するたびにタイムワーピング行列を追加していく必要がある。すなわち、図15ではタイムワーピング行列を1つしか図示していないが、同様のタイムワーピング行列を時間の経過とともに次々と追加する必要がある。そのため、データストリームの増加とともに計算量やメモリ使用量が増大するという問題があった。 In other words, when using this conventional method, when detecting a similar partial sequence from the data stream, it is necessary to compare with a partial sequence of any pattern, so every time data in the data stream arrives after the time has passed. It is necessary to add a time warping matrix. That is, FIG. 15 shows only one time warping matrix, but it is necessary to add similar time warping matrices one after another as time passes. Therefore, there has been a problem that the amount of calculation and the amount of memory used increase as the number of data streams increases.
また、DTWを用いたシーケンスマッチングのためのアルゴリズムは数多く提案されているが、その多くは事前に用意された問い合わせシーケンスに類似するシーケンスを検出するものである。非特許文献1および非特許文献2では、DTWを用いたシーケンスマッチングにおいて計算コスト削減のための手法が提案されている。しかし、これらの手法は蓄積されたデータ集合のための手法であり、ストリーム処理には適していない。
Many algorithms for sequence matching using DTW have been proposed, but many of them detect sequences similar to a query sequence prepared in advance. Non-Patent
また、DTWを用いたストリームのシーケンスマッチングについては、非特許文献3において、問い合わせシーケンスに類似する部分シーケンスを検出する手法が提案されている。しかし、このシーケンスマッチングのための従来手法は、用意された問い合わせシーケンスに類似する部分シーケンスを検出するものに過ぎない。
Regarding the sequence matching of streams using DTW, Non-Patent
一方、特定の問い合わせシーケンスを用意せず、増え続けるストリームの中から類似する部分シーケンスペアを検出し続ける技術も重要視されている。非特許文献4や非特許文献5は、リアルタイムでのストリーム監視に焦点をあて、ストリーム間の相関を検出する手法を提案している。しかし、これらは、時間軸方向の調節がない距離尺度を用いており、タイムワーピングに対応していない。
On the other hand, a technique that does not prepare a specific inquiry sequence and continues to detect similar partial sequence pairs from an ever-increasing stream is also regarded as important.
本発明が扱うのは、データストリームからの類似部分シーケンスペア検出問題であり、具体的には「2つのデータストリームが与えられたとき、類似する部分シーケンスペアを、DTWに準じた手法(DTWと同等の手法)で検出する」ことである。この問題について、図13を用いて説明する。図13は、類似部分シーケンスペアの検出に使用されるデータストリーム(シーケンス)の例である。 The present invention deals with the problem of detecting a similar partial sequence pair from a data stream. Specifically, “when two data streams are given, a similar partial sequence pair is converted into a method based on DTW (DTW and DTW). Equivalent method) ”. This problem will be described with reference to FIG. FIG. 13 is an example of a data stream (sequence) used for detecting similar partial sequence pairs.
図13の(a)と(b)に示すように、シーケンス#1は#11、#12、#14に、シーケンス#2は#22、#23に小さなスパイク(突出部)が存在するデータである。各スパイクの振幅はほぼ同じであるが、周期(時間幅)はそれぞれ異なっている。また、これらのシーケンスには3つの大きなスパイク(#13、#21、#24)が含まれており、これらについても周期は異なっている。
As shown in FIGS. 13A and 13B,
本発明が解決しようとする課題は、2つのシーケンス間の部分的な類似を見つけることである。例えば、部分シーケンスペア#11と#22、#11と#23、#13と#21、#13と#24は、シーケンス#1と#2の類似部分シーケンスペアである。これらのペアの周期は異なっているため、タイムワーピングを考慮しない場合、的確に検出することが困難である。
The problem to be solved by the present invention is to find a partial similarity between two sequences. For example, partial
ここで、データストリームXは、時刻I=i1,i2,…,in,…で収集されるx1,x2,…,xn,…の値からなる半無限長のシーケンスとして表記できる。xnはinにおける最新のデータであり、時間の経過と共にnは増加する。X[is:ie]をisからieまでの部分シーケンスであるとする。同様に、Yは、y1,y2,…,ymの値からなるシーケンスであり、Y[js:je]をjsからjeまでの部分シーケンスであるとする。例えば、シーケンス#1をデータストリームX、シーケンス#2をデータストリームYとすると、部分シーケンス#11はX[1155:2712]、#22はY[6111:8361]と表せる。このとき、類似部分シーケンスペア検出問題は、次のように定義される。
Here, the data stream X, the time I = i 1, i 2, ..., i n,
[類似部分シーケンスペア検出]
2つのデータストリームXとY、類似判定のための閾値ε、類似部分シーケンス長の下限値ζが与えられたとき、次の条件を満たす類似部分シーケンスペアX[is:ie]とY[js:je]を検出する。
1. X[is:ie]とY[js:je]の平均距離値はε以下である。
2. X[is:ie]とY[js:je]のシーケンス長はいずれもζ以上である。
ここで、平均距離値とは部分シーケンスX[is:ie]とY[js:je]の1要素あたりの距離値を意味し、X[is:ie]とY[js:je]の距離値/(X[is:ie]とY[js:je]のタイムワーピングパス長)により求めるものとする。
[Similar partial sequence pair detection]
Given two data streams X and Y, a threshold value ε for similarity determination, and a lower limit value ζ of similar partial sequence lengths, similar partial sequence pairs X [i s : i e ] and Y [ j s : j e ] is detected.
1. The average distance value between X [i s : i e ] and Y [j s : j e ] is ε or less.
2. The sequence lengths of X [i s : i e ] and Y [j s : j e ] are both ζ or more.
Here, the average distance value means a distance value per element of the partial sequences X [i s : i e ] and Y [j s : j e ], and X [i s : i e ] and Y [j The distance value of s : j e ] / (time warping path length of X [i s : i e ] and Y [j s : j e ]).
閾値εおよび類似部分シーケンス長の下限値ζはユーザにより指定(設定)され、これらの条件に基づいて類似部分シーケンスペアが検出される。 The threshold value ε and the lower limit value ζ of the similar partial sequence length are designated (set) by the user, and a similar partial sequence pair is detected based on these conditions.
この問題を従来技術であるDTWを用いて解決することを考える。DTWを用いてデータストリームから類似部分シーケンスペアX[is:ie]とY[js:je]を検出する場合、O(nm)個のマトリックスを必要とする。これは、1≦is≦n−ζ+1,1≦js≦m−ζ+1の範囲で変化する各開始点から始まるマトリックスを作成する必要があるためである。これが、従来の一般的な方法である。本明細書ではこの方法をナイーブな手法と呼ぶ。
Consider solving this problem using DTW, which is the prior art. When detecting similar partial sequence pairs X [i s : i e ] and Y [j s : j e ] from the data stream using DTW, O (nm) matrices are required. This is because it is necessary to create a matrix starting from each starting point that varies in the range of 1 ≦ i s ≦ n−ζ + 1 and 1 ≦ j s ≦ m−
i,j番目のマトリックス(すなわち、時刻iと時刻jから始まるマトリックス)において、要素(k,l)の距離をdi,j(k,l)とする。ナイーブな手法では、XとYの部分シーケンスマッチングの距離は以下のように求められる。なお、i=1,2,…,n、k=1,2,…,n−i+1、j=1,2,…,m、l=1,2,…,m−j+1である。 In the i, j-th matrix (that is, the matrix starting from time i and time j), let the distance of element (k, l) be d i, j (k, l). In the naive method, the partial sequence matching distance between X and Y is obtained as follows. Note that i = 1, 2,..., N, k = 1, 2,..., N−i + 1, j = 1, 2,.
D(X[is:ie],Y[js:je])=dis,js(ie−is+1,je−js+1) ・・・式(13)
di,j(k,l)=‖xi+k−1−yj+l−1‖+min{di,j(k,l−1),di,j(k−1,l),di,j(k−1,l−1)} ・・・式(14)
di,j(0,0)=0 ・・・式(15)
di,j(k,0)=di,j(0,l)=∞ ・・・式(16)
D (X [i s: i e], Y [j s: j e]) = d is, js (i e -i s + 1, j e -j s +1) ··· formula (13)
d i, j (k, l) = ‖x i + k−1 −y j + l−1 ‖ + min {d i, j (k, l−1), d i, j (k−1, l), d i, j (k-1, l-1)} Expression (14)
d i, j (0,0) = 0 Expression (15)
d i, j (k, 0) = d i, j (0, l) = ∞ (16)
また、X[is:ie]とY[js:je]の類似度を評価するための平均距離d’は、次のように求められる。なお、Wは部分シーケンスX[is:ie]と部分シーケンスY[js:je]とのタイムワーピングパスの長さである。
d’=di,j(k,l)/W ・・・式(17)
Further, the average distance d ′ for evaluating the similarity between X [i s : i e ] and Y [j s : j e ] is obtained as follows. W is the length of the time warping path between the partial sequence X [i s : i e ] and the partial sequence Y [j s : j e ].
d ′ = d i, j (k, l) / W (17)
しかしながら、DTWは固定長の問い合わせシーケンスに類似するシーケンスを検出するためのシーケンスマッチング手法であるため、この手法を使用すると、計算に必要となるマトリックスの数が時間の経過とともに増加する。そのため、毎時刻に更新する必要のある値はO(nm2)またはO(n2m)となり(マトリックスの数がO(nm)なので)、計算量やメモリ使用量が大幅に増加するという問題がある。 However, since DTW is a sequence matching technique for detecting a sequence similar to a fixed-length query sequence, the use of this technique increases the number of matrices required for calculation. Therefore, the value that needs to be updated every hour is O (nm 2 ) or O (n 2 m) (since the number of matrices is O (nm)), and the amount of calculation and memory usage increase significantly. There is.
本発明は、前記問題に鑑みてなされたものであり、2つのデータストリームから類似する部分シーケンスのペアを検出するときの計算量やメモリ使用量の増加を抑制することを課題とする。 The present invention has been made in view of the above problems, and an object of the present invention is to suppress an increase in the amount of calculation and memory usage when detecting a pair of similar partial sequences from two data streams.
前記した課題を解決するため、本発明は、2つのデータストリームから、類似する部分シーケンスのペアを、2つの前記部分シーケンス同士の類似度スコアを示すタイムワーピング行列を用いて検出する類似部分シーケンス検出装置による類似部分シーケンス検出方法であって、前記類似部分シーケンス検出装置は、前記タイムワーピング行列を記憶する記憶部と、処理部と、を備えており、前記処理部は、前記2つのデータストリームのうちいずれかのデータストリームのデータの1つの要素を受信したとき、当該要素を含む前記データストリーム中の部分シーケンスと、他方の前記データストリーム中の部分シーケンスと、の類似度スコアを算出し、前記算出した類似度スコアと、その類似度スコアの算出に用いた2つの前記部分シーケンスの開始位置および終了位置と、を対応付けて前記記憶部の前記タイムワーピング行列に記憶し、前記記憶部のタイムワーピング行列に記憶された前記類似度スコアを用いて、類似する部分シーケンスのペアを検出して出力することを特徴とする。 In order to solve the above-described problem, the present invention detects a similar partial sequence detection from two data streams using a time warping matrix indicating a similarity score between the two partial sequences. A similar partial sequence detection method by an apparatus, wherein the similar partial sequence detection device includes a storage unit that stores the time warping matrix, and a processing unit, wherein the processing unit is configured to store the two data streams. When one element of data of any one of the data streams is received, a similarity score between the partial sequence in the data stream including the element and the partial sequence in the other data stream is calculated, The calculated similarity score and the two partial sequences used to calculate the similarity score A pair of similar partial sequences using the similarity score stored in the time warping matrix of the storage unit in association with the start position and the end position of the storage unit stored in the time warping matrix of the storage unit Is detected and output.
かかる発明によれば、2つのデータストリームから類似する部分シーケンスのペアを検出するとき、用いるタイムワーピング行列が単一で済むので、計算量やメモリ使用量の増加を抑制することができる。 According to this invention, when detecting a pair of similar partial sequences from two data streams, since only a single time warping matrix is used, an increase in calculation amount and memory usage can be suppressed.
また、本発明は、前記処理部が、前記2つのデータストリームの部分シーケンス同士の前記類似度スコアを算出するとき、2つの部分シーケンスX[is:ie]とY[js:je]との類似度スコアS(X[is:ie],Y[js:je])を、以下の式(1)〜式(5)により算出し、
S(X[is:ie],Y[js:je])=s(ie,je) ・・・式(1)
s(i,j)=max{0,2ε−‖xi−yj‖+sbest} ・・・式(2)
sbest=max{s(i,j−1),s(i−1,j),s(i−1,j−1)}
・・・式(3)
s(i,0)=0 ・・・式(4)
s(0,j)=0 ・・・式(5)
前記タイムワーピング行列に記憶する前記部分シーケンスX[is:ie]の開始位置isと、前記部分シーケンスY[js:je]の開始位置jsとを示すp(i,j)を、以下の式(7)により算出し、
p(i,j)={p(i,j−1) (if sbest=s(i,j−1)),
p(i−1,j) (if sbest=s(i−1,j)),
p(i−1,j−1)(if sbest=s(i−1,j−1)),
(i,j) (if sbest=0)} ・・・式(7)
前記開始位置is,jsを、以下の式(8)により算出することが望ましい。
(is,js)=p(ie,je) ・・・式(8)
ただし、i=1,2,…,n、j=1,2,…,m、‖xi−yj‖はxiとyjとの間の距離を示す。
Further, according to the present invention, when the processing unit calculates the similarity score between the partial sequences of the two data streams, the two partial sequences X [i s : i e ] and Y [j s : j e ] Similarity score S (X [i s : i e ], Y [j s : j e ]) is calculated by the following equations (1) to (5),
S (X [i s : i e ], Y [j s : j e ]) = s (i e , j e ) (1)
s (i, j) = max {0, 2ε−‖x i −y j ‖ + s best } Expression (2)
s best = max {s (i, j-1), s (i-1, j), s (i-1, j-1)}
... Formula (3)
s (i, 0) = 0 Formula (4)
s (0, j) = 0 Formula (5)
The partial sequence X stored in the time warping matrix [i s: i e] and the start position i s of the partial sequence Y: p indicating the start position j s of [j s j e] (i , j) Is calculated by the following equation (7),
p (i, j) = {p (i, j-1) (if s best = s (i, j-1)),
p (i-1, j) (if s best = s (i-1, j)),
p (i-1, j-1) (if s best = s (i-1, j-1)),
(I, j) (if s best = 0)} (7)
It is desirable to calculate the start position i s , j s by the following equation (8).
(I s , j s ) = p (i e , j e ) (8)
However, i = 1,2, ..., shown n, j = 1,2, ..., m, the distance between the ‖x i -y j ‖ the x i and y j.
かかる発明によれば、類似度スコアを具体的に適切に算出し、その類似度スコアと、その類似度スコアの算出に用いた2つの前記部分シーケンスの開始位置および終了位置と、を対応付けて前記タイムワーピング行列に記憶することができる。 According to this invention, the similarity score is specifically calculated appropriately, and the similarity score is associated with the start position and the end position of the two partial sequences used for the calculation of the similarity score. It can be stored in the time warping matrix.
また、本発明は、前記処理部が、前記記憶部のタイムワーピング行列に記憶された前記類似度スコアを用いて、類似する部分シーケンスのペアを検出して出力する場合、
類似度スコアの平均値s’を、以下の式(6)により算出し、
s’=s(i,j)/W ・・・式(6)
前記算出した類似度スコアの平均値s’が所定の閾値ε以上であり、かつ、前記類似度スコアの算出に使用した2つの部分シーケンスの長さがいずれも所定の長さζ以上であるとき、それらの2つの前記部分シーケンスを、類似する部分シーケンスのペアとして検出して出力することが望ましい。
ただし、Wは部分シーケンスX[is:ie]と部分シーケンスY[js:je]とのタイムワーピングパスの長さを示す。
In the present invention, when the processing unit detects and outputs a pair of similar partial sequences using the similarity score stored in the time warping matrix of the storage unit,
The average value s ′ of the similarity score is calculated by the following equation (6),
s ′ = s (i, j) / W (6)
When the average value s ′ of the calculated similarity score is equal to or greater than a predetermined threshold ε, and the lengths of the two partial sequences used for calculating the similarity score are both equal to or greater than the predetermined length ζ It is desirable to detect and output these two partial sequences as pairs of similar partial sequences.
Here, W indicates the length of the time warping path between the partial sequence X [i s : i e ] and the partial sequence Y [j s : j e ].
かかる発明によれば、類似度スコアをその対応するタイムワーピングパスの長さで除算した平均値を用いることで、類似する部分シーケンスのペアをより正確に検出することができる。 According to this invention, a pair of similar partial sequences can be detected more accurately by using the average value obtained by dividing the similarity score by the length of the corresponding time warping path.
また、本発明は、前記処理部が、前記算出した類似度スコアの平均値s’が所定の閾値ε以上であり、かつ、前記算出に使用した2つの部分シーケンスの長さがいずれも所定の長さζ以上である場合、当該2つの部分シーケンスを、類似部分シーケンスペア候補として前記記憶部に記憶し、前記記憶部に記憶された前記類似部分シーケンスペア候補のうち、前記タイムワーピングパスの少なくとも一部に重複しているものがあるとき、前記重複している類似部分シーケンスペア候補の中から、前記タイムワーピングパスが最長の類似部分シーケンスペア候補を選択し、当該選択した類似部分シーケンスペア候補である2つの前記部分シーケンスを、類似する部分シーケンスのペアとして出力することが望ましい。 Further, according to the present invention, the processing unit has an average value s ′ of the calculated similarity score that is equal to or greater than a predetermined threshold value ε, and the lengths of the two partial sequences used for the calculation are both predetermined. If the length ζ is greater than or equal to ζ, the two partial sequences are stored in the storage unit as similar partial sequence pair candidates, and among the similar partial sequence pair candidates stored in the storage unit, at least the time warping path When there is an overlapping part, the similar partial sequence pair candidate with the longest time warping path is selected from the overlapping similar partial sequence pair candidates, and the selected similar partial sequence pair candidate is selected. It is desirable to output the two partial sequences that are as pairs of similar partial sequences.
かかる発明によれば、タイムワーピングパスの少なくとも一部が重複する類似部分シーケンスペアが複数あった場合、その中でタイムワーピングパスが最長の類似部分シーケンスペアを出力するので、ユーザに対して、冗長な情報を与えることなく、より有益な情報を提供できる。 According to this invention, when there are a plurality of similar partial sequence pairs in which at least a part of the time warping path overlaps, the similar partial sequence pair with the longest time warping path among them is output, so that redundancy is provided to the user. It is possible to provide more useful information without giving unnecessary information.
また、本発明は、類似部分シーケンス検出方法をコンピュータに実行させることを特徴とする類似部分シーケンス検出プログラムである。このようなプログラムによれば、類似部分シーケンス検出方法を一般的なコンピュータに実行させることができる。 The present invention also provides a similar partial sequence detection program which causes a computer to execute a similar partial sequence detection method. According to such a program, it is possible to cause a general computer to execute the similar partial sequence detection method.
本発明によれば、2つのデータストリームから類似する部分シーケンスのペアを検出するときの計算量やメモリ使用量の増加を抑制することができる。 According to the present invention, it is possible to suppress an increase in calculation amount and memory usage when detecting a pair of similar partial sequences from two data streams.
以下、本発明を実施するための最良の形態(以下、実施形態という)を、第1実施形態および第2実施形態に分けて説明する。また、その後で、3つの実験結果について説明する。 Hereinafter, the best mode for carrying out the present invention (hereinafter referred to as an embodiment) will be described by dividing it into a first embodiment and a second embodiment. Thereafter, three experimental results will be described.
≪第1実施形態≫
図1は、第1実施形態の類似部分シーケンス検出装置の構成図である。類似部分シーケンス検出装置1は、コンピュータ装置であり、入力部11、処理部12、記憶部13および出力部14を備える。
<< First Embodiment >>
FIG. 1 is a configuration diagram of a similar partial sequence detection apparatus according to the first embodiment. The similar partial
入力部11は、外部装置(不図示)やセンサ(不図示)からインターネットやLAN(Local Area Network)経由でデータストリームの入力を受け付けたり、キーボードやマウス等の入力装置(不図示)から類似部分シーケンスペア(以下、単に「類似部分シーケンス」ともいう。)の検出のための類似部分シーケンス検出条件の入力を受け付けたりする。この類似部分シーケンス検出条件は、例えば、データストリームから類似部分シーケンスを検出するときの部分シーケンス長の下限値ζ、類似度スコアの平均値の閾値ε等(詳細は後記)である。この入力部11は、インターネットやLAN経由でデータの送受信を行うための通信インタフェースや、入力装置等の外部装置との各種データの入出力を行うための入出力インタフェースにより実現される。
The
このような入力部11は、2つのデータストリームから類似部分シーケンスを検出するときに用いる類似部分シーケンス検出条件の入力を受け付ける検出条件入力部111と、データストリームの入力を受け付けるデータストリーム入力部112とを含んで構成される。
Such an
処理部12は、2つのデータストリームから類似部分シーケンスペアを検出するための各種演算処理を行うものであり、例えば、CPU(Central Processing Unit)が記憶部13のプログラムを実行することで実現される。この処理部12は、データストリーム処理部121を備え、データストリーム入力部112で受信したデータストリームに関して、記憶部13のタイムワーピングデータ記憶部132のタイムワーピング行列(マトリックス)を用いて、類似部分シーケンスペアを検出し、出力部14の類似部分シーケンス出力部141(後記)経由で外部へ出力する。なお、このデータストリーム処理部121は、2つのデータストリームから部分シーケンス同士の類似度スコアの平均値を計算するとき、スコアリング関数を用いる。
The
スコアリング関数は、類似部分シーケンスペアを検出するための類似判定手段である。部分シーケンス間の類似度は、2つのシーケンス間の各要素同士をマッチングするために時間軸方向に最適に伸長を行った後、スコアとして算出される。スコアリング関数はDTWと同様、動的計画法に基づくアプローチであるが、次の2つの点でDTWと異なる。 The scoring function is similarity determination means for detecting similar partial sequence pairs. The degree of similarity between partial sequences is calculated as a score after optimal expansion in the time axis direction in order to match each element between two sequences. Similar to DTW, the scoring function is an approach based on dynamic programming, but differs from DTW in the following two points.
1つ目は、累積スコアの最大値を用いて類似部分シーケンスペアを求めることである。一方、DTWは、累積距離の最小値を用いて類似部分シーケンスペアを求める。 The first is to obtain a similar partial sequence pair using the maximum value of the cumulative score. On the other hand, the DTW obtains a similar partial sequence pair using the minimum cumulative distance.
2つ目は、スコアリング関数のための“zero-resetting”を導入したことである。これは、もしマトリックスの累積スコアs(i,j)が負の値となった場合、この値を0(ゼロ)で置き換えること意味する。このアプローチは、バイオインフォマティックスの分野で提案されており、Smith-Watermanアルゴリズムなどに実装されている。バイオインフォマティックス分野におけるシーケンスは記号シーケンスを対象としているが、本実施形態でのスコアリング関数は数値シーケンスを対象としている点で異なる。 The second is the introduction of “zero-resetting” for scoring functions. This means that if the cumulative score s (i, j) of the matrix becomes a negative value, this value is replaced with 0 (zero). This approach has been proposed in the field of bioinformatics and is implemented in the Smith-Waterman algorithm and the like. The sequence in the bioinformatics field is intended for symbol sequences, but the scoring function in this embodiment is different in that it is intended for numerical sequences.
スコアを0で置き換えることは、終了点(i,j)における部分シーケンスXとYが、もはや類似部分シーケンス検出の定義を満たしていない、すなわち、全く類似していないことを意味する。そのため、0が連続する区間では、この区間の部分シーケンスペアが全く類似していないことを表す。“zero-resetting”により、部分シーケンスペアX[is:ie](長さはLx)とY[js:je](長さはLy)の間の類似度を評価することができる。 Replacing the score with 0 means that the partial sequences X and Y at the end point (i, j) no longer meet the definition of similar partial sequence detection, i.e. are not at all similar. Therefore, in the section where 0 continues, the partial sequence pairs in this section are not similar at all. Assess the similarity between the partial sequence pair X [i s : i e ] (length is L x ) and Y [j s : j e ] (length is L y ) by “zero-resetting” Can do.
以下、スコアリング関数等について、さらに具体的に説明する。スコアリング関数は、一方のデータストリームX=(x1,x2,…,xn,…)と、他方のデータストリームY=(y1,y2,…,ym,…)との類似度スコアの平均値を計算するための関数である。データストリーム処理部121は、いずれかのデータストリームのデータが1つ到着するたびに、このスコアリング関数により、データストリームXの部分シーケンスX[is:ie]と、データストリームYの部分シーケンスY[js:je]の類似度スコアを計算(算出)する。
Hereinafter, the scoring function and the like will be described more specifically. The scoring function is similar to one data stream X = (x 1 , x 2 ,..., X n ,...) And the other data stream Y = (y 1 , y 2 ,..., Y m ,. It is a function for calculating the average value of the degree score. The data
なお、このスコアリング関数により計算される類似度スコアは、式(1)〜式(5)に示すように、類似度が高ければ加算され、類似度が低ければ減算される仕組みになっており、類似度スコアが閾値ε以上となる部分シーケンス同士が、類似する部分シーケンス同士であることを意味する。この類似度スコアは、データストリーム処理部121が、タイムワーピング行列(図3〜図6参照)を用いて、部分シーケンスXと部分シーケンスYの各要素同士を対応させて計算する。
The similarity score calculated by this scoring function is added when the similarity is high and subtracted when the similarity is low, as shown in equations (1) to (5). This means that partial sequences having a similarity score equal to or greater than the threshold ε are similar partial sequences. The similarity score is calculated by the data
2つの前記部分シーケンスX[is:ie]とY[js:je]との類似度スコアS(X[is:ie],Y[js:je])は、以下の式(1)〜式(5)により算出される。なお、i=1,2,…,n、j=1,2,…,mとする。 The similarity score S (X [i s : i e ], Y [j s : j e ]) between the two partial sequences X [i s : i e ] and Y [j s : j e ] is (1) to (5). Note that i = 1, 2,..., N, j = 1, 2,.
S(X[is:ie],Y[js:je])=s(ie,je) ・・・式(1)
s(i,j)=max{0,2ε−‖xi−yj‖+sbest} ・・・式(2)
sbest=max{s(i,j−1),s(i−1,j),s(i−1,j−1)}
・・・式(3)
s(i,0)=0 ・・・式(4)
s(0,j)=0 ・・・式(5)
S (X [i s : i e ], Y [j s : j e ]) = s (i e , j e ) (1)
s (i, j) = max {0, 2ε−‖x i −y j ‖ + s best } Expression (2)
s best = max {s (i, j-1), s (i-1, j), s (i-1, j-1)}
... Formula (3)
s (i, 0) = 0 Formula (4)
s (0, j) = 0 Formula (5)
また、前記類似度スコアの平均値s’は、以下の式(6)により算出される。
s’=s(i,j)/W ・・・式(6)
Further, the average value s ′ of the similarity score is calculated by the following equation (6).
s ′ = s (i, j) / W (6)
ここで、εは、類似判定のための閾値である。式(1)は、類似度スコアの定義である。式(2)は、具体的な計算式である。式(2)において、‖xi−yj‖は、2つの数値(xiとyj)の距離を表すものであり、例えば、ユークリッド距離やマンハッタン距離(L1距離)などが挙げられるが、ここでは、ユークリッド距離の二乗の値を使用する。 Here, ε is a threshold value for similarity determination. Formula (1) is the definition of the similarity score. Formula (2) is a specific calculation formula. In Expression (2), ‖x i −y j ‖ represents a distance between two numerical values (x i and y j ), and examples thereof include a Euclidean distance and a Manhattan distance (L1 distance). Here, the square value of the Euclidean distance is used.
式(2),(3)におけるmax{}は、{}内の値のうち、最大のものを採用する、という意味である。なお、式(4)および式(5)は、タイムワーピング行列における境界条件である。また、Wは部分シーケンスX[is:ie]と部分シーケンスY[js:je]とのタイムワーピングパスの長さを示す。この類似度スコアを用いたタイムワーピング行列および類似度スコアの平均値s’を使用することで、シーケンスXとシーケンYにおける類似部分シーケンスのペアをより正確に検出することができる(詳細は後記)。 In formulas (2) and (3), max {} means that the maximum value among the values in {} is adopted. Expressions (4) and (5) are boundary conditions in the time warping matrix. W represents the length of the time warping path between the partial sequence X [i s : i e ] and the partial sequence Y [j s : j e ]. By using the time warping matrix using the similarity score and the average value s ′ of the similarity score, a pair of similar partial sequences in sequence X and sequence Y can be detected more accurately (details will be described later). .
なお、式(2)に示すように、s(i,j)を計算する場合において、「2ε−‖xi−yj‖+sbest」の値が0より小さくなったときには、s(i,j)=0とする。このようにすることで、類似度スコアが0より小さくなった場合でも、それ以降の部分シーケンスの類似度スコアに影響を与えないようにすることができる。つまり、類似度スコアのより高い部分シーケンス同士のつながりを反映した類似度スコアの計算を行うことができる。 As shown in the equation (2), when s (i, j) is calculated, when the value of “2ε−‖x i −y j ‖ + s best ” becomes smaller than 0, s (i, j j) = 0. By doing in this way, even when the similarity score becomes smaller than 0, it is possible to prevent the similarity score of the subsequent partial sequences from being affected. That is, it is possible to calculate a similarity score that reflects the connection between partial sequences having higher similarity scores.
また、タイムワーピング行列に記憶させる部分シーケンスX[is:ie]の開始位置isと、前記部分シーケンスY[js:je]の開始位置jsとを示すp(i,j)は、以下の式(7)により算出することができる。 The time warping matrix subsequence X to store [i s: i e] and the start position i s of the partial sequence Y: p showing the [j s j e] start position j s (i, j) Can be calculated by the following equation (7).
p(i,j)={p(i,j−1) (if sbest=s(i,j−1)),
p(i−1,j) (if sbest=s(i−1,j)),
p(i−1,j−1)(if sbest=s(i−1,j−1)),
(i,j) (if sbest=0)} ・・・式(7)
p (i, j) = {p (i, j-1) (if s best = s (i, j-1)),
p (i-1, j) (if s best = s (i-1, j)),
p (i-1, j-1) (if s best = s (i-1, j-1)),
(I, j) (if s best = 0)} (7)
そして、開始位置is,jsは、以下の式(8)により算出することができる。
(is,js)=p(ie,je) ・・・式(8)
Then, the start position i s , j s can be calculated by the following equation (8).
(I s , j s ) = p (i e , j e ) (8)
つまり、このタイムワーピング行列は、各要素に類似度スコアと、その類似度スコアの算出に用いた部分シーケンスX,Yの開始位置を保持することで、該当するタイムワーピングパスの開始位置を、過去に遡ることなく(過去のデータを保持することなく)認識することができる。 That is, this time warping matrix holds the similarity score for each element and the start positions of the partial sequences X and Y used to calculate the similarity score, so that the start position of the corresponding time warping path is stored in the past. Can be recognized without going back to the past (without holding past data).
記憶部13は、2つのデータストリームから類似部分シーケンス検出を行うための各種データを記憶する。この記憶部13は、例えば、RAM(Random Access Memory)と、HDD(Hard Disk Drive)とにより実現される。この記憶部13は、検出条件記憶部131と、タイムワーピングデータ記憶部132とを含んで構成される。なお、破線で示した類似部分シーケンス候補記憶部133については、別途、第2実施形態で説明する。
The
検出条件記憶部131は、類似部分シーケンス検出条件を記憶する。この類似部分シーケンス検出条件は、2つのデータストリームから類似部分シーケンスのペアを検出するときの部分シーケンス長の下限値ζ、類似度スコアの平均値の閾値ε等を示す情報である。
The detection
タイムワーピングデータ記憶部132は、前記したタイムワーピング行列(図3〜図6参照)を記憶する。このタイムワーピング行列が単一であることが、類似部分シーケンス検出装置1の特徴の1つである。すなわち、1つのタイムワーピング行列の使用で類似部分シーケンスペアを検出することができるので、多数のタイムワーピング行列を使用する場合に比較して、計算量やメモリ使用量の増加を大幅に抑制することができる。また、オリジナルのデータストリームを保持する必要がなく、メモリ使用量の増加をさらに抑制することができる。
The time warping
なお、図3〜図6では、受信したデータストリームのすべての要素のタイムワーピング行列を示しているが、このタイムワーピングデータ記憶部132に用意されるタイムワーピング行列は、外側(新しいデータ側)の2行2列分のデータ(図3のマトリックスではi=3,4、j=4,5の部分のデータ)があればよい。
3 to 6 show the time warping matrix of all elements of the received data stream, the time warping matrix prepared in the time warping
出力部14は、データストリーム処理部121で検出された類似部分シーケンスを出力する類似部分シーケンス出力部141を含んで構成される。この出力部14は、前記した通信インタフェースや、出力装置等の外部装置との各種データの入出力を行うための入出力インタフェースにより実現される。
The
次に、類似部分シーケンス検出装置1の処理について説明する。図2は、第1実施形態の類似部分シーケンス検出装置1の処理を示すフローチャートである。ここでは、2つのデータストリームX(=x1,…,xi,…,xn,…)と、データストリームy(=y1,…,yj,…,ym,…)とにおける各要素が、順次与えられるものとする。
Next, processing of the similar partial
まず、データストリーム処理部121は、データストリーム入力部112経由で、時刻iにおいてデータxiを受信する(ステップS11)。
次に、データストリーム処理部121は、jの値を0にリセットする(ステップS12)。
First, the data
Next, the data
その後、データストリーム処理部121は、jの値をインクリメント(1増加)させながら、jの値がmになるまで、ステップS13〜S16の処理を繰り返す。
Thereafter, the data
ステップS13において、データストリーム処理部121は、xiとyjの類似度スコアs(i,j)、類似度スコアの平均値s’、および、開始位置p(i,j)を、前記式(1)〜(7)を用いて計算する。
In step S13, the data
ステップS14において、データストリーム処理部121は、s’≧εかつLx≧ζかつLy≧ζの条件を満たすか否か、つまり、類似度スコアの平均値s’が所定の閾値ε以上であり、かつ、その類似度スコアs(i,j)の算出に使用した2つの部分シーケンスの長さがいずれも所定の長さζ以上であるか否か、判断する。
In step S14, the data
ステップS14でYesのとき、ステップS15において、データストリーム処理部121は、(is,js)にp(ie,je)、ieにi、jeにj、の値をそれぞれ代入する。
When Yes in step S14, in step S15, the data
ステップS16において、データストリーム処理部121は、is,ie,js, je,s’の値を、類似部分シーケンス出力部141経由でユーザに対して出力する。
In step S < b > 16, the data
ステップS14でNoのとき、ステップS15およびステップS16をスキップする。 When No in step S14, step S15 and step S16 are skipped.
データストリーム処理部121は、データストリーム入力部112経由で、時刻jにおいてデータyjを受信した場合(ステップS21)、ステップS12〜ステップS16の処理と同様にして、ステップS22〜ステップS26の処理を行う。
When the data
ステップS13〜S16の処理の後、あるいは、ステップS23〜S26の処理の後、データストリーム処理部121は、2つのデータストリームの受信が終了したか否か判断する(ステップS31)。データストリーム処理部121は、終了していなければ(ステップS31でNo)ステップS11あるいはステップS21に戻り、終了していれば(ステップS31でYes)処理を終了する。
After the processes of steps S13 to S16 or after the processes of steps S23 to S26, the data
次に、この図2のフローチャートの処理の具体例について説明する。図3〜図6は、その具体例の説明図である。この具体例では、2つのデータストリームX=(5,12,6,10,6,5,1)、y=(11,6,9,4,13,8,5)について、ε=3、ζ=4の条件の下、類似部分シーケンスペアを検出することを想定する。なお、前記したように、マトリックス(タイムワーピング行列)は、各要素(セル)に、類似度スコアと、その類似度スコアの算出に用いた部分シーケンスX,Yの開始位置を保持するものであるが、以下では、説明を容易にするために、各要素(セル)に、類似度スコアの平均値と前記開始位置を保持するものとして説明する。 Next, a specific example of the processing of the flowchart of FIG. 2 will be described. 3-6 is explanatory drawing of the specific example. In this example, for two data streams X = (5, 12, 6, 10, 6, 5, 1), y = (11, 6, 9, 4, 13, 8, 5), ε = 3, Assume that similar partial sequence pairs are detected under the condition of ζ = 4. As described above, the matrix (time warping matrix) holds, for each element (cell), the similarity score and the start positions of the partial sequences X and Y used to calculate the similarity score. However, in the following, for ease of explanation, each element (cell) is assumed to hold the average value of the similarity score and the start position.
データストリームXまたはYの1つの要素が到着した時点で、類似部分シーケンス検出装置1による処理が実行される。まず、i=4,j=5の時点、つまり、X=(5,12,6,10)、y=(11,6,9,4,13)のデータをすでに受信した場合のマトリックスは図3のようになる。各セルには類似度スコアの平均値s’と、その算出の開始点p(i,j)の情報が保持されており、上段に類似度スコアの平均値s’を、下段に開始点情報を示している。例えば、セル(4,3)の類似度スコアの平均値s’は4であり、部分シーケンスX[2:4]とY[1:3]の類似度スコアの平均値であることを意味する。
When one element of the data stream X or Y arrives, processing by the similar partial
そして、時刻i=5においてx5=6が到着した場合、図2のステップS11〜S16の処理が実行され、図4の色付け(網掛け)されたセルの各値が計算される。図4はi=5,j=5の時点におけるマトリックスである。このとき、丸印で囲ったセル(5,4)において、平均スコアがε(=3)以上、長さがいずれもζ(=4)以上となる部分シーケンスX[2:5]、Y[1:4]のペアが類似部分シーケンスペアとして検出される。 When x 5 = 6 arrives at time i = 5, the processing in steps S11 to S16 in FIG. 2 is executed, and the values of the colored (shaded) cells in FIG. 4 are calculated. FIG. 4 is a matrix at the time point when i = 5 and j = 5. At this time, in the cells (5, 4) surrounded by the circles, the partial sequences X [2: 5], Y [whose average score is equal to or greater than ε (= 3) and whose length is equal to or greater than ζ (= 4). 1: 4] is detected as a similar partial sequence pair.
データストリームYの要素が到着した場合には、図2のステップS21〜S26の処理が実行される。データストリームXおよびYの各要素が到着した時点でこれらの処理が繰り返され、最終的なマトリックスは図5のようになる。図5はi=7,j=7の時点におけるマトリックスである(各数値の記載は省略)。図5に示すように、最終的に、丸印で囲った5つのセルに対応する部分シーケンスペアが類似部分シーケンスペアとして検出される。 When the element of the data stream Y arrives, the processing of steps S21 to S26 in FIG. 2 is executed. These processes are repeated when the elements of the data streams X and Y arrive, and the final matrix is as shown in FIG. FIG. 5 is a matrix at the time point of i = 7 and j = 7 (the description of each numerical value is omitted). As shown in FIG. 5, finally, partial sequence pairs corresponding to the five cells surrounded by circles are detected as similar partial sequence pairs.
ナイーブな手法では、類似部分シーケンスペアを検出するためにO(nm2+n2m)のメモリ量を使用し、単位時間あたりO(nm2)(Xの要素が到着した場合)またはO(n2m)(Yの要素が到着した場合)の距離値の更新が必要となる。一方、本実施形態では単一のマトリックスのみで類似部分シーケンスペアの検出が可能なため、O(m+n)のメモリ量を使用し、単位時間あたりO(m)(Xの要素が到着した場合)またはO(n)(Yの要素が到着した場合)の値しか更新しなくてよい。そのため、計算量(計算時間)やメモリ使用量の大幅な低減化を実現できる。 The naive approach uses a memory amount of O (nm 2 + n 2 m) to detect similar partial sequence pairs, and O (nm 2 ) (when an element of X arrives) or O (n 2 m) It is necessary to update the distance value (when the element Y arrives). On the other hand, in the present embodiment, similar partial sequence pairs can be detected using only a single matrix. Therefore, a memory amount of O (m + n) is used, and O (m) per unit time (when an element of X arrives) Alternatively, only the value of O (n) (when the element Y arrives) needs to be updated. Therefore, it is possible to achieve a significant reduction in the calculation amount (calculation time) and memory usage.
≪第2実施形態≫
次に、第2実施形態について説明する。前記した第1実施形態の類似部分シーケンス検出装置1によれば、類似部分シーケンスペア検出により出力される類似部分シーケンスペアには、タイムワーピングパスの少なくとも一部が重複するものも含まれる。例えば、図5で検出される類似部分シーケンスペアは、X[1:5]とY[4:7]のペア、X[1:6]とY[4:7]のペア、X[2:5]とY[1:4]のペア、X[2:6]とY[1:4]のペア、X[2:7]とY[1:4]のペアの5つであり、これらのタイムワーピングパスは図6のようになる。図6は、図5で検出される類似部分シーケンスペアのタイムワーピングパスを示す図である。
<< Second Embodiment >>
Next, a second embodiment will be described. According to the similar partial
前記したように、タイムワーピングパスとは、2つの部分シーケンスのどの要素同士がマッチングしているのかを示すものである。図6から確認できるように、5つのシーケンスペアは大きく2つのグループに分類できる、すなわち、5つのタイムワーピングパスは異なる2つのグループに分類することができる。そこで、第2実施形態の類似部分シーケンス検出装置1では、タイムワーピングパスが重複する複数の類似部分シーケンスペアから、タイムワーピングパスが最長の類似部分シーケンスペアを1つ選択して検出する。ユーザヘの報知(データ出力)はその選択されたタイムワーピングパスが最長の類似部分シーケンスペアのみとすることにより、ユーザが重複する情報を受け取る事態を回避できる。図5の例では、X[1:6],Y[4:7]のペア、および、X[2:7],Y[1:4]のペアが、出力されるタイムワーピングパスが最長の類似部分シーケンスペアとなる。
As described above, the time warping path indicates which elements of the two partial sequences are matched with each other. As can be seen from FIG. 6, the five sequence pairs can be broadly classified into two groups, that is, the five time warping paths can be classified into two different groups. Therefore, the similar partial
第2実施形態の類似部分シーケンス検出装置1について、第1実施形態の場合との相違点を中心に説明する。第2実施形態の類似部分シーケンス検出装置1は、タイムワーピングパスの少なくとも一部が重複する複数の類似部分シーケンスペアから、最長の類似部分シーケンスペアを1つ選択して検出することを特徴とする。以下の説明において、前記した第1実施形態と同様の構成要素には同じ符号を付して、説明を省略する。
The similar partial
類似部分シーケンス検出装置1は、図1に示すように、記憶部13に類似部分シーケンス候補記憶部133を備える。この類似部分シーケンス候補記憶部133は、s’≧εかつLx≧ζかつLy≧ζの条件を満たす類似部分シーケンスペアの情報を1つ以上記録(蓄積)する。
As illustrated in FIG. 1, the similar partial
このような類似部分シーケンス検出装置1の処理手順を、図7を用いて説明する。図7は、第2実施形態の類似部分シーケンス検出装置の処理を示すフローチャートである。
The processing procedure of such a similar partial
データストリーム処理部121は、ステップS15の後、is,ie,js, je,s’の値を類似部分シーケンスペアの候補として、記憶部13の類似部分シーケンス候補記憶部133に記憶させる(ステップS17)。ステップS27についても同様である。
After step S15, the data
データストリーム処理部121は、ステップS13〜S17のループの後、あるいは、ステップS23〜S27のループの後、タイムワーピングパスの少なくとも一部が重複する複数の類似部分シーケンスペアのうち、タイムワーピングパスが最長となる類似部分シーケンスペアが決定したか否か判断する(ステップS41)。この判断は、タイムワーピング行列(マトリックス)の各セルの開始位置の情報を使用することで実行できる。つまり、例えば、タイムワーピングパスの少なくとも一部が重複する類似部分シーケンスペアが複数あった場合、マトリックスにおいて逐次更新するすべてのセルの開始位置の情報がそれらの複数の類似部分シーケンスペアのタイムワーピングパスの終了位置よりも後ろになっていれば、重複する類似部分シーケンスペアはもうそれ以上ないことになる。
After the loop of steps S13 to S17 or the loop of steps S23 to S27, the data
ステップS41でYesのとき、データストリーム処理部121は、タイムワーピングパスが最長となる類似部分シーケンスペアを類似部分シーケンス出力部141経由でユーザに対して出力(ステップS42)し、ステップS31に移る。
When Yes in step S41, the data
このようにして、第2実施形態の類似部分シーケンス検出装置1によれば、タイムワーピングパスの少なくとも一部が重複する類似部分シーケンスペアが複数あった場合、その中でタイムワーピングパスが最長の類似部分シーケンスを出力するので、ユーザに対して、冗長な情報を与えることなく、より有益な情報(タイムワーピングパスが最長の類似部分シーケンス)を提供できる。
In this way, according to the similar partial
また、第1実施形態および第2実施形態の類似部分シーケンス検出方法を実行させるための類似部分シーケンス検出プログラムを作成すれば、そのプログラムを実行する一般的なコンピュータが類似部分シーケンス検出装置1として動作できる。
If a similar partial sequence detection program for executing the similar partial sequence detection method of the first embodiment and the second embodiment is created, a general computer that executes the program operates as the similar partial
≪実験結果≫
次に、第1実施形態の類似部分シーケンス検出装置1を用いた処理の実験結果について説明する。実験結果を視覚的に把握するため、ここでは、散布図を用いる。例えば、図8は、図13のシーケンス#1と#2から類似部分シーケンスペアを検出した結果を表す散布図である。図8の散布図は、シーケンス#1と#2における類似部分シーケンスペアであるX[is:ie]とY[js:je]における要素ieとjeを反映している。つまり、この図8における横軸はXの要素を、縦軸はYの要素を表し、部分シーケンスペアX[is:ie]とY[js:je]が類似している場合、散布図の(ie,je)の位置に点がプロットされる。
≪Experimental results≫
Next, experimental results of processing using the similar partial
図8では、2つの実線で囲まれたそれぞれの部分が検出された小さなスパイクを、破線で囲まれた部分が検出された大きなスパイクを含んだ領域を、それぞれ表している。この図8では、2つのシーケンス間の類似部分シーケンスペアの周期性(出現間隔や出現時間幅)を確認することができる。 In FIG. 8, a small spike in which each part surrounded by two solid lines is detected, and a region including a large spike in which a part surrounded by a broken line is detected are shown. In FIG. 8, the periodicity (appearance interval and appearance time width) of similar partial sequence pairs between two sequences can be confirmed.
例えば、小さなスパイク#11と#22は類似しており、その関係は散布図において左の実線で囲まれた部分の一番左下に現れている。実線で囲まれた部分では、小さなスパイク同士の対応を表す6つの位置が規則的にプロットされており、#11や#22に類似する小さなスパイクが周期的に現れていることがわかる。シーケンス#1と#2では大小のそれぞれのスパイクの間隔が異なっているが、類似部分シーケンスペアの存在およびその周期性を確認することができる。
以下、図9〜図11について、同様にして散布図を作成することができる。
For example,
Hereinafter, scatter diagrams can be created in the same manner for FIGS.
次に、実データを用いた実験結果を示す。各実験は、2GBのメモリ、3GHzのCPUを搭載したコンピュータ上で実施した。 Next, experimental results using actual data are shown. Each experiment was carried out on a computer equipped with a 2 GB memory and a 3 GHz CPU.
図9において、(a)と(b)はホワイトノイズを持つ複数のサイン波から構成される人工データ(Sines)を示す図であり(縦軸は数値、横軸は時間)、(c)は実験結果の散布図である。
図9の(a)と(b)に示すように、Sines1とSines2は、含まれるサイン波の周期と、サイン波の現れる周期が、それぞれ異なっている。そして、図9(c)に示すように、本実施形態の類似部分シーケンス検出装置1によれば、すべてのサイン波と時間変化する周期性を完全に特定(表現)することができていることがわかる。つまり、Sines1にはサイン波が6つ、Sines2にはサイン波が5つあり、散布図には30個(=6×5)のプロット群が存在している。また、図9(c)の散布図において、各サイン波の周期の違いは傾きの違いとして表れていることが確認できる。
9, (a) and (b) are diagrams showing artificial data (Sines) composed of a plurality of sine waves having white noise (the vertical axis is a numerical value, the horizontal axis is time), and (c) is It is a scatter diagram of an experimental result.
As shown in FIGS. 9A and 9B,
図10において、(a)と(b)は温度センサの計測値(Temperature)を示す図でありその温度は摂氏で表され(縦軸は温度、横軸は時間)、(c)は実験結果の散布図である。 10, (a) and (b) are diagrams showing measured values (Temperature) of the temperature sensor, and the temperature is expressed in Celsius (the vertical axis is temperature, the horizontal axis is time), and (c) is the experimental result. It is a scatter diagram.
図10の(a)と(b)におけるデータの取得間隔は約1分であり、これらのデータでは多くの時刻で計測値が欠けている。Temperature1とTemperature2は、天候によって、約18度から32度まで大きく変動する温度変化が連続して2つ表れるパターンを、それぞれ2つずつ含んでいる(破線部分参照)。図10(c)に示すように、本実施形態の類似部分シーケンス検出装置1では、これらの2つずつのパターンを見つけることに成功していることがわかる。つまり、図10(c)の散布図には4個(=2×2)のプロット群が存在している。
The data acquisition interval in FIGS. 10A and 10B is about 1 minute, and these data lack measurement values at many times.
図11において、(a)と(b)はモーションキャプチャデータ(Mocap)を示す図であり、(c)は実験結果の散布図である。この2つのデータ(Mocap1とMocap2)は、被験者の各部位にマーカーを取り付け、取り付けた部位の角速度を1秒間に120回というサンプリング周期で測定したモーションキャプチャデータである。表の“Sec.”が実際のモーション時間に対応しており、被験者があるモーションを連続して行っていることを示す。 In FIG. 11, (a) and (b) are diagrams showing motion capture data (Mocap), and (c) is a scatter diagram of experimental results. These two data (Mocap1 and Mocap2) are motion capture data obtained by attaching a marker to each part of the subject and measuring the angular velocity of the attached part at a sampling period of 120 times per second. “Sec.” In the table corresponds to the actual motion time, and indicates that the subject is performing a certain motion continuously.
例えば、Mocap1では、被験者がwalking-running-jumping-…の順にモーションを行ったことを意味する。本実験では、二の腕・肘下・太もも・ふくらはぎの各部位に左右対称に取り付けられたマーカーから取得された8個の角速度データを選択し、8次元データをして使用している。これらのデータにはwalkingモーションが含まれており(表の色付けした部分)、各walkingモーションのデータ長は異なっている。図11(c)に示すように、本実施形態の類似部分シーケンス検出装置1では、walkingモーションがすべて検出されている様子が散布図から確認できる。つまり、Mocap1にはwalkingが3つ、Mocap2にもwalkingが3つあり、散布図には9個(=3×3)のプロット群が存在している。
For example, in Mocap1, it means that the subject performed a motion in the order of walking-running-jumping-. In this experiment, eight pieces of angular velocity data acquired from markers attached symmetrically to the respective parts of the upper arm, the elbow, the thigh, and the calf are selected and used as eight-dimensional data. These data include walking motion (colored portion of the table), and the data length of each walking motion is different. As shown in FIG. 11C, in the similar partial
なお、Mocap1およびMocap2における「Time」の数値と、散布図におけるプロット群の位置とに多少のずれが生じている部分があるようにも見える。しかし、それは、被験者によるモーションの切り替えが連続的な場合(一旦停止なし)と不連続な場合(一旦停止あり)とが混在していて、次のモーションが始まるまでを検出している(つまり、あるモーションの終了直後に、すぐ次のモーションが始まる場合と、被験者の動きが一旦(1,2秒)停止する場合とでは、類似スコアの減少速度が異なる)ことに起因するものであり、本手法の精度とは無関係である。
In addition, it seems that there is a part where a slight deviation occurs between the numerical value of “Time” in
図12は、本実施形態による方法とナイーブな手法との計算時間に関する比較図である。データには人工データを用い、シーケンス長(横軸)のnとmを変化させている。図12では、マトリックスの更新と類似部分シーケンスペア検出の合計時間を平均し、計算時間として縦軸に示している。この実験結果から、本実施形態による方法がナイーブな手法と比べ、非常に高い性能を示している(処理の高速化を実現している)ことがわかる。つまり、計算量が、ナイーブな手法のO(nm2+n2m)(マトリックスの数がO(nm)なので)と比較して、本実施形態による方法はO(m+n)(マトリックスが単一なので)であり、大幅な低減化を達成している。 FIG. 12 is a comparison diagram regarding calculation time between the method according to the present embodiment and the naive method. Artificial data is used as data, and the sequence length (horizontal axis) n and m are changed. In FIG. 12, the total time of matrix update and similar partial sequence pair detection is averaged, and the vertical axis indicates the calculation time. From this experimental result, it can be seen that the method according to the present embodiment shows extremely high performance (higher processing speed is realized) than the naive method. In other words, the calculation amount is O (m + n) (since the matrix is single) as compared with the naive technique O (nm 2 + n 2 m) (since the number of matrices is O (nm)). ) And has achieved a significant reduction.
以上、本発明の実施形態について説明したが、本発明はこれに限定されるものではなく、その趣旨を変えない範囲で実施することができる。 As mentioned above, although embodiment of this invention was described, this invention is not limited to this, It can implement in the range which does not change the meaning.
その他、ハードウェア、ソフトウェアの具体的な構成について、本発明の主旨を逸脱しない範囲で適宜変更が可能である。 In addition, specific configurations of hardware and software can be appropriately changed without departing from the gist of the present invention.
なお、データストリームは、映像やセンサネットワーク、金融など様々な分野で発生する。本発明はこれらのすべての分野に適用可能である。 Data streams occur in various fields such as video, sensor networks, and finance. The present invention is applicable to all these fields.
1 類似部分シーケンス検出装置
11 入力部
12 処理部
13 記憶部
14 出力部
111 検出条件入力部
112 データストリーム入力部
121 データストリーム処理部
131 検出条件記憶部
132 タイムワーピングデータ記憶部
133 類似部分シーケンス候補記憶部
141 類似部分シーケンス出力部
DESCRIPTION OF
Claims (9)
前記類似部分シーケンス検出装置は、前記タイムワーピング行列を記憶する記憶部と、処理部と、を備えており、
前記処理部は、
前記2つのデータストリームのうちいずれかのデータストリームのデータの1つの要素を受信したとき、当該要素を含む前記データストリーム中の部分シーケンスと、他方の前記データストリーム中の部分シーケンスと、の類似度スコアを算出し、
前記算出した類似度スコアと、その類似度スコアの算出に用いた2つの前記部分シーケンスの開始位置および終了位置と、を対応付けて前記記憶部の前記タイムワーピング行列に記憶し、
前記記憶部のタイムワーピング行列に記憶された前記類似度スコアを用いて、類似する部分シーケンスのペアを検出して出力する
ことを特徴とする類似部分シーケンス検出方法。 A similar partial sequence detection method by a similar partial sequence detection device for detecting a pair of similar partial sequences from two data streams using a time warping matrix indicating a similarity score between the two partial sequences,
The similar partial sequence detection device includes a storage unit that stores the time warping matrix, and a processing unit.
The processor is
When one element of data of one of the two data streams is received, the degree of similarity between the partial sequence in the data stream including the element and the partial sequence in the other data stream Calculate the score,
The calculated similarity score and the start position and end position of the two partial sequences used for calculating the similarity score are stored in the time warping matrix of the storage unit in association with each other,
A similar partial sequence detection method, comprising: detecting and outputting a pair of similar partial sequences using the similarity score stored in the time warping matrix of the storage unit.
前記2つのデータストリームの部分シーケンス同士の前記類似度スコアを算出するとき、
2つの部分シーケンスX[is:ie]とY[js:je]との類似度スコアS(X[is:ie],Y[js:je])を、以下の式(1)〜式(5)により算出し、
S(X[is:ie],Y[js:je])=s(ie,je) ・・・式(1)
s(i,j)=max{0,2ε−‖xi−yj‖+sbest} ・・・式(2)
sbest=max{s(i,j−1),s(i−1,j),s(i−1,j−1)}
・・・式(3)
s(i,0)=0 ・・・式(4)
s(0,j)=0 ・・・式(5)
前記タイムワーピング行列に記憶する前記部分シーケンスX[is:ie]の開始位置isと、前記部分シーケンスY[js:je]の開始位置jsとを示すp(i,j)を、以下の式(7)により算出し、
p(i,j)={p(i,j−1) (if sbest=s(i,j−1)),
p(i−1,j) (if sbest=s(i−1,j)),
p(i−1,j−1)(if sbest=s(i−1,j−1)),
(i,j) (if sbest=0)} ・・・式(7)
前記開始位置is,jsを、以下の式(8)により算出することを特徴とする請求項1に記載の類似部分シーケンス検出方法。
(is,js)=p(ie,je) ・・・式(8)
ただし、i=1,2,…,n、j=1,2,…,m、‖xi−yj‖はxiとyjとの間の距離を示す。 The processor is
When calculating the similarity score between the partial sequences of the two data streams,
The similarity score S (X [i s : i e ], Y [j s : j e ]) between two partial sequences X [i s : i e ] and Y [j s : j e ] is expressed as Calculated by equations (1) to (5),
S (X [i s : i e ], Y [j s : j e ]) = s (i e , j e ) (1)
s (i, j) = max {0, 2ε−‖x i −y j ‖ + s best } Expression (2)
s best = max {s (i, j-1), s (i-1, j), s (i-1, j-1)}
... Formula (3)
s (i, 0) = 0 Formula (4)
s (0, j) = 0 Formula (5)
The partial sequence X stored in the time warping matrix [i s: i e] and the start position i s of the partial sequence Y: p indicating the start position j s of [j s j e] (i , j) Is calculated by the following equation (7),
p (i, j) = {p (i, j-1) (if s best = s (i, j-1)),
p (i-1, j) (if s best = s (i-1, j)),
p (i-1, j-1) (if s best = s (i-1, j-1)),
(I, j) (if s best = 0)} (7)
The similar partial sequence detection method according to claim 1, wherein the start position i s , j s is calculated by the following equation (8).
(I s , j s ) = p (i e , j e ) (8)
However, i = 1,2, ..., shown n, j = 1,2, ..., m, the distance between the ‖x i -y j ‖ the x i and y j.
前記記憶部のタイムワーピング行列に記憶された前記類似度スコアを用いて、類似する部分シーケンスのペアを検出して出力する場合、
類似度スコアの平均値s’を、以下の式(6)により算出し、
s’=s(i,j)/W ・・・式(6)
前記算出した類似度スコアの平均値s’が所定の閾値ε以上であり、かつ、前記類似度スコアの算出に使用した2つの部分シーケンスの長さがいずれも所定の長さζ以上であるとき、それらの2つの前記部分シーケンスを、類似する部分シーケンスのペアとして検出して出力する
ことを特徴とする請求項2に記載の類似部分シーケンス検出方法。
ただし、Wは部分シーケンスX[is:ie]と部分シーケンスY[js:je]とのタイムワーピングパスの長さを示す。 The processor is
Using the similarity score stored in the time warping matrix of the storage unit to detect and output a pair of similar partial sequences,
The average value s ′ of the similarity score is calculated by the following equation (6),
s ′ = s (i, j) / W (6)
When the average value s ′ of the calculated similarity score is equal to or greater than a predetermined threshold ε, and the lengths of the two partial sequences used for calculating the similarity score are both equal to or greater than the predetermined length ζ The similar partial sequence detection method according to claim 2, wherein the two partial sequences are detected and output as a pair of similar partial sequences.
Here, W indicates the length of the time warping path between the partial sequence X [i s : i e ] and the partial sequence Y [j s : j e ].
前記算出した類似度スコアの平均値s’が所定の閾値ε以上であり、かつ、前記算出に使用した2つの部分シーケンスの長さがいずれも所定の長さζ以上である場合、
当該2つの部分シーケンスを、類似部分シーケンスペア候補として前記記憶部に記憶し、
前記記憶部に記憶された前記類似部分シーケンスペア候補のうち、前記タイムワーピングパスの少なくとも一部に重複しているものがあるとき、前記重複している類似部分シーケンスペア候補の中から、前記タイムワーピングパスが最長の類似部分シーケンスペア候補を選択し、当該選択した類似部分シーケンスペア候補である2つの前記部分シーケンスを、類似する部分シーケンスのペアとして出力する
ことを特徴とする請求項3に記載の類似部分シーケンス検出方法。 The processor is
When the average value s ′ of the calculated similarity score is equal to or greater than a predetermined threshold ε, and the lengths of the two partial sequences used for the calculation are both equal to or greater than a predetermined length ζ,
The two partial sequences are stored in the storage unit as similar partial sequence pair candidates,
Among the similar partial sequence pair candidates stored in the storage unit, when there is an overlap in at least a part of the time warping path, the time is selected from the overlapping similar partial sequence pair candidates. The similar partial sequence pair candidate with the longest warping path is selected, and the two partial sequences that are the selected similar partial sequence pair candidates are output as pairs of similar partial sequences. Similar partial sequence detection method.
前記タイムワーピング行列を記憶する記憶部と、
前記2つのデータストリームのうちいずれかのデータストリームのデータの1つの要素を受信したとき、当該要素を含む前記データストリーム中の部分シーケンスと、他方の前記データストリーム中の部分シーケンスと、の類似度スコアを算出し、
前記算出した類似度スコアと、その類似度スコアの算出に用いた2つの前記部分シーケンスの開始位置および終了位置と、を対応付けて前記記憶部の前記タイムワーピング行列に記憶し、
前記記憶部のタイムワーピング行列に記憶された前記類似度スコアを用いて、類似する部分シーケンスのペアを検出して出力する処理部と、
を備えることを特徴とする類似部分シーケンス検出装置。 A similar partial sequence detection device for detecting a pair of similar partial sequences from two data streams using a time warping matrix indicating a similarity score between the two partial sequences,
A storage unit for storing the time warping matrix;
When one element of data of one of the two data streams is received, the degree of similarity between the partial sequence in the data stream including the element and the partial sequence in the other data stream Calculate the score,
The calculated similarity score and the start position and end position of the two partial sequences used for calculating the similarity score are stored in the time warping matrix of the storage unit in association with each other,
A processing unit that detects and outputs a pair of similar partial sequences using the similarity score stored in the time warping matrix of the storage unit;
A similar partial sequence detection device comprising:
前記2つのデータストリームの部分シーケンス同士の前記類似度スコアを算出するとき、
2つの部分シーケンスX[is:ie]とY[js:je]との類似度スコアS(X[is:ie],Y[js:je])を、以下の式(1)〜式(5)により算出し、
S(X[is:ie],Y[js:je])=s(ie,je) ・・・式(1)
s(i,j)=max{0,2ε−‖xi−yj‖+sbest} ・・・式(2)
sbest=max{s(i,j−1),s(i−1,j),s(i−1,j−1)}
・・・式(3)
s(i,0)=0 ・・・式(4)
s(0,j)=0 ・・・式(5)
前記タイムワーピング行列に記憶する前記部分シーケンスX[is:ie]の開始位置isと、前記部分シーケンスY[js:je]の開始位置jsとを示すp(i,j)を、以下の式(7)により算出し、
p(i,j)={p(i,j−1) (if sbest=s(i,j−1)),
p(i−1,j) (if sbest=s(i−1,j)),
p(i−1,j−1)(if sbest=s(i−1,j−1)),
(i,j) (if sbest=0)} ・・・式(7)
前記開始位置is,jsを、以下の式(8)により算出することを特徴とする請求項6に記載の類似部分シーケンス検出装置。
(is,js)=p(ie,je) ・・・式(8)
ただし、i=1,2,…,n、j=1,2,…,m、‖xi−yj‖はxiとyjとの間の距離を示す。 The processor is
When calculating the similarity score between the partial sequences of the two data streams,
The similarity score S (X [i s : i e ], Y [j s : j e ]) between two partial sequences X [i s : i e ] and Y [j s : j e ] is expressed as Calculated by equations (1) to (5),
S (X [i s : i e ], Y [j s : j e ]) = s (i e , j e ) (1)
s (i, j) = max {0, 2ε−‖x i −y j ‖ + s best } Expression (2)
s best = max {s (i, j-1), s (i-1, j), s (i-1, j-1)}
... Formula (3)
s (i, 0) = 0 Formula (4)
s (0, j) = 0 Formula (5)
The partial sequence X stored in the time warping matrix [i s: i e] and the start position i s of the partial sequence Y: p indicating the start position j s of [j s j e] (i , j) Is calculated by the following equation (7),
p (i, j) = {p (i, j-1) (if s best = s (i, j-1)),
p (i-1, j) (if s best = s (i-1, j)),
p (i-1, j-1) (if s best = s (i-1, j-1)),
(I, j) (if s best = 0)} (7)
The similar partial sequence detection apparatus according to claim 6, wherein the start position i s , j s is calculated by the following equation (8).
(I s , j s ) = p (i e , j e ) (8)
However, i = 1,2, ..., shown n, j = 1,2, ..., m, the distance between the ‖x i -y j ‖ the x i and y j.
前記記憶部のタイムワーピング行列に記憶された前記類似度スコアを用いて、類似する部分シーケンスのペアを検出して出力する場合、
類似度スコアの平均値s’を、以下の式(6)により算出し、
s’=s(i,j)/W ・・・式(6)
前記算出した類似度スコアの平均値s’が所定の閾値ε以上であり、かつ、前記類似度スコアの算出に使用した2つの部分シーケンスの長さがいずれも所定の長さζ以上であるとき、それらの2つの前記部分シーケンスを、類似する部分シーケンスのペアとして検出して出力する
ことを特徴とする請求項7に記載の類似部分シーケンス検出装置。
ただし、Wは部分シーケンスX[is:ie]と部分シーケンスY[js:je]とのタイムワーピングパスの長さを示す。 The processor is
Using the similarity score stored in the time warping matrix of the storage unit to detect and output a pair of similar partial sequences,
The average value s ′ of the similarity score is calculated by the following equation (6),
s ′ = s (i, j) / W (6)
When the average value s ′ of the calculated similarity score is equal to or greater than a predetermined threshold ε, and the lengths of the two partial sequences used for calculating the similarity score are both equal to or greater than the predetermined length ζ The similar partial sequence detection apparatus according to claim 7, wherein the two partial sequences are detected and output as a pair of similar partial sequences.
Here, W indicates the length of the time warping path between the partial sequence X [i s : i e ] and the partial sequence Y [j s : j e ].
前記算出した類似度スコアの平均値s’が所定の閾値ε以上であり、かつ、前記算出に使用した2つの部分シーケンスの長さがいずれも所定の長さζ以上である場合、
当該2つの部分シーケンスを、類似部分シーケンスペア候補として前記記憶部に記憶し、
前記記憶部に記憶された前記類似部分シーケンスペア候補のうち、前記タイムワーピングパスの少なくとも一部に重複しているものがあるとき、前記重複している類似部分シーケンスペア候補の中から、前記タイムワーピングパスが最長の類似部分シーケンスペア候補を選択し、当該選択した類似部分シーケンスペア候補である2つの前記部分シーケンスを、類似する部分シーケンスのペアとして出力する
ことを特徴とする請求項8に記載の類似部分シーケンス検出装置。 The processor is
When the average value s ′ of the calculated similarity score is equal to or greater than a predetermined threshold ε, and the lengths of the two partial sequences used for the calculation are both equal to or greater than a predetermined length ζ,
The two partial sequences are stored in the storage unit as similar partial sequence pair candidates,
Among the similar partial sequence pair candidates stored in the storage unit, when there is an overlap in at least a part of the time warping path, the time is selected from the overlapping similar partial sequence pair candidates. 9. The similar partial sequence pair candidate with the longest warping path is selected, and the two partial sequences that are the selected similar partial sequence pair candidates are output as a pair of similar partial sequences. Similar partial sequence detection device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008042633A JP5060340B2 (en) | 2008-02-25 | 2008-02-25 | Similar partial sequence detection method, similar partial sequence detection program, and similar partial sequence detection device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008042633A JP5060340B2 (en) | 2008-02-25 | 2008-02-25 | Similar partial sequence detection method, similar partial sequence detection program, and similar partial sequence detection device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009199507A true JP2009199507A (en) | 2009-09-03 |
JP5060340B2 JP5060340B2 (en) | 2012-10-31 |
Family
ID=41142907
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008042633A Expired - Fee Related JP5060340B2 (en) | 2008-02-25 | 2008-02-25 | Similar partial sequence detection method, similar partial sequence detection program, and similar partial sequence detection device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5060340B2 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012059100A (en) * | 2010-09-10 | 2012-03-22 | Hitachi Ltd | Local correspondence extraction device and local correspondence extraction method |
WO2017185576A1 (en) * | 2016-04-25 | 2017-11-02 | 百度在线网络技术(北京)有限公司 | Multi-streaming data processing method, system, storage medium, and device |
US10223069B2 (en) | 2015-01-22 | 2019-03-05 | Mitsubishi Electric Corporation | Time-series data search device and computer readable medium |
JP7122960B2 (en) | 2018-12-27 | 2022-08-22 | 三菱電機株式会社 | Anomaly detector |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000305940A (en) * | 1999-04-21 | 2000-11-02 | Nippon Telegr & Teleph Corp <Ntt> | Method and device for retrieving time series data and storage medium storing time series data retrieval program |
-
2008
- 2008-02-25 JP JP2008042633A patent/JP5060340B2/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000305940A (en) * | 1999-04-21 | 2000-11-02 | Nippon Telegr & Teleph Corp <Ntt> | Method and device for retrieving time series data and storage medium storing time series data retrieval program |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012059100A (en) * | 2010-09-10 | 2012-03-22 | Hitachi Ltd | Local correspondence extraction device and local correspondence extraction method |
US10223069B2 (en) | 2015-01-22 | 2019-03-05 | Mitsubishi Electric Corporation | Time-series data search device and computer readable medium |
WO2017185576A1 (en) * | 2016-04-25 | 2017-11-02 | 百度在线网络技术(北京)有限公司 | Multi-streaming data processing method, system, storage medium, and device |
JP7122960B2 (en) | 2018-12-27 | 2022-08-22 | 三菱電機株式会社 | Anomaly detector |
Also Published As
Publication number | Publication date |
---|---|
JP5060340B2 (en) | 2012-10-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10895454B2 (en) | Movement line information generation system, movement line information generation method and movement line information generation program | |
KR101906859B1 (en) | Aparatus and method for detecting anomalous subsequence | |
JP6350251B2 (en) | Route information processing apparatus, method, and program | |
Hassani et al. | Towards a mobile health context prediction: Sequential pattern mining in multiple streams | |
JP2011252844A (en) | Data processing device, data processing method and program | |
JP5060340B2 (en) | Similar partial sequence detection method, similar partial sequence detection program, and similar partial sequence detection device | |
Katsikouli et al. | Persistence based online signal and trajectory simplification for mobile devices | |
JP4939349B2 (en) | Trend detection method, trend detection program, and trend detection device | |
Kulkarni et al. | Mobidict: A mobility prediction system leveraging realtime location data streams | |
US9674083B2 (en) | Path calculation order deciding method, program and calculating apparatus | |
Song et al. | An adaptive stochastic central force optimisation algorithm for node localisation in wireless sensor networks | |
Zhang et al. | Lightweight and accurate DNN-based anomaly detection at edge | |
Sankararaman et al. | Computing similarity between a pair of trajectories | |
JP4801566B2 (en) | Data stream monitoring device, data stream monitoring method, program thereof, and recording medium | |
CN107329473B (en) | Robot inspection path planning method based on mean value and sound search | |
JP2010198227A (en) | Device, method and program for detection of similar partial sequence | |
CN116541721A (en) | Positioning and road network matching method and system for signaling data | |
Ramya et al. | Recommendations in social network using link prediction technique | |
Gong et al. | NSPRING: Normalization-supported SPRING for subsequence matching on time series streams | |
Li et al. | Efficient Multi-source Contact Event Query Processing for Moving Objects | |
Moghtasedi et al. | High-quality prediction of tourist movements using temporal trajectories in graphs | |
Chen et al. | Adaptive Cross-Camera Video Analytics at the Edge | |
Li et al. | Subspace estimation of distribution algorithms: To perturb part of all variables in estimation of distribution algorithms | |
JP5786879B2 (en) | Subject tracking device, subject tracking method and program | |
Pehlivan et al. | Anchor-Free Action Proposal Network with Uncertainty Estimation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100114 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20110811 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120117 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120124 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120322 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20120731 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120803 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150810 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |