This is a PyTorch implementation of
Addressing Heterophily in Graph Anomaly Detection: A Perspective of Graph Spectrum (WWW2023)
In this work, we aim to address the heterophily problem in the spectral domain. We point out that heterophily is positively associated with the frequency of a graph. Towards this end, we could prune inter-class edges by simply emphasizing and delineating the high-frequency components of the graph. We adopt graph Laplacian to measure the extent of 1-hop label changing of the center node and indicate high-frequency components. Our indicator can effectively reduce the heterophily degree of the graph and is less likely to be influenced by the prediction error.
- What is heterophily and how does it affect the performance of the GNNs? Heterophily indicates the edges connecting nodes with different labels. Low-pass filters like GCN could undermine the discriminative information of the anomalies on heterophilous graphs.
- How does indicator work? GHRN will calculate the post-aggregation matrix for the graph, and a smaller value means a larger probability of the inter-class edges.
YelpChi and Amazon can be downloaded from here or dgl.data.FraudDataset. The T-Finance and T-Social datasets developed in the paper are on google drive.
- pytorch 1.9.0
- dgl 0.8.1
- sympy
- argparse
- sklearn
- scipy
- pickle
python main.py --dataset tfinance
python main.py --dataset tfinance --del_ratio 0.015
Note that a delete ratio of 0 should be run first to get predictions y.
Also, here's an awesome implementation.
Our code references:
@inproceedings{
gao2023ghrn,
title={Addressing Heterophily in Graph Anomaly Detection: A Perspective of Graph Spectrum},
author={Yuan Gao and Xiang Wang and Xiangnan He and Zhenguang Liu and Huamin Feng and Yongdong Zhang},
booktitle={WWW},
year={2023},
}