Papers
Topics
Authors
Recent
Search
2000 character limit reached

Time Series Classification through Diffeomorphic Time Warping (DiffTW)

Published 22 Jun 2026 in stat.ML and cs.LG | (2606.23472v1)

Abstract: Time series classification involves learning a mapping from a continuous, temporally ordered sequence of real-valued observations to a discrete response variable, like class labels. This task is fundamental in domains, including health monitoring, where the temporal structure of data is critical for accurate prediction. Dynamic Time Warping (DTW) is a standard technique for measuring similarity between sequences varying in time or speed. However, DTW is restricted to discrete point matching. To move beyond pairwise alignment, we propose a theoretical framework that learns mappings between real-valued functions. These mappings approximate the flow associated with the characteristic curves of a linear transport equation with a space-dependent velocity field, providing a diffeomorphic transformation between two time series. Using the method of characteristics, we transform this partial differential equation into ordinary differential equations (ODEs) modeling system dynamics. The objective function used to learn these ODEs derives from the fundamental theorem of calculus. To enable flexible, expressive representations of the velocity field, we utilize reproducing kernel Hilbert spaces and optimal control methods. Our method, Diffeomorphic Time Warping (DiffTW), provides a theoretically grounded dissimilarity measure. Using a 1-nearest neighbor classifier, DiffTW outperforms DTW on 60 of 86 datasets.

Summary

  • The paper introduces DiffTW, which formulates temporal alignment as the solution to a PDE driven by a learned, space-dependent velocity field.
  • It leverages RKHS theory, optimal control, and gradient-based optimization to achieve efficient, interpretable, and differentiable warping of time series data.
  • Empirical results show DiffTW attains higher classification accuracy on diverse datasets with linear computational complexity versus DTW’s quadratic cost.

Diffeomorphic Time Warping (DiffTW) for Time Series Classification

Introduction

Dynamic Time Warping (DTW) has dominated time series classification for several decades, providing a robust mechanism for aligning signals subject to local time distortions. However, DTW and its extensive suite of extensions remain fundamentally discrete and exhibit several limitations: reliance on pairwise alignment, high quadratic complexity, and weak modeling of underlying sequence dynamics. "Time Series Classification through Diffeomorphic Time Warping (DiffTW)" (2606.23472) departs from these traditions by introducing a theoretical and algorithmic framework for continuous, diffeomorphic alignment of time series, formulating the warping process as the solution to a PDE driven by a learned, space-dependent velocity field. DiffTW advances time series classification by integrating tools from RKHS theory, optimal control, and continuous optimization, providing improvements in both efficiency and interpretability.

Theoretical Framework and Methodology

DiffTW models the temporal deformation between two signals, ϕ0\phi_0 (source) and ϕ1\phi_1 (target), as a solution to a linear transport (advection) PDE. The evolution from ϕ0\phi_0 to ϕ1\phi_1 is governed by a space-dependent velocity field α(x)\alpha(x), with the key property that the mapping from x(0)x(0) to x(1)x(1) is a diffeomorphism, ensuring smoothness and invertibility. This PDE is reduced via the method of characteristics to ODEs for trajectories x(t)x(t) and is parameterized using random Fourier features to yield efficient, expressive RKHS-based representations.

The learning objective minimizes the L2L^2 loss between the warped source and target, regularized by the RKHS norm of α\alpha, subject to ODE constraints. Gradient-based optimization applies an adjoint method, leading to efficient, differentiable training with continuous backpropagation through time, reminiscent of neural ODEs.

The imposition of zero-boundary constraints on ϕ1\phi_10 is handled via RKHS projections, ensuring that time warpings avoid undesired endpoint distortions. This further encourages the learned dynamics to focus on the signal's internal structure. Figure 1

Figure 1: The original function ϕ1\phi_11 and target ϕ1\phi_12, showing the learned flow transporting the source to the target via characteristic paths under the diffeomorphic vector field.

Empirical Results and Experimental Setup

Toy Problem

A controlled synthetic example validates DiffTW’s ability to recover known ground-truth dynamics. Here, the learned velocity field rapidly converges to the underlying transport, and the objective decreases smoothly.

Electrocardiogram Study

On MIT-BIH Arrhythmia Database ECG data, DiffTW demonstrates alignment fidelity superior to DTW, successfully morphing normal beats into arrhythmic variants with expedited convergence. Figure 2

Figure 2: Example ECG signal with P wave, QRS complex, and T wave, highlighting morphological complexity typical of biomedical signals.

Figure 3

Figure 3: DiffTW warping ECG signals (N to R), visualizing the characteristic-driven transport and the optimization trajectory in vector field space.

Large-Scale Benchmarking

DiffTW and standard DTW were systematically compared via 1-NN on 86 datasets (85 from UCR and the specialized ECG corpus). A substantial grid search for hyperparameters (regularization and kernel bandwidth) was performed using cross-validation on training splits, with GPU acceleration and Adam optimization throughout.

DiffTW achieves a higher classification accuracy on 60 of 86 datasets, DTW outperforms on 22, with 4 ties. This outcome is statistically significant (Wilcoxon signed-rank ϕ1\phi_13), indicating that the continuous, diffeomorphic alignment produced by DiffTW can more reliably capture complex, morphologically relevant deformations between signals. Figure 4

Figure 4: Accuracy comparison across datasets, showing improved median and upper quantile results for DiffTW over DTW.

Analysis of Strengths and Limitations

The key empirical advantage of DiffTW is its capacity for precise localization and transport of waveform features, especially those with smooth or phase-shifted character. For instance, on the synthetic BME dataset, DiffTW yields perfect accuracy, demonstrating fine-grained alignment of localized geometric features. Figure 5

Figure 5: DiffTW precisely aligns temporally-localized features on the BME dataset, outperforming discretized DTW.

Conversely, DiffTW's integrated framework is less robust on signals containing sparse, high-amplitude anomalies (e.g., ACSFOne), where the discrete, non-smooth structure is more naturally captured by the point-wise step nature of DTW. Figure 6

Figure 6: ACSFOne displays the shortcomings of a continuous method when faced with sparse, burst-like time series, where DTW's rigid steps are advantageous.

On deeply noisy or intrinsically ambiguous datasets such as Ham, neither method offers a statistical advantage; both converge to equivalent accuracy, suggesting that alignment capacity is not the limiting performance factor. Figure 7

Figure 7: Ham dataset—complex and overlapping, both methods yield indistinguishable classification efficacy.

Importantly, DiffTW’s computational complexity is reduced to linear in sequence length, a substantial advantage over DTW’s quadratic profile, due to the absence of explicit pairwise cost matrices.

Implications and Future Directions

DiffTW materially changes the paradigm of time series alignment from discrete path-finding to continuous optimal control. Its diffeomorphic approach better models the physical or biological continuity inherent in many scientific and engineering time series, supporting interpretable, invertible transformations.

Theoretically, the work links the time series alignment problem to topics in dynamical systems, PDEs, kernel methods, and optimal transport. This invites future research to further combine learning of flows, e.g., with hybrid DTW initialization, as well as scaling up to even higher dimensional (multivariate or non-uniform) datasets, and to explore deeper integration with probabilistic and Bayesian time series models.

There is clear potential for further acceleration and real-time deployment with hardware-aware implementations, as well as adaptation to unsupervised clustering, anomaly detection, and generative modeling for time series.

Conclusion

DiffTW establishes a new framework for time series classification by formulating temporal alignment as an optimal diffeomorphic transport in a learned RKHS velocity field. Extensive empirical evidence confirms that DiffTW consistently yields higher classification accuracy compared to DTW across diverse datasets, especially those with complex, smoothly deforming waveform morphologies. The method is computationally efficient, interpretable, and extendable. However, there remain conditions—principally, highly discrete or burst-type signals—where classical discrete warping retains advantages. Future developments should explore hybridization and broader application contexts, but DiffTW's move to a continuous, gradient-based alignment paradigm marks a substantial contribution to the theory and practice of time-series analysis.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 7 likes about this paper.