Ultra-Fast Shapelets for Time Series Classification

Martin Wistuba, Josif Grabocka, Lars Schmidt-ThiemearXiv 2015

Abstract

Time series shapelets are discriminative subsequences and their similarity to a time series can be used for time series classification. Since the discovery of time series shapelets is costly in terms of time, the applicability on long or multivariate time series is difficult. In this work we propose Ultra-Fast Shapelets that uses a number of random shapelets. It is shown that Ultra-Fast Shapelets yield the same prediction quality as current state-of-the-art shapelet-based time series classifiers that carefully select the shapelets by being by up to three orders of magnitudes. Since this method allows a ultra-fast shapelet discovery, using shapelets for long multivariate time series classification becomes feasible. A method for using shapelets for multivariate time series is proposed and Ultra-Fast Shapelets is proven to be successful in comparison to state-of-the-art multivariate time series classifiers on 15 multivariate time series datasets from various domains. Finally, time series derivatives that have proven to be useful for other time series classifiers are investigated for the shapelet-based classifiers. It is shown that they have a positive impact and that they are easy to integrate with a simple preprocessing step, without the need of adapting the shapelet discovery algorithm.

Introduction

In time series classification (TSC), "shapelets" are considered the gold standard for interpretability. A shapelet is a small, discriminative subsequence—such as a specific "dip" in an ECG reading—that identifies a class regardless of when it occurs in the temporal sequence.

However, finding these shapelets is a significant computational challenge. Traditional exhaustive searches compare every possible subsequence of every possible length against every time series in a dataset. For long or multivariate (multi-stream) data, this process is often too slow for practical use. While modern alternatives exist, they frequently rely on complex pruning or optimization techniques. The Ultra-Fast Shapelets (UFS) approach addresses this by demonstrating that sophisticated selection logic is unnecessary if one can sample a sufficient number of shapelets at random very quickly.

Methodology

Ultra-Fast Shapelets (UFS) revolutionizes the standard Shapelet Transformation pipeline by replacing expensive supervised discovery with random sampling. The process follows these core steps:

  1. Random Sampling: Instead of ranking subsequences by Information Gain or F-Stat, UFS selects a fixed number ($p$) of subsequences at random from the training set.
  2. Distance Transformation: For every time series, UFS calculates the minimum Euclidean distance to each of these $p$ random shapelets. This transforms the raw time series into a $p$-dimensional feature vector.
  3. Multivariate and Derivative Extensions: For multivariate data, shapelets are sampled from each stream. Additionally, calculating the first-order derivative of the time series provides a "velocity" stream that captures the shape of trends more effectively.
  4. Classification: These distance features are fed into well-regularized classifiers like Random Forests or Linear SVMs.
The Shapelet Transformation pipeline, illustrating the flow from candidate extraction to final class prediction.

By moving the discriminative logic from the discovery phase to the training phase, the classifier acts as a filter, identifying which random shapelets are useful for the specific task.

Experimental Results

The researchers evaluated UFS across 52 univariate and 15 multivariate datasets from the UCR/UEA archive. The results highlight a dramatic shift in the efficiency-accuracy trade-off.

Massive Speedups: UFS is consistently 100x to 1,000x faster than traditional methods like Learning Shapelets (LS) or Exhaustive Search (ES). As shown in the performance comparison, while exhaustive search may reach peak accuracy with fewer shapelets, the time cost is astronomical compared to the near-instantaneous random selection used in UFS.

Comparison of accuracy and computation time between Ultra-Fast Selection and Exhaustive Search. Note the logarithmic scale for time.

Competitive Accuracy: Despite the stochastic nature of the discovery, UFS matched or exceeded state-of-the-art accuracy on univariate data. In multivariate contexts, UFS combined with derivatives outperformed the previous state-of-the-art (SMTS) on 11 out of 15 datasets. The method proved remarkably stable; as long as the number of random shapelets is sufficiently high (e.g., 10,000 per stream), accuracy remains high and consistent.

Conclusion

Ultra-Fast Shapelets demonstrate that redundancy in time series data can be exploited to bypass expensive search algorithms. By leveraging random sampling and the power of modern regularized classifiers, UFS makes shapelet-based classification feasible for large-scale and multivariate problems. While the method introduces some memory overhead due to large feature vectors, its speed and accuracy make it a compelling choice for real-world time series analysis.

Summary updated

BibTeX
@misc{wistuba2015ultra,
  author = {Martin Wistuba and Josif Grabocka and Lars Schmidt-Thieme},
  title = {{Ultra-Fast Shapelets for Time Series Classification}},
  year = {2015},
  eprint = {1503.05018},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1503.05018},
}
Figure