Deep Time Series Forecasting With Shape and Temporal Criteria

Vincent Le Guen, Nicolas Thome

Abstract

Standard deep learning models for time series often produce "blurry" results because they rely on Mean Squared Error (MSE), which ignores the underlying geometry of the data. This paper introduces DILATE and STRIPE++, two novel frameworks that incorporate differentiable shape and temporal criteria into the training process. DILATE focuses on deterministic point-predictions by combining shape loss (soft-DTW) and temporal loss (soft-TDI). STRIPE++ addresses probabilistic forecasting by generating diverse trajectories through a Conditional Variational Autoencoder (cVAE) regularized by Determinantal Point Processes (DPP) with shape and time kernels. Experimental results on synthetic and real-world datasets like Traffic and ECG5000 show that these methods produce forecasts that are both sharper and more temporally accurate than MSE-based baselines.

Introduction: The "Averaging" Trap

In many real-world scenarios—such as traffic monitoring, medical heart rate tracking, or energy grid management—time series are non-stationary, featuring sudden spikes, drops, or regime shifts. The industry standard for training models on this data is the Mean Squared Error (MSE). However, MSE treats every time point independently, failing to account for the structural properties of the signal.

If a model predicts a sharp drop slightly early or late, MSE penalizes it as heavily as a complete miss. To minimize this "misalignment" penalty, models often learn to produce smooth, "blurry" averages that fail to capture the actual dynamics of the signal. This phenomenon is illustrated in the figure below, where different predictions with the same MSE yield vastly different qualitative results, and standard stochastic models fail to capture the true predictive distribution.

Comparison of MSE limitations in deterministic forecasting and the performance of probabilistic forecasting models.

Methodology

DILATE: Deterministic Forecasting

For point-predictions, the authors introduce the DIstortion Loss including shApe and TimE (DILATE). It decouples the loss into two primary components:

  • Shape Loss ($\mathcal{L}_{shape}$): Based on a differentiable "soft" version of Dynamic Time Warping (DTW). This allows gradients to flow back through the neural network, encouraging the model to match the "profile" or geometric shape of the target signal regardless of minor temporal shifts.
  • Temporal Loss ($\mathcal{L}_{time}$): Based on a smooth version of the Temporal Distortion Index (TDI). This term specifically penalizes the model for being "late" or "early," ensuring that sharp changes are correctly localized in time.
The DILATE framework: combining differentiable DTW for shape and TDI for temporal alignment.

STRIPE++: Probabilistic Forecasting

Predicting multiple possible futures requires capturing uncertainty. The authors present STRIPE++, which utilizes a Conditional Variational Autoencoder (cVAE) backbone. To ensure generated trajectories are not just minor pixel-wise variations, they employ Determinantal Point Processes (DPP). Crucially, the DPP kernels are designed using the shape and temporal criteria from DILATE. This forces the model to produce a set of forecasts that are diverse in how they look and when they happen, rather than just being diverse in raw values.

Experimental Evaluation

The researchers evaluated their methods on six diverse datasets, including synthetic benchmarks with step functions, ECG5000 (electrocardiograms), Traffic (California road occupancy), and Electricity consumption.

Key Results

  • State-of-the-Art Integration: When DILATE was used to train top-tier models like N-Beats and Informer, it consistently improved performance on shape (Ramp score) and timing (Hausdorff distance) metrics compared to standard MSE training.
  • Temporal Accuracy: On the Traffic dataset, DILATE reduced the TDI (temporal error) by nearly 30% compared to MSE-trained models on generic RNN architectures.
  • Sharper Probabilistic Forecasts: STRIPE++ significantly outperformed DeepAR and standard cVAEs. On synthetic datasets, it achieved a much higher F1 score for covering the true distribution of possible futures, avoiding the "mode collapse" common in standard generative models.
  • Efficiency: Custom CUDA/C++ kernels for these loss functions achieved a 35x speedup for long-sequence forecasts compared to standard automatic differentiation.

Conclusion

The core insight of this work is that shape and time should be treated as separate, differentiable components of the loss function. By moving beyond pixel-wise MSE, practitioners can train models that respect the underlying geometry of time series data. Future work includes extending these criteria to spatio-temporal data like video and integrating external event data to improve the anticipation of sharp changes.

Summary updated

BibTeX
@article{guen2021deep,
  author = {Vincent Le Guen and Nicolas Thome},
  title = {{Deep Time Series Forecasting With Shape and Temporal Criteria}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2021},
  doi = {10.1109/tpami.2022.3152862},
}
Figure