TILDE-Q: A Transformation Invariant Loss Function for Time-Series Forecasting

Hyunwook Lee, Chunggi Lee, Hongkyu Lim, Sungahn Ko · DOI

TL;DR

This paper introduces TILDE-Q, a novel loss function for time-series forecasting that goes beyond simple point-wise error minimization. By being invariant to common distortions like amplitude and phase shifts, TILDE-Q enables models to better capture the underlying "shape" and temporal dynamics of time-series data, leading to more robust and accurate forecasts.

What Problem Does This Paper Address?

Accurate time-series forecasting is crucial for many real-world applications, from predicting energy demand to traffic flow. However, existing forecasting models often struggle with complex temporal patterns, especially sudden changes or intricate shapes within the data. This difficulty stems from the common practice of using loss functions like Mean Absolute Error (MAE) or Mean Squared Error (MSE). These "point-wise" loss functions primarily focus on minimizing the difference between predicted and actual values at each time step, neglecting the overall shape and temporal dynamics of the series. This can lead to models that produce predictions that are numerically close but lack meaningful temporal patterns, or even generate results that are uncorrelated with the true signal. The authors argue that a truly effective forecasting loss function needs to be invariant to common distortions that preserve the underlying shape of the time-series.

Methods

The core contribution of this paper is the TILDE-Q (Transformation Invariant Loss function with Distance EQuilibrium). TILDE-Q is designed to be invariant to three key distortions: amplitude shifting, phase shifting, and uniform amplification. To achieve this, it combines three sub-losses:

  • Amplitude Shifting Invariance (La.shift): This sub-loss uses a softmax function on the signed distance between predicted and ground truth values. This encourages the model to learn an equal gap across all points, making it invariant to constant shifts in amplitude.
  • Phase Shifting Invariance (Lphase): This sub-loss leverages Fourier coefficients. By focusing on dominant frequencies and their relationships, it aims to capture periodicity and temporal patterns regardless of their exact timing. It also incorporates a normalization technique to handle uniform amplification.
  • Uniform Amplification Invariance (Lamp): This sub-loss uses normalized cross-correlation. This helps the model mimic the label sequences by comparing their autocorrelations and cross-correlations, making it robust to uniform scaling of the amplitude.

TILDE-Q combines these sub-losses with tunable hyperparameters ($\alpha$ and $\gamma$) to balance their contributions and adapt to different data characteristics (e.g., emphasizing non-periodic signals). The paper also discusses why other distortions like dynamic amplification and dynamic time scaling are generally incompatible with optimization objectives.

Datasets

The authors evaluated TILDE-Q on a variety of datasets, including:

  • Synthetic: An artificial dataset designed to test robustness to sudden changes (step functions).
  • ECG5000: A dataset of electrocardiogram data.
  • Traffic: Hourly road occupancy rates from California.
  • ETT (ETTm1): Electricity transformer temperature data.
  • ECL: Electricity consumption load data.
  • Weather: Meteorological indicators.
  • Exchange: Daily exchange rates.
  • ILI: Influenza-like illness patient data.

These datasets cover both periodic and non-periodic time-series, allowing for a comprehensive evaluation.

Key Insights and Ideas

  • Shape Matters More Than Just Point-wise Accuracy: The paper strongly advocates that for many time-series forecasting tasks, preserving the underlying "shape" and temporal dynamics is as, if not more, important than achieving perfect point-wise accuracy.
  • Distortion Invariance is Key: Traditional loss functions fail because they are sensitive to common transformations (like shifting or scaling) that don't change the fundamental shape of a time-series. TILDE-Q's invariance to these distortions is its core innovation.
  • Combining Different Signal Processing Techniques: TILDE-Q cleverly integrates concepts from signal processing (Fourier transforms, autocorrelation) with machine learning loss function design to achieve its goals.
  • Model Agnosticism: The proposed loss function is designed to be compatible with various deep learning architectures, as demonstrated by experiments with multiple state-of-the-art models.

Key Results

  • Superior Performance: Across numerous experiments with various models and datasets, TILDE-Q consistently outperformed baseline metrics like MSE and DILATE in terms of both accuracy (MAE, MSE) and shape-related metrics (DTW, LCSS).
  • Significant Improvements: For some models, like Autoformer and NSformer, TILDE-Q led to significant performance improvements (around 5%), suggesting it helps capture features that were previously overlooked. Crossformer saw an 8.85% improvement, highlighting TILDE-Q's ability to enhance temporal dependency modeling.
  • Qualitative Evidence: Visualizations show that models trained with TILDE-Q produce forecasts that better capture the shape, periodicity, and sudden changes in the time-series compared to MSE-trained models. These forecasts appear more "robust" and "shape-aware."

Limitations and Future Work

  • Hyperparameter Tuning: The effectiveness of TILDE-Q relies on the careful selection of hyperparameters $\alpha$ and $\gamma$, which might require tuning for different datasets.
  • Dynamic Distortions: The paper notes that dynamic time scaling and dynamic amplification are generally difficult to make invariant in a loss function without significant trade-offs.
  • Future Research: The authors suggest that future work could explore loss functions that consider causality and inter-domain dependency, building upon the insights gained from this research. They also highlight the potential for further investigation into how model design interacts with loss function effectiveness.

Summary updated

BibTeX
@inproceedings{lee2023tilde,
  author = {Hyunwook Lee and Chunggi Lee and Hongkyu Lim and Sungahn Ko},
  title = {{TILDE-Q: A Transformation Invariant Loss Function for Time-Series Forecasting}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=D1Sawu2y1QG},
}
Figure