Skip to content

About

The official code implement of [ SIGMOD25 Demo | KDSelector: A Knowledge-Enhanced and Data-Efficient Model Selector Learning Framework for Time Series Anomaly Detection]

Topics

Resources

Stars

8 stars

Watchers

2 watching

Forks

Repository files navigation

KDSelector logo

KDSelector

A knowledge-enhanced, data-efficient model selector for time-series anomaly detection

Python 3.8 PyTorch 1.13.1 Streamlit 1.40.1

KDSelector learns to recommend a suitable anomaly detector for an unseen time series by reusing knowledge from historical benchmark results. It further employs data-efficient learning to reduce selector-training cost. KDSelector is the algorithm behind our SIGMOD 2025 work, while the extended algorithmic details and comprehensive analyses are presented in our PVLDB 2026 paper; see the paper and repository for details.

KDSelector system overview

Highlights

  • Knowledge-enhanced selection — learns from historical detector performance instead of evaluating every detector from scratch.
  • Data-efficient training — integrates InfoBatch to reduce redundant training samples.
  • Broad model support — includes deep selectors and conventional feature-based classifiers.
  • End-to-end interface — provides a Streamlit workflow for dataset loading, selector training, selector management, and anomaly detection.
  • Multiple evaluation metrics — ships benchmark scores for AUC-ROC, AUC-PR, VUS-ROC, and VUS-PR.

Supported methods

Component Implementations
Deep selectors ConvNet, InceptionTime, ResNet, SiT
Feature-based selectors k-NN, linear SVC, decision tree, random forest, MLP, AdaBoost, Gaussian NB, QDA
Anomaly detectors AE, CNN, HBOS, Isolation Forest, LOF, LSTM, Matrix Profile, NORMA, OCSVM, PCA, POLY

Quick start

1. Clone the repository

git clone https://github.com/chenyuanTKCY/KDSelector.git
cd KDSelector

2. Create the environment

Conda is recommended because the project targets Python 3.8 and pins its main machine-learning dependencies.

conda env create --file environment.yml
conda activate KDSelector

Alternatively, install the Python dependencies directly:

python -m pip install -r requirements.txt

GPU acceleration requires a CUDA setup compatible with the pinned PyTorch version. The application can also run on CPU.

3. Launch the application

Run this command from the repository root:

streamlit run app/Home.py

The application opens in your browser and guides you through four stages: dataset preparation, selector learning, selector management, and model selection with anomaly detection.

Command-line training

Train a deep selector:

python train_deep_model.py \
  --path <dataset-directory> \
  --model resnet \
  --params models/configuration/resnet_default.json \
  --eval-true

Train a feature-based selector:

python train_feature_based.py \
  --path <dataset-directory> \
  --classifier random_forest \
  --eval-true

Use --help with either script to see every training option.

Repository layout

KDSelector/
├── app/                 # Streamlit application and detector integrations
├── data/                # Benchmark metric tables
├── InfoBatch/           # Data-efficient training implementation
├── models/              # Selector architectures and configurations
├── report/              # Technical report
├── utils/               # Data loading, evaluation, and training utilities
├── train_*.py           # Selector training entry points
└── eval_*.py            # Selector evaluation entry points

Resources

Citation

If KDSelector supports your research, please cite:

@inproceedings{liang2025kdselector,
  title     = {KDSelector: A Knowledge-Enhanced and Data-Efficient Model
               Selector Learning Framework for Time Series Anomaly Detection},
  author    = {Liang, Zhiyu and Cai, Dongrui and Zhang, Chenyuan and
               Liang, Zheng and Liang, Chen and Zheng, Bo and Qiu, Shi and
               Wang, Jin and Wang, Hongzhi},
  booktitle = {Companion of the 2025 International Conference on Management
               of Data},
  year      = {2025}
}

For implementation details and experimental context, see the technical report.

About

The official code implement of [ SIGMOD25 Demo | KDSelector: A Knowledge-Enhanced and Data-Efficient Model Selector Learning Framework for Time Series Anomaly Detection]

Topics

Resources

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages