Abstract
Self-supervised learning (SSL) has emerged as a powerful paradigm for time series analysis, mitigating the need for expensive human labeling. However, existing methods often prioritize inter-sample contrastive learning while neglecting the intrinsic temporal structures within individual samples. We present SelfTime, a novel framework that captures both global inter-sample relations and local intra-temporal patterns through dual relational reasoning. By leveraging temporal distance as a self-supervised signal, SelfTime achieves state-of-the-art performance across diverse time series datasets, significantly outperforming traditional contrastive learning methods.
Introduction
Deep learning models excel at analyzing complex time series data, such as physiological signals or industrial sensor streams. However, their performance is often bottlenecked by the scarcity of labeled data. Self-supervised learning (SSL) addresses this by defining pretext tasks where labels are derived from the data itself. While common in computer vision, applying SSL to time series requires capturing the unique temporal progression of signals. Most current approaches focus on inter-sample relations—distinguishing between different samples—but frequently overlook the intra-temporal structure, which represents the underlying "DNA" of time series evolution.
The SelfTime Framework
SelfTime utilizes a shared backbone neural network to extract features, which are then processed by two specialized reasoning heads. This dual-task approach ensures that the learned representations are both globally discriminative and locally structured.
1. Inter-sample Relational Reasoning
This component employs a contrastive strategy. By comparing an anchor sample with its augmented versions (positive) and different samples (negative), the model learns to identify global characteristics that define a specific signal's identity. This helps the model understand "what" the signal represents at a high level.
2. Intra-temporal Relational Reasoning
The primary innovation of SelfTime is its focus on internal temporal structure. The model samples two subsequences ("pieces") from the same time series and classifies their relative temporal distance into discrete categories, such as short-term, middle-term, or long-term. This task forces the backbone to understand the underlying "flow" and temporal dependencies of the data, capturing the "how" of signal evolution.
Experimental Setup
The framework was evaluated on six diverse datasets across three major categories:
- Motion: CricketX and UWaveGestureLibraryAll (hand gestures).
- Sensor: DodgerLoopDay (traffic data) and InsectWingbeatSound.
- Device: MFPT and XJTU (industrial bearing vibration data).
These datasets vary significantly in sample size, signal length, and class distributions, providing a robust stress test for the framework's generalization capabilities.
Results and Discussion
SelfTime consistently set new benchmarks across all tested datasets. In linear evaluation, it outperformed the best baselines by significant margins, including a 14.61% accuracy boost on the DodgerLoopDay dataset and over 5% on several others.
Key Insights
- Synergy of Scales: The paper demonstrates that inter-sample and intra-temporal reasoning are highly complementary. Inter-sample reasoning provides global context, while intra-temporal reasoning captures intricate local patterns.
- Temporal Distance as Supervision: Using the time gap between snippets as a label is an elegant and effective way to provide supervision without human intervention.
- Augmentation Robustness: The authors found that combining magnitude warping with time warping created the most effective training environment. Interestingly, intra-temporal reasoning proved much more robust to different types of data augmentation than traditional inter-sample methods.
- Transferability and Clustering: SelfTime excels at transfer learning, maintaining superior performance when trained on one dataset and tested on another. Furthermore, t-SNE visualizations show that SelfTime creates tighter, more distinct data clusters compared to methods like SimCLR or Triplet Loss.
Conclusion
SelfTime demonstrates that reasoning about internal temporal distances is a potent signal for self-supervised time series learning. By balancing global identity with local structural patterns, the model learns more robust and generalizable features. Future work may extend this framework to multivariate data and explore more granular or continuous temporal reasoning to further enhance the resolution of the learned representations.
Summary updated