Table of Contents
Fetching ...

Disentangled Graph Prompting for Out-Of-Distribution Detection

Cheng Yang, Yu Hao, Qi Zhang, Chuan Shi

Abstract

When testing data and training data come from different distributions, deep neural networks (DNNs) will face significant safety risks in practical applications. Therefore, out-of-distribution (OOD) detection techniques, which can identify OOD samples at test time and alert the system, are urgently needed. Existing graph OOD detection methods usually characterize fine-grained in-distribution (ID) patterns from multiple perspectives, and train end-to-end graph neural networks (GNNs) for prediction. However, due to the unavailability of OOD data during training, the absence of explicit supervision signals could lead to sub-optimal performance of end-to-end encoders. To address this issue, we follow the pre-training+prompting paradigm to utilize pre-trained GNN encoders, and propose Disentangled Graph Prompting (DGP), to capture fine-grained ID patterns with the help of ID graph labels. Specifically, we design two prompt generators that respectively generate class-specific and class-agnostic prompt graphs by modifying the edge weights of an input graph. We also design several effective losses to train the prompt generators and prevent trivial solutions. We conduct extensive experiments on ten datasets to demonstrate the superiority of our proposed DGP, which achieves a relative AUC improvement of 3.63% over the best graph OOD detection baseline. Ablation studies and hyper-parameter experiments further show the effectiveness of DGP. Code is available at https://github.com/BUPT-GAMMA/DGP.

Disentangled Graph Prompting for Out-Of-Distribution Detection

Abstract

When testing data and training data come from different distributions, deep neural networks (DNNs) will face significant safety risks in practical applications. Therefore, out-of-distribution (OOD) detection techniques, which can identify OOD samples at test time and alert the system, are urgently needed. Existing graph OOD detection methods usually characterize fine-grained in-distribution (ID) patterns from multiple perspectives, and train end-to-end graph neural networks (GNNs) for prediction. However, due to the unavailability of OOD data during training, the absence of explicit supervision signals could lead to sub-optimal performance of end-to-end encoders. To address this issue, we follow the pre-training+prompting paradigm to utilize pre-trained GNN encoders, and propose Disentangled Graph Prompting (DGP), to capture fine-grained ID patterns with the help of ID graph labels. Specifically, we design two prompt generators that respectively generate class-specific and class-agnostic prompt graphs by modifying the edge weights of an input graph. We also design several effective losses to train the prompt generators and prevent trivial solutions. We conduct extensive experiments on ten datasets to demonstrate the superiority of our proposed DGP, which achieves a relative AUC improvement of 3.63% over the best graph OOD detection baseline. Ablation studies and hyper-parameter experiments further show the effectiveness of DGP. Code is available at https://github.com/BUPT-GAMMA/DGP.

Paper Structure

This paper contains 49 sections, 16 equations, 7 figures, 4 tables, 1 algorithm.

Figures (7)

  • Figure 1: An illustration of our Disentangled Graph Prompting (DGP) method. DGP can take advantage of pre-trained GNN encoders, and generate prompt graphs from both class-specific and class-agnostic views for fine-grained ID pattern mining. The parameters of GNN encoders are frozen at the prompting stage.
  • Figure 2: An illustration of the training process of our proposed DGP. For each input graph, we generate two prompt graphs to capture ID patterns from class-specific and class-agnostic views, respectively. We design several losses to supervise and regularize the training of prompt generators. Here the parameters of pre-trained GNN encoder are frozen in our method.
  • Figure 3: Decision score distributions of ID and OOD graphs on ten datasets. Smaller distribution overlap indicates better detection ability. The two images in the same column respectively represent the pre-trained (left), pre-trained+prompted right.
  • Figure 4: Graph OOD detection results (AUC values) of different ablated variants and GNN encoder initialization strategies.
  • Figure 5: Graph OOD detection results (AUC values) on BZR-COX2 and PTC_MR-MUTAG with respect to four hyper-parameters and different MLP layers.
  • ...and 2 more figures