The official PyTorch implementation of Cross-Domain Graph Anomaly Detection via Anomaly-aware Contrastive Alignment, AAAI2023, to appear.
By Qizhou Wang, Guansong Pang, Mahsa Salehi, Wray Buntine and Christopher Leckie.
t-SNE visualisation of a CD GAD dataset before (a) and after (b) our anomaly-aware contrastive alignment. Compared to (a) where the two domains show clear discrepancies in different aspects like anomaly distribution, in (b) our domain alignment approach effectively aligns the normal class, while pushing away the anomalous nodes in both source and target domains from the normal class.
Miniconda/Anaconda is recommended for setting up the dependencies.
git clone https://github.com/QZ-WANG/ACT
cd ACT
conda env create -f env/environment.yml
To set up the dataset directories, place the data files as the following:
datasets/
├── Amazon
│ └── Amazon.mat
├── YelpHotel
│ └── YelpHotel.mat
├── YelpNYC
│ └── YelpNYC.mat
└── YelpRes
└── YelpRes.mat
The authors of COMMANDER (Ding et al. 2021) have kindly allowed us to share the datasets. Please ensure appropriate citations when using the datasets.
To run the framework:
chmod +x ./script/pipeline.sh
./script/pipeline.sh <name-of-pipeline-config-file>
Please see the sample meta config file in ./exp/pipelines/config
.
We thank the authors of COMMANDER (Ding et al. 2021) for sharing the datasets. This repository is developed using PyTorch Geometric.