Exact, Parallelizable Dynamic Time Warping Alignment with Linear Memory

Christopher Tralie, Elizabeth Dempsey
8/4/2020
cs.SDcs.IRcs.LG

Official code: ctralie/linmdtw (63 stars, Jupyter Notebook, Apache-2.0, last commit 2024-07-03).

Abstract

Audio alignment is a fundamental preprocessing step in many MIR pipelines. For two audio clips with M and N frames, respectively, the most popular approach, dynamic time warping (DTW), has O(MN) requirements in both memory and computation, which is prohibitive for frame-level alignments at reasonable rates.

Show full abstract

To address this, a variety of memory efficient algorithms exist to approximate the optimal alignment under the DTW cost. To our knowledge, however, no exact algorithms exist that are guaranteed to break the quadratic memory barrier. In this work, we present a divide and conquer algorithm that computes the exact globally optimal DTW alignment using O(M+N) memory. Its runtime is still O(MN), trading off memory for a 2x increase in computation. However, the algorithm can be parallelized up to a factor of min(M, N) with the same memory constraints, so it can still run more efficiently than the textbook version with an adequate GPU. We use our algorithm to compute exact alignments on a collection of orchestral music, which we use as ground truth to benchmark the alignment accuracy of several popular approximate alignment schemes at scales that were not previously possible.

View on arXivView PDF

Code Implementations(1)

ctralie/linmdtwOfficial100%
Apache-2.0

A linear memory, parallelizable algorithm for Dynamic Time Warping (DTW). Also contains cython implementations of FastDTW, and Memory-Restricted Multiscale DTW (MrMsDTW), and globally constrained DTW with the Sakoe-Chiba band (so-called "cdtw")

6311Jupyter Notebook, PythonSep 3, 20192 years agoApache-2.0

Similar Papers

Cite this paper

@article{tralie2020exact,
  title  = {Exact, Parallelizable Dynamic Time Warping Alignment with Linear Memory},
  author = {Christopher Tralie and Elizabeth Dempsey},
  year   = {2020},
  eprint = {2008.02734},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2008.02734}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2008.02734.svg)](https://codeofpaper.com/paper/2008.02734)

Discussion