Skip to content

TDroyal/TEP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python 3.8.8 torch 1.31.1 License

TEP

This repository supplements our paper "Pre-training Enhanced Transformer for multivariate time series anomaly detection" accepted in Information Fusion 2025. Follow the below steps to replicate each cell in the results table.

Model Framework

model framework

Performance

performance

Installation

We use Python-3.8.8.

pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116
pip install -r requirements.txt

Download Data

You can download all the raw datasets at Google Drive, and unzip them to TEP/.

Result Reproduction

Take the SMD dataset as an example, other datasets are similar.

  • Method 1:

Retrain the CANets model

python main.py --model CANets --dataset SMD --retrain

The trained CANets model will be saved to the checkpoints/CANets_SMD folder, take out the .pth file with the lowest loss, rename it to SMD_CANets.pth, and finally put it in CANets/SMD, and then execute the following command.

python main.py --model TEP --dataset SMD --retrain --fuse_knowledge
  • Method 2: (Official Recommendation)

For each dataset, the pre-trained CANets model has been put in the CANets folder in advance. You can directly execute the following command.

python main.py --model TEP --dataset SMD --retrain --fuse_knowledge

Cite this work

Our paper is available in the Proceedings of Information Fusion: https://www.sciencedirect.com/science/article/pii/S1566253525002441. If you find this repository useful for your work, please consider citing it as follows:

@article{wang2025pre,
  title={Pre-training Enhanced Transformer for multivariate time series anomaly detection},
  author={Wang, Chao and Shi, Haochen and Hu, Jie and Yang, Xin and Zhang, Junbo and Du, Shengdong and Li, Tianrui},
  journal={Information Fusion},
  pages={103171},
  year={2025},
  publisher={Elsevier}
}

Star

If it is helpful to you, please give a star to the project, thank you.

License

This project is licensed under the BSD 3-Clause License.

See LICENSE for details.

About

TEP model for anomaly detection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages