README.md

September 23, 2024 ยท View on GitHub

TSGBench: Time Series Generation Benchmark

TSGBench is the inaugural TSG benchmark designed for the Time Series Generation (TSG) task. We are excited to share that TSGBench has received the Best Research Paper Award Nomination at VLDB 2024 ๐Ÿ†

TSGAssist is an interactive assistant that integrates the strengths of TSGBench and utilizes Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG) for TSG recommendations and benchmarking ๐Ÿค–๐Ÿ“Š

We are actively exploring industrial collaborations in time series analytics. Please feel free to reach out (yihao_ang AT comp.nus.edu.sg) if interested ๐Ÿคโœจ

drawing

Table of Contents

Overview of TSGBench

Overall Architecture of TSGBench

Time Series Generation (TSG)

Time Series Generation (TSG) is crucial in a range of applications, including data augmentation, anomaly detection, and privacy preservation. Given an input time series, TSG aims to produce time series akin to the original, preserving temporal dependencies and dimensional correlations while ensuring the generated time series remains useful for various downstream tasks.

TSG Methods

TSGBench surveys a diverse range of Time Series Generation (TSG) methods by different backbone models and their specialties. The table below provides an overview of these methods along with their references.

TimePaperModelSpecialtySource Codes
2016C-RNN-GANGANmusichttps://github.com/olofmogren/c-rnn-gan
2017RGANGANgeneral (w/ medical) TShttps://github.com/ratschlab/RGAN
2018T-CGANGANirregular TShttps://github.com/gioramponi/GAN_Time_Series
2019WaveGANGANaudiohttps://github.com/chrisdonahue/wavegan
2019TimeGANGANgeneral TShttps://github.com/jsyoon0823/TimeGAN
2020TSGANGANgeneral TSCommunity implementation: https://github.com/Yashkataria/CGAN-for-time-series
2020DoppelGANgerGANgeneral TShttps://github.com/fjxmlzn/DoppelGANger
2020SigCWGANGANlong financial TShttps://github.com/SigCGANs/Conditional-Sig-Wasserstein-GANs
2020Quant GANsGANlong financial TSCommunity implementations: https://github.com/ICascha/QuantGANs-replication, https://github.com/JamesSullivan/temporalCN
2020COT-GANGANTS and videohttps://github.com/tianlinxu312/cot-gan
2021Sig-WGANGANfinancial TShttps://github.com/SigCGANs/Sig-Wasserstein-GANs
2021TimeGCIGANgeneral TSNo code available
2021RTSGANGANgeneral (w/ incomplete) TShttps://github.com/acphile/RTSGAN
2022PSA-GANGANgeneral (w/ forecasting) TShttps://github.com/mbohlkeschneider/psa-gan
2022CEGENGANgeneral TSNo code available
2022TTS-GANGANgeneral TShttps://github.com/imics-lab/tts-gan
2022TsT-GANGANgeneral TSNo code available
2022COSCI-GANGANgeneral TShttps://github.com/aliseyfi75/COSCI-GAN
2023AEC-GANGANlong TShttps://github.com/HBhswl/AEC-GAN
2023TT-AAEGANgeneral TShttps://openreview.net/forum?id=fI3y_Dajlca
2021TimeVAEVAEgeneral TShttps://github.com/abudesai/timeVAE
2023CRVAEVAEmedical TS & causal discoveryhttps://github.com/sinhasam/CRVAE
2023TimeVQVAEVAEgeneral TShttps://github.com/ML4ITS/TimeVQVAE
2023TimeVQVAE w/ ESSVAEgeneral TShttps://github.com/ML4ITS/TimeVQVAE?tab=readme-ov-file#enhanced-sampling-scheme-2
2023KVAEVAEgeneral (w/ irregular) TSNo code available
2020CTFPFlowgeneral TShttps://github.com/BorealisAI/continuous-time-flow-process
2021Fourier FlowFlowgeneral TShttps://github.com/ahmedmalaa/Fourier-flows
2018Neural ODEODE + RNNgeneral TShttps://github.com/rtqichen/torchdiffeq
2019ODE-RNNODE + RNNirregular TShttps://github.com/YuliaRubanova/latent_ode
2021Neural SDEODE + GANgeneral TShttps://github.com/google-research/torchsde
2022GT-GANODE + GANgeneral (w/ irregular) TShttps://openreview.net/forum?id=ez6VHWvuXEx
2023LS4ODE + VAEgeneral (w/ forecasting) TShttps://github.com/alexzhou907/ls4
2023SGMDiffusiongeneral TSNo code available

TSG Datasets

TSGBench selects ten real-world datasets from various domains, ensuring a wide coverage of scenarios for TSG evaluation. Here, RR is the number of sub-matrics after preprocessing, ll is the series length, and NN is the number of series in the sub-matrics.

DatasetRRllNNDomainLink
DLG2461420Traffichttp://archive.ics.uci.edu/dataset/157/dodgers+loop+sensor
Stock3294246Financialhttps://finance.yahoo.com/quote/GOOG/history?p=GOOG
Stock Long32041256Financialhttps://finance.yahoo.com/quote/GOOG/history?p=GOOG
Exchange67151258Financialhttps://github.com/laiguokun/multivariate-time-series-data
Energy177392428Applianceshttp://archive.ics.uci.edu/dataset/374/appliances+energy+prediction
Energy Long1764912528Applianceshttp://archive.ics.uci.edu/dataset/374/appliances+energy+prediction
EEG1336612814Medicalhttps://archive.ics.uci.edu/dataset/264/eeg+eye+state
HAPT15141286Medicalhttps://archive.ics.uci.edu/dataset/341/smartphone+based+recognition+of+human+activities+and+postura+transitions
Air77311686Sensorhttps://www.microsoft.com/en-us/research/project/urban-air/
Boiler8093519211Industrialhttps://github.com/DMIRLAB-Group/SASA/tree/main/datasets/Boiler

TSG Evaluation Measures

TSGBench considers the following evaluation measures, ranking analysis, and a novel generalization test by Domain Adaptation (DA).

  1. Model-based Measures
    • Discriminitive Score (DS)
    • Predictive Score (PS)
    • Contextual-FID (C-FID)
  2. Feature-based Measures
    • Marginal Distribution Difference (MDD)
    • AutoCorrelation Difference (ACD)
    • Skewness Difference (SD)
    • Kurtosis Difference (KD)
  3. Distance-based Measures
    • Euclidean Distance (ED)
    • Dynamic Time Warping (DTW)
  4. Visualization
    • t-SNE
    • Distribution Plot
  5. Training Efficiency
    • Training Time

Benchmarking Results

Main Results

TSG Benchmarking Results

Visualization

Visualization for TSG Benchmarking by t-SNE and Distribution Plot

Generalization Test

Generalization Test

Overview of TSGAssist

TSGAssist is an interactive assistant harnessing LLMs and RAG for time series generation recommendations and benchmarking.

  • It offers multi-round personalized recommendations through a conversational interface that bridges the cognitive gap,
  • It enables the direct application and instant evaluation of users' data, providing practical insights into the effectiveness of various methods.

Screenshot of TSGAssist 1 Screenshot of TSGAssist 2

Getting Started with TSGBench

Configuration

We recommend using conda to create a virtual environment for TSGBench.

conda create -n tsgbench python=3.7
conda activate tsgbench
conda install --file requirements.txt

The configuration file ./config/config.yaml contains various settings to run TSGBench. It is structured into the following sections:

  • Preprocessing: Configures data preprocessing. Specify the input data path using the preprocessing.original_data_path and the output path for processed data using preprocessing.output_ori_path.
  • Generation: Contains the settings related to data generation.
  • Evaluation: Includes the parameters required for evaluating the model's performance.

Running TSGBench

  1. Set Input Data: Update the preprocessing.original_data_path in config.yaml to specify the location of your input data.

  2. Run TSGBench: Execute the main script by running python ./main.py. By default, this will run the preprocessing, generation, and evaluation stages in sequence. You can skip or adjust these steps by modifying the relevant sections in the configuration file. In particular,

    (1) Preprocessing: During preprocessing, data is processed and saved to the path specified by preprocessing.output_ori_path in the configuration file.

    (2) Generation: Place your designated model structure under the ./model directory. In ./src/generation, point the model entry to your model. If necessary, provide pretrained parameters by specifying them under generation.pretrain_path. Generated data will be saved at generation.output_gen_path.

    (3) Evaluation: Select specific evaluation measures by updating the evaluation.method_list in the configuration file. The evaluation results will be saved to the path specified in evaluation.result_path.

References

Please consider citing our work if you use TSGBench (and/or TSGAssist) in your research:

# TSGBench
@article{ang2023tsgbench,
  title        = {TSGBench: Time Series Generation Benchmark},
  author       = {Ang, Yihao and Huang, Qiang and Bao, Yifan and Tung, Anthony KH and Huang, Zhiyong},
  journal      = {Proc. {VLDB} Endow.},
  volume       = {17},
  number       = {3},
  pages        = {305--318},
  year         = {2023}
}

# TSGAssist
@article{ang2024tsgassist,
  title        = {TSGAssist: An Interactive Assistant Harnessing LLMs and RAG for Time Series Generation Recommendations and Benchmarking},
  author       = {Ang, Yihao and Bao, Yifan and Huang, Qiang and Tung, Anthony KH and Huang, Zhiyong},
  journal      = {Proc. {VLDB} Endow.},
  volume       = {17},
  number       = {12},
  pages        = {4309--4312},
  year         = {2024}
}