크기와 형태를 넘어: 방향 인지 손실 함수를 활용한 시계열 예측
Beyond Magnitude and Shape: A Direction-Aware Loss for Time Series Forecasting
시계열 데이터의 정확한 값뿐만 아니라, 그 변화의 방향(상승 또는 하락)은 리스크 관리 및 금융 예측과 같은 의사 결정 기반 응용 분야에서 매우 중요합니다. 그러나 대부분의 예측 손실 함수는 점 추정치의 크기나 형태, 주파수 구조를 최적화하는 데 집중하며, 변화의 방향을 명시적으로 고려하지 않습니다. 본 논문에서는 MSE(Mean Squared Error)로 학습된 예측 모델이 작은 변화의 방향에 대한 예측 정확도가 낮다는 것을 확인했습니다. 이러한 문제를 해결하기 위해, 우리는 CosDir이라는 간단하면서도 효과적인 방향 인지 손실 함수를 제안합니다. CosDir은 예측 값과 목표 값 사이의 차이 벡터를 코사인 유사도를 통해 정렬하며, 크기 불변성을 가지므로 작은 변화에 대한 방향 정보를 유지하여 MSE가 놓치는 학습 신호를 다시 주입합니다. CosDir은 가벼운 플러그인 형태로, 어떠한 구조적 변경 없이 기존 모델에 적용할 수 있습니다. 또한, 데이터 세트마다 최적의 방향 및 크기 손실 함수의 혼합 비율이 다르다는 점을 고려하여, 우리는 CosDir-UW라는 확장된 방식을 제안합니다. CosDir-UW는 학습 과정에서 이 비율을 적응적으로 조정하며, 하이퍼파라미터 없이 데이터 세트별로 최적화된 가중치를 사용합니다. 10만 건 이상의 실험을 통해, 제안하는 방법이 방향 정확도를 지속적이고 현저하게 향상시키면서 크기 정확도를 유지하며, 다양한 손실 함수보다 우수한 성능을 보임을 입증했습니다. 관련 코드는 다음 링크에서 확인할 수 있습니다: https://github.com/seunghan96/cosdir.
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.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.