Table of Contents
Fetching ...

Weighted Contrastive Learning for Anomaly-Aware Time-Series Forecasting

Joel Ekstrand, Tor Mattsson, Zahra Taghiyarrenani, Slawomir Nowaczyk, Jens Lundström, Mikael Lindén

TL;DR

The paper tackles forecasting under distribution shifts caused by anomalies in multivariate time series, focusing on ATM cash withdrawal data. It introduces WECA, a weighted contrastive adaptation framework that softly aligns normal and anomaly-augmented representations to preserve anomaly information while remaining stable to benign changes. The method formalizes per-timestep alignment weights within an InfoNCE-style loss and combines this with a forecasting MAE objective, demonstrated on a large ATM dataset where anomaly-affected SMAPE improves by about 6 points without harming normal-period accuracy. This yields a tunable invariance–sensitivity trade-off that enhances forecasting reliability under anomalous conditions and distribution shifts.

Abstract

Reliable forecasting of multivariate time series under anomalous conditions is crucial in applications such as ATM cash logistics, where sudden demand shifts can disrupt operations. Modern deep forecasters achieve high accuracy on normal data but often fail when distribution shifts occur. We propose Weighted Contrastive Adaptation (WECA), a Weighted contrastive objective that aligns normal and anomaly-augmented representations, preserving anomaly-relevant information while maintaining consistency under benign variations. Evaluations on a nationwide ATM transaction dataset with domain-informed anomaly injection show that WECA improves SMAPE on anomaly-affected data by 6.1 percentage points compared to a normally trained baseline, with negligible degradation on normal data. These results demonstrate that WECA enhances forecasting reliability under anomalies without sacrificing performance during regular operations.

Weighted Contrastive Learning for Anomaly-Aware Time-Series Forecasting

TL;DR

The paper tackles forecasting under distribution shifts caused by anomalies in multivariate time series, focusing on ATM cash withdrawal data. It introduces WECA, a weighted contrastive adaptation framework that softly aligns normal and anomaly-augmented representations to preserve anomaly information while remaining stable to benign changes. The method formalizes per-timestep alignment weights within an InfoNCE-style loss and combines this with a forecasting MAE objective, demonstrated on a large ATM dataset where anomaly-affected SMAPE improves by about 6 points without harming normal-period accuracy. This yields a tunable invariance–sensitivity trade-off that enhances forecasting reliability under anomalous conditions and distribution shifts.

Abstract

Reliable forecasting of multivariate time series under anomalous conditions is crucial in applications such as ATM cash logistics, where sudden demand shifts can disrupt operations. Modern deep forecasters achieve high accuracy on normal data but often fail when distribution shifts occur. We propose Weighted Contrastive Adaptation (WECA), a Weighted contrastive objective that aligns normal and anomaly-augmented representations, preserving anomaly-relevant information while maintaining consistency under benign variations. Evaluations on a nationwide ATM transaction dataset with domain-informed anomaly injection show that WECA improves SMAPE on anomaly-affected data by 6.1 percentage points compared to a normally trained baseline, with negligible degradation on normal data. These results demonstrate that WECA enhances forecasting reliability under anomalies without sacrificing performance during regular operations.

Paper Structure

This paper contains 7 sections, 4 equations, 1 figure, 3 tables.

Figures (1)

  • Figure 1: Example of anomaly curves for augmentation. B=0.39 while A and C are sampled from normal distributions with means 74120 and 0.806, and standard deviations 20000 and 0.3.