Skip to main content
QUICK REVIEW

[Paper Review] Parameterizing the cost function of Dynamic Time Warping with application to time series classification

Matthieu Herrmann, Chang Wei Tan|arXiv (Cornell University)|Jan 24, 2023
Time Series Analysis and ForecastingComputer Science3 citations
TL;DR

This paper proposes a tunable cost function for Dynamic Time Warping (DTW) using an exponent γ in λγ(a,b) = |a−b|γ, allowing dynamic weighting of small vs. large differences in time series. By optimizing γ per task, DTW+ and ADTW+ significantly improve classification accuracy over standard DTW and state-of-the-art models on UCR benchmark datasets, with PF+ achieving new SOTA performance on six tasks.

ABSTRACT

Dynamic Time Warping (DTW) is a popular time series distance measure that aligns the points in two series with one another. These alignments support warping of the time dimension to allow for processes that unfold at differing rates. The distance is the minimum sum of costs of the resulting alignments over any allowable warping of the time dimension. The cost of an alignment of two points is a function of the difference in the values of those points. The original cost function was the absolute value of this difference. Other cost functions have been proposed. A popular alternative is the square of the difference. However, to our knowledge, this is the first investigation of both the relative impacts of using different cost functions and the potential to tune cost functions to different tasks. We do so in this paper by using a tunable cost function λγ with parameter γ. We show that higher values of γ place greater weight on larger pairwise differences, while lower values place greater weight on smaller pairwise differences. We demonstrate that training γ significantly improves the accuracy of both the DTW nearest neighbor and Proximity Forest classifiers.

Motivation & Objective

  • To investigate the impact of different cost functions on DTW-based time series classification accuracy.
  • To address the lack of systematic tuning of the DTW cost function in practice, despite its known influence on alignment outcomes.
  • To develop a parameterized cost function family that allows task-specific optimization of sensitivity to small or large differences.
  • To evaluate the effectiveness of the proposed method in both nearest neighbor and ensemble classifiers, particularly Proximity Forest.
  • To demonstrate that cost function tuning can enhance robustness to noise and improve performance on real-world time series tasks.

Proposed method

  • Proposes a family of cost functions λγ(a,b) = |a−b|γ, where γ controls the relative weight on small vs. large differences.
  • Introduces two new distance measures: DTW+ (using λγ in standard DTW) and ADTW+ (using λγ in Accelerated DTW with banding).
  • Employs grid search over γ values (e.g., 0.5, 1, 2, 5) to find the optimal exponent for each dataset during training.
  • Applies the tuned γ to both DTW-based nearest neighbor classification and the Proximity Forest (PF) ensemble classifier.
  • Uses the UCR Time Series Classification Archive as the benchmark dataset collection for evaluation.
  • Compares performance against state-of-the-art models including HIVE-COTE 2.0, TS-CHIEF, MultiRocket, and InceptionTime.
(a) Series $S$
(a) Series $S$

Experimental results

Research questions

  • RQ1How does varying the exponent γ in the cost function |a−b|γ affect the similarity ranking of time series in DTW?
  • RQ2Can tuning γ improve classification accuracy in DTW-based and Proximity Forest-based time series classifiers?
  • RQ3Does the optimal γ value depend on the characteristics of the time series dataset, such as noise level or amplitude variation?
  • RQ4Can a parameterized cost function enhance robustness to noise in time series data?
  • RQ5Does the proposed method outperform existing state-of-the-art models on standard time series classification benchmarks?

Key findings

  • Tuning the cost function exponent γ significantly improves classification accuracy for both DTW nearest neighbor and Proximity Forest classifiers.
  • The proposed PF+ model achieves new state-of-the-art performance on six UCR benchmark datasets, outperforming HIVE-COTE 2.0, TS-CHIEF, MultiRocket, and InceptionTime.
  • On the ArrowHead dataset, PF+ achieved 89.71% accuracy, surpassing the next best method (HC2) at 86.29%.
  • On the SemgHandSubjectCh2 dataset, PF+ reached 93.11% accuracy, exceeding the best baseline (HC2) by 2.89 percentage points.
  • Lower γ values (e.g., 0.5) emphasize small-amplitude differences and favor alignments with consistent low-level patterns, while higher γ values (e.g., 5) prioritize large differences.
  • The method demonstrates that noise can be managed through cost function tuning: low γ exploits noise to penalize long warping paths, while high γ focuses on robust, large-scale features.
(b) Series $T$
(b) Series $T$

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.