Abstract
Self-supervised learning (SSL) has become a cornerstone for analyzing unlabeled time series data in domains like healthcare and finance. However, existing SSL methods often struggle with domain-specific contrastive rules, neglect spectral information, or introduce noise through masking. We present the Cross Reconstruction Transformer (CRT), a framework that utilizes both time and frequency domains (magnitude and phase). By dropping patches instead of masking and performing cross-domain reconstruction, CRT captures intricate temporal-spectral correlations. Our experiments show that CRT outperforms state-of-the-art methods by 2% to 9% across multiple benchmarks, including PTB-XL and Sleep-EDF.
Introduction
In real-world applications, unlabeled time series data is abundant, but labeled data is scarce and expensive to acquire. Self-supervised learning (SSL) helps bridge this gap by pre-training models on unlabelled data. However, existing SSL methods for time series have three major flaws:
- Reliance on Contrastive Learning: Most methods require cumbersome, domain-specific rules to construct positive and negative pairs, often leading to sampling bias and unstable performance.
- Ignoring the Frequency Domain: Time series data is rich in periodic patterns, yet most models only look at the time domain, completely ignoring spectral (frequency) information.
- The "Masking" Problem: Existing reconstruction-based methods (like masked autoencoders) hide data by replacing values with zeros. In time series, the shape of the wave is critical; injecting zeros destroys the original shape, introduces noise, and creates a distribution shift between the pre-training and fine-tuning phases.
Methodology
To tackle these issues, the authors propose the Cross Reconstruction Transformer (CRT), which relies on a few key innovations designed to capture the holistic nature of signal data.
Dual-Domain Input (Magnitude + Phase)
The model transforms the time series into the frequency domain using the Fast Fourier Transform (FFT). Crucially, instead of just using the magnitude of the frequency (which loses shape information), CRT explicitly inputs both magnitude and phase alongside the time-domain data. The authors demonstrate that reconstructing a signal using only phase preserves the overall shape much better than using only magnitude.
Dropping Rather Than Masking
Instead of replacing hidden patches with zeros, CRT completely drops them from the sequence. The remaining patches are fed into the model. This preserves the global context and prevents the model from learning artificial "zero-step" patterns that do not exist in the original data distribution.
Cross-Domain Reconstruction and Constraints
A CNN extracts local features from the time, magnitude, and phase patches. A Transformer encoder then fuses these representations. Finally, a decoder is tasked with reconstructing the dropped original data across all domains. This cross-domain synergy forces the model to learn how different domains complement one another.
To further enhance the learned representations, the model employs an Instance Discrimination Constraint (IDC). This custom loss function maximizes the mutual information between the representations and the original inputs while pushing apart the representations of different samples. Additionally, Curriculum Learning is used to stabilize training; the model starts with a small dropping ratio (an "easy" task) and progressively increases it as training progresses.
Experimental Setup
The authors evaluated CRT on three standard, publicly available time series classification benchmarks:
- PTB-XL: A large dataset of 12-lead Electrocardiograms (ECGs) used to classify cardiac abnormalities.
- HAR (Human Activity Recognition): Accelerometer and gyroscope data from smartphones used to classify daily activities.
- Sleep-EDF: Electroencephalogram (EEG) recordings used for sleep stage classification.
Key Results and Discussion
CRT consistently outperformed contrastive baselines (SimCLR, TS-TCC, TNC, CPC) and reconstruction baselines (TST) across all three datasets. Quantitative gains ranged from 2% to 9% depending on the metric. For example, on the PTB-XL dataset, CRT achieved an 89.22% ROC-AUC compared to the next best baseline (CPC at 87.42%).
Beyond raw performance, CRT exhibited lower standard deviations across multiple runs compared to contrastive methods, proving that reconstruction-based SSL is generally more stable. Even with a massive 70% dropping ratio, the model successfully reconstructed the complex, periodic trends of dropped inputs, particularly visible in the ECG data.
Conclusion
The Cross Reconstruction Transformer addresses fundamental weaknesses in current time series SSL by integrating spectral information and avoiding the pitfalls of zero-masking. While the current framework is primarily evaluated on in-distribution classification, future work will focus on adapting CRT to handle out-of-distribution (OOD) scenarios and more challenging generative or predictive problems in time series analysis.
Summary updated