Skip to main content
QUICK REVIEW

[Paper Review] Deep Declarative Dynamic Time Warping for End-to-End Learning of Alignment Paths

Ming Xu, Sourav Garg|arXiv (Cornell University)|Mar 19, 2023
Time Series Analysis and ForecastingComputer Science3 citations
TL;DR

This paper proposes DecDTW, a differentiable dynamic time warping layer based on deep declarative networks and bi-level optimization, enabling end-to-end learning with exact optimal warping paths instead of soft approximations. Unlike Soft-DTW, DecDTW outputs discrete, exact alignment paths that can be directly optimized against ground truth, achieving state-of-the-art performance in audio-to-score alignment and visual place recognition with improved accuracy and training efficiency.

ABSTRACT

This paper addresses learning end-to-end models for time series data that include a temporal alignment step via dynamic time warping (DTW). Existing approaches to differentiable DTW either differentiate through a fixed warping path or apply a differentiable relaxation to the min operator found in the recursive steps used to solve the DTW problem. We instead propose a DTW layer based around bi-level optimisation and deep declarative networks, which we name DecDTW. By formulating DTW as a continuous, inequality constrained optimisation problem, we can compute gradients for the solution of the optimal alignment (with respect to the underlying time series) using implicit differentiation. An interesting byproduct of this formulation is that DecDTW outputs the optimal warping path between two time series as opposed to a soft approximation, recoverable from Soft-DTW. We show that this property is particularly useful for applications where downstream loss functions are defined on the optimal alignment path itself. This naturally occurs, for instance, when learning to improve the accuracy of predicted alignments against ground truth alignments. We evaluate DecDTW on two such applications, namely the audio-to-score alignment task in music information retrieval and the visual place recognition task in robotics, demonstrating state-of-the-art results in both.

Motivation & Objective

  • To address the limitation of existing differentiable DTW methods that rely on soft approximations or fixed warping paths, which hinder effective end-to-end learning when alignment path accuracy is critical.
  • To formulate dynamic time warping as a continuous, inequality-constrained optimization problem, enabling exact optimal alignment paths to be computed and differentiated.
  • To enable direct supervision of alignment paths via differentiable gradients, particularly when ground truth alignment paths are available.
  • To demonstrate improved performance and efficiency in real-world alignment tasks such as audio-to-score alignment and visual place recognition.
  • To provide a scalable, differentiable DTW layer that outputs discrete, interpretable warping paths suitable for path-dependent loss functions.

Proposed method

  • Formulate DTW as a continuous, inequality-constrained non-linear program (NLP) based on the GDTW (Generalized DTW) framework, enabling continuous-time warping functions.
  • Use a custom dynamic programming algorithm to solve the forward pass and compute the optimal warping path for two time series.
  • Apply implicit differentiation via the deep declarative networks (DDN) framework to backpropagate gradients through the optimal solution of the NLP.
  • Derive gradients using the implicit function theorem, avoiding the need to differentiate through the entire optimization process.
  • Integrate the DecDTW layer into deep learning models for end-to-end training with path-sensitive loss functions.
  • Optimize the warping path directly using a differentiable loss that penalizes discrepancies between predicted and ground truth alignment paths.
Figure 1: Classic DTW (a) is a discrete optimisation problem which finds the minimum cost warping path through a pairwise cost matrix (b). DecDTW uses a continuous time variant of classic DTW (GDTW) (c) and finds an optimal time warp function between two continuous time signals (d).
Figure 1: Classic DTW (a) is a discrete optimisation problem which finds the minimum cost warping path through a pairwise cost matrix (b). DecDTW uses a continuous time variant of classic DTW (GDTW) (c) and finds an optimal time warp function between two continuous time signals (d).

Experimental results

Research questions

  • RQ1Can a differentiable DTW layer be designed to output exact, discrete warping paths rather than soft approximations, enabling direct supervision of alignment accuracy?
  • RQ2Does using exact warping paths in end-to-end learning improve performance on tasks where alignment path accuracy is the primary objective?
  • RQ3How does DecDTW compare in efficiency and accuracy to Soft-DTW and other differentiable DTW baselines in real-world alignment tasks?
  • RQ4Can the proposed formulation be extended to support path-dependent loss functions that explicitly optimize for alignment fidelity?
  • RQ5What is the scalability trade-off between exact path computation and computational cost in long time series?

Key findings

  • DecDTW achieves state-of-the-art performance on audio-to-score alignment, outperforming Soft-DTW and other baselines with a 90.1% accuracy at 5m error tolerance on the MAESTRO dataset.
  • In visual place recognition, DecDTW achieves 88.0% accuracy at 100m tolerance on the TUM-ROV dataset, significantly outperforming DILATE and base models.
  • DecDTW reduces maximum GPS error by a substantial margin compared to base features and DILATE, especially in tighter error tolerances (≤5m), demonstrating superior alignment learning.
  • The method improves over DILATE by 13.5% in accuracy at 100m tolerance on the VPR task, indicating greater effectiveness in utilizing path information.
  • While GDTW is 15–50x slower than DTW at test time, the gap can be reduced to 4–12x with minimal accuracy loss (0.5%) by removing warp refinement iterations.
  • Fine-tuning with DecDTW significantly reduces localization error compared to OTAM and Along GT losses, which fail to improve over base features due to lack of path supervision.
Figure 2: Learning with path information. Left: Using Soft-DTW, one can define a loss between the soft, (i.e., $\gamma>0$ ) expected alignment path against a penalty matrix $\bm{\Omega}$ . During inference, DTW (i.e., $\gamma=0$ ) must be used to produce a predicted alignment. Right: Our DecDTW outp
Figure 2: Learning with path information. Left: Using Soft-DTW, one can define a loss between the soft, (i.e., $\gamma>0$ ) expected alignment path against a penalty matrix $\bm{\Omega}$ . During inference, DTW (i.e., $\gamma=0$ ) must be used to produce a predicted alignment. Right: Our DecDTW outp

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.