[论文解读] Improving Position Encoding of Transformers for Multivariate Time Series Classification
该论文提出了一种基于Transformer的新模型ConvTran,用于多变量时间序列分类,通过引入两种新型位置编码方法:时间绝对位置编码(tAPE),该方法通过结合序列长度和嵌入维度,将绝对位置编码适配于时间序列;以及高效相对位置编码(eRPE),可提升模型泛化能力。ConvTran在32个多变量时间序列数据集上实现了最先进性能,优于现有的CNN和Transformer模型。
Transformers have demonstrated outstanding performance in many applications of deep learning. When applied to time series data, transformers require effective position encoding to capture the ordering of the time series data. The efficacy of position encoding in time series analysis is not well-studied and remains controversial, e.g., whether it is better to inject absolute position encoding or relative position encoding, or a combination of them. In order to clarify this, we first review existing absolute and relative position encoding methods when applied in time series classification. We then proposed a new absolute position encoding method dedicated to time series data called time Absolute Position Encoding (tAPE). Our new method incorporates the series length and input embedding dimension in absolute position encoding. Additionally, we propose computationally Efficient implementation of Relative Position Encoding (eRPE) to improve generalisability for time series. We then propose a novel multivariate time series classification (MTSC) model combining tAPE/eRPE and convolution-based input encoding named ConvTran to improve the position and data embedding of time series data. The proposed absolute and relative position encoding methods are simple and efficient. They can be easily integrated into transformer blocks and used for downstream tasks such as forecasting, extrinsic regression, and anomaly detection. Extensive experiments on 32 multivariate time-series datasets show that our model is significantly more accurate than state-of-the-art convolution and transformer-based models. Code and models are open-sourced at \url{https://github.com/Navidfoumani/ConvTran}.
研究动机与目标
- 探究现有绝对和相对位置编码在多变量时间序列分类中的有效性和效率。
- 解决标准位置编码在时间序列中的局限性,即低嵌入维度和可变序列长度会降低性能。
- 设计一种针对时间序列的绝对位置编码方法,综合考虑序列长度和嵌入维度。
- 开发一种计算高效的相对位置编码方法,以增强模型泛化能力。
- 将所提出的编码方法整合到混合CNN-Transformer架构(ConvTran)中,以提升多变量时间序列分类性能。
提出的方法
- 提出时间绝对位置编码(tAPE),一种新型绝对位置编码方法,明确结合序列长度和输入嵌入维度,以更好地表示时间序列中的位置信息。
- 引入高效相对位置编码(eRPE),一种计算轻量化的相对位置编码方法,旨在提升时间序列任务中的泛化能力。
- 在Transformer模块中结合tAPE和eRPE,并与卷积层集成以提取输入特征,形成ConvTran模型。
- 采用混合架构,其中卷积层提取局部时间模式,而结合增强位置编码的Transformer捕捉长程依赖关系。
- 使用可学习的位置嵌入,并在训练过程中联合优化,使模型能够适应多变量时间序列的结构。
- 在标准自注意力机制中,通过使用所提出的编码方法修改查询-键评分,以保持序列顺序和上下文信息。
实验结果
研究问题
- RQ1在低嵌入维度和可变序列长度的条件下,标准绝对和相对位置编码在多变量时间序列分类中的有效性如何?
- RQ2是否一种结合序列长度和嵌入维度的时间序列专用绝对位置编码方法能提升模型性能?
- RQ3一种更高效的相对位置编码方法是否能增强时间序列分类任务中的泛化能力?
- RQ4将改进的位置编码与卷积前端结合,是否能提升多变量时间序列分类的性能?
- RQ5所提出的ConvTran模型在多样化的多变量时间序列数据集上,与最先进模型相比,在准确率和效率方面表现如何?
主要发现
- ConvTran在32个多变量时间序列数据集上实现了最先进性能,显著优于现有的CNN和基于Transformer的模型。
- 在每类有100个或以上训练样本的数据集中,ConvTran优于HC2、ROCKET、CIF和Inception-Time,多数胜场在性能对比图中以红色标示。
- 在小样本数据集如EigenWorms(每类26个训练样本)中,ConvTran在基于CNN的模型中仍表现具有竞争力,但由于数据稀缺,仍被部分最先进模型超越。
- 在大型InsectWingBeat数据集(25,000个训练样本)上,ConvTran在所有子集大小下均取得了高于ROCKET的测试准确率,尽管ROCKET在小数据集上更快。
- 随着数据集规模增大,ConvTran的训练时间快于ROCKET,且推理时间始终更快,即使ROCKET运行在CPU上而ConvTran使用GPU。
- 消融实验表明,tAPE和eRPE均对性能有显著贡献,完整ConvTran模型在所有评估指标上均表现最佳。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。