Abstract
Time series analysis is a fundamental task in various application domains, and deep learning approaches have demonstrated remarkable performance in this area. However, many real-world time series data exhibit significant periodic or quasi-periodic dynamics that are often not adequately captured by existing deep learning-based solutions. This results in an incomplete representation of the underlying dynamic behaviors of interest. To address this gap, we propose an unsupervised method called Floss that automatically regularizes learned representations in the frequency domain. The Floss method first automatically detects major periodicities from the time series. It then employs periodic shift and spectral density similarity measures to learn meaningful representations with periodic consistency. In addition, Floss can be easily incorporated into both supervised, semi-supervised, and unsupervised learning frameworks. We conduct extensive experiments on common time series classification, forecasting, and anomaly detection tasks to demonstrate the effectiveness of Floss. We incorporate Floss into several representative deep learning solutions to justify our design choices and demonstrate that it is capable of automatically discovering periodic dynamics and improving state-of-the-art deep learning models.
Introduction
While deep learning has revolutionized time series analysis, many models still struggle with a fundamental characteristic of real-world data: periodicity. Whether it’s daily traffic cycles, weekly energy consumption, or seasonal weather patterns, these rhythms are often "quasi-periodic"—meaning they shift slightly or are buried under noise.
Existing representation learning methods often borrow ideas directly from Computer Vision or Natural Language Processing, treating time series as sequences of tokens. However, time series data possesses underlying physical dynamics. If a model doesn't explicitly account for these periodicities, its internal representations remain incomplete, leading to brittle forecasts and missed anomalies.
The Floss Framework
The proposed Floss (Frequency Domain Regularization) method is a three-phase framework designed to be integrated into almost any existing time series model to better capture these "rhythms":
- Periodicity Detection: Instead of relying on manual labels, Floss automatically identifies the most significant periods in a dataset using a periodogram (average spectral density). It finds the "rhythm" of the data on the fly.
- Periodic Augmentation: Once a period $T$ is found, Floss creates a "periodic view" of the data. It takes a segment and shifts it by a random multiple of $T$. In a perfectly periodic world, the original and the shifted segment should look very similar in the frequency domain.
- Hierarchical Frequency-Domain Loss: This is the core innovation. The model passes both the original and shifted segments through an encoder. Floss then calculates the similarity between their spectral densities using the Discrete Cosine Transform (DCT).
Hierarchical Temporal Pooling
A critical component of the Floss loss is the application of temporal max-pooling to representations at multiple scales. This forces the model to align rhythms at different resolutions, focusing more on robust low-frequency components while filtering out high-frequency noise. This "zooming out" allows the model to prioritize the most important, large-scale periodic patterns over minor, noisy fluctuations.
Experimental Results
The authors validated Floss across a massive battery of benchmarks including forecasting (Weather, Electricity, ETT), classification (UCR and UEA archives), and anomaly detection (Yahoo, KPI, MSL, SMD).
- Forecasting: On the TS2Vec model, adding Floss reduced Mean Squared Error (MSE) by an average of 7.2%. Improvements were most pronounced on highly periodic datasets like Electricity.
- Classification: Floss achieved a 2.3% increase in accuracy over the baseline TS2Vec across 125 UCR datasets and a 3.0% increase on 29 UEA datasets.
- Anomaly Detection: In "cold-start" scenarios, Floss improved the F1-score by about 10%, proving it captures general periodic invariances that transfer well between datasets.
Discussion and Conclusion
Floss demonstrates that the frequency domain is often more stable for periodic data representation than the time domain. By shifting data by exactly one or more periods, the authors create a "natural" augmentation that preserves signal identity better than random cropping.
While Floss is a powerful plug-and-play enhancement, it has limitations. For instance, hierarchical loss occasionally hindered performance on the Weather dataset, where high-frequency components may contain vital information. Future work may explore more stable sampling strategies and integration with Graph Neural Networks (GNNs) to model periodic relationships between different sensors in a network. Overall, Floss provides a robust mechanism for automatically discovering and leveraging periodic dynamics to improve state-of-the-art deep learning models.
Summary updated