TL;DR
This paper introduces FANFOLD, a novel approach for unsupervised graph-level anomaly detection that leverages normalizing flows within an asymmetric network architecture. By transforming normal graph distributions into a standard normal distribution, FANFOLD effectively captures the underlying characteristics of normal graphs, leading to improved detection of anomalies.
What Problem Does This Paper Address?
Detecting anomalies in graphs (e.g., identifying fraudulent transactions in a network or unusual protein structures) is a critical task across many domains. Unsupervised graph-level anomaly detection (UGAD) aims to do this without pre-labeled anomaly data. While knowledge distillation (KD) has shown promise in improving UGAD models, existing KD-based methods often use symmetric "teacher" and "student" networks. This symmetry can lead to similar outputs for both normal and anomalous graphs, making it hard to distinguish them. Furthermore, relying solely on graph features can be unstable for complex data. This paper addresses the challenge of creating a more effective UGAD method by introducing asymmetry and a more robust way to model graph distributions.
Methods
FANFOLD is built upon two core ideas: an asymmetric network architecture and the use of normalizing flows.
- Asymmetric Network: Instead of identical teacher and student networks, FANFOLD employs an asymmetric setup. The "source" network (teacher) is enhanced with normalizing flows, while the "target" network (student) is a standard GNN. This asymmetry is crucial for creating a discernible difference in outputs between normal and anomalous graphs.
- Normalizing Flows: These are powerful generative models that can transform a complex data distribution into a simpler one (like a standard Gaussian distribution) while preserving the ability to compute exact probabilities. In FANFOLD, normalizing flows are applied to the source network to map the distribution of normal graph embeddings to a standard normal distribution. This process helps to explicitly model the underlying distribution and density of normal graphs.
- Knowledge Distillation: The model uses a KD-like approach where the source network's learned representations and distributions are used to guide the training of the target network. During inference, the difference in outputs between the source and target networks is used to calculate an anomaly score.
The training involves a pre-training phase for the source network encoder, followed by training the normalizing flows to achieve the desired distribution transformation. Finally, the asymmetric source-target network is trained using a combined loss that encourages consistency for normal graphs while highlighting discrepancies for anomalies.
Datasets
The paper evaluates FANFOLD on 15 diverse graph-level anomaly detection datasets from various fields, including small molecules, bioinformatics, and social networks. These datasets are drawn from the widely adopted TUDataset benchmark. The authors follow established conventions for defining anomalous graphs within these datasets, using only normal graphs for training.
Key Insights and Ideas
- Symmetry is a bottleneck: The paper strongly argues that the inherent symmetry in traditional KD-based UGAD models hinders their ability to effectively distinguish anomalies. Introducing asymmetry is key.
- Distribution matters more than just features: Relying solely on graph features can be brittle. Modeling the distribution of graph embeddings, especially for normal graphs, provides a more fundamental way to identify deviations.
- Normalizing flows are powerful for UGAD: By transforming complex graph distributions into a standard normal distribution, normalizing flows provide a principled way to learn the "essence" of normal graphs and detect deviations.
- Asymmetry + Normalizing Flows = Superiority: The combination of an asymmetric architecture and normalizing flows in FANFOLD leads to a significant improvement in anomaly detection performance, outperforming many existing methods.
Key Results
FANFOLD demonstrates state-of-the-art performance across the evaluated datasets:
- It achieves the top performance on 9 out of 15 datasets.
- It secures second place on 2 additional datasets.
- FANFOLD attains the highest average rank among all compared methods.
- Ablation studies show that:
- The asymmetric structure (Asy-ST) provides a significant performance boost.
- Normalizing flows (Non-NF vs. FANFOLD) contribute an additional ~10% performance improvement on certain datasets, highlighting their role in capturing essential graph characteristics.
Limitations and Future Work
- Strict Training Data Assumption: FANFOLD, like many existing UGAD methods, assumes that the training data contains only normal graphs. This is a practical limitation as real-world scenarios often have some level of anomaly contamination in training data. The authors acknowledge this and suggest it diverges from real-world scenarios and incurs extra costs for data curation.
- Computational Cost: While not explicitly detailed as a limitation, the use of normalizing flows and potentially deeper GNNs can increase computational complexity. The paper does explore the impact of message-passing steps, suggesting that too many steps can lead to performance degradation.
Future work could explore methods that are more robust to anomaly contamination in training data or investigate more efficient implementations of normalizing flows for graph data.
Summary updated