<!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>Bag-of-Temporal-SIFT-Words for Time Series Classi cation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Adeline Bailly</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Simon Malinowski</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Romain Tavenard</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Thomas Guyet</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>L titia Chapel</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Agrocampus Ouest, IRISA</institution>
          ,
          <addr-line>Rennes</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Universite de Bretagne Sud</institution>
          ,
          <addr-line>Vannes ; IRISA, Rennes</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Universite de Rennes 1, IRISA</institution>
          ,
          <addr-line>Rennes</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>Universite de Rennes 2, IRISA, LETG-Rennes COSTEL</institution>
          ,
          <addr-line>Rennes</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2015</year>
      </pub-date>
      <abstract>
        <p>Time series classi cation is an application of particular interest with the increase of data to monitor. Classical techniques for time series classi cation rely on point-to-point distances. Recently, Bag-ofWords approaches have been used in this context. Words are quantized versions of simple features extracted from sliding windows. The SIFT framework has proved e cient for image classi cation. In this paper, we design a time series classi cation scheme that builds on the SIFT framework adapted to time series to feed a Bag-of-Words. Experimental results show competitive performance with respect to classical techniques.</p>
      </abstract>
      <kwd-group>
        <kwd>time series classi cation</kwd>
        <kwd>Bag-of-Words</kwd>
        <kwd>SIFT</kwd>
        <kwd>BoTSW</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Copyright c 2015 for this paper by its authors. Copying permitted for private and academic
purposes.
words correspond to the description of local gradients around keypoints, that are
rst extracted from the time series. This approach can be seen as an adaptation
of the SIFT framework to time series.</p>
      <p>This paper is organized as follows. Section 2 summarizes related work,
Section 3 describes the proposed Bag-of-Temporal-SIFT-Words (BoTSW) method,
and Section 4 reports experimental results. Finally, Section 5 concludes and
discusses future work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related work</title>
      <p>Our approach for time series classi cation builds on two well-known methods
in computer vision: local features are extracted from time series using a
SIFTbased approach and a global representation of time series is built using
Bagof-Words. This section rst introduces state-of-the-art methods in time series
classi cation, then presents standard approaches for extracting features in the
image classi cation context and nally lists previous works that make use of
such approaches for time series classi cation.</p>
      <p>
        Data mining community has, for long, investigated the eld of time series
classi cation. Early works focus on the use of dedicated metrics to assess
similarity between time series. In [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], Ratanamahatana and Keogh compare
Dynamic Time Warping to Euclidean Distance when used with a simple kNN
classi er. While the former bene ts from its robustness to temporal distortions to
achieve high e ciency, ED is known to have much lower computational cost.
Cuturi [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] shows that DTW fails at precisely quantifying dissimilarity between
non-matching sequences. He introduces Global Alignment Kernel that takes into
account all possible alignments to produce a reliable dissimilarity metric to be
used with kernel methods such as Support Vector Machines (SVM). Douzal and
Amblard [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] investigate the use of time series metrics for classi cation trees.
      </p>
      <p>
        So as to e ciently classify images, those rst have to be described accurately.
Both local and global descriptions have been proposed by the computer vision
community. For long, the most powerful local feature for images was SIFT [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]
that describes detected keypoints in the image using the gradients in the regions
surrounding those points. Building on this, Sivic and Zisserman [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] suggested
to compare video frames using standard text mining approaches in which
documents are represented by word histograms, known as Bag-of-Words (BoW). To
do so, authors map the 128-dimensional space of SIFT features to a codebook
of few thousand words using vector quantization. VLAD (Vector of Locally
Aggregated Descriptors) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] are global features that build upon local ones in the
same spirit as BoW. Instead of storing counts for each word in the dictionary,
VLAD preserves residuals to build a ne-grain global representation.
      </p>
      <p>
        Inspired by text mining, information retrieval and computer vision
communities, recent works have investigated the use of Bag-of-Words for time series
classi cation [
        <xref ref-type="bibr" rid="ref1 ref12 ref14 ref2 ref9">1, 2, 9, 12, 14</xref>
        ]. These works are based on two main operations:
converting time series into Bag-of-Words (a histogram representing the occurrence
of words), and building a classi er upon this BoW representation. Usually,
classical techniques are used for the classi cation step: random forests, SVM, neural
networks, kNN. In the following, we focus on explaining how the conversion of
time series into BoW is performed in the literature. In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], local features such as
mean, variance, extremum values are computed on sliding windows. These
features are then quantized into words using a codebook learned by a class
probability estimate distribution. In [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], discrete wavelet coe cients are extracted on
sliding windows and then quantized into words using k-means. In [
        <xref ref-type="bibr" rid="ref12 ref9">9, 12</xref>
        ], words
are constructed using the SAX representation [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] of time series. SAX symbols
are extracted from time series and histograms of n-grams of these symbols are
computed. In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], multivariate time series are transformed into a feature matrix,
whose rows are feature vectors containing a time index, the values and the
gradient of time series at this time index (on all dimensions). Random samples of this
matrix are given to decision trees whose leaves are seen as words. A histogram
of words is output when the di erent trees are learned. Rather than computing
features on sliding windows, authors of [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] rst extract keypoints from time
series. These keypoints are selected using the Di erences-of-Gaussians (DoG)
framework, well-known in the image community, that can be adapted to
onedimensional signals. Keypoints are then described by scale-invariant features
that describe the shapes of the extremum surrounding keypoints. In [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ],
extraction and description of time series keypoints in a SIFT-like framework is used
to reduce the complexity of Dynamic Time Warping: features are used to match
anchor points from two di erent time series and prune the search space when
nding the optimal path in the DTW computation.
      </p>
      <p>In this paper, we design a time series classi cation technique based on the
extraction and the description of keypoints using a SIFT framework adapted to
time series. The description of keypoints is quantized using a k-means algorithm
to create a codebook of words and classi cation of time series is performed with
a linear SVM fed with normalized histograms of words.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Bag-of-Temporal-SIFT-Words (BoTSW) method</title>
      <p>
        The proposed method is adapted from the SIFT framework [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] widely used for
image classi cation. It is based on three main steps : (i) detection of keypoints
(scale-space extrema) in time series, (ii) description of these keypoints by
gradient magnitude at a speci c scale, and (iii) representation of time series by a
BoW, words corresponding to quantized version of the description of keypoints.
These steps are depicted in Fig. 1 and detailed below.
      </p>
      <p>Following the SIFT framework, keypoints in time series correspond to local
extrema both in terms of scale and location. These scale-space extrema are
identi ed using a DoG function, which establishes a list of scale-invariant keypoints.
Let L(t; ) be the convolution ( ) of a Gaussian function G(t; ) of width with
a time series S(t):</p>
      <p>L(t; ) = G(t; ) S(t):
DoG is obtained by subtracting two time series ltered at consecutive scales:
D(t; ) = L(t; ksc )</p>
      <p>L(t; );
where ksc controls the scale ratio between two consecutive scales. A keypoint
is detected at time index t and scale j if it corresponds to an extremum of
D(t; ksjc ) in both time and scale (8 neighbors : 2 at the same scale, and 6 in
adjacent scales) If a point is higher (or lower) than all of its neighbors, it is
considered as an extremum in the scale-space domain and hence a keypoint of
S.</p>
      <p>Next step in our process is the description of keypoints. A keypoint at (t; j)
is described by gradient magnitudes of L( ; ksjc ) around t. nb blocks of size a
are selected around the keypoint. Gradients are computed at each point of each
block and weighted using a Gaussian window of standard deviation a 2nb so that
points that are farther in time from the detected keypoint have lower in uence.
Then, each block is described by storing separately the sums of magnitude of
positive and negative gradients. Resulting feature vector is of dimension 2 nb.</p>
      <p>Features are then quantized using a k-means algorithm to obtain a codebook
of k words. Words represent di erent kinds of local behavior in the time series.
For a given time series, each feature vector is assigned to the closest word of the
codebook. The number of occurrences of each word in a time series is computed.
The BoTSW representation of a time series is the normalized histogram (i.e.
frequency vector) of word occurrences. These histograms are then passed to a
classi er to learn how to discriminate classes from this BoTSW description.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Experiments and results</title>
      <p>
        In this section, we investigate the impact of both the number of blocks nb and the
number of words k in the codebook (de ned in Section 3) on classi cation error
rates. Experiments are conducted on 20 datasets from the UCR repository [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
We set all parameters of BoTSW but nb and k as follows : = 1:6, ksc = 21=3,
a = 8. These values have shown to produce stable results. Parameters nb and
k vary inside the following sets : f2; 4; 6; 8; 10; 12; 14; 16g and 2i; 8 i 2 f2::10g
respectively. Codebooks are obtained via k-means quantization. Two classi ers
are used to classify times series represented as BoTSW : a linear SVM or a 1NN
classi er. Each dataset is composed of a train and a test set. For our approach,
the best set of (k; nb) parameters is selected by performing a leave-one-out
crossvalidation on the train set. This best set of parameters is then used to build the
classi er on the train set and evaluate it on the test set. Experimental error rates
(ER) are reported in Table 1, together with baseline scores publicly available
at [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
0.5
0.4
te 0.3
rrao
rrE 0.2
      </p>
      <p>BoTSW coupled with a linear SVM is better than both ED and DTW on
11 datasets. It is also better than BoTSW coupled with a 1NN classi er on
13 datasets. We also compared our approach with classical techniques for time
series classi cation. We varied number of codewords k between 4 and 1024. Not
surprisingly, cross-validation tends to select large codebooks that lead to more
precise representation of time series by BoTSW. Fig. 2 shows undoubtedly that,
for Yoga dataset, (left) the larger the codebook, the better the results and (right)
the choice of the number nb of blocks is less crucial as a wide range of values
yield competitive classi cation performance.</p>
      <p>Win-Tie-Lose scores (see Table 2) show that coupling BoTSW with a linear
SVM reaches competitive performance with respect to the literature.</p>
      <p>As it can be seen in Table 1, BoTSW is (by far) less e cient than both ED
and DTW for dataset Adiac. As BoW representation maps keypoint descriptions
into words, details are lost during this quantization step. Knowing that only very
few keypoints are detected for these Adiac time series, we believe a more precise
representation would help.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>BoTSW transforms time series into histograms of quantized local features.
Distinctiveness of the SIFT keypoints used with Bag-of-Words enables to e ciently
and accurately classify time series, despite the fact that BoW representation
ignores temporal order. We believe classi cation performance could be further
improved by taking time information into account and/or reducing the impact
of quantization losses in our representation.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This work has been partly funded by ANR project ASTERIX
(ANR-13-JS020005-01), Region Bretagne and CNES-TOSCA project VEGIDAR.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>M. G.</given-names>
            <surname>Baydogan</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Runger</surname>
          </string-name>
          .
          <article-title>Learning a symbolic representation for multivariate time series classi cation</article-title>
          .
          <source>DMKD</source>
          ,
          <volume>29</volume>
          (
          <issue>2</issue>
          ):
          <volume>400</volume>
          {
          <fpage>422</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>M. G.</given-names>
            <surname>Baydogan</surname>
          </string-name>
          , G. Runger, and
          <string-name>
            <given-names>E.</given-names>
            <surname>Tuv</surname>
          </string-name>
          .
          <article-title>A Bag-of-Features Framework to Classify Time Series</article-title>
          .
          <source>IEEE PAMI</source>
          ,
          <volume>35</volume>
          (
          <issue>11</issue>
          ):
          <volume>2796</volume>
          {
          <fpage>2802</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>K. S.</given-names>
            <surname>Candan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Rossini</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M. L.</given-names>
            <surname>Sapino</surname>
          </string-name>
          . sDTW:
          <article-title>Computing DTW Distances using Locally Relevant Constraints based on Salient Feature Alignments</article-title>
          .
          <source>Proc. VLDB</source>
          ,
          <volume>5</volume>
          (
          <issue>11</issue>
          ):
          <volume>1519</volume>
          {
          <fpage>1530</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>M.</given-names>
            <surname>Cuturi</surname>
          </string-name>
          .
          <article-title>Fast global alignment kernels</article-title>
          .
          <source>In Proc. ICML</source>
          , pages
          <volume>929</volume>
          {
          <fpage>936</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>A.</given-names>
            <surname>Douzal-Chouakria</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Amblard</surname>
          </string-name>
          .
          <article-title>Classi cation trees for time series</article-title>
          .
          <source>Elsevier Pattern Recognition</source>
          ,
          <volume>45</volume>
          (
          <issue>3</issue>
          ):
          <volume>1076</volume>
          {
          <fpage>1091</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>H.</given-names>
            <surname>Jegou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Douze</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Schmid</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Perez</surname>
          </string-name>
          .
          <article-title>Aggregating local descriptors into a compact image representation</article-title>
          .
          <source>In Proc. CVPR</source>
          , pages
          <volume>3304</volume>
          {
          <fpage>3311</fpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>E.</given-names>
            <surname>Keogh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Zhu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Hao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Xi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Wei</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C. A.</given-names>
            <surname>Ratanamahatana</surname>
          </string-name>
          .
          <source>The UCR Time Series Classi cation/Clustering Homepage</source>
          ,
          <year>2011</year>
          . www.cs.ucr.edu/~eamonn/time_series_data/.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>J.</given-names>
            <surname>Lin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Keogh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Lonardi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>B.</given-names>
            <surname>Chiu</surname>
          </string-name>
          .
          <article-title>A symbolic representation of time series, with implications for streaming algorithms</article-title>
          .
          <source>In Proc. ACM SIGMOD Workshop on Research Issues in DMKD</source>
          , pages
          <volume>2</volume>
          {
          <fpage>11</fpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>J.</given-names>
            <surname>Lin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Khade</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Li</surname>
          </string-name>
          .
          <article-title>Rotation-invariant similarity in time series using bag-of-patterns representation</article-title>
          .
          <source>IJIS</source>
          ,
          <volume>39</volume>
          :
          <fpage>287</fpage>
          {
          <fpage>315</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>D. G.</given-names>
            <surname>Lowe</surname>
          </string-name>
          .
          <article-title>Distinctive image features from scale-invariant keypoints</article-title>
          .
          <source>IJCV</source>
          ,
          <volume>60</volume>
          (
          <issue>2</issue>
          ):
          <volume>91</volume>
          {
          <fpage>110</fpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>C. A.</given-names>
            <surname>Ratanamahatana</surname>
          </string-name>
          and
          <string-name>
            <given-names>E.</given-names>
            <surname>Keogh</surname>
          </string-name>
          .
          <article-title>Everything you know about dynamic time warping is wrong</article-title>
          .
          <source>In Proc. ACM SIGKDD Workshop on Mining Temporal and Sequential Data</source>
          , pages
          <volume>22</volume>
          {
          <fpage>25</fpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>P.</given-names>
            <surname>Senin</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Malinchik.</surname>
          </string-name>
          SAX-VSM:
          <article-title>Interpretable Time Series Classi cation Using SAX and Vector Space Model</article-title>
          .
          <source>Proc. ICDM</source>
          , pages
          <volume>1175</volume>
          {
          <fpage>1180</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>J.</given-names>
            <surname>Sivic</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Zisserman. Video Google</surname>
          </string-name>
          :
          <article-title>A text retrieval approach to object matching in videos</article-title>
          .
          <source>In Proc. ICCV</source>
          , pages
          <volume>1470</volume>
          {
          <fpage>1477</fpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. J.
          <string-name>
            <surname>Wang</surname>
            , P. Liu,
            <given-names>M. F.H.</given-names>
          </string-name>
          <string-name>
            <surname>She</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Nahavandi</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Kouzani</surname>
          </string-name>
          .
          <article-title>Bag-of-words Representation for Biomedical Time Series Classi cation</article-title>
          .
          <source>BSPC</source>
          ,
          <volume>8</volume>
          (
          <issue>6</issue>
          ):
          <volume>634</volume>
          {
          <fpage>644</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <given-names>J.</given-names>
            <surname>Xie</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Beigi</surname>
          </string-name>
          .
          <article-title>A Scale-Invariant Local Descriptor for Event Recognition in 1D Sensor Signals</article-title>
          .
          <source>In Proc. ICME</source>
          , pages
          <volume>1226</volume>
          {
          <fpage>1229</fpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>