Finding Order in Chaos: A Novel Data Augmentation Method for Time Series in Contrastive Learning

Berken Utku Demirel, Christian Holz

Introduction

Contrastive learning has emerged as a powerful paradigm for self-supervised representation learning, relying heavily on data augmentation to generate diverse "positive pairs." While techniques like cropping and rotation are effective for computer vision, time-series data—particularly quasi-periodic signals such as electrocardiograms (ECG) or inertial measurement unit (IMU) data—is significantly more fragile.

Standard augmentation techniques like "mixup" (linear interpolation) often lead to destructive interference. When two periodic signals are slightly out of phase, their linear combination can result in a garbled or flattened signal, destroying the semantic information necessary for downstream tasks. This paper introduces a smarter, phase-aware mixup technique designed to preserve the underlying "order" within the "chaos" of augmented signals.

Methodology: Phase-Aware Mixup and Latent Control

The researchers from ETH Zürich propose a frequency-domain approach to augmentation that treats signal magnitude and phase as independent features.

1. Phase-Aware Mixup

Instead of interpolating raw time-domain signals, the data is transformed via a Fourier Transform. Magnitudes are mixed linearly, while phases are mixed by interpolating along the shortest angular distance between samples. This prevents signal cancellation and ensures that the augmented sample remains a semantically valid representation of its class.

2. Latent-Space Coefficient Control

To further refine the augmentation, the authors employ a Variational Autoencoder (VAE) to map samples into a latent space. The mixup strength is dynamically adjusted based on the latent distance between samples:

  • Intra-class pairs (close in latent space) are mixed aggressively to create challenging "hard positives."
  • Inter-class pairs (far apart) are mixed lightly to avoid generating "impossible" samples that might confuse the model's decision boundaries.

Experimental Evaluation

The method was rigorously evaluated across eight datasets spanning three critical real-world domains:

  • Human Activity Recognition (HAR): UCIHAR, HHAR, and USC-HAD.
  • Heart Rate Estimation: IEEE SPC (SPC12, SPC22) and DaLia (PPG signals).
  • Cardiovascular Disease (CVD) Detection: CPSC2018 and Chapman (ECG recordings).

Key Results

The proposed method consistently outperformed state-of-the-art (SOTA) augmentation techniques, including NNCLR, IDAA, and DACL.

Key highlights include:

  • Activity Recognition: Outperformed DACL by up to 20.8% in accuracy on the UCIHAR dataset.
  • Heart Rate Prediction: Achieved a Mean Absolute Error (MAE) of 10.57 on the DaLia dataset, significantly lower than competing self-supervised methods.
  • Disease Detection: Reached a peak AUC of 95.90% on the Chapman dataset, demonstrating superior performance even against complex adversarial methods.

Discussion and Future Work

The success of this method underscores the importance of the frequency domain for stable interpolation of periodic signals. By formalizing the "SNR Matters" assumption, the authors demonstrate that preserving signal power in task-relevant frequency bands is crucial for effective contrastive learning.

However, some limitations remain. The current logic relies on the "quasi-periodicity" of signals, and its applicability to purely stochastic data (e.g., financial time series) requires further investigation. Additionally, the reliance on a pre-trained VAE introduces a computational overhead. Future research may explore more efficient ways to estimate sample similarity or develop batch sampling strategies that optimize intra-class mixing as the number of classes scales.

Summary updated

BibTeX
@inproceedings{demirel2023finding,
  author = {Berken Utku Demirel and Christian Holz},
  title = {{Finding Order in Chaos: A Novel Data Augmentation Method for Time Series in Contrastive Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=dbVRDk2wt7},
}
Figure