Papers
Topics
Authors
Recent
Search
2000 character limit reached

DILATE: Loss for Shape & Time in Forecasting

Updated 9 January 2026
  • The paper introduces DILATE with dual loss terms that separately optimize waveform shape fidelity and temporal precision.
  • It implements a soft-DTW shape term and a soft-TDI temporal term using dynamic programming for efficient, end-to-end gradient-based training.
  • Empirical results show significant MAE reductions over MSE and classic DTW, validating its effectiveness in diverse forecasting applications.

DILATE (Distortion Loss Incorporating Shape and Time) is a differentiable training objective designed for deep models in multi-step time series forecasting, with explicit sensitivity to both waveform shape and event timing. Unlike conventional losses such as Mean Squared Error (MSE) or classic Dynamic Time Warping (DTW), DILATE disentangles amplitude/shape fidelity and temporal precision via two smoothly-differentiable terms. The loss is implemented with dynamic programming, yielding computational efficiency and enabling end-to-end gradient-based training in complex neural architectures. Empirical evaluations demonstrate that DILATE substantially improves the detection and prediction of sudden or sharp changes in diverse domains such as physiological waveform modeling and traffic or electricity forecasting (Guen et al., 2021, Guen et al., 2019, Sahoo et al., 2 Jan 2026).

1. Mathematical Formulation and Key Components

The DILATE loss computes a weighted sum of two distortion terms over predicted and observed sequences of equal length, yy and y^\hat y, parameterized by a tradeoff scalar α[0,1]\alpha \in [0,1] and a soft-min smoothing parameter γ>0\gamma > 0:

LDILATE(y^,y)=αLshape(y^,y)+(1α)Ltemporal(y^,y)\mathcal{L}_{\mathrm{DILATE}}(\hat y, y) = \alpha\,\mathcal{L}_{\mathrm{shape}}(\hat y, y) + (1-\alpha)\,\mathcal{L}_{\mathrm{temporal}}(\hat y, y)

  • Shape term (soft-DTW): Measures morphological similarity via a log-sum-exp relaxation of classic DTW. For Δij=y^iyj2\Delta_{ij} = \lVert \hat y_i - y_j \rVert^2 (or y^iyj|\hat y_i - y_j| in (Sahoo et al., 2 Jan 2026)), soft-DTW is:

DTW~γ(y^,y)=γlog[AAexp(A,Δ/γ)]\widetilde{\mathrm{DTW}}_\gamma(\hat y, y) = -\gamma\,\log\left[\sum_{A \in \mathcal{A}} \exp\left(-\langle A, \Delta \rangle / \gamma\right)\right]

where A\mathcal{A} denotes monotonic alignment matrices. As γ0+\gamma \to 0^+, soft-DTW converges to classic DTW.

  • Temporal term (soft-TDI): Assesses alignment by penalizing off-diagonal associations, measuring timing errors. Using a penalty matrix Ω\Omega (typically Ωij=(ij)2\Omega_{ij} = (i-j)^2 or ij|i-j|):

TDI~γ(y^,y)=Aγ,Ω\widetilde{\mathrm{TDI}}_\gamma(\hat y, y) = \langle A^*_\gamma, \Omega \rangle

with Aγ=ΔDTW~γ(y^,y)A^*_\gamma = \nabla_\Delta \widetilde{\mathrm{DTW}}_\gamma(\hat y, y), the expected soft-alignments under the Gibbs measure induced by Δ\Delta. This yields differentiability in both model output and input sequences.

2. Computational Implementation and Differentiation

Both shape and temporal components leverage dynamic programming for efficient evaluation and gradient computation:

  • Forward DP: Constructs recurrence matrices to compute soft-DTW in O(k2)O(k^2) time and space, avoiding enumeration of all O(3k)O(3^k) alignment paths.
  • Backward DP: Derivatives with respect to Δ\Delta are computed via reverse dynamic programming. The temporal loss multiplies AγA^*_\gamma with Ω\Omega and backpropagates through the Hessian of DTW~γ\widetilde{\mathrm{DTW}}_\gamma (Guen et al., 2019).
  • PyTorch integration: Custom autograd functions exploit intermediate DP tables for both forward and backward passes, yielding up to 35×35\times speed-up versus naïve autograd for k=100k = 100 (Guen et al., 2019, Guen et al., 2021).

3. Parameterization and Hyperparameter Selection

DILATE introduces the following tunable elements for practical deployment:

Parameter Purpose Typical Values
α\alpha Shape/timing balance in total loss 0.3α0.70.3 \leq \alpha \leq 0.7
γ\gamma Smoothing in soft-minimum 1e21e{-2} to 1e11e{-1}
Ω\Omega Temporal penalty matrix (ij)2(i-j)^2, ij|i-j|
β,η\beta, \eta KD vs DILATE weighting (Sahoo et al., 2 Jan 2026) β=10\beta=10, η=10\eta=10

Cross-validation or ablation can identify optimal hyperparameters. For KDPhys (rPPG), best MAE was achieved for α=0.5\alpha = 0.5 and γ=102\gamma = 10^{-2} (Sahoo et al., 2 Jan 2026). For generic forecasting and biomedical signals, similar mid-range α\alpha achieves robust shape and event detection.

4. Domain-Specific Roles and Significance

The shape term in DILATE enforces morphological fidelity, preserving oscillations, amplitudes, and salient event structure (e.g., systolic ramp in rPPG). The temporal term penalizes horizontal event shifts, ensuring sharp event localization—a property vital for domains where precise timing of peaks, drops, or change-points is critical.

For rPPG extraction, DILATE ensures predicted pulse cycles align in both morphology and event timing, outperforming MSE or frequency-domain losses that cannot separate these criteria (Sahoo et al., 2 Jan 2026). In traffic or ECG forecasting, DILATE detects sudden transitions and matches ground-truth event positions better than alternatives (Guen et al., 2019, Guen et al., 2021).

5. Comparative Evaluation and Ablation Results

Empirical studies confirm DILATE's advantages. On standard benchmarks:

Loss MAE/DTW/TDI Improvement Case
DILATE MAE reduction by 18.15%18.15\% KDPhys rPPG (Sahoo et al., 2 Jan 2026)
DILATE vs MSE DTW down 1020%10-20\%, TDI 1530%15-30\% ECG, traffic, electricity (Guen et al., 2021)
DILATE vs TD+FD 22.3%22.3\% lower MAE UBFC rPPG (Sahoo et al., 2 Jan 2026)

In ablation, a sweep of α\alpha in DILATE shows optimal MAE and RMSE centrally (α=0.5\alpha=0.5); shifting towards pure shape or timing degrades performance (Sahoo et al., 2 Jan 2026). Separate shape and temporal terms outperform "tangled" DILATE or band-constrained soft-DTW (Guen et al., 2019).

6. Integration into Neural Architectures and Applications

DILATE's differentiability, DP-based efficiency, and agnostic design allow integration with MLPs, RNNs, Seq2Seq, Transformer, and convolutional architectures. No changes to output layers are required—only the loss function is modified (Guen et al., 2019, Guen et al., 2021).

In KDPhys, DILATE is combined with an Attention Feature Distillation term for end-to-end knowledge transfer from 3D CNN teachers to lightweight 2D students (Sahoo et al., 2 Jan 2026). In STRIPE++ (Guen et al., 2021), DILATE-driven kernels enable determinantal point process (DPP) diversity in probabilistic multi-future forecasting, with quality-weighting to encourage sharp and temporally varied forecasts.

DILATE is robust to noise, benefiting from γ\gamma annealing and gradient clipping strategies for numerically demanding signals.

7. Limitations and Variants

DILATE's performance is dependent on correct balancing of shape and time—extreme values of α\alpha can render either criterion dominant to the detriment of the other. The quadratic time complexity (O(k2)O(k^2)) scales favourably for moderate-length sequences but becomes limiting in very long horizons. Tangled variants that combine shape and time in a single soft-DTW term underperform the separated approach (Guen et al., 2019).

For domain-specific applications such as noisy biomedical signals or traffic, asymmetric penalty matrices Ω\Omega or adaptive smoothing may further improve event localization, especially when early or late shifts have different functional interpretations.


DILATE establishes a rigorous, efficiently-computable, and highly adaptable framework for deep time series learning with sensitivity to both feature morphology and timing. Its widespread empirical validation positions it as a strong alternative to conventional loss formulations in forecasting and physiological waveform analysis (Guen et al., 2021, Sahoo et al., 2 Jan 2026, Guen et al., 2019).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

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

Follow Topic

Get notified by email when new papers are published related to Distortion Loss Incorporating Shape and Time (DILATE).