TL;DR
Shapelet-based time series classification is highly accurate and interpretable but notoriously slow due to its need for an exhaustive search over all possible subsequences. This paper introduces SALSA-R, a randomized sampling algorithm that finds high-quality shapelets orders of magnitude faster than traditional methods while simultaneously mitigating the risk of overfitting.
What Problem Does This Paper Address?
Time series classification—such as identifying anomalies in ECG data or classifying sensor readings—can be effectively solved using "shapelets." Shapelets are maximally discriminative local subsequences extracted from the data that define a specific class.
While shapelets offer excellent accuracy and interpretability (unlike many black-box neural networks), finding the best shapelet is a computational nightmare. Standard approaches require an exhaustive search: evaluating every possible subsequence length at every possible starting position across every single time series in the training set. For even moderately sized datasets, the number of candidates quickly reaches tens of millions, turning model training into an ordeal that takes days or weeks.
Methods
The authors propose the ShApLet SAmpling (SALSA) algorithm to break this computational bottleneck. Instead of searching exhaustively, SALSA samples the shapelet space and stops early once the quality of new shapelets stabilizes (i.e., when no significant improvement in Information Gain or margin is observed over a set number of iterations, $NI$).
The key breakthrough variant is SALSA-R, which utilizes a random evaluation order over the entire shapelet space, mixing all lengths and offsets uniformly. To optimize the construction of the rest of the classification tree, SALSA-R computes and caches the distances from the sampled shapelets to all time series at the root node. This allows subsequent nodes in the tree to reuse precalculated distances without any extra computational cost.
The authors compared three ordering strategies to find the best shapelets:
- Simple: Iterating through shapelets in increasing order of length (the standard approach).
- Binary: Fast initial coverage using non-overlapping subsequences.
- Random (SALSA-R): A completely randomized permutation of the entire shapelet space.
Datasets
The algorithm was evaluated on seven standard one-dimensional time series benchmarks from the UCR archive:
- arrowhead
- coffee
- controlCharts
- ecgPatterns
- mallat
- shield
- wheat
These datasets span various real-world and synthetic domains, featuring a wide range of time series lengths, training set sizes, and class counts.
Key Insights and Ideas
- Shapelets are Clustered, Not Uniform: Why does random sampling work so well? By mapping out the distribution of top-tier shapelets, the authors discovered that high-quality shapelets are not evenly distributed. Instead, they are tightly concentrated in specific clusters of lengths and locations (the true "fingerprints" of the classes). Length-based sorting forces an algorithm to waste days scanning irrelevant lengths first. Random sampling cuts across the entire space, hitting these rich clusters almost immediately.
- More Searching Can Hurt (Overfitting): Counterintuitively, evaluating all shapelets can actually degrade model accuracy. The authors observed that accuracy often peaks early and then declines as more shapelets are checked. Exhaustive searches risk memorizing training set noise, making SALSA-R's early stopping mechanism a regularizing feature rather than just a shortcut.
Key Results
- Massive Speedups: SALSA-R reduces training times from days to minutes or seconds. For the mallat dataset, the standard exhaustive algorithm takes over two weeks (>1.2 million seconds). SALSA-R achieves comparable accuracy in just 114 seconds (with $NI=10,000$).
- Maintained or Improved Accuracy: Despite checking only a tiny fraction of the shapelet space (sometimes as low as 1/1000th), SALSA-R delivers accuracy within 2% of the exhaustive search. Remarkably, it actually improves accuracy on several datasets—such as wheat, where accuracy jumped from 58.0% to 69.2%—by successfully avoiding overfitting.
Limitations and Future Work
- Incompatibility with Distance Pruning: Because SALSA relies on caching root-level distances to accelerate subtree generation, it cannot easily integrate existing distance-pruning optimizations (which discard shapelets early before full distance matrices are computed).
- Future Directions: The authors suggest exploring hybrid sampling strategies—such as starting with uniform random sampling to locate high-quality clusters, and then switching to a localized, thorough search within those regions. They also note that alternative shapelet quality metrics beyond Information Gain could be explored.
Summary updated