This repository contains the source code for the research work RADA, which is currently under submission to the VLDB conference.
RADA is an unsupervised domain adaptation framework for time series anomaly detection built on PyTorch. By introducing innovative mechanisms for reliability filtering and dual-view multi-granularity feature extraction, it effectively addresses the negative transfer problem during cross-domain transfer.
Cross-entity time-series anomaly detection uses normal data from existing entities to identify anomalies in a new entity. Because normal patterns vary across entities, directly transferring a source-domain model can produce false positives. Adapting to a new domain with unlabeled target data may also cause the model to fit anomalies mixed into the target set. We propose RADA, a reliability-aware domain adaptation model that selects reliable target units for joint reconstruction, learning target-domain normal patterns while limiting anomaly contamination. RADA combines the mean reconstruction error from two stochastic reconstructions with their predictive disagreement to form a risk score. It filters target units according to the within-batch distribution and updates a shared network jointly with normal source-domain data. Dual amplitude and gradient views with multi-granularity reconstruction provide temporal information for reliability estimation and anomaly scoring. On SMD, MSL, and SMAP, we compare RADA with 11 baselines. Across 12 source-entity settings, RADA improves F1, AUPR, and AUROC by 16.08%, 19.02%, and 5.63% on average over the best baseline for each metric and setting, respectively.
To use this code, please follow the steps below to configure your environment:
Clone this repository:
git clone https://github.com/allzna/RADA.git
Create and activate a virtual environment:
conda create -n rada_env python=3.10
conda activate rada_env
Install required dependencies:
pip install -r requirements.txt
For the complete cross-domain adaptation pipeline on a specific dataset, you can directly run the main entry point:
python run_uda_loop.py