Table of Contents
Fetching ...

GenIAS: Generator for Instantiating Anomalies in time Series

Zahra Zamanzadeh Darban, Qizhou Wang, Geoffrey I. Webb, Shirui Pan, Charu C. Aggarwal, Mahsa Salehi

TL;DR

GenIAS introduces a latent-space anomaly generator for time series that uses a TCN-VAE with learned latent perturbations and a deviation-based patching strategy to create diverse, realistic anomalies. A novel enhanced KL loss with a tunable prior tightens normal latent representations, improving separation from anomalies. The framework is validated on nine TSAD datasets, integrated with a strong detector, and shows consistent improvements over 17 baselines in both generation quality and anomaly detection metrics. These results highlight the practical value of generative anomaly injection for unsupervised time series anomaly detection and point to future work on adaptive perturbations and inter-variable correlations.

Abstract

A recent and promising approach for building time series anomaly detection (TSAD) models is to inject synthetic samples of anomalies within real data sets. The existing injection mechanisms have significant limitations - most of them rely on ad hoc, hand-crafted strategies which fail to capture the natural diversity of anomalous patterns, or are restricted to univariate time series settings. To address these challenges, we design a generative model for TSAD using a variational autoencoder, which is referred to as a Generator for Instantiating Anomalies in Time Series (GenIAS). GenIAS is designed to produce diverse and realistic synthetic anomalies for TSAD tasks. By employing a novel learned perturbation mechanism in the latent space and injecting the perturbed patterns in different segments of time series, GenIAS can generate anomalies with greater diversity and varying scales. Further, guided by a new triplet loss function, which uses a min-max margin and a new variance-scaling approach to further enforce the learning of compact normal patterns, GenIAS ensures that anomalies are distinct from normal samples while remaining realistic. The approach is effective for both univariate and multivariate time series. We demonstrate the diversity and realism of the generated anomalies. Our extensive experiments demonstrate that GenIAS - when integrated into a TSAD task - consistently outperforms seventeen traditional and deep anomaly detection models, thereby highlighting the potential of generative models for time series anomaly generation.

GenIAS: Generator for Instantiating Anomalies in time Series

TL;DR

GenIAS introduces a latent-space anomaly generator for time series that uses a TCN-VAE with learned latent perturbations and a deviation-based patching strategy to create diverse, realistic anomalies. A novel enhanced KL loss with a tunable prior tightens normal latent representations, improving separation from anomalies. The framework is validated on nine TSAD datasets, integrated with a strong detector, and shows consistent improvements over 17 baselines in both generation quality and anomaly detection metrics. These results highlight the practical value of generative anomaly injection for unsupervised time series anomaly detection and point to future work on adaptive perturbations and inter-variable correlations.

Abstract

A recent and promising approach for building time series anomaly detection (TSAD) models is to inject synthetic samples of anomalies within real data sets. The existing injection mechanisms have significant limitations - most of them rely on ad hoc, hand-crafted strategies which fail to capture the natural diversity of anomalous patterns, or are restricted to univariate time series settings. To address these challenges, we design a generative model for TSAD using a variational autoencoder, which is referred to as a Generator for Instantiating Anomalies in Time Series (GenIAS). GenIAS is designed to produce diverse and realistic synthetic anomalies for TSAD tasks. By employing a novel learned perturbation mechanism in the latent space and injecting the perturbed patterns in different segments of time series, GenIAS can generate anomalies with greater diversity and varying scales. Further, guided by a new triplet loss function, which uses a min-max margin and a new variance-scaling approach to further enforce the learning of compact normal patterns, GenIAS ensures that anomalies are distinct from normal samples while remaining realistic. The approach is effective for both univariate and multivariate time series. We demonstrate the diversity and realism of the generated anomalies. Our extensive experiments demonstrate that GenIAS - when integrated into a TSAD task - consistently outperforms seventeen traditional and deep anomaly detection models, thereby highlighting the potential of generative models for time series anomaly generation.

Paper Structure

This paper contains 43 sections, 3 theorems, 13 equations, 10 figures, 7 tables, 2 algorithms.

Key Result

Theorem 1

Let a VAE be trained on normal data with a latent prior $\mathcal{N}(0, \sigma^2_{\text{prior}})$, where $\sigma_{\text{prior}} < 1$. The encoder posterior for normal samples follows $\mathcal{N}(\mu, \sigma^2_{\text{normal}})$, with compactness enforced by KL regularization. If the encoder $\phi$ a

Figures (10)

  • Figure 1: An illustration of our key idea: Variance-scaling enforces latent space compactness in the latent space, strengthening the separation between normal and generated anomalous samples by GenIAS, in latent space. The bottom figure, with $\sigma_{\text{prior}}$ = 0.5, visually shows this effect.
  • Figure 2: The overall architecture of GenIAS: The model comprises an encoder, a structured latent space, and a decoder. The encoder, built with a TCN-VAE, maps input time series windows into a latent representation by learning temporal dependencies. The latent space regularization ensures compact normal representations, while anomalies are generated by perturbing the variance of the learned distribution without altering the mean, preserving realistic deviations. The decoder reconstructs both normal and perturbed windows using transpose convolutional layers.
  • Figure 3: Effect of deviation-based patching with different thresholds (0.4, 0.2, 0.05) on generated anomalous windows across various entities from the MSL, SMAP, SMD, Yahoo, and KPI datasets.
  • Figure 4: Each plot visualizes a different time series (TS) injection or generation method using t-SNE. Blue markers represent the original anomalous TS, while orange markers represent the injected or generated anomalous TS.
  • Figure 5: F1 and AUPR for different patching methods.
  • ...and 5 more figures

Theorems & Definitions (3)

  • Theorem 1: Enhanced Separation Between Normals and Anomalies in Latent Space
  • Lemma 1: Compact Latent Space in Enhanced KL Loss
  • Lemma 2: Reduced Reconstruction Error for Normal Samples