Skip to content

BlockDTW: Efficient, Parallel and Differentiable Time-Series Alignment for Neural Learning Systems

Alberto Zancanaro, Leonardo Badia, Giulia Cisotto

cs.LG

Abstract

Dynamic Time Warping (DTW) is a cornerstone technique for measuring similarity between time-series under temporal distortions, but its quadratic time and space complexity limits scalability, real-time deployment, and its use as a loss function in neural networks. Existing approximations often trade off accuracy, differentiability, or computational efficiency. We introduce BlockDTW, a block-wise, differentiable temporal-alignment loss that partitions time-series into non-overlapping segments, computes local alignments independently, and aggregates them into a global objective compatible with gradient-based optimization. By constraining the admissible warping paths to block junctions (\emph{islands}), BlockDTW reduces complexity from O(N2)\mathcal{O}(N^2) to O(bN)\mathcal{O}(bN), and its parallel implementation processes blocks concurrently. We evaluate BlockDTW on three tasks: (i) similarity measurement and alignment of synthetic frequency-varying sinusoids, (ii) time-series prediction with feedforward networks on the Trace dataset and 7373 UCR Archive datasets, and (iii) training a deep model (hvEEGNet) for high-fidelity reconstruction of multichannel EEG signals. Results show that BlockDTW closely approximates SoftDTW, achieves prediction and reconstruction performance comparable to established differentiable alignment losses, and substantially reduces computational cost, with hardware-dependent speedups up to 120×120\times in parallel-runtime benchmarks. BlockDTW is thus an efficient and scalable differentiable objective for neural models on temporally distorted sequences, with particular potential for real-time and biomedical applications.

Create a lesson

Metadata

Categories
cs.LG, eess.SP