Time Series Representations with Hard-Coded Invariances

Thibaut Germain, Chrysoula Kosma, Laurent OudreICML 2025

Automatically extracting robust representations from large, complex time series data is critical for real-world applications. However, deep learning models often struggle with common "deformations"—nuisances like a sensor's baseline drifting over time (offset shift) or a gradual increase in signal intensity (linear trend).

While standard Convolutional Neural Networks (CNNs) are spatially invariant (they can find a pattern regardless of where it happens in time), they are highly sensitive to these vertical deformations. Traditionally, researchers handle this by manually preprocessing the data (e.g., Z-normalization) or using data augmentation to force the model to learn to ignore the deformations. Both approaches can be brittle and inefficient.

To address this, researchers have introduced InvConvNet, a novel convolutional architecture that mathematically hard-codes invariances to common time-series deformations directly into the network layers.

Hard-Coding Invariances: The Methodology

The core contribution of InvConvNet is the mathematical formulation of Invariant Convolutions. Instead of hoping the network learns to ignore a trend, the authors use group theory and orthogonal projections to make the network mathematically incapable of being "fooled" by it.

  • Group Actions & Orthogonal Projections: Deformations like adding a constant baseline or a linear trend are modeled as "group actions" on the time-series signal. To make a convolution invariant to a specific deformation, the signal is projected onto a subspace orthogonal to that deformation. Essentially, the filter mathematically "subtracts" the local trend before performing the dot product.
  • The Pool of Convolutions: Rather than relying solely on invariant filters, InvConvNet uses a layer that concatenates standard filters with those invariant to offsets and linear trends. This allows the model to capture both the raw signal and the deformation-free features simultaneously.
  • Efficiency via FFT: Because invariant convolutions require larger kernel sizes to be effective, they are implemented using the Fast Fourier Transform (FFT). This keeps the computational complexity manageable ($O(L \log L)$) regardless of kernel size.
Comparison of standard and invariant convolutions on an ECG signal with a drifting baseline.

As seen in the visualization above, standard CNN feature maps ($C_{normal}$) drift chaotically when a trend is present in the raw signal. In contrast, the linear-trend invariant convolution ($C_{LT}$) remains perfectly stable, cleanly extracting the relevant peaks regardless of the underlying baseline shift.

Key Insights and Performance

By hard-coding these invariances, InvConvNet achieves significant advantages over both standard CNNs and modern self-supervised contrastive learning methods.

  • Robustness to Distribution Shifts: In "out-of-distribution" scenarios where test data contains stronger trends than the training data, hard-coded models dramatically outperform learned approaches. For example, on the HandOutlines dataset, adding a random linear trend caused a standard CNN's accuracy to plummet from 77% to 37%. InvConvNet maintained a 70% accuracy without ever seeing a trend during training.
  • Local vs. Global Processing: Unlike global Z-normalization, invariant convolutions work locally within the sliding window. They can easily handle signals where a trend changes direction or slope throughout the series.
  • State-of-the-Art Baselines: InvConvNet achieved the best mean rank across 26 diverse datasets from the UEA Multivariate Repository, outperforming heavyweights like TimesNet, ROCKET, and PatchTST.
Accuracy vs. Computational Cost across various time series models.

Despite the mathematical overhead of orthogonal projections, the FFT implementation allows InvConvNet to remain highly efficient. It trains faster and requires a significantly smaller memory footprint than many state-of-the-art Transformer-based models, offering an exceptional trade-off between accuracy and computational cost.

Limitations and Future Directions

While highly effective, the current iteration of InvConvNet focuses primarily on affine deformations (constant offsets and linear trends). Real-world data often contains non-linear trends, such as exponential curves or complex seasonality, which are not yet hard-coded into this specific architecture. Additionally, the "Pool of Convolutions" introduces new hyperparameters, such as the optimal ratio of normal versus invariant filters per layer.

Future work aims to extend this framework to non-linear functions—like splines or low-frequency cosine bases—to handle more complex seasonal distortions, and to explore the potential of these invariant layers in fully unsupervised learning environments.

Summary updated

BibTeX
@inproceedings{germain2025time,
  author = {Thibaut Germain and Chrysoula Kosma and Laurent Oudre},
  title = {{Time Series Representations with Hard-Coded Invariances}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=SaKPKyjDp6},
}
Figure