RED-F: Reconstruction-Elimination based Dual-stream Contrastive Forecasting for Multivariate Time Series Anomaly Prediction
Official PyTorch implementation of the paper: RED-F: Reconstruction-Elimination based Dual-stream Contrastive Forecasting for Multivariate Time Series Anomaly Prediction.
If RED-F helps your research, please consider giving us a ⭐ star!
RED-F, a framework composed of the Reconstruction-Elimination Model (REM) and the Dual-Stream Contrastive Forecasting Model (DFM). Technically, we utilize REM to construct a baseline of normal patterns from historical data, providing a foundation for subsequent predictions of anomalies. Then DFM simultaneously predicts both the constructed normal pattern and the current window, employing a contrastive forecast that transforms the difficult AP task into a simpler, more robust task of relative trajectory comparison by computing the divergence between these two predictions.
Ensure you have a Python 3.8+ environment ready. Install the necessary dependencies via:
pip install -r requirements.txt
Download the pre-processed datasets from the following sources: OneDrive or BaiduCloud. Extract the archives and place the contents into the ./dataset directory.
- Model Definition: Explore the core logic in here.
- Reproduction: Run the provided scripts to replicate our results. For instance, to test on the Genesis dataset:
sh ./scripts/multivariate_detection/detect_label/Genesis/REDF_pred32.shExtensive experiments on 6 real-world datasets demonstrate that RED-F achieves state-of-the-art performance. We show the main results of all the 6 real-world datasets:
We also include scripts for baseline models (e.g., PatchTST-AT) for fair comparison:
sh ./scripts/multivariate_detection/detect_label/Genesis/PatchTST-AT.shWe acknowledge the following open-source projects for their outstanding contributions to the field:
- TAB: Unified Benchmarking of Time Series Anomaly Detection Methods(https://github.com/decisionintelligence/TAB)
- CATCH: Channel-Aware Multivariate Time Series Anomaly Detection via Frequency Patching(https://github.com/decisionintelligence/CATCH)
If you find this repo useful, please cite our paper.
@inproceedings{chen2025redf,
title = {{RED-F}: Reconstruction-Elimination based Dual-stream Contrastive Forecasting for Multivariate Time Series Anomaly Prediction},
author = {Chen, P Y and Shi, X and Chang, Y and others},
booktitle = {arXiv preprint arXiv:2511.20044},
year = {2025}
}
If you have any questions or suggestions, feel free to contact:
-
[PengYu Chen] ([email protected])
-
Or describe it in Issues.