YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Towards Foundation Models for Zero-Shot Time Series Anomaly Detection: Leveraging Synthetic Data and Relative Context Discrepancy

This repository contains the implementation of Time-RCD for time series anomaly detection, integrated with the TSB-AD (Time Series Benchmark for Anomaly Detection) datasets.

Project Structure

.
β”œβ”€β”€ checkpoints/          # Pre-trained model checkpoints
β”œβ”€β”€ datasets/            # TSB-AD datasets (univariate and multivariate)
β”œβ”€β”€ evaluation/          # Evaluation metrics and visualization tools
β”œβ”€β”€ models/              # Model implementations
β”‚   └── time_rcd/       # Time-RCD model components
β”œβ”€β”€ utils/               # Utility functions
β”œβ”€β”€ testing.py              # Main entry point
β”œβ”€β”€ model_wrapper.py     # Model wrapper for different algorithms
└── README.md            # This file

Prerequisites

  • Python 3.10
  • conda (recommended for environment management)
  • Git

Installation

1. Create and Activate Conda Environment

conda create -n Time-RCD python=3.10
conda activate Time-RCD

2. Download the Repository

wget https://anonymous.4open.science/api/repo/TimeRCD-5BE1/zip -O Time-RCD.zip
unzip Time-RCD.zip -d Time-RCD

or dowload from the link: https://anonymous.4open.science/r/TimeRCD-5BE1 and unzip

3. Download TSB-AD Datasets

Create the datasets directory and download the TSB-AD-U (univariate) and TSB-AD-M (multivariate) datasets:

mkdir -p "datasets" \
  && wget -O "datasets/TSB-AD-U.zip" "https://www.thedatum.org/datasets/TSB-AD-U.zip" \
  && wget -O "datasets/TSB-AD-M.zip" "https://www.thedatum.org/datasets/TSB-AD-M.zip" \
  && cd datasets \
  && unzip TSB-AD-U.zip && rm TSB-AD-U.zip \
  && unzip TSB-AD-M.zip && rm TSB-AD-M.zip \
  && cd ..

4. Install Python Dependencies

Option A: Fast Install (using uv)

pip install uv
uv pip install jaxtyping einops pandas numpy scikit-learn transformers torch torchvision statsmodels matplotlib seaborn -U "huggingface_hub[cli]"

Option B: Normal Install

pip install jaxtyping einops pandas numpy scikit-learn transformers torch torchvision statsmodels matplotlib seaborn -U "huggingface_hub[cli]"

5. Download Pre-trained Checkpoints

Download the pre-trained model checkpoints from Hugging Face:

huggingface-cli download thu-sail-lab/Time-RCD checkpoints.zip --local-dir ./
unzip checkpoints.zip

Single Variable Time Series

To run anomaly detection on univariate time series:

python testing.py

Multi-Variable Time Series

To run anomaly detection on multivariate time series:

python testing.py --mode multi
Downloads last month
105
Safetensors
Model size
37.1M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using thu-sail-lab/Time-RCD 1