Imbalanced Graph-Level Anomaly Detection via Counterfactual Augmentation and Feature Learning

Zitong Wang, Xuexiong Luo, Enfeng Song, Qiu-Qing Bai, Fu Lin

TL;DR

This paper introduces IGAD-CF, a novel approach to graph-level anomaly detection (GLAD) that tackles the common problem of imbalanced datasets. By using counterfactual learning to generate realistic anomalous samples and a feature learning module that combines node attributes with degree information, IGAD-CF significantly improves detection performance and robustness.

What Problem Does This Paper Address?

Graph-level anomaly detection (GLAD) is crucial for identifying unusual patterns in entire graphs, with applications ranging from fraud detection to medical diagnosis. A major hurdle in this field is the severe imbalance between normal and anomalous graphs, where anomalies are typically rare. This imbalance leads existing methods to over-focus on normal patterns, hindering their ability to detect anomalies effectively. Furthermore, many current GLAD techniques rely solely on inherent node features, neglecting valuable structural information like node degrees, which can lead to suboptimal performance. This paper aims to address both the data imbalance and the underutilization of features in GLAD.

Methods

The proposed IGAD-CF framework introduces three key components:

  1. Anomaly Sample Generation Module: This module employs counterfactual learning to create synthetic anomalous graph samples. By perturbing normal graphs, it generates samples that are similar to real anomalies, effectively balancing the dataset without introducing unreliable or artificial patterns. This helps the model learn more robust anomalous features.
  2. Node Feature Learning Module: This module addresses the underutilization of node features. It combines the inherent node attributes with node degree attributes (representing the number of connections a node has) using Graph Neural Networks (GNNs). This fusion captures richer, more comprehensive information about the graph's structure and node relationships.
  3. Adaptive Weight Learning Module: Recognizing that different features have varying importance, this module assigns adaptive weights to the learned features. This ensures that the model prioritizes more informative features, enhancing its generalization capabilities and tailoring its focus to the specific characteristics of different datasets.

The framework also incorporates a custom loss function that balances the contributions of original and generated anomalous samples, as well as normal samples.

Datasets

The paper evaluates IGAD-CF on eight publicly available graph anomaly detection datasets: AIDS, BZR, COX2, DHFR, ENZYMES, IMDB-BINARY, NCI1, and hERG. These datasets represent diverse domains, including small molecules, bioinformatics, and social networks. Additionally, the authors apply their model to two brain disorder datasets (HIV and BP) derived from neuroimaging data (DTI and fMRI) to demonstrate its generalization capabilities in a real-world medical context.

Key Insights and Ideas

  • Counterfactuals for Data Balancing: The paper highlights that counterfactual learning is a powerful technique for generating realistic anomalous samples, which is crucial for overcoming data imbalance in GLAD. This approach is more sophisticated than simple oversampling.
  • Degree Attributes are Key: Integrating node degree information alongside traditional node features significantly enhances the model's ability to capture graph anomalies. This suggests that structural information is as important as attribute information for effective GLAD.
  • Adaptive Feature Weighting Matters: Not all features are created equal. An adaptive weighting mechanism allows the model to dynamically adjust its focus on different features based on their importance for a given dataset, leading to improved generalization.
  • Robustness Across Domains: The successful application of IGAD-CF to both standard GLAD benchmarks and complex brain disease datasets demonstrates its versatility and robustness.

Key Results

IGAD-CF consistently outperforms several state-of-the-art baselines across multiple datasets. For instance, on the IMDB-BINARY dataset, IGAD-CF achieved an AUC improvement of 14.85% over the second-best method. The model also exhibits low standard deviations, indicating stable performance. In the brain disease detection case study, IGAD-CF significantly outperformed two established brain graph anomaly detection methods, BrainGNN and IBGNN, showing superior accuracy and stability.

Limitations and Future Work

The paper acknowledges that for datasets with very simple structures (like AIDS), the performance gains from IGAD-CF might be less pronounced, as simpler models can already achieve good results. The authors suggest that future work could explore more advanced GNN architectures and further investigate the impact of different counterfactual generation strategies. The paper also implicitly suggests that exploring other types of graph augmentations beyond counterfactuals could be a fruitful direction.

Summary updated

Abstract

Graph-level anomaly detection (GLAD) has already gained significant importance and has become a popular field of study, attracting considerable attention across numerous downstream works. The core focus of this domain is to capture and highlight the anomalous information within given graph datasets. In most existing studies, anomalies are often the instances of few. The stark imbalance misleads current GLAD methods to focus on learning the patterns of normal graphs more, further impacting anomaly detection performance. Moreover, existing methods predominantly utilize the inherent features of nodes to identify anomalous graph patterns which is approved suboptimal according to our experiments. In this work, we propose an imbalanced GLAD method via counterfactual augmentation and feature learning. Specifically, we first construct anomalous samples based on counterfactual learning, aiming to expand and balance the datasets. Additionally, we construct a module based on Graph Neural Networks (GNNs), which allows us to utilize degree attributes to complement the inherent attribute features of nodes. Then, we design an adaptive weight learning module to integrate features tailored to different datasets effectively to avoid indiscriminately treating all features as equivalent. Furthermore, extensive baseline experiments conducted on public datasets substantiate the robustness and effectiveness. Besides, we apply the model to brain disease datasets, which can prove the generalization capability of our work. The source code of our work is available online1.
BibTeX
@misc{wang2024imbalanced,
  author = {Zitong Wang and Xuexiong Luo and Enfeng Song and Qiu-Qing Bai and Fu Lin},
  title = {{Imbalanced Graph-Level Anomaly Detection via Counterfactual Augmentation and Feature Learning}},
  year = {2024},
  eprint = {2407.11082},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.11082},
}

Loading related content...

Figure