<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Finding Similar Movements in Positional Data Streams</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jens Haasey</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ulf Brefeldz</string-name>
          <email>brefeld@kma.informatik.tu-darmstadt.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Knowledge Mining &amp; Assessment Group Technische Universita ̈t Darmstadt</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we study the problem of efficiently finding similar movements in positional data streams, given a query trajectory. Our approach is based on a translation-, rotation-, and scale-invariant representation of movements. Nearneighbours given a query trajectory are then efficiently computed using dynamic time warping and locality sensitive hashing. Empirically, we show the efficiency and accuracy of our approach on positional data streams recorded from a real soccer game.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1 Introduction
Team sports has become a major business in many parts of the world. Clubs
spend a great deal of money on players, training facilities and other ways to
further improve their play. For instance, the German Bundesliga records all games
with special cameras, capturing bird’s eye views of the pitch, to better analyse
player movements and tactics. The recordings capture positions of the players
and the ball for every fraction of a second. While simple analyses, such as the
overall distance a player covered, heat maps of player positions, etc., can be
computed (semi-)automatically, more complex analyses involving tactics and
counter-strategies rely on human experts. However, the sheer existence of such
data paves the way for automatic analyses using intelligent mining techniques.
In this paper, we study efficient techniques for detecting similar movements in
positional data streams to provide a basis for the analyses of frequent
movements and tactical patterns.</p>
      <p>For a soccer game taking about 90 minutes, the recorded data translate into
a positional data stream. Standard recording rates of 25 frames per second lead
to a representation by about 135,000 snapshots. Every snapshot consists of the
23 positions of the players of the two teams and the ball. In sum, the game
is described by more than three million coordinates. As player movements are
sequences of such coordinates, it is clear that there are a great deal of
comparisons necessary to account for different lengths of such sequences across
players. Thus, there is a real need for efficient techniques to further process and
analyse the data.</p>
      <p>
        In this paper, we study the problem of finding similar movements of
players in such positional data streams. The problem is challenging for two
reasons. Firstly, it is not clear how to define an appropriate similarity measure on
player trajectories and secondly, the sheer number of coordinates render exact
approaches infeasible as we will show in the experiments. We first propose a
translation-, rotation-, and scale-invariant representation of movements using
Angle/Arc-Lengths [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Second, we investigate efficient near-neighbour
routines based on dynamic time warping [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and locality sensitive hashing [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Our
empirical results on positional data recorded from a real soccer game show the
efficiency and accuracy of our approach compared to exact baseline methods.
      </p>
      <p>The remainder is structured as follows. Section 2 briefly reviews related
work. Our main contribution is presented in Section 3 and we report on
empirical results in Section 4. Section 5 concludes.
2</p>
      <p>
        Related Work
Prior work on mining positional data streams mostly focuses on the performance
of individual players. Kang et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] present an approach that uses positional
data to assess player positions in particular areas of the pitch, such as catchable,
safe or competing zones. Grunz et al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] analyse groups of players and their
behaviour using self organising maps on positional data. Every neuron of the
network represents a certain area of the pitch. Thus, whenever a player moves
into such an area, the respective neuron is activated. Persˇe at al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] use
positional data of basketball games to compare movements of players with respect
to tactical patterns, e.g., a player blocks space for his teammate. The presented
approach however does not detect novel movements that deviate from the
already known patterns. By contrast, we study a purely data-driven approach to
find similar movements in positional data for a given query trajectory without
making any assumptions on zones, tasks, or movements.
3
3.1
      </p>
      <p>Contribution</p>
      <p>Preliminaries
For each player, we are given a positional data stream P = hx1; x2; : : :i where
xt = (x1; x2)&gt; denotes the coordinates of the players position on the pitch at
time t. A trajectory or movement of the player is a subset p P of the stream,
e.g., p = hxt; xt+1; : : : ; xt+mi, where m is the length of the trajectory. A game
D is thus given by the union of all trajectories of length m of the two teams. For
simplicity, we omit the time index t and simply index elements of a trajectory
by their offset 1; : : : ; m in the remainder. The goal of this paper is to accurately
and efficiently compute similarities between trajectories in D. That is, given a
query trajectory q, we aim at finding the N most similar trajectories in D.
3.2</p>
      <p>
        Representation
We aim to exploiting the symmetries of the pitch and use Angle/Arc-Length
(AAL) [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] transformations to guarantee translation, rotation, and scale
invariant representations of trajectories. The main idea of AAL is to represent a
movement p = hx1; : : : ; xmi in terms of distances and angles
p 7! p = h( 1; kv1k); : : : ; ( m; kvmk)i;
(1)
where vi = xi xi 1. The difference vi is called the movement vector at time
i and the corresponding angle with respect to a reference vector vref = (1; 0)&gt;
is defined as
i = sign(vi; vref ) cos 1
      </p>
      <p>vi&gt;vref
kvik kvref k
;
where the sign function computes the direction (clockwise ore
counterclockwise) of the movement with respect to the reference. In the remainder, we
discard the norms in Equation (1) and represent trajectories by their sequences of
angles, p 7! p~ = h 1; : : : ; mi.
3.3</p>
      <p>
        Dynamic Time Warping
In this section, we propose a distance measure for trajectories. The proposed
representation of the previous section fulfils the required invariance in terms
of translation, rotation and scaling [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. However, some movements may start
slow and end fast, while others start fast and then slow down at the end. Thus,
we additionally need to compensate for phase shifts of trajectories. A remedy
comes from the area of speech recognition and is called dynamic time warping
(DTW) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. Given two sequences s = hs1; : : : ; smi and q = hq1; : : : ; qmi and
an element-wise distance function dist : R R ! R (e.g., Euclidean distance),
we define the DTW function g recursively as follows
g(;; ;) = 0
g(s; ;) = dist(;; q) = 1
g(s; q) = dist(s1; q1) + min
8&lt; g(s; hq2; : : : ; qmi) 9=
      </p>
      <p>
        g(hs2; : : : ; smi; q)
: g(hs2; : : : ; smi; hq2; : : : ; qmi) ;
The time complexity of DTW is O(jsjjqj) which is clearly intractable for
computing similarities of thousands of trajectories. However, recall that we aim at
finding the N best matches for a given query. This allows for pruning some
DTW computations using lower bounds f , i.e., f (s; q) g(s; q), with an
appropriate function f that can be more efficiently computed than g [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. We use
two different lower bound functions, fkim [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and fkeogh [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], that are defined
as follows: fkim focuses on the first, last, greatest, and smallest values of two
sequences [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
fkim(s; q) = max fjs1 q1j; jsm
qmj; j max(s)
max(q)j; j min(s)
min(q)jg
and can be computed in O(m). However, the greatest (or smallest) entry in
the transformed paths is always close or identical to (or ) and can thus
be ignored. Consequentially, the time complexity reduces to O(1) [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The
second lower bound fkeogh [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] uses minimum `i and an maximum values ui for
subsequences of the query q given by
`i = min(qi r; : : : ; qi+r) and
ui = max(qi r; qi+r);
where r is a user defined threshold. Trivially, ui
the lower bound fkeogh is given by
qi
      </p>
      <p>`i holds for all i and
vu m
fkeogh(q; s) = tuX ci
i=1
with ci =
8(si
&lt;</p>
      <p>
        (si
:
0
ui)2 : if si &gt; ui
`i)2 : if si &lt; `i
: otherwise
which can also be computed in O(m) (see [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] for details).
      </p>
      <p>
        Algorithm 1 extends [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] to compute the N most similar trajectories for a
given query q. Lines 2–9 compute the DTW distances of the first N entries in
the database and store the entry with the highest distance to q. Lines 10–21 loop
over all subsequent trajectories in D by first applying the lower bound functions
fkim and fkeogh to efficiently filter irrelevant movements before using the exact
DTW distance for the remaining candidates. Every trajectory, realising a smaller
DTW distance than the current maximum, replaces its peer and the variables
maxdist and maxind are updated accordingly. Note that the complexity of
Algorithm 1 is linear in the number of trajectories in D. In the worst case, the
sequences are sorted in descending order by the DTW distance, which requires
to compute all DTW distances. In practice we however observe much lower
run-times.
      </p>
      <p>
        An important factor is the tightness of the lower bound functions. The better
the approximation of the DTW the better the pruning. The parameter N plays
also a crucial part in the effectiveness of the algorithm. If we set N = 1 the
maximum value will drop faster towards the lowest value in the dataset. By
contrast, setting N = jDj requires to compute the DTW distances for all entries
in the database. Hence, in most cases, N jDj is an appropriate choice to
reduce the overall computation time.
To further improve the efficiency of our algorithm, we will use locality
sensitive hashing (LSH) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] to remove a great deal of trajectories before
processing them with Algorithm 1. The idea of LSH is to hash similar objects to the
same bucket, so that all objects of a bucket are considered candidates for being
near-neighbours. An interesting equivalence class of LSH functions are distance
based hashes (DBH) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] that can be applied together with arbitrary (e.g.,
nonmetric) distance measures.
      </p>
      <p>To define a hash family for our purposes, we first need to define a function
h : D ! R that maps a trajectory s 2 D to the set of real numbers. Choosing
two randomly drawn members s1; s2 2 D we define the function h as follows:
In the remainder, we will use the identity dist(s1; s2) = fkim(s1; s2) for
simplicity. To compute a discrete hash value for s we verify whether h(s) lies in a
certain interval [t1; t2],
Optimally, the interval boundaries t1 and t2 are chosen so that the probability
that a randomly drawn s 2 X lies with 50% chance within and with 50% chance
outside of the interval. The set T defines the set of admissible intervals,</p>
      <p>T (s1; s2) = n[t1; t2] : P rD(h[st11;;st22](s)) = 0) = P rD(h[st11;;st22](s)) = 1)o :
Given h and T we can now define the DBH hash family that can be directly
integrated in standard LSH algorithms:</p>
      <p>
        HDBH = nh[st11;;st22] : s1; s2 2 R ^ [t1; t2] 2 T (s1; s2)
o
Using random draws from HDBH , we construct several hash functions by
ANDand OR-concatenation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Given a query trajectory q 2 D, the retrieval process
first identities candidate objects that are hashed to the same bucket for at least
one of the hash functions and computes the exact distances of the remaining
candidates using Algorithm 1.
4
      </p>
      <p>Evaluation
In this section, we evaluate our approach in terms of run-time, pruning
efficiency, and precision. For our experiments, we use positional data published
by the DEBS Grand Challenge in 20131. There are eight players in each team,
where every player is equipped with two sensors, one for each shoe. We
average these two values to obtain only a single measurement for every player at a
time. Discarding additional data that is not useful in our context leaves us with
a stream of</p>
      <p>(sensor/player id; timestamp; player coordinates)
1 http://www.orgs.ttu.edu/debs2013/index.php?goto=cfchallengedetails</p>
      <p>T(siemce) 1500</p>
      <p>Top 1000 with DBH +
Top 1000 with DBH (4 CPU)</p>
      <p>Top 1000
Top 1000 (4 CPU) 2</p>
      <p>Baseline
+
+
+ +</p>
      <p>+
triplets. Additionally, we discard all data points that have been recorded before
or after the game as well as data points that occurred outside of the pitch. We
also remove the effects of changing sides after half time by appropriate
transformations. Finally, we average the positional information of each player over
100ms to reduce the overall amount of data and use trajectories of size 10.</p>
      <p>In our first experiment, we focus on 15,000 consecutive positions of one
player, so that we are still able to compare performances to the exact baseline
using the DTW distance from Section 3.3. We compute the N -most similar
trajectories using Algorithm 1, where N = 1; 000 and study run-times of the
different approaches. Figure 1 (left) shows the results. The computation time of
the baseline grows exponentially in the size of the data D. Algorithm 1 performs
slightly super-linear and clearly outperforms the baseline. Pre-filtering
trajectories using DBH results in only a small speed-up. Adding more CPUs further
significantly improves the run-time of the algorithms and indicates that
parallelisation of the approach allows for computing near-neighbours for large data
sets in only a couple of minutes.</p>
      <p>The observed improvements in run-time are the result of a highly efficient
pruning strategy. Table 4 shows the amount of trajectories that are pruned for
different amounts of data. Note that the DBH pruning depends on the data and not
on the ratio N . The effectiveness of pruning using fkim and fkeogh increases
jDj
with increasing amounts of data for constant N .</p>
      <p>We now investigate the accuracy of the proposed approach. We compute the
1000 most similar trajectories for all 35,248 player movements and measure the
effect of DBH in terms of the precision@N. For every query q we computed
the performance for N 2 f100; 200; : : : 1000g and averaged the results that
are shown in Figure 2. For completeness we also included the worst cases. The
quality of the candidates covers a broad range and the worst cases are clearly
inappropriate for accurate computations of similarity. Nevertheless, on average
DBH performs well and only slightly decreases in the size of N . Figure 3 shows
an exemplary query trajectory (top, left) as well as five similar trajectories found
by DBH, where the axes denote the coordinates on the pitch of the respective
movement. The retrieved near-duplicates are very close to the query and well
suited for further processing.
5</p>
      <p>Conclusion
In this paper, we presented an approach to efficiently compute similar
movements in positional data streams. Our solution is based on dynamic time warping
and distance based hashing. Empirically, we showed the efficiency and accuracy
of our approaches. Future work will deal with detecting frequent movements
across players.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>V.</given-names>
            <surname>Athitsos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Potamias</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Papapetrou</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Kollios</surname>
          </string-name>
          .
          <article-title>Nearest neighbor retrieval using distance-based hashing</article-title>
          .
          <source>In Proceedings of the 2008 IEEE 24th International Conference on Data Engineering</source>
          , pages
          <fpage>327</fpage>
          -
          <lpage>336</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>A.</given-names>
            <surname>Gionis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Indyk</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Motwani</surname>
          </string-name>
          .
          <article-title>Similarity search in high dimensions via hashing</article-title>
          .
          <source>In Proceedings of the 25th International Conference on Very Large Data Bases</source>
          , pages
          <fpage>518</fpage>
          -
          <lpage>529</lpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Andreas</surname>
            <given-names>Grunz</given-names>
          </string-name>
          , Daniel Memmert, and
          <string-name>
            <given-names>Jrgen</given-names>
            <surname>Perl</surname>
          </string-name>
          .
          <article-title>Tactical pattern recognition in soccer games by means of special self-organizing maps</article-title>
          .
          <source>Human Movement Science</source>
          ,
          <volume>31</volume>
          (
          <issue>2</issue>
          ):
          <fpage>334</fpage>
          -
          <lpage>343</lpage>
          ,
          <year>2012</year>
          .
          <article-title>Special issue on Network approaches in complex environments</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>C.-H. Kang</surname>
            ,
            <given-names>J.-R.</given-names>
          </string-name>
          <string-name>
            <surname>Hwang</surname>
            , and
            <given-names>K.-J.</given-names>
          </string-name>
          <string-name>
            <surname>Li</surname>
          </string-name>
          .
          <article-title>Trajectory analysis for soccer players</article-title>
          .
          <source>In Proceedings of the Sixth IEEE International Conference on Data Mining - Workshops</source>
          , pages
          <fpage>377</fpage>
          -
          <lpage>381</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Eamonn</given-names>
            <surname>Keogh</surname>
          </string-name>
          .
          <article-title>Exact indexing of dynamic time warping</article-title>
          .
          <source>In Proceedings of the 28th international conference on Very Large Data Bases</source>
          , pages
          <fpage>406</fpage>
          -
          <lpage>417</lpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>S.-W.</given-names>
            <surname>Kim</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Park</surname>
          </string-name>
          , and
          <string-name>
            <given-names>W. W.</given-names>
            <surname>Chu</surname>
          </string-name>
          .
          <article-title>An index-based approach for similarity search supporting time warping in large sequence databases</article-title>
          .
          <source>In Proceedings of the 17th International Conference on Data Engineering</source>
          , pages
          <fpage>607</fpage>
          -
          <lpage>614</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>D.</given-names>
            <surname>Lemire</surname>
          </string-name>
          .
          <article-title>Faster retrieval with a two-pass dynamic-time-warping lower bound</article-title>
          .
          <source>Pattern Recogn</source>
          .,
          <volume>42</volume>
          (
          <issue>9</issue>
          ):
          <fpage>2169</fpage>
          -
          <lpage>2180</lpage>
          ,
          <year>September 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>M. Persˇe</surname>
            , M. Kristan, S. Kovacˇicˇ, G. Vucˇkovicˇ, and
            <given-names>J. Persˇ.</given-names>
          </string-name>
          <article-title>A trajectory-based analysis of coordinated team activity in a basketball game</article-title>
          .
          <source>Computer Vision</source>
          and Image Understanding,
          <volume>113</volume>
          (
          <issue>5</issue>
          ):
          <fpage>612</fpage>
          -
          <lpage>621</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Lawrence</given-names>
            <surname>Rabiner</surname>
          </string-name>
          and
          <string-name>
            <surname>Biing-Hwang Juang</surname>
          </string-name>
          .
          <article-title>Fundamentals of speech recognition</article-title>
          .
          <source>PrenticeHall</source>
          , Inc., Upper Saddle River, NJ, USA,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>T.</given-names>
            <surname>Rakthanmanon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Campana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Mueen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Batista</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Westover</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Zhu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Zakaria</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Keogh</surname>
          </string-name>
          .
          <article-title>Searching and mining trillions of time series subsequences under dynamic time warping</article-title>
          .
          <source>In Proceedings of the International Conference on Knowledge Discovery and Data Mining</source>
          , pages
          <fpage>262</fpage>
          -
          <lpage>270</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>Michail</given-names>
            <surname>Vlachos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Gunopulos</surname>
          </string-name>
          , and
          <string-name>
            <surname>Gautam Das</surname>
          </string-name>
          .
          <article-title>Rotation invariant distance measures for trajectories</article-title>
          .
          <source>In Proceedings of tInternational Conference on Knowledge Discovery and Data Mining, KDD '04</source>
          , pages
          <fpage>707</fpage>
          -
          <lpage>712</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>