超越幅值与形状:面向时间序列预测的方向感知损失函数
Beyond Magnitude and Shape: A Direction-Aware Loss for Time Series Forecasting
浏览论文内容
中文总结 AI 辅助
该研究针对时间序列预测中现有损失函数未明确优化变化方向的问题,提出CosDir及自适应权重扩展CosDir-UW,经大量实验证实其可提升预测方向精度且优于多种损失函数。
中文摘要 AI 辅助
在风险管理、金融预测等决策驱动的应用中,序列的变化方向(即序列将上升还是下降)通常与其精确值同等重要。然而,大多数预测损失函数仅优化点幅值或形状与频率结构,没有一种损失函数明确针对变化方向。本文发现,经MSE训练的预测模型在小幅变动的方向预测上表现不佳。为解决该问题,我们提出CosDir,一种简单却有效的方向感知损失函数,通过余弦相似度对齐预测值与目标值的差值向量。由于具有尺度不变性,CosDir在小幅变动上保留方向梯度,在MSE忽略的位置重新注入学习信号。CosDir是轻量型可即插即用的项,可附加到任何骨干模型而无需修改架构。由于不同数据集的方向项与幅值项混合的最优比例存在差异,我们进一步提出CosDir-UW,一种扩展方法,通过训练过程学习使该比例自适应,匹配按数据集调优的权重且无需超参数。我们开展了超过10万次实验,证明所提方法在保持幅值预测精度的同时,持续显著提升方向预测精度,且优于多种损失函数。代码可访问:this https URL。
英文摘要
The direction of change --- whether a series will move up or down --- is often as important as its exact value in decisiondriven applications such as risk management and financial forecasting. However, most forecasting losses optimize either point magnitude or shape and frequency structure, and none explicitly targets the direction of change. In this paper, we find that MSE-trained forecasters fail on the direction of small moves. To address this, we propose CosDir, a simple yet effective direction-aware loss that aligns the difference vectors of the prediction and the target via cosine similarity. Being scale-invariant, CosDir keeps a directional gradient on small moves, re-injecting learning signal exactly where MSE neglects it. CosDir is a lightweight, plug-in term that attaches to any backbone without architectural modification. Since the best ratio for mixing the directional and magnitude terms differs across datasets, we further propose CosDir-UW, an extension that makes this ratio adaptive by learning it during training, matching a per-dataset tuned weight with no hyperparameter. We conduct over 100K experiments, demonstrating that our method consistently and significantly improves directional accuracy while preserving magnitude accuracy, and that it outperforms various loss functions. Code is available at: https://github.com/seunghan96/cosdir.