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

Berken Utku Demirel, Christian Holz

TL;DR

This paper introduces a novel data augmentation technique for time-series data within contrastive learning. By carefully mixing phase and magnitude components of time-series signals, the method aims to create more informative positive samples, leading to improved feature representations and better performance on downstream tasks.

What Problem Does This Paper Address?

Contrastive learning (CL) has shown great success in self-supervised representation learning across various domains. A key component of CL is data augmentation, which generates similar (positive) and dissimilar (negative) pairs of samples. However, effectively augmenting time-series data, especially quasi-periodic and non-stationary signals, remains a significant challenge. Existing methods often struggle to preserve crucial information or can even introduce destructive interference, leading to suboptimal performance. There's a lack of a general, widely recognized time-series augmentation method that can be applied across different tasks.

Methods

The core contribution is a novel data augmentation method that builds upon the "mixup" technique. Instead of a simple linear interpolation of the entire time series, this method treats the magnitude and phase of the signal's frequency components as separate features.

  • Magnitude Mixing: This is performed using a standard linear interpolation approach.
  • Phase Mixing: This is more sophisticated. It involves calculating the shortest phase difference between two samples and then adding a portion of this difference to the anchor sample's phase, guided by the direction of the other sample. This aims to prevent destructive interference that can occur when phases are simply averaged or interpolated linearly.

A key aspect is the controlled degree of augmentation. The authors propose using a Variational Autoencoder (VAE) to learn a latent representation of the data. Samples that are closer in this latent space (indicating semantic similarity) are augmented more aggressively, while less similar samples are augmented less. This helps to connect intra-class samples more effectively without causing inter-class collapse. The mixing coefficients for phase and magnitude are sampled based on this latent space similarity.

Datasets

The proposed method was evaluated on a variety of datasets across three main tasks:

  • Human Activity Recognition (HAR): UCIHAR, HHAR, USC
  • Heart Rate Prediction (PPG): IEEE SPC12, IEEE SPC22, DaLia
  • Cardiovascular Disease (CVD) Classification (ECG): CPSC2018, Chapman

Key Insights and Ideas

  • Phase Matters: The phase component of time-series signals carries crucial information, and naive mixing can lead to destructive interference, losing task-specific details.
  • Controlled Augmentation: Simply mixing samples isn't enough; the degree of mixing needs to be adapted. Augmenting similar samples more aggressively helps learn better representations.
  • Latent Space Guidance: Using a VAE to guide the augmentation process by considering sample similarity in the latent space is effective for tuning augmentation strength.
  • Quasi-Periodicity is Key: The method is specifically designed for quasi-periodic time-series, a common characteristic in many real-world signals.

Key Results

The proposed method consistently outperformed state-of-the-art methods across seven out of eight datasets in activity recognition, heart rate prediction, and CVD classification tasks.

  • Activity Recognition: Achieved an accuracy of 91.60% on UCIHAR, outperforming the next best method (DACL) by a significant margin (up to 20.8%).
  • Heart Rate Prediction: Achieved an MAE of 16.26 on IEEE SPC12, outperforming prior methods.
  • CVD Classification: Achieved an AUC of 85.30 on CPSC 2018 and 95.90 on Chapman, showing strong performance.

The ablation studies demonstrated that both the tailored phase/magnitude mixing and the latent-space-guided augmentation degree contribute significantly to the performance gains.

Limitations and Future Work

  • VAE Training: The effectiveness of the latent space guidance relies on a well-trained VAE. If the VAE doesn't accurately capture semantic similarity, it can lead to inconsistencies.
  • Dataset Size: The performance of the latent space distance metric might be affected by dataset size and the number of classes, especially in downstream tasks with many classes.
  • Future Work: The authors suggest exploring different distance metrics for quasi-periodic time-series data that can scale better with the number of classes and smaller datasets. They also believe their method has potential for use in other learning paradigms beyond contrastive learning.

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