Error-bounded Approximate Time Series Joins Using Compact Dictionary Representations of Time Series

Chin-Chia Michael Yeh, Yan Zheng, Junpeng Wang, Huiyuan Chen, Zhongfang Zhuang, Wei Zhang, Eamonn Keogh

TL;DR

This paper introduces a way to speed up time series "inter-similarity joins"—comparing one data stream against another—by up to 20x using compact dictionaries of representative patterns. By replacing a massive database with a tiny, curated dictionary, the authors achieve high-throughput anomaly detection with guaranteed error bounds and virtually no loss in accuracy.

What Problem Does This Paper Address?

Time series data mining often relies on the Matrix Profile, a powerful tool for finding motifs (repeated patterns) and discords (anomalies). While researchers have spent years optimizing "self-joins" (comparing a series to itself), the "inter-similarity join" (comparing a new query series to a large reference database) has remained a computational bottleneck.

In real-world scenarios like medical monitoring or industrial sensor tracking, you often want to compare incoming live data against a massive archive of "normal" behavior to spot anomalies. Doing this exactly is too slow for high-frequency data. This paper tackles the challenge of creating an approximate join that is fast enough for real-time streams but reliable enough to provide theoretical guarantees on its errors.

Methods

The authors propose a two-phase approach:

  1. Dictionary Learning: Instead of keeping every data point from a "normal" reference series, they build a compact dictionary. The algorithm greedily selects the most representative subsequences (motifs) while demoting patterns that are too similar to what’s already in the dictionary. This ensures the dictionary is diverse and non-redundant.
  2. Similarity Join: When new data arrives, it is joined against the dictionary rather than the original database. Because the dictionary is orders of magnitude smaller, the computation is significantly faster.
A query Q is compared against a time series T to create a distance profile S.

Crucially, the method provides two mathematical assurances:

  • No False Negatives: The approximate distance calculated will never be smaller than the true distance. In anomaly detection, this means you are guaranteed not to miss a "discord" (anomaly) that would have been found using the full data.
  • Max Error Guarantee: There is a provable upper bound on how much the approximate result can deviate from the truth.

Datasets

The researchers evaluated their method on several diverse datasets:

  • MIT-BIH Long-Term ECG Database: Heartbeat data used to test anomaly detection (e.g., spotting premature ventricular contractions).
  • 2017 Melbourne Pedestrian Dataset: Urban mobility data used to test how well the dictionary summarizes different classes of behavior.
  • Synthetic Data: Random walks and random noise were used as "sanity checks" to measure how the algorithm handles non-compressible data.

Key Insights and Ideas

  • Compressibility is Key: The authors observe that many real-world time series are highly redundant. They suggest that the inverse of the area under a Matrix Profile curve can actually serve as a measure of a dataset's "compressibility."
  • Semantic Summarization: Beyond speed, the dictionaries are human-readable. In the ECG tests, the dictionary elements naturally aligned with specific medical categories, like "normal beats" vs. "bundle branch block beats," providing an intuitive summary of the data.
  • Triangle Inequality for Error Bounds: The proof for the maximum error bound elegantly uses the triangle inequality in the high-dimensional space of subsequences, showing that the error is bounded by the distance between the original data and its closest representative in the dictionary.
The approximate matrix profile is built by taking the element-wise minimum of joins with individual dictionary elements.

Key Results

  • 20X Throughput: For ECG anomaly detection, the dictionary-based approach processed data 22.34 times faster than an exact join.
  • High Accuracy: Even when 99% of the reference data was removed (a 0.99 space-saving factor), the accuracy (AUC) for anomaly detection dropped by less than 4%.
  • Real-time Capability: While an exact join could only handle a 500 Hz sampling rate on their test machine, the proposed method could handle 10,000 Hz—or twenty 500 Hz streams simultaneously.

Limitations and Future Work

The primary limitation is the initial cost of building the dictionary. The learning phase has a time complexity of $O(n^2)$, where $n$ is the length of the reference time series. While this is a one-time "offline" cost, it could be prohibitive for extremely long archives. The authors suggest that using existing approximate self-join algorithms could further reduce this setup time.

Additionally, the current work assumes a static "normal" archive. Future research could explore how to dynamically update the dictionary as the underlying data distribution shifts over time (concept drift).

Summary updated

BibTeX
@inproceedings{yeh2022error,
  author = {Chin-Chia Michael Yeh and Yan Zheng and Junpeng Wang and Huiyuan Chen and Zhongfang Zhuang and Wei Zhang and Eamonn Keogh},
  title = {{Error-bounded Approximate Time Series Joins Using Compact Dictionary Representations of Time Series}},
  booktitle = {SDM},
  year = {2022},
  doi = {10.1137/1.9781611977172.21},
}
Figure