Table of Contents
Fetching ...

Motif-Consistent Counterfactuals with Adversarial Refinement for Graph-Level Anomaly Detection

Chunjing Xiao, Shikang Pang, Wenxin Tai, Yanlong Huang, Goce Trajcevski, Fan Zhou

TL;DR

Graph-level anomaly detection can suffer from spurious correlations and poor generalization when using perturbation-based counterfactuals. MotifCAR introduces a motif-driven counterfactual generator that merges the discriminative motif of one graph with the contextual subgraph of another, followed by a GAN-based optimizer with motif-consistency, contextual, and connection losses to enforce Realism, Validity, Proximity, and Sparsity. The approach yields higher detection accuracy and counterfactual quality across four benchmark datasets, outperforming state-of-the-art baselines and existing counterfactual augmentation methods. By embedding motif-guided structure and adversarial refinement, MotifCAR provides a robust framework for graph-level anomaly detection that generalizes across environments and can be extended to evolving-graph settings.

Abstract

Graph-level anomaly detection is significant in diverse domains. To improve detection performance, counterfactual graphs have been exploited to benefit the generalization capacity by learning causal relations. Most existing studies directly introduce perturbations (e.g., flipping edges) to generate counterfactual graphs, which are prone to alter the semantics of generated examples and make them off the data manifold, resulting in sub-optimal performance. To address these issues, we propose a novel approach, Motif-consistent Counterfactuals with Adversarial Refinement (MotifCAR), for graph-level anomaly detection. The model combines the motif of one graph, the core subgraph containing the identification (category) information, and the contextual subgraph (non-motif) of another graph to produce a raw counterfactual graph. However, the produced raw graph might be distorted and cannot satisfy the important counterfactual properties: Realism, Validity, Proximity and Sparsity. Towards that, we present a Generative Adversarial Network (GAN)-based graph optimizer to refine the raw counterfactual graphs. It adopts the discriminator to guide the generator to generate graphs close to realistic data, i.e., meet the property Realism. Further, we design the motif consistency to force the motif of the generated graphs to be consistent with the realistic graphs, meeting the property Validity. Also, we devise the contextual loss and connection loss to control the contextual subgraph and the newly added links to meet the properties Proximity and Sparsity. As a result, the model can generate high-quality counterfactual graphs. Experiments demonstrate the superiority of MotifCAR.

Motif-Consistent Counterfactuals with Adversarial Refinement for Graph-Level Anomaly Detection

TL;DR

Graph-level anomaly detection can suffer from spurious correlations and poor generalization when using perturbation-based counterfactuals. MotifCAR introduces a motif-driven counterfactual generator that merges the discriminative motif of one graph with the contextual subgraph of another, followed by a GAN-based optimizer with motif-consistency, contextual, and connection losses to enforce Realism, Validity, Proximity, and Sparsity. The approach yields higher detection accuracy and counterfactual quality across four benchmark datasets, outperforming state-of-the-art baselines and existing counterfactual augmentation methods. By embedding motif-guided structure and adversarial refinement, MotifCAR provides a robust framework for graph-level anomaly detection that generalizes across environments and can be extended to evolving-graph settings.

Abstract

Graph-level anomaly detection is significant in diverse domains. To improve detection performance, counterfactual graphs have been exploited to benefit the generalization capacity by learning causal relations. Most existing studies directly introduce perturbations (e.g., flipping edges) to generate counterfactual graphs, which are prone to alter the semantics of generated examples and make them off the data manifold, resulting in sub-optimal performance. To address these issues, we propose a novel approach, Motif-consistent Counterfactuals with Adversarial Refinement (MotifCAR), for graph-level anomaly detection. The model combines the motif of one graph, the core subgraph containing the identification (category) information, and the contextual subgraph (non-motif) of another graph to produce a raw counterfactual graph. However, the produced raw graph might be distorted and cannot satisfy the important counterfactual properties: Realism, Validity, Proximity and Sparsity. Towards that, we present a Generative Adversarial Network (GAN)-based graph optimizer to refine the raw counterfactual graphs. It adopts the discriminator to guide the generator to generate graphs close to realistic data, i.e., meet the property Realism. Further, we design the motif consistency to force the motif of the generated graphs to be consistent with the realistic graphs, meeting the property Validity. Also, we devise the contextual loss and connection loss to control the contextual subgraph and the newly added links to meet the properties Proximity and Sparsity. As a result, the model can generate high-quality counterfactual graphs. Experiments demonstrate the superiority of MotifCAR.
Paper Structure (20 sections, 1 theorem, 20 equations, 5 figures, 3 tables)

This paper contains 20 sections, 1 theorem, 20 equations, 5 figures, 3 tables.

Key Result

Theorem 1

For a graph $G$ which is sampled from the graphon $W_G$, its discriminative motif exists in $W_G$.

Figures (5)

  • Figure 1: An example of perturbations altering semantics. $G_1$ and $G_2$ are normal graphs. While, $G_3$ is abnormal one as its fully connected structure deviates significantly from the normal ones. However, by pruning a few edges, abnormal graph $G_3$ is transformed into normal graph $G_4$, leading to an altered semantic.
  • Figure 2: The Overview of the MotifCAR framework.
  • Figure 3: Ablation study: Variants of MotifCAR.
  • Figure 4: Validity and Sparsity.
  • Figure 5: The effect of the hyper-parameters.

Theorems & Definitions (2)

  • Definition 1
  • Theorem 1