TSINR: Capturing Temporal Continuity via Implicit Neural Representations for Time Series Anomaly Detection

Mengxuan Li, Ke Liu, Hongyang Chen, Jiajun Bu, Hongwei Wang, Haishuai Wang

Introduction

Time series anomaly detection is a critical task in various domains, from industrial IoT to satellite monitoring. Most unsupervised methods rely on reconstruction: a model learns to recreate "normal" patterns, and deviations are flagged as anomalies. However, real-world training data often contains unlabeled anomalies. If a model is too expressive, it may learn to reconstruct these anomalies perfectly, rendering them undetectable.

TSINR addresses this by leveraging Implicit Neural Representations (INR). By treating time series as a continuous function $f(t)$ and exploiting the "spectral bias" of neural networks—the tendency to learn low-frequency patterns before high-frequency ones—the model naturally struggles to reconstruct sharp, anomalous fluctuations.

Overview of TSINR and the effect of spectral bias during training.

The TSINR Framework

The core innovation of TSINR is representing time series data as a continuous function. Instead of discrete sequences, the model fits a function $f(t)$ where $t$ is the timestamp. This approach provides an inherent bias toward temporal continuity, making the model naturally "allergic" to the discontinuous fluctuations typical of anomalies.

The TSINR framework architecture, featuring LLM-based encoding and functional decomposition.

Key Components

  1. Functional Decomposition: The INR function $f(t)$ is decomposed into three specialized components to capture different temporal dynamics:
  2. Trend: Captures long-term drift using low-degree polynomials.
  3. Seasonal: Models recurring cycles via Fourier series.
  4. Residual: A group-based MLP architecture that handles complex, non-periodic interactions across multiple variables (channels).
  5. LLM-Powered Feature Amplification: TSINR utilizes a frozen, pre-trained Large Language Model (GPT-2) as an encoder. LLMs have shown a surprising ability to identify irregular transitions in sequences. This encoder amplifies anomalous fluctuations in both time and across different sensors before reconstruction.
  6. Transformer-based Parameter Prediction: To ensure efficiency, a Transformer encoder predicts the weights of the INR function in a single forward pass, avoiding the need for slow per-sample optimization during inference.

Key Insights and Results

TSINR turns the "spectral bias" of neural networks—usually seen as a limitation in high-resolution tasks like 3D vision—into a powerful feature for anomaly detection. By stopping training early (as shown in Figure 1), the model remains "well-fitted" to normal trends while failing to capture the high-frequency "noise" of anomalies.

Performance Benchmarks

TSINR achieved state-of-the-art results across several multivariate and univariate datasets:

  • SOTA F1-Scores: TSINR reached an average F1-score of 78.45%, significantly outperforming previous methods like FPT (74.00%) and AnomalyTransformer.
  • Robustness: The model showed particularly strong gains on datasets like SMAP (83.35 F1), which are characterized by isolated point anomalies that INRs are specifically sensitive to.
  • Efficiency: Despite the LLM backbone, the model is highly efficient, with an inference time of just 0.08s per batch, making it viable for real-time industrial monitoring.

Limitations and Future Directions

While highly effective for multivariate data, the LLM encoder was found to slightly decrease performance on univariate datasets (e.g., UCR). Without multiple channels to fuse, the LLM's feature extraction can occasionally smooth out the very discontinuities needed for detection. Additionally, like all reconstruction-based methods, TSINR requires careful thresholding of the anomaly score.

Future research may explore applying this continuous function approach to other time series tasks, such as long-term forecasting or data imputation.

Summary updated

BibTeX
@inproceedings{li2024tsinr,
  author = {Mengxuan Li and Ke Liu and Hongyang Chen and Jiajun Bu and Hongwei Wang and Haishuai Wang},
  title = {{TSINR: Capturing Temporal Continuity via Implicit Neural Representations for Time Series Anomaly Detection}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2024},
}
Figure