Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Contrastive Time Series Forecasting with Anomalies

About

Time series forecasting predicts future values from past data. In real-world settings, some anomalous events have lasting effects and influence the forecast, while others are short-lived and should be ignored. Standard forecasting models fail to make this distinction, often either overreacting to noise or missing persistent shifts. We propose Co-TSFA (Contrastive Time Series Forecasting with Anomalies), a regularization framework that learns when to ignore anomalies and when to respond. Co-TSFA generates input-only and input-output augmentations to model forecast-irrelevant and forecast-relevant anomalies, and introduces a latent-output alignment loss that ties representation changes to forecast changes. This encourages invariance to irrelevant perturbations while preserving sensitivity to meaningful distributional shifts. Experiments on the Traffic and Electricity benchmarks, as well as on a real-world cash-demand dataset, demonstrate that Co-TSFA improves performance under anomalous conditions while maintaining accuracy on normal data. An anonymized GitHub repository with the implementation of Co-TSFA is provided and will be made public upon acceptance.

Joel Ekstrand, Zahra Taghiyarrenani, Slawomir Nowaczyk• 2025

Related benchmarks

TaskDatasetResultRank
Time Series ForecastingTraffic (test)
MSE0.0592
192
ForecastingElectricity (test)
MAE0.1997
64
ForecastingTraffic
MSE0.0572
60
ForecastingCash Demand Clean (test)
MAE0.231
24
Time Series ForecastingTraffic dataset clean (test)
MAE0.1545
20
ForecastingCash Demand Input-Only (test)
MAE0.251
12
Showing 6 of 6 rows

Other info

Follow for update