Abstract
Selecting appropriate data augmentations for time series contrastive learning is a critical yet challenging task, as improper choices can lead to significant performance degradation. We present a systematic framework that automates augmentation selection by leveraging signal decomposition. By breaking down a query dataset into its trend and seasonality components and comparing them against a pre-benchmarked synthetic library, our system identifies optimal transformations. Experimental results across six real-world domains show that our approach consistently identifies high-performing augmentations, yielding up to a 32% performance margin over suboptimal choices.
Introduction
In self-supervised contrastive learning, models learn robust representations by identifying that different "views" of the same data point—created via augmentations—should have similar latent embeddings. While intuitive rules exist for image data (e.g., horizontal flips), time series data is abstract, and its semantic meaning is easily destroyed by inappropriate transformations.
Currently, researchers often select augmentations based on heuristics, literature precedents, or computationally expensive grid searches. However, the effectiveness of an augmentation is highly domain-dependent; a transformation beneficial for heart rate data may fail for financial indices. As shown in Figure 1, the gap between the best and worst augmentation choice can reach a staggering 32% in F1-score, highlighting the need for a principled selection framework.
Methodology
We propose a Trend-Seasonality-Based Recommendation system that replaces trial-and-error with a structured lookup strategy based on signal characteristics. The pipeline consists of three primary phases:
1. Synthetic Benchmarking
We established a library of 12 synthetic datasets covering various combinations of linear and non-linear trends alongside trigonometric and Morlet wavelet seasonalities. We exhaustively benchmarked eight common augmentations—Jittering, Scaling, Flipping, Permutation, Resizing, Time Masking, Frequency Masking, and Time-wise Neighboring—to determine the optimal transformations for each signal profile.
2. Signal Decomposition
To analyze a new "query" dataset, we employ Seasonal-Trend decomposition using Loess (STL). This process breaks the raw signal into three distinct components: Trend ($T$), Seasonality ($S$), and Residual ($R$).
3. The Recommendation Pipeline
The recommendation process, detailed in Figure 2, follows a six-step logic:
- Similarity Analysis: The system calculates cosine similarity between the query dataset's components and the synthetic templates.
- Power Calculation: It determines the relative weight (power) of the trend versus the seasonality.
- Twin Identification: The system identifies the "synthetic twin"—the template that most closely matches the query's profile.
- Selection: It recommends the top-performing augmentations based on the benchmarked results of that twin.
Additionally, we investigated Single-view vs. Double-view augmentation. While frameworks like SimCLR typically use two augmented views, our findings suggest that for time series, comparing one augmented view against the original "anchor" sample (single-view) often provides a more stable and effective training signal.
Experimental Setup
The framework was validated using the 12-dataset synthetic library and six diverse real-world datasets: Human Activity Recognition (HAR), ECG-based heart disease diagnosis (PTB), Mechanical Fault Detection (FD), Melbourne Pedestrian volume (MP), Electricity usage (ElecD), and S&P 500 stock market indices (SPX500).
Key Insights and Results
Our analysis revealed several critical findings regarding time series augmentations:
- Seasonality Dominance: Seasonality is the primary driver of augmentation effectiveness. Signals with similar seasonal patterns benefit from the same augmentations regardless of their long-term trends.
- The Efficacy of Resizing: For datasets with trigonometric seasonality (common in physical sensors), Resizing—randomly cropping and stretching a segment—is consistently the top performer.
- Contextual Jittering: Adding noise (Jittering) and Time Masking are highly effective when seasonality is strong but can hinder learning if the trend component dominates.
- Recommendation Accuracy: The system achieved an average Recall@3 of 0.667 on real-world data, meaning at least two of the three recommended augmentations were among the actual top three performers.
- Performance Gains: On the Fault Detection (FD) dataset, the recommended "Resizing" augmentation led to a 21.64% improvement in F1-score compared to a non-pretrained baseline.
Conclusion
This framework provides a robust, automated method for selecting augmentations in time series contrastive learning. While the current system relies on 12 synthetic templates, future work will focus on expanding this library to include compound seasonalities and complex real-world patterns. Furthermore, we aim to investigate if these guidelines generalize across different model architectures, such as CNNs and State Space Models.
Summary updated