  Most existing deep learning models are trained based on the closed-world
assumption, where the test data is assumed to be drawn i.i.d. from the same
distribution as the training data, known as in-distribution (ID). However, when
models are deployed in an open-world scenario, test samples can be
out-of-distribution (OOD) and therefore should be handled with caution. To
detect such OOD samples drawn from unknown distribution, OOD detection has
received increasing attention lately. However, current endeavors mostly focus
on grid-structured data and its application for graph-structured data remains
under-explored. Considering the fact that data labeling on graphs is commonly
time-expensive and labor-intensive, in this work we study the problem of
unsupervised graph OOD detection, aiming at detecting OOD graphs solely based
on unlabeled ID data. To achieve this goal, we develop a new graph contrastive
learning framework GOOD-D for detecting OOD graphs without using any
ground-truth labels. By performing hierarchical contrastive learning on the
augmented graphs generated by our perturbation-free graph data augmentation
method, GOOD-D is able to capture the latent ID patterns and accurately detect
OOD graphs based on the semantic inconsistency in different granularities
(i.e., node-level, graph-level, and group-level). As a pioneering work in
unsupervised graph-level OOD detection, we build a comprehensive benchmark to
compare our proposed approach with different state-of-the-art methods. The
experiment results demonstrate the superiority of our approach over different
methods on various datasets.
