Table of Contents
Fetching ...

COMET: Codebook-based Online-adaptive Multi-scale Embedding for Time-series Anomaly Detection

Jinwoo Park, Hyeongwon Kang, Seung Hun Han, Pilsung Kang

TL;DR

COMET tackles time-series anomaly detection under distribution drift by integrating multi-scale patch encoding, a vector-quantized coreset of normal patterns, and online codebook adaptation. It introduces a density-aware memory-distance score and a reconstruction-based quantization score, augmented by deviation-based variable selection and EMA normalization, then fuses them for robust detection. Empirically, COMET achieves state-of-the-art performance on 39/45 metrics across five benchmarks and remains parameter-efficient, with additional gains from test-time adaptation via activation-based pseudo-labeling and contrastive learning. The work offers a practical, scalable solution for real-world monitoring where non-stationarity and limited labeling are common challenges.

Abstract

Time series anomaly detection is a critical task across various industrial domains. However, capturing temporal dependencies and multivariate correlations within patch-level representation learning remains underexplored, and reliance on single-scale patterns limits the detection of anomalies across different temporal ranges. Furthermore, focusing on normal data representations makes models vulnerable to distribution shifts at inference time. To address these limitations, we propose Codebook-based Online-adaptive Multi-scale Embedding for Time-series anomaly detection (COMET), which consists of three key components: (1) Multi-scale Patch Encoding captures temporal dependencies and inter-variable correlations across multiple patch scales. (2) Vector-Quantized Coreset learns representative normal patterns via codebook and detects anomalies with a dual-score combining quantization error and memory distance. (3) Online Codebook Adaptation generates pseudo-labels based on codebook entries and dynamically adapts the model at inference through contrastive learning. Experiments on five benchmark datasets demonstrate that COMET achieves the best performance in 36 out of 45 evaluation metrics, validating its effectiveness across diverse environments.

COMET: Codebook-based Online-adaptive Multi-scale Embedding for Time-series Anomaly Detection

TL;DR

COMET tackles time-series anomaly detection under distribution drift by integrating multi-scale patch encoding, a vector-quantized coreset of normal patterns, and online codebook adaptation. It introduces a density-aware memory-distance score and a reconstruction-based quantization score, augmented by deviation-based variable selection and EMA normalization, then fuses them for robust detection. Empirically, COMET achieves state-of-the-art performance on 39/45 metrics across five benchmarks and remains parameter-efficient, with additional gains from test-time adaptation via activation-based pseudo-labeling and contrastive learning. The work offers a practical, scalable solution for real-world monitoring where non-stationarity and limited labeling are common challenges.

Abstract

Time series anomaly detection is a critical task across various industrial domains. However, capturing temporal dependencies and multivariate correlations within patch-level representation learning remains underexplored, and reliance on single-scale patterns limits the detection of anomalies across different temporal ranges. Furthermore, focusing on normal data representations makes models vulnerable to distribution shifts at inference time. To address these limitations, we propose Codebook-based Online-adaptive Multi-scale Embedding for Time-series anomaly detection (COMET), which consists of three key components: (1) Multi-scale Patch Encoding captures temporal dependencies and inter-variable correlations across multiple patch scales. (2) Vector-Quantized Coreset learns representative normal patterns via codebook and detects anomalies with a dual-score combining quantization error and memory distance. (3) Online Codebook Adaptation generates pseudo-labels based on codebook entries and dynamically adapts the model at inference through contrastive learning. Experiments on five benchmark datasets demonstrate that COMET achieves the best performance in 36 out of 45 evaluation metrics, validating its effectiveness across diverse environments.
Paper Structure (42 sections, 27 equations, 5 figures, 12 tables, 2 algorithms)

This paper contains 42 sections, 27 equations, 5 figures, 12 tables, 2 algorithms.

Figures (5)

  • Figure 1: Overall architecture of COMET. (Left) During training, input time series are processed via Multi-scale Patch Encoding to capture temporal contexts at different resolutions. The resulting embeddings are mapped to a Vector-Quantized Coreset, where activated codebook entries are stored in the memory bank. (Right) During inference, Online Codebook Adaptation selectively updates the codebook by identifying reliable normal samples through pseudo-labeling and contrastive learning. Anomaly scores are computed by combining memory distance and quantization error. (Bottom) Illustration of vector quantization and the Online Codebook Adaptation process.
  • Figure 2: Comparison between global distance and local scaling distance. (Top) Global distance fails to identify normal queries in sparse regions as it relies solely on absolute distance without considering local density. (Bottom) Local scaling distance accounts for local density, leading to more consistent classification of queries across regions with varying density.
  • Figure 3: Comparison of Affiliation F1-Score versus training time on PSM dataset. Circle size indicates the number of model parameters. COMET achieves the highest performance with the smallest parameter count, highlighting its parameter efficiency.
  • Figure 4: UMAP visualization of patch embeddings and codebook entries on SWaT dataset. Train Normal samples are shown in gray, Test Normal in light blue, and Test Anomaly in pink. Codebook entries for each patch scale are marked as green circles (Patch 2), purple squares (Patch 4), and orange triangles (Patch 6).
  • Figure 5: Performance--efficiency visualizations across datasets (Affiliation F1-score vs. training time; circle size indicates parameter count).