Abstract
Time series analysis finds wide applications in fields such as weather forecasting, anomaly detection, and behavior recognition. Previous methods attempted to model temporal variations directly using 1D time series. However, this has been quite challenging due to the discrete nature of data points in time series and the complexity of periodic variation. In terms of periodicity, taking weather and traffic data as an example, there are multi-periodic variations such as yearly, monthly, weekly, and daily, etc. In order to break through the limitations of the previous methods, we decouple the implied complex periodic variations into inclusion and overlap relationships among different level periodic components based on the observation of the multi-periodicity therein and its inclusion relationships. This explicitly represents the naturally occurring pyramid-like properties in time series, where the top level is the original time series and lower levels consist of periodic components with gradually shorter periods, which we call the periodic pyramid. To further extract complex temporal variations, we introduce self-attention mechanism into the periodic pyramid, capturing complex periodic relationships by computing attention between periodic components based on their inclusion, overlap, and adjacency relationships. Our proposed Peri-midFormer demonstrates outstanding performance in five mainstream time series analysis tasks, including short- and long-term forecasting, imputation, classification, and anomaly detection.
Introduction
Time series data—ranging from global weather patterns and urban traffic flow to physiological signals like heart rates—is rarely a simple linear sequence of independent data points. Instead, it is a complex "soup" of overlapping cycles. For instance, a daily temperature fluctuation is nested within a monthly cycle, which in turn is nested within a yearly seasonal pattern.
Traditional deep learning architectures often struggle to capture this inherent hierarchy. Recurrent Neural Networks (RNNs) frequently succumb to vanishing gradients over long-term dependencies, while standard Transformers treat every data point as a discrete token, often failing to perceive the underlying "rhythm" of the data. While recent innovations like TimesNet attempted to address this by reshaping 1D data into 2D tensors, they often overlooked the inclusion relationships—the physical reality that long-duration cycles contain multiple shorter-duration cycles. Peri-midFormer bridges this gap by explicitly modeling time series as a multi-level periodic pyramid.
The Periodic Pyramid Framework
The core innovation of Peri-midFormer is the Periodic Pyramid, a hierarchical structure designed to decompose 1D time series into nested periodic components. The construction involves several key stages:
- Frequency Decomposition: The model utilizes a Fast Fourier Transform (FFT) to identify the top-$k$ most significant frequencies (periods) within the data. This ensures the model focuses on the most dominant rhythmic signals.
- Pyramid Construction: A top-down hierarchy is built where the top level represents the original series (the longest period), and subsequent lower levels consist of periodic components with progressively shorter periods.
- Periodic Pyramid Attention Mechanism (PPAM): Rather than calculating dense attention between every individual timestamp, PPAM focuses on the relationships between periodic components. It models three specific types of dependencies:
- Inclusion (Inter-level): Attention between a "parent" cycle and the "child" cycles it contains.
- Adjacency (Intra-level): Attention between cycles of the same length that occur sequentially.
- Overlap: Capturing dependencies where cycles partially share time windows.
- Periodic Feature Flows: For tasks requiring reconstruction (such as forecasting or imputation), the model treats each path from the top to the bottom of the pyramid as a "flow" of information, aggregating these flows to generate the final output.
Experimental Evaluation
The authors evaluated Peri-midFormer across a comprehensive battery of benchmarks covering five distinct tasks:
- Long-term Forecasting: Evaluated on Weather, Traffic, Electricity, Exchange, and the ETT (Electricity Transformer Temperature) datasets.
- Short-term Forecasting: Tested using the M4 dataset across various granularities (yearly, quarterly, monthly).
- Imputation: Focused on recovering missing data in ETT, Electricity, and Weather datasets.
- Classification: Tested on 10 multivariate datasets from the UEA archive, including Heartbeat and EthanolConcentration.
- Anomaly Detection: Benchmarked against SMD, MSL, SMAP, SWaT, and PSM.
Key Insights and Results
Cycles as Tokens
By treating an entire periodic component as a token rather than a single timestamp, Peri-midFormer allows the Transformer to "see the forest for the trees." This inductive bias forces the model to respect the natural nesting of time, making it significantly more robust in the presence of noise compared to standard Transformers that must learn these hierarchies implicitly.
Performance and Efficiency
Peri-midFormer demonstrated dominant performance across all tested tasks. In long-term forecasting, it outperformed GPT4TS and approached or exceeded the performance of Time-LLM. Crucially, it achieved these results with a fraction of the computational overhead. While Large Language Model (LLM)-based approaches require massive Floating Point Operations (FLOPs), Peri-midFormer remains lightweight and memory-efficient, making it suitable for practical engineering applications. In classification tasks, it achieved an average accuracy of 76.6% across the UEA datasets, surpassing established models like TSLANet and TimesNet.
Conclusion and Future Work
Peri-midFormer represents a shift toward architecture that mirrors the physical properties of time. By explicitly modeling the inclusion and overlap of periodic cycles, it provides a more interpretable and efficient path for time series analysis.
A primary limitation remains its periodicity dependency. The model is specifically optimized for rhythmic data; in scenarios dominated by stochastic "random walks" or single massive trends without clear cycles (e.g., certain financial data), its advantages are less pronounced. Future research will focus on integrating more adaptive trend-handling mechanisms to manage non-periodic shifts more gracefully.
Summary updated