BasisFormer: Attention-based Time Series Forecasting with Learnable and Interpretable Basis

Zelin Ni,Hang Yu,Shizhan Liu,Jianguo Li,Weiyao Lin
2024-01-19
Abstract:Bases have become an integral part of modern deep learning-based models for time series forecasting due to their ability to act as feature extractors or future references. To be effective, a basis must be tailored to the specific set of time series data and exhibit distinct correlation with each time series within the set. However, current state-of-the-art methods are limited in their ability to satisfy both of these requirements simultaneously. To address this challenge, we propose BasisFormer, an end-to-end time series forecasting architecture that leverages learnable and interpretable bases. This architecture comprises three components: First, we acquire bases through adaptive self-supervised learning, which treats the historical and future sections of the time series as two distinct views and employs contrastive learning. Next, we design a Coef module that calculates the similarity coefficients between the time series and bases in the historical view via bidirectional cross-attention. Finally, we present a Forecast module that selects and consolidates the bases in the future view based on the similarity coefficients, resulting in accurate future predictions. Through extensive experiments on six datasets, we demonstrate that BasisFormer outperforms previous state-of-the-art methods by 11.04\% and 15.78\% respectively for univariate and multivariate forecasting tasks. Code is available at: \url{<a class="link-external link-https" href="https://github.com/nzl5116190/Basisformer" rel="external noopener nofollow">this https URL</a>}
Machine Learning
What problem does this paper attempt to address?
The problem that this paper attempts to solve is that in time - series prediction, existing methods cannot meet two key requirements simultaneously when selecting or learning the basis: the basis must be customized for a specific time - series dataset and have a distinct relevance to each time series in the dataset. Specifically: 1. **Basis selection or learning**: Existing methods either rely on predefined bases (such as Fourier bases), but these bases may not be able to effectively capture all periods or frequencies in the time series; or they learn the basis adaptively but ignore the flexible association between the basis and each time series. 2. **Time - series decomposition**: It is necessary to calculate the similarity coefficients or weights between the time series and the basis vectors, and these coefficients should vary with different time series because each time series has its unique pattern and characteristics. 3. **Future prediction**: Based on the similarity coefficients, the future parts of the basis are weighted and aggregated to predict future values. To overcome these problems, the paper proposes **BasisFormer**, an end - to - end time - series prediction architecture, which is achieved through the following three main components: 1. **Basis Module**: Obtain the basis from the data through self - supervised learning, and use the contrastive learning method to ensure that the basis selected for the same time series in the historical view and the future view remains consistent. 2. **Coef Module**: Calculate the similarity coefficients between the time series and the basis in the historical view through a bidirectional cross - attention mechanism, achieving a flexible association between the time series and the basis. 3. **Predict Module**: According to the similarity coefficients calculated by the Coef Module, select and integrate the basis vectors in the future view to make accurate future predictions. Through extensive experiments, the paper proves that **BasisFormer** outperforms the existing state - of - the - art methods in both univariate and multivariate time - series prediction tasks, improving performance by 11.04% and 15.78% respectively.