BlockDTW: Efficient, Parallel and Differentiable Time-Series Alignment for Neural Learning Systems
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 $\mathcal{O}(N^2)$ to $\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 $73$ UCR Archive datasets, and (iii) training a deep model (hvEEGNet) for high-fidelity reconstruction of multichannel EEG signals. Results show that…
- arXiv
- 2612.02276
- Authors
- Alberto Zancanaro, Leonardo Badia, Giulia Cisotto
- Categories
- cs.LG · eess.SP