Graph-level representation learning is important in a wide range of applications. However, existing graph-level models are generally built on i.i.d. assumption for both training and testing graphs, which is not realistic in an open world, where models can encounter out-of-distribution (OOD) testing graphs that are from different distributions unknown during training. A trustworthy model should not only produce accurate predictions for in-distribution (ID) data, but also detect OOD graphs to avoid unreliable prediction. In this paper, we present SGOOD, a novel graph-level OOD detection framework. We find that substructure differences commonly exist between ID and OOD graphs. Hence, SGOOD explicitly utilizes substructures to learn powerful representations to achieve superior performance. Specifically, we build a super graph of substructures for every graph, and design a two-level graph encoding pipeline that works on both original graphs and super graphs to obtain substructure-enhanced graph representations. To further distinguish ID and OOD graphs, we develop three graph augmentation techniques that preserve substructures and increase expressiveness. Extensive experiments against 10 competitors on numerous graph datasets demonstrate the superiority of SGOOD, often surpassing existing methods by a significant margin. The code is available at https://anonymous.4open.science/r/SGOOD-0958.
翻译:图级表示学习在众多应用中具有重要意义。然而,现有图级模型通常建立在训练与测试图均服从独立同分布(i.i.d.)假设的基础上,这在开放世界中并不现实——模型可能遇到分布未知且训练阶段未曾出现的分布外(OOD)测试图。一个值得信赖的模型不仅需要对分布内(ID)数据做出准确预测,还需检测OOD图以避免不可靠预测。本文提出SGOOD,一种新型图级OOD检测框架。我们发现ID图与OOD图之间存在普遍的子结构差异,因此SGOOD显式利用子结构学习强表征以实现卓越性能。具体而言,我们为每个图构建子结构超图,并设计双层级图编码流程,同时作用于原始图和超图以获取子结构增强的图表示。为进一步区分ID与OOD图,我们开发了三种保留子结构并增强表达能力的图增强技术。在多个图数据集上与10种基线方法的广泛实验表明,SGOOD具有显著优越性,通常以较大幅度超越现有方法。代码已开源:https://anonymous.4open.science/r/SGOOD-0958。