Strategies for Pre-training Graph Neural Networks
Published as a conference paper at ICLR 2020
Strategies for Pre-training Graph Neural Networks
Abstract
摘要
Many applications of machine learning require a model to make accurate predictions on test examples that are distributionally different from training ones, while task-specific labels are scarce during training. An effective approach to this challenge is to pre-train a model on related tasks where data is abundant, and then fine-tune it on a downstream task of interest. While pre-training has been effective in many language and vision domains, it remains an open question how to effectively use pre-training on graph datasets. In this paper, we develop a new strategy and self-supervised methods for pre-training Graph Neural Networks (GNNs). The key to the success of our strategy is to pre-train an expressive GNN at the level of individual nodes as well as entire graphs so that the GNN can learn useful local and global representations simultaneously. We systematically study pre-training on multiple graph classification datasets. We find that naïve strategies, which pre-train GNNs at the level of either entire graphs or individual nodes, give limited improvement and can even lead to negative transfer on many downstream tasks. In contrast, our strategy avoids negative transfer and improves generalization significantly across downstream tasks, leading up to 9.4% absolute improvements in ROC-AUC over non-pre-trained models and achieving state-of-the-art performance for molecular property prediction and protein function prediction.
许多机器学习应用要求模型能在与训练分布不同的测试样本上做出准确预测,而训练时任务特定的标签又很稀缺。应对这一挑战的有效办法,是先在数据充足的相关任务上预训练模型,再在所关心的下游任务上微调。预训练在许多语言和视觉领域已经很有效,但如何在图数据上有效使用预训练,仍然是一个开放问题。本文为图神经网络(GNN)的预训练提出了一套新策略和自监督方法。该策略成功的关键,是在单个节点以及整张图两个层次上预训练一个表达能力强的 GNN,使其能同时学到有用的局部和全局表示。我们在多个图分类数据集上系统研究了预训练。我们发现,只在整图级或只在节点级预训练 GNN 的朴素策略,提升有限,甚至会在许多下游任务上造成负迁移。相比之下,我们的策略避免了负迁移,并在下游任务上显著提升了泛化,相对未预训练模型最多将 ROC-AUC 绝对提高 9.4 个百分点,并在分子性质预测和蛋白质功能预测上达到当时最佳水平。
Introduction
1 引言
Transfer learning refers to the setting where a model, initially trained on some tasks, is re-purposed on different but related tasks. Deep transfer learning has been immensely successful in computer vision (Donahue et al., 2014; Girshick et al., 2014; Zeiler & Fergus, 2014) and natural language processing (Devlin et al., 2019; Peters et al., 2018; Mikolov et al., 2013). Despite being an effective approach to transfer learning, few studies have generalized pre-training to graph data.
迁移学习指的是:模型先在某些任务上训练,再被改用于不同但相关的任务。深度迁移学习在计算机视觉(Donahue et al., 2014;Girshick et al., 2014;Zeiler & Fergus, 2014)和自然语言处理(Devlin et al., 2019;Peters et al., 2018;Mikolov et al., 2013)中已经非常成功。尽管预训练是一种有效的迁移学习途径,把它推广到图数据上的研究仍然很少。
Pre-training has the potential to provide an attractive solution to the following two fundamental challenges with learning on graph datasets (Pan & Yang, 2009; Hendrycks et al., 2019): First, task-specific labeled data can be extremely scarce. This problem is exacerbated in important graph datasets from scientific domains, such as chemistry and biology, where data labeling (e.g., biological experiments in a wet laboratory) is resource- and time-intensive (Zitnik et al., 2018). Second, graph data from real-world applications often contain out-of-distribution samples, meaning that graphs in the training set are structurally very different from graphs in the test set. Out-of-distribution prediction is common in real-world graph datasets, for example, when one wants to predict chemical properties of a brand-new, just synthesized molecule, which is different from all molecules synthesized so far, and thereby different from all molecules in the training set.
预训练有可能为图数据学习中的两个基本挑战提供有吸引力的解决办法(Pan & Yang, 2009;Hendrycks et al., 2019)。第一,任务特定的标注数据可能极其稀缺。在化学、生物等科学领域的重要图数据中,这一问题更加突出,因为标注(例如在湿实验室中做生物实验)既耗资源又耗时(Zitnik et al., 2018)。第二,真实应用中的图数据常常包含分布外样本,也就是训练集中的图在结构上与测试集中的图很不一样。分布外预测在真实图数据中很常见,例如要预测一种刚刚合成、与此前所有分子都不同、因而也与训练集中所有分子都不同的新分子的化学性质。
However, pre-training on graph datasets remains a hard challenge. Several key studies (Xu et al., 2017; Ching et al., 2018; Wang et al., 2019) have shown that successful transfer learning is not only a matter of increasing the number of labeled pre-training datasets that are from the same domain as the downstream task. Instead, it requires substantial domain expertise to carefully select examples and target labels that are correlated with the downstream task of interest. Otherwise, the transfer of knowledge from related pre-training tasks to a new downstream task can harm generalization, which is known as negative transfer (Rosenstein et al., 2005) and significantly limits the applicability and reliability of pre-trained models.
然而,在图数据上做预训练仍然很难。若干关键研究(Xu et al., 2017;Ching et al., 2018;Wang et al., 2019)表明,成功的迁移学习并不仅仅是增加与下游任务同领域的带标注预训练数据集数量。它还需要相当多的领域知识,来谨慎选择与所关心下游任务相关的样本和目标标签。否则,从相关预训练任务向新的下游任务迁移知识,反而会损害泛化,这就是所谓的负迁移(Rosenstein et al., 2005),它会显著限制预训练模型的适用范围和可靠性。
Figure 1: (a.i) When only node-level pre-training is used, nodes of different shapes (semantically different nodes) can be well separated, however, node embeddings are not composable, and thus resulting graph embeddings (denoted by their classes, and ) that are created by pooling node-level embeddings are not separable. (a.ii) With graph-level pre-training only, graph embeddings are well separated, however the embeddings of individual nodes do not necessarily capture their domain-specific semantics. (a.iii) High-quality node embeddings are such that nodes of different types are well separated, while at the same time, the embedding space is also composable. This allows for accurate and robust representations of entire graphs and enables robust transfer of pre-trained models to a variety of downstream tasks. (b) Categorization of pre-training methods for GNNs. Crucially, our methods, i.e., Context Prediction, Attribute Masking, and graph-level supervised pre-training (Supervised Attribute Prediction) enable both node-level and graph-level pre-training.
图 1:(a.i)若只做节点级预训练,不同形状的节点(语义不同的节点)可以被很好分开,但节点嵌入不可组合,因而由池化节点级嵌入得到的图嵌入(用类别 和 表示)无法分开。(a.ii)若只做图级预训练,图嵌入可以很好分开,但单个节点的嵌入不一定能刻画其领域特定语义。(a.iii)高质量的节点嵌入应使不同类型的节点被很好分开,同时嵌入空间也是可组合的。这样就能得到准确、稳健的整图表示,并使预训练模型能够稳健地迁移到多种下游任务。(b)GNN 预训练方法的分类。关键在于,我们的方法,即上下文预测、属性掩码以及图级有监督预训练(有监督属性预测),能够同时进行节点级和图级预训练。
Present work. Here, we focus on pre-training as an approach to transfer learning in Graph Neural Networks (GNNs) (Kipf & Welling, 2017; Hamilton et al.; Ying et al.; Xu et al., 2019; Xu et al., 2018) for graph-level property prediction. Our work presents two key contributions. (1) We conduct the first systematic large-scale investigation of strategies for pre-training GNNs. For that, we build two large new pre-training datasets, which we share with the community: a chemistry dataset with 2 million graphs and a biology dataset with 395K graphs. We also show that large domain-specific datasets are crucial to investigate pre-training and that existing downstream benchmark datasets are too small to evaluate models in a statistically reliable way. (2) We develop an effective pre-training strategy for GNNs and demonstrate its effectiveness and its ability for out-of-distribution generalization on hard transfer-learning problems.
本文工作。 这里我们把预训练作为图神经网络(GNN)(Kipf & Welling, 2017;Hamilton et al.;Ying et al.;Xu et al., 2019;Xu et al., 2018)在图级属性预测中的迁移学习途径。本文有两项主要贡献。(1)我们首次对 GNN 预训练策略做了系统的大规模考察。为此,我们构建了两个新的大型预训练数据集,并与社区共享:一个含 200 万张图的化学数据集,以及一个含 395K 张图的生物数据集。我们还说明,要研究预训练,大规模的领域特定数据集至关重要,而已有的下游基准数据集太小,无法以统计上可靠的方式评估模型。(2)我们为 GNN 提出一种有效的预训练策略,并在困难的迁移学习问题上展示了它的效果以及分布外泛化能力。
In our systematic study, we show that pre-training GNNs does not always help. Na"ive pre-training strategies can lead to negative transfer on many downstream tasks. Strikingly, a seemingly strong pre-training strategy (i.e., graph-level multi-task supervised pre-training using a state-of-the-art graph neural network architecture for graph-level prediction tasks) only gives marginal performance gains. Furthermore, this strategy even leads to negative transfer on many downstream tasks (2 out of 8 molecular datasets and 13 out of 40 protein prediction tasks).
在这项系统研究中,我们表明预训练 GNN 并不总是有帮助。朴素的预训练策略会在许多下游任务上造成负迁移。更突出的是,一种看起来很强的预训练策略(即用当时最佳的图级预测 GNN 架构,做图级多任务有监督预训练)也只带来很小的性能提升。而且,这一策略甚至会在许多下游任务上造成负迁移(8 个分子数据集中的 2 个,以及 40 个蛋白质预测任务中的 13 个)。
We develop an effective strategy for pre-training GNNs. The key idea is to use easily accessible node-level information and encourage GNNs to capture domain-specific knowledge about nodes and edges, in addition to graph-level knowledge. This helps the GNN to learn useful representations at both global and local levels (Figure 1 (a.iii)), and is crucial to be able to generate graph-level representations (which are obtained by pooling node representations) that are robust and transferable to diverse downstream tasks (Figure 1). Our strategy is in contrast to naïve strategies that either leverage only at graph-level properties (Figure 1 (a.ii)) or node-level properties (Figure 1 (a.i)).
我们为预训练 GNN 提出一种有效策略。核心想法是利用容易获得的节点级信息,鼓励 GNN 在图级知识之外,再捕获关于节点和边的领域知识。这有助于 GNN 在全局和局部两个层次上学到有用表示(图 1(a.iii)),而这对于生成稳健、可迁移到多种下游任务的图级表示(由图节点表示池化得到)至关重要(图 1)。这一策略不同于只利用图级属性(图 1(a.ii))或只利用节点级属性(图 1(a.i))的朴素策略。
Empirically, our pre-training strategy used together with the most expressive GNN architecture, GIN (Xu et al., 2019), yields state-of-the-art results on benchmark datasets and avoids negative transfer across downstream tasks we tested. It significantly improves generalization performance across downstream tasks, yielding up to 9.4% higher average ROC-AUC than non-pre-trained GNNs, and up to 5.2% higher average ROC-AUC compared to GNNs with the extensive graph-level multi-task supervised pre-training. Furthermore, we find that the most expressive architecture, GIN, benefits more from pre-training compared to those with less expressive power (e.g., GCN (Kipf & Welling, 2017), GraphSAGE (Hamilton et al.) and GAT (Velickovic et al., 2018)), and that pre-training GNNs leads to orders-of-magnitude faster training and convergence in the fine-tuning stage.
经验上,把我们的预训练策略与表达能力最强的 GNN 架构 GIN(Xu et al., 2019)一起使用,在基准数据集上达到了当时最佳结果,并在我们所测试的下游任务上避免了负迁移。它在下游任务上显著提升了泛化,平均 ROC-AUC 比未预训练的 GNN 最多高 9.4 个百分点,也比经过充分图级多任务有监督预训练的 GNN 最多高 5.2 个百分点。此外我们还发现,表达能力最强的架构 GIN,比表达能力较弱的架构(例如 GCN(Kipf & Welling, 2017)、GraphSAGE(Hamilton et al.)和 GAT(Velickovic et al., 2018))更能从预训练中受益,而且预训练 GNN 能在微调阶段把训练和收敛速度提高数个数量级。
Preliminaries of Graph Neural Networks
2 图神经网络预备知识
We first formalize supervised learning of graphs and provide an overview of GNNs (Gilmer et al., 2017). Then, we briefly review methods for unsupervised graph representation learning.
我们首先形式化图上的监督学习,并概述 GNN(Gilmer et al., 2017),然后简要回顾无监督图表示学习方法。
Supervised learning of graphs. Let denote a graph with node attributes for and edge attributes for . Given a set of graphs {, …, } and their labels {, …, }, the task of graph supervised learning is to learn a representation vector that helps predict the label of an entire graph , . For example, in molecular property prediction, is a molecular graph, where nodes represent atoms and edges represent chemical bonds, and the label to be predicted can be toxicity or enzyme binding.
图上的监督学习。 令 表示一张图,节点 有属性 ,边 有属性 。给定一组图 {, …, } 及其标签 {, …, },图监督学习的任务是学习表示向量 ,以帮助预测整张图 的标签 。例如在分子性质预测中, 是分子图,节点表示原子,边表示化学键,要预测的标签可以是毒性或酶结合。
{Graph Neural Networks (GNNs)}. GNNs use the graph connectivity as well as node and edge features to learn a representation vector (i.e., embedding) for every node and a vector for the entire graph . Modern GNNs use a neighborhood aggregation approach, where representation of node is iteratively updated by aggregating representations of 's neighboring nodes and edges (Gilmer et al., 2017). After iterations of aggregation, 's representation captures the structural information within its -hop network neighborhood. Formally, the -th layer of a GNN is:
图神经网络(GNN)。 GNN 利用图的连接关系以及节点和边的特征,为每个节点 学习表示向量(即嵌入),并为整张图 学习向量 。现代 GNN 采用邻域聚合方法:节点 的表示通过聚合 的邻居节点和边的表示来迭代更新(Gilmer et al., 2017)。经过 次聚合后, 的表示捕获了其 跳网络邻域内的结构信息。形式化地,GNN 的第 层为:
where is the representation of node at the -th iteration/layer, is the feature vector of edge between and , and is a set neighbors of . We initialize .
其中 是节点 在第 次迭代/层的表示, 是 与 之间边的特征向量, 是 的邻居集合。我们初始化 。
Graph representation learning. To obtain the entire graph's representation , the READOUT function pools node features from the final iteration ,
图表示学习。 为得到整张图的表示 ,READOUT 函数对最后一次迭代 的节点特征做池化,
READOUT is a permutation-invariant function, such as averaging or a more sophisticated graph-level pooling function (Ying et al.; Zhang et al., 2018).
READOUT 是一个置换不变函数,例如取平均,或更复杂的图级池化函数(Ying et al.;Zhang et al., 2018)。
Strategies for pre-training Graph Neural Networks
3 图神经网络的预训练策略
At the technical core of our pre-training strategy is the notion to pre-train a GNN both at the level of individual nodes as well as entire graphs. This notion encourages the GNN to capture domain-specific semantics at both levels, as illustrated in Figure 1 (a.iii). This is in contrast to straightforward but limited pre-training strategies that either only use pre-training to predict properties of entire graphs (Figure 1 (a.ii)) or only use pre-training to predict properties of individual nodes (Figure 1 (a.i)).
我们预训练策略的技术核心,是在单个节点以及整张图两个层次上同时预训练 GNN。这一做法鼓励 GNN 在两个层次上都捕获领域特定语义,如图 1(a.iii)所示。这与只用于预测整图属性(图 1(a.ii))或只用于预测单个节点属性(图 1(a.i))的直接但有限的预训练策略形成对比。
In the following, we first describe our node-level pre-training approach (Section 3.1) and then graph-level pre-training approach (Section 3.2). Finally, we describe the full pre-training strategy in Section 3.3.
下面我们先描述节点级预训练方法(第 3.1 节),再描述图级预训练方法(第 3.2 节)。最后在第 3.3 节给出完整的预训练策略。
Figure 2: Illustration of our node-level methods, Context Prediction and Attribute Masking for pre-training GNNs. (a) In Context Prediction, the subgraph is a -hop neighborhood around a selected center node, where is the number of GNN layers and is set to 2 in the figure. The context is defined as the surrounding graph structure that is between - and -hop from the center node, where we use and in the figure. (b) In Attribute Masking, the input node/edge attributes (e.g., atom type in the molecular graph) are randomly masked, and the GNN is asked to predict them.
图 2:我们用于预训练 GNN 的节点级方法:上下文预测与属性掩码的示意。(a)在上下文预测中,子图是围绕所选中心节点的 跳邻域,其中 是 GNN 层数,图中取为 2。上下文定义为距离中心节点 跳到 跳之间的周围图结构,图中取 、。(b)在属性掩码中,输入的节点/边属性(例如分子图中的原子类型)被随机遮住,并要求 GNN 预测它们。
Node-level pre-training
3.1 节点级预训练
For node-level pre-training of GNNs, our approach is to use easily-accessible unlabeled data to capture domain-specific knowledge/regularities in the graph. Here we propose two self-supervised methods, Context Prediction and Attribute Masking.
对 GNN 的节点级预训练,我们的做法是利用容易获得的未标注数据,来捕获图中的领域知识/规律。这里我们提出两种自监督方法:上下文预测和属性掩码。
Context Prediction: Exploiting distribution of graph structure
3.1.1 上下文预测:利用图结构的分布
In Context Prediction, we use subgraphs to predict their surrounding graph structures. Our goal is to pre-train a GNN so that it maps nodes appearing in similar structural contexts to nearby embeddings (Rubenstein & Goodenough, 1965; Mikolov et al., 2013).
在上下文预测中,我们用子图去预测它们周围的图结构。我们的目标是预训练一个 GNN,使出现在相似结构上下文中的节点被映射到邻近的嵌入(Rubenstein & Goodenough, 1965;Mikolov et al., 2013)。
Neighborhood and context graphs. For every node , we define 's neighborhood and context graphs as follows. -hop neighborhood of contains all nodes and edges that are at most -hops away from in the graph. This is motivated by the fact that a -layer GNN aggregates information across the -th order neighborhood of , and thus node embedding depends on nodes that are at most -hops away from . We define context graph of node as graph structure that surrounds 's neighborhood. The context graph is described by two hyperparameters, and , and it represents a subgraph that is between -hops and -hops away from (i.e., it is a ring of width ). Examples of neighborhood and context graphs are shown in Figure 2 (a). We require so that some nodes are shared between the neighborhood and the context graph, and we refer to those nodes as context anchor nodes. These anchor nodes provide information about how the neighborhood and context graphs are connected with each other.
邻域图与上下文图。 对每个节点 ,我们如下定义它的邻域图和上下文图。 的 跳邻域 包含图中距离 至多 跳的所有节点和边。这样做的动机是: 层 GNN 会在 的 阶邻域上聚合信息,因而节点嵌入 依赖于距离 至多 跳的节点。我们把节点 的上下文图定义为环绕其邻域的图结构。上下文图由两个超参数 和 描述,表示距离 在 跳到 跳之间的子图(也就是宽度为 的环)。邻域图和上下文图的例子见图 2(a)。我们要求 ,从而使邻域与上下文图之间有一些共享节点,并把这些节点称为上下文锚点。这些锚点提供了邻域图与上下文图如何相连的信息。
Encoding context into a fixed vector using an auxiliary GNN. Directly predicting the context graph is intractable due to the combinatorial nature of graphs. This is different from natural language processing, where words come from a fixed and finite vocabulary. To enable context prediction, we encode context graphs as fixed-length vectors. To this end, we use an auxiliary GNN, which we refer to as the context GNN. As depicted in Figure 2 (a), we first apply the context GNN (denoted as GNN in Figure 2 (a)) to obtain node embeddings in the context graph. We then average embeddings of context anchor nodes to obtain a fixed-length context embedding. For node in graph , we denote its corresponding context embedding as .
用辅助 GNN 把上下文编码成固定向量。 由于图具有组合性质,直接预测上下文图是难以处理的。这与自然语言处理不同,那里的词来自固定且有限的词表。为了进行上下文预测,我们把上下文图编码为固定长度的向量。为此,我们使用一个辅助 GNN,称为上下文 GNN。如图 2(a)所示,我们先把上下文 GNN(图 2(a)中记为 GNN)作用在上下文图上,得到其中的节点嵌入,再对上下文锚点的嵌入取平均,得到固定长度的上下文嵌入。对图 中的节点 ,相应的上下文嵌入记为 。
Learning via negative sampling. We then use negative sampling (Mikolov et al., 2013; Ying et al.) to jointly learn the main GNN and the context GNN. The main GNN encodes neighborhoods to obtain node embeddings. The context GNN encodes context graphs to obtain context embeddings. In particular, the learning objective of Context Prediction is a binary classification of whether a particular neighborhood and a particular context graph belong to the same node:
通过负采样学习。 随后我们用负采样(Mikolov et al., 2013;Ying et al.)来联合学习主 GNN 和上下文 GNN。主 GNN 对邻域编码以得到节点嵌入,上下文 GNN 对上下文图编码以得到上下文嵌入。具体而言,上下文预测的学习目标是一个二分类问题:判断某个邻域和某个上下文图是否属于同一个节点:
where is the sigmoid function, and is the indicator function. We either let and (i.e., a positive neighborhood-context pair), or we randomly sample from a randomly chosen graph (i.e., a negative neighborhood-context pair). We use a negative sampling ratio of 1 (one negative pair per one positive pair), and use the negative log likelihood as the loss function. After pre-training, the main GNN is retained as our pre-trained model.
其中 是 sigmoid 函数, 是指示函数。我们或者取 且 (即正的邻域-上下文对),或者从随机选取的图 中随机采样 (即负的邻域-上下文对)。负采样比为 1(每一正对配一负对),损失函数为负对数似然。预训练结束后,保留主 GNN 作为我们的预训练模型。
Attribute Masking: Exploiting distribution of graph attributes
3.1.2 属性掩码:利用图属性的分布
In Attribute Masking, we aim to capture domain knowledge by learning the regularities of the node/edge attributes distributed over graph structure.
在属性掩码中,我们希望通过学习节点/边属性在图结构上的分布规律,来捕获领域知识。
Masking node and edges attributes. Attribute Masking pre-training works as follows: We mask node/edge attributes and then we let GNNs predict those attributes (Devlin et al., 2019) based on neighboring structure. Figure 2 (b) illustrates our proposed method when applied to a molecular graph. Specifically, We randomly mask input node/edge attributes, for example atom types in molecular graphs, by replacing them with special masked indicators. We then apply GNNs to obtain the corresponding node/edge embeddings (edge embeddings can be obtained as a sum of node embeddings of the edge's end nodes). Finally, a linear model is applied on top of embeddings to predict a masked node/edge attribute. Different from Devlin et al. (2019) that operates on sentences and applies message passing over the fully-connected graph of tokens, we operate on non-fully-connected graphs and aim to capture the regularities of node/edge attributes distributed over different graph structures. Furthermore, we allow masking edge attributes, going beyond masking node attributes.
掩码节点和边的属性。 属性掩码预训练的过程如下:我们遮住节点/边属性,再让 GNN 根据邻近结构预测这些属性(Devlin et al., 2019)。图 2(b)给出了该方法用在分子图上的示意。具体来说,我们随机掩码输入的节点/边属性,例如分子图中的原子类型,把它们替换成特殊的掩码标记。然后应用 GNN 得到相应的节点/边嵌入(边嵌入可由该边两端节点嵌入之和得到)。最后在嵌入之上用线性模型预测被掩码的节点/边属性。与 Devlin et al.(2019)在句子上操作、并在词元的全连接图上做消息传递不同,我们操作的是非全连接图,目标是捕获节点/边属性在不同图结构上的分布规律。此外,我们还允许掩码边属性,而不仅仅是节点属性。
Our node and edge attribute masking method is especially beneficial for richly-annotated graphs from scientific domains. For example, (1) in molecular graphs, the node attributes correspond to atom types, and capturing how they are distributed over the graphs enables GNNs to learn simple chemistry rules such as valency, as well as potentially more complex chemistry phenomenon such as the electronic or steric properties of functional groups. Similarly, (2) in protein-protein interaction (PPI) graphs, the edge attributes correspond to different kinds of interactions between a pair of proteins. Capturing how these attributes distribute across the PPI graphs enables GNNs to learn how different interactions relate and correlate with each other.
我们的节点和边属性掩码方法,对来自科学领域、标注丰富的图尤其有益。例如:(1)在分子图中,节点属性对应原子类型,捕获它们在图上的分布,能使 GNN 学到化合价这类简单化学规则,以及官能团的电子或立体性质等可能更复杂的化学现象。类似地,(2)在蛋白质-蛋白质相互作用(PPI)图中,边属性对应一对蛋白质之间不同类型的相互作用。捕获这些属性在 PPI 图上的分布,能使 GNN 学习不同相互作用如何彼此关联。
Graph-level Pre-training
3.2 图级预训练
We aim to pre-train GNNs to generate useful graph embeddings composed of the meaningful node embeddings obtained by methods in Section 3.1. Our goal is to ensure both node and graph embeddings are of high-quality so that graph embeddings are robust and transferable across downstream tasks, as illustrated in Figure 1 (a.iii). Additionally, there are two options for graph-level pre-training, as shown in Figure 1 (b): making predictions about domain-specific attributes of entire graphs (e.g., supervised labels), or making predictions about graph structure.
我们希望预训练 GNN,使其能由第 3.1 节方法得到的有意义节点嵌入,组成有用的图嵌入。我们的目标是让节点嵌入和图嵌入都具有高质量,从而使图嵌入稳健,并能在下游任务之间迁移,如图 1(a.iii)所示。此外,图级预训练有两种选择,如图 1(b)所示:预测整张图的领域特定属性(例如有监督标签),或预测图结构。
Supervised Graph-Level Property Prediction
3.2.1 有监督的图级属性预测
As the graph-level representation is directly used for fine-tuning on downstream prediction tasks, it is desirable to directly encode domain-specific information into .
由于图级表示 会直接用于下游预测任务的微调,因此希望把领域特定信息直接编码进 。
We inject graph-level domain-specific knowledge into our pretrained embeddings by defining supervised graph-level prediction tasks. In particular, we consider a practical method to pre-train graph representations: graph-level multi-task supervised pre-training to jointly predict a diverse set of supervised labels of individual graphs. For example, in molecular property prediction, we can pre-train GNNs to predict essentially all the properties of molecules that have been experimentally measured so far. In protein function prediction, where the goal is predict whether a given protein has a given functionality, we can pre-train GNNs to predict the existence of diverse protein functions that have been validated so far. In our experiments in Section 5, we prepare a diverse set of supervised tasks (up to 5000 tasks) to simulate these practical scenarios. Further details of the supervised tasks and datasets are described in Section 5.1. To jointly predict many graph properties, where each property corresponds to a binary classification task, we apply linear classifiers on top of graph representations.
我们通过定义有监督的图级预测任务,把图级领域知识注入预训练嵌入。具体而言,我们考虑一种实用的图表示预训练方法:图级多任务有监督预训练,联合预测单个图的一组多样化有监督标签。例如在分子性质预测中,可以预训练 GNN 去预测迄今已被实验测定的几乎所有分子性质。在蛋白质功能预测中,目标是判断给定蛋白质是否具有某种功能,我们可以预训练 GNN 去预测迄今已得到验证的多种蛋白质功能是否存在。在第 5 节的实验中,我们准备了一组多样化的有监督任务(最多 5000 个),以模拟这些实际情形。有监督任务和数据集的更多细节见第 5.1 节。为了联合预测许多图属性(每个属性对应一个二分类任务),我们在图表示之上使用线性分类器。
Importantly, naïvely performing the extensive multi-task graph-level pre-training alone can fail to give transferable graph-level representations, as empirically demonstrated in Section 5. This is because some supervised pre-training tasks might be unrelated to the downstream task of interest and can even hurt the downstream performance (negative transfer). One solution would be to select "truly-relevant" supervised pre-training tasks and pre-train GNNs only on those tasks. However, such a solution is extremely costly since selecting the relevant tasks requires significant domain expertise and pre-training needs to be performed separately for different downstream tasks.
重要的是,如第 5 节经验所示,仅仅朴素地做这种大规模多任务图级预训练,并不能得到可迁移的图级表示。这是因为某些有监督预训练任务可能与所关心的下游任务无关,甚至会损害下游表现(负迁移)。一种解决办法是选出“真正相关”的有监督预训练任务,只在这些任务上预训练 GNN。但这种办法代价极高:选择相关任务需要大量领域知识,而且对不同下游任务还需要分别做预训练。
To alleviate this issue, our key insight is that the multi-task supervised pre-training only provides graph-level supervision; thus, local node embeddings from which the graph-level embeddings are created may not be meaningful, as illustrated in Figure 1 (a.ii). Such non-useful node embeddings can exacerbate the problem of negative transfer because many different pre-training tasks can more easily interfere with each other in the node embedding space. Motivated by this, our pre-training strategy is to first regularize GNNs at the level of individual nodes via node-level pre-training methods described in Section 3.1, before performing graph-level pre-training. As we demonstrate empirically, the combined strategy produces much more transferable graph representations and robustly improves downstream performance without expert selection of supervised pre-training tasks.
为缓解这一问题,我们的关键认识是:多任务有监督预训练只提供图级监督,因此用来构成图级嵌入的局部节点嵌入未必是有意义的,如图 1(a.ii)所示。这类无用的节点嵌入会加重负迁移,因为许多不同的预训练任务更容易在节点嵌入空间中相互干扰。受此启发,我们的预训练策略是:在做图级预训练之前,先用第 3.1 节的节点级预训练方法在单个节点层次上对 GNN 做正则。如经验所示,这一组合策略能产生更可迁移的图表示,并在无需专家挑选有监督预训练任务的情况下,稳健地提升下游表现。
Structural Similarity Prediction
3.2.2 结构相似度预测
A second approach is to define a graph-level predictive task where the goal would be to model the structural similarity of two graphs. Examples of such tasks include modeling the graph edit distance (Bai et al., 2019) or predicting graph structure similarity (Navarin et al., 2018). However, finding the ground truth graph distance values is a difficult problem, and in large datasets there is a quadratic number of graph pairs to consider. Therefore, while this type of pre-training is also very natural, it is beyond the scope of this paper and we leave its investigation for future work.
第二种做法是定义一个图级预测任务,目标是刻画两张图的结构相似度。这类任务的例子包括建模图编辑距离(Bai et al., 2019)或预测图结构相似度(Navarin et al., 2018)。然而,找到真实的图距离值本身就很困难,而且在大型数据集中需要考虑的图对数量是二次的。因此,尽管这类预训练也很自然,它超出了本文范围,我们把它留给后续工作。
Overview: Pre-training GNNs and Fine-tuning for Downstream Tasks
3.3 概览:预训练 GNN 并在下游任务上微调
Altogether, our pre-training strategy is to first perform node-level self-supervised pre-training (Section 3.1) and then graph-level multi-task supervised pre-training (Section 3.2). When the GNN pre-training is finished, we fine-tune the pre-trained GNN model on downstream tasks. Specifically, we add linear classifiers on top of graph-level representations to predict downstream graph labels. The full model, i.e., the pre-trained GNN and downstream linear classifiers, is subsequently fine-tuned in an end-to-end manner. Time-complexity analysis is provided in Appendix F, where we show that our pre-training methods incur little computational overhead to forward computation in GNNs.
综合起来,我们的预训练策略是:先做节点级自监督预训练(第 3.1 节),再做图级多任务有监督预训练(第 3.2 节)。GNN 预训练结束后,我们在下游任务上微调该预训练 GNN 模型。具体而言,我们在图级表示之上加上线性分类器,以预测下游图标签。完整模型,也就是预训练 GNN 与下游线性分类器,随后以端到端方式微调。时间复杂度分析见附录 F,其中我们说明,这些预训练方法给 GNN 的前向计算只增加很少的额外开销。
Further Related Work
4 更多相关工作
There is rich literature on unsupervised representation learning of individual nodes within graphs, which broadly falls into two categories. In the first category are methods that use local random walk-based objectives (Grover & Leskovec, 2016; Perozzi et al., 2014; Tang et al., 2015) and methods that reconstruct a graph's adjacency matrix, e.g., by predicting edge existence (Hamilton et al.; Kipf & Welling, 2016). In the second category are methods, such as Deep Graph Infomax (Veličković et al., 2019), that train a node encoder that maximizes mutual information between local node representations and a pooled global graph representation. All these methods encourage nearby nodes to have similar embeddings and were originally proposed and evaluated for node classification and link prediction. This, however, can be sub-optimal for graph-level prediction tasks, where capturing structural similarity of local neighborhoods is often more important than capturing the positional information of nodes within a graph (You et al., 2019; Rogers & Hahn, 2010; Yang et al., 2014). Our approach thus considers both the node-level as well as graph-level pretraining tasks and as we show in our experiments, it is essential to use both types of tasks in order for pretrained models to achieve good performance.
关于图中单个节点的无监督表示学习,已有丰富文献,大体可分为两类。第一类包括基于局部随机游走目标的方法(Grover & Leskovec, 2016;Perozzi et al., 2014;Tang et al., 2015),以及通过预测边是否存在等方式重构图邻接矩阵的方法(Hamilton et al.;Kipf & Welling, 2016)。第二类则是 Deep Graph Infomax(Veličković et al., 2019)这类方法:训练节点编码器,使局部节点表示与池化得到的全局图表示之间的互信息最大化。这些方法都鼓励邻近节点具有相似嵌入,最初是为节点分类和链接预测提出并评估的。然而,这对图级预测任务可能并非最优:在这类任务中,捕获局部邻域的结构相似性,往往比捕获节点在图中的位置信息更重要(You et al., 2019;Rogers & Hahn, 2010;Yang et al., 2014)。因此我们的方法同时考虑节点级和图级预训练任务;实验表明,两类任务都使用,对预训练模型取得良好表现至关重要。
A number of recent works have also explored how node embeddings generalize across tasks (Jaeger et al., 2018; Zhou et al., 2018; Chakravarti, 2018; Narayanan et al., 2016). However, all of these methods use distinct node embeddings for different substructures and do not share any parameters. Thus, they are inherently transductive, cannot transfer between datasets, cannot be fine-tuned in an end-to-end manner, and cannot capture large and diverse neighborhoods/contexts due to data sparsity. Our approach addresses all these challenges by developing pre-training methods for GNNs that use shared parameters to encode the the graph-level as well as node-level dependencies and structures.
近期也有一些工作探讨节点嵌入如何在任务之间泛化(Jaeger et al., 2018;Zhou et al., 2018;Chakravarti, 2018;Narayanan et al., 2016)。不过,这些方法都为不同子结构使用互不相同的节点嵌入,并且不共享参数。因此它们本质上是直推的,不能在数据集之间迁移,不能端到端微调,也无法因数据稀疏而捕获大而多样的邻域/上下文。我们的方法通过为 GNN 设计预训练方法来解决这些问题:用共享参数来编码图级以及节点级的依赖和结构。
Experiments
5 实验
Datasets
5.1 数据集
We consider two domains; molecular property prediction in chemistry and protein function prediction in biology. We release the new datasets at: http://snap.stanford.edu/gnn-pretrain.
我们考虑两个领域:化学中的分子性质预测,以及生物中的蛋白质功能预测。新数据集发布于:http://snap.stanford.edu/gnn-pretrain。
Pre-training datasets. For the chemistry domain, we use 2 million unlabeled molecules sampled from the ZINC15 database (Sterling & Irwin, 2015) for node-level self-supervised pre-training. For graph-level multi-task supervised pre-training, we use a preprocessed ChEMBL dataset (Mayr et al., 2018; Gaulton et al., 2011), containing 456K molecules with 1310 kinds of diverse and extensive biochemical assays. For the biology domain, we use 395K unlabeled protein ego-networks derived from PPI networks of 50 species (e.g., humans, yeast, zebra fish) for node-level self-supervised pre-training. For graph-level multi-task supervised pre-training, we use 88K labeled protein ego-networks to jointly predict 5000 coarse-grained biological functions (e.g., cell apoptosis, cell proliferation).
预训练数据集。 在化学领域,节点级自监督预训练使用从 ZINC15 数据库(Sterling & Irwin, 2015)抽样的 200 万个未标注分子。图级多任务有监督预训练使用经过预处理的 ChEMBL 数据集(Mayr et al., 2018;Gaulton et al., 2011),包含 456K 个分子以及 1310 种多样化、覆盖面广的生化测定。在生物领域,节点级自监督预训练使用由 50 个物种(例如人、酵母、斑马鱼)的 PPI 网络得到的 395K 个未标注蛋白质自我网络。图级多任务有监督预训练使用 88K 个带标注的蛋白质自我网络,联合预测 5000 种粗粒度生物功能(例如细胞凋亡、细胞增殖)。
Downstream classification datasets. For the chemistry domain, we considered classical graph classification benchmarks (MUTAG, PTC molecule datasets) (Kersting et al., 2016; Xu et al., 2019) as our downstream tasks, but found that they are too small (188 and 344 examples for MUTAG and PTC) to evaluate different methods in a statistically meaningful way (see Appendix B for the results and discussion). Because of this, as our downstream tasks, we decided to use 8 larger binary classification datasets contained in MoleculeNet (Wu et al., 2018), a recently-curated benchmark for molecular property prediction. The dataset statistics are summarized in Table 1. For the biology domain, we compose our PPI networks from Zitnik et al. (2019), consisting of 88K proteins from 8 different species, where the subgraphs centered at a protein of interest (i.e., ego-networks) are used to predict their biological functions. Our downstream task is to predict 40 fine-grained biological functions ¹ that correspond to 40 binary classification tasks. In contrast to existing PPI datasets (Hamilton et al.), our dataset is larger and spans multiple species (i.e., not only humans), which makes it a suitable benchmark for evaluating out-of-distribution prediction. Additional details about datasets and features of molecule/PPI graphs are in Appendices C and D.
下游分类数据集。 在化学领域,我们曾考虑把经典图分类基准(MUTAG、PTC 分子数据集)(Kersting et al., 2016;Xu et al., 2019)作为下游任务,但发现它们太小(MUTAG 和 PTC 分别只有 188 和 344 个样本),无法以统计上有意义的方式比较不同方法(结果和讨论见附录 B)。因此,下游任务改用 MoleculeNet(Wu et al., 2018)中的 8 个较大二分类数据集,这是近期整理的分子性质预测基准。数据集统计见表 1。在生物领域,我们根据 Zitnik et al.(2019)组成 PPI 网络,包含来自 8 个不同物种的 88K 个蛋白质,以感兴趣蛋白质为中心的子图(即自我网络)被用来预测其生物功能。下游任务是预测 40 种细粒度生物功能¹,对应 40 个二分类任务。与已有 PPI 数据集(Hamilton et al.)相比,我们的数据集更大,并且覆盖多个物种(即不只是人),因此适合作为评估分布外预测的基准。关于数据集以及分子/PPI 图特征的更多细节见附录 C 和 D。
¹ Fine-grained labels are harder to obtain than coarse-grained labels; the latter are used for pre-training.
¹ 细粒度标签比粗粒度标签更难获得;后者用于预训练。
Dataset splitting. In many applications, conventional random split is overly optimistic and does not simulate the real-world use case, where test graphs can be structurally different from training graphs (Wu et al., 2018; Zitnik et al., 2019). To reflect the actual use case, we split the downstream data in the following ways to evaluate the models' out-of-distribution generalization. In the chemistry domain, we use scaffold split (Ramsundar et al., 2019), where we split molecules according to their scaffold (molecular substructure). In the biology domain, we use species split, where we predict functions of proteins from new species. Details are in Appendix E. Furthermore, to prevent data leakage, all test graphs used for performance evaluation are removed from the graph-level supervised pre-training datasets.
数据集划分。 在许多应用中,常规的随机划分过于乐观,并不能模拟真实使用情形:测试图在结构上可能与训练图不同(Wu et al., 2018;Zitnik et al., 2019)。为反映实际用法,我们用以下方式划分下游数据,以评估模型的分布外泛化。在化学领域,我们使用骨架划分(Ramsundar et al., 2019),按骨架(分子子结构)划分分子。在生物领域,我们使用物种划分,预测来自新物种的蛋白质功能。细节见附录 E。此外,为防止数据泄漏,所有用于性能评估的测试图都已从用于图级有监督预训练的数据集中剔除。
Table 1: Test ROC-AUC (%) performance on molecular prediction benchmarks using different pre-training strategies with GIN. The rightmost column averages the mean of test performance across the 8 datasets. The best result for each dataset and comparable results (i.e., results within one standard deviation from the best result) are bolded. Italic cells indicate negative transfer, i.e., ROC-AUC of a pre-trained model is worse than that of a non-pre-trained model. Notice that node- as well as graph-level pretraining are essential for good performance.
| Graph-level | Node-level | BBBP | Tox21 | ToxCast | SIDER | ClinTox | MUV | HIV | BACE | Average |
|---|---|---|---|---|---|---|---|---|---|---|
| # Molecules | 2039 | 7831 | 8575 | 1427 | 1478 | 93087 | 41127 | 1513 | / | |
| # Binary prediction tasks | 1 | 12 | 617 | 27 | 2 | 17 | 1 | 1 | / | |
| -- | -- | 65.8 ± 4.5 | 74.0 ± 0.8 | 63.4 ± 0.6 | 57.3 ± 1.6 | 58.0 ± 4.4 | 71.8 ± 2.5 | 75.3 ± 1.9 | 70.1 ± 5.4 | 67.0 |
| -- | Infomax | 68.8 ± 0.8 | 75.3 ± 0.5 | 62.7 ± 0.4 | 58.4 ± 0.8 | 69.9 ± 3.0 | 75.3 ± 2.5 | 76.0 ± 0.7 | 75.9 ± 1.6 | 70.3 |
| -- | EdgePred | 67.3 ± 2.4 | 76.0 ± 0.6 | 64.1 ± 0.6 | 60.4 ± 0.7 | 64.1 ± 3.7 | 74.1 ± 2.1 | 76.3 ± 1.0 | 79.9 ± 0.9 | 70.3 |
| -- | AttrMasking | 64.3 ± 2.8 | 76.7 ± 0.4 | 64.2 ± 0.5 | 61.0 ± 0.7 | 71.8 ± 4.1 | 74.7 ± 1.4 | 77.2 ± 1.1 | 79.3 ± 1.6 | 71.1 |
| -- | ContextPred | 68.0 ± 2.0 | 75.7 ± 0.7 | 63.9 ± 0.6 | 60.9 ± 0.6 | 65.9 ± 3.8 | 75.8 ± 1.7 | 77.3 ± 1.0 | 79.6 ± 1.2 | 70.9 |
| Supervised | -- | 68.3 ± 0.7 | 77.0 ± 0.3 | 64.4 ± 0.4 | 62.1 ± 0.5 | 57.2 ± 2.5 | 79.4 ± 1.3 | 74.4 ± 1.2 | 76.9 ± 1.0 | 70.0 |
| Supervised | Infomax | 68.0 ± 1.8 | 77.8 ± 0.3 | 64.9 ± 0.7 | 60.9 ± 0.6 | 71.2 ± 2.8 | 81.3 ± 1.4 | 77.8 ± 0.9 | 80.1 ± 0.9 | 72.8 |
| Supervised | EdgePred | 66.6 ± 2.2 | 78.3 ± 0.3 | 66.5 ± 0.3 | 63.3 ± 0.9 | 70.9 ± 4.6 | 78.5 ± 2.4 | 77.5 ± 0.8 | 79.1 ± 3.7 | 72.6 |
| Supervised | AttrMasking | 66.5 ± 2.5 | 77.9 ± 0.4 | 65.1 ± 0.3 | 63.9 ± 0.9 | 73.7 ± 2.8 | 81.2 ± 1.9 | 77.1 ± 1.2 | 80.3 ± 0.9 | 73.2 |
| Supervised | ContextPred | 68.7 ± 1.3 | 78.1 ± 0.6 | 65.7 ± 0.6 | 62.7 ± 0.8 | 72.6 ± 1.5 | 81.3 ± 2.1 | 79.9 ± 0.7 | 84.5 ± 0.7 | 74.2 |
表 1:在分子预测基准上,用 GIN 配合不同预训练策略得到的测试 ROC-AUC(%)。最右一列是 8 个数据集测试表现均值的平均。每个数据集上的最好结果,以及与最好结果相差不超过一个标准差的可比结果,均加粗。斜体格子表示负迁移,即预训练模型的 ROC-AUC 差于未预训练模型。可以看到,节点级和图级预训练对取得良好表现都是必要的。
| Graph-level | Node-level | BBBP | Tox21 | ToxCast | SIDER | ClinTox | MUV | HIV | BACE | Average |
|---|---|---|---|---|---|---|---|---|---|---|
| # Molecules | 2039 | 7831 | 8575 | 1427 | 1478 | 93087 | 41127 | 1513 | / | |
| # Binary prediction tasks | 1 | 12 | 617 | 27 | 2 | 17 | 1 | 1 | / | |
| -- | -- | 65.8 ± 4.5 | 74.0 ± 0.8 | 63.4 ± 0.6 | 57.3 ± 1.6 | 58.0 ± 4.4 | 71.8 ± 2.5 | 75.3 ± 1.9 | 70.1 ± 5.4 | 67.0 |
| -- | Infomax | 68.8 ± 0.8 | 75.3 ± 0.5 | 62.7 ± 0.4 | 58.4 ± 0.8 | 69.9 ± 3.0 | 75.3 ± 2.5 | 76.0 ± 0.7 | 75.9 ± 1.6 | 70.3 |
| -- | EdgePred | 67.3 ± 2.4 | 76.0 ± 0.6 | 64.1 ± 0.6 | 60.4 ± 0.7 | 64.1 ± 3.7 | 74.1 ± 2.1 | 76.3 ± 1.0 | 79.9 ± 0.9 | 70.3 |
| -- | AttrMasking | 64.3 ± 2.8 | 76.7 ± 0.4 | 64.2 ± 0.5 | 61.0 ± 0.7 | 71.8 ± 4.1 | 74.7 ± 1.4 | 77.2 ± 1.1 | 79.3 ± 1.6 | 71.1 |
| -- | ContextPred | 68.0 ± 2.0 | 75.7 ± 0.7 | 63.9 ± 0.6 | 60.9 ± 0.6 | 65.9 ± 3.8 | 75.8 ± 1.7 | 77.3 ± 1.0 | 79.6 ± 1.2 | 70.9 |
| Supervised | -- | 68.3 ± 0.7 | 77.0 ± 0.3 | 64.4 ± 0.4 | 62.1 ± 0.5 | 57.2 ± 2.5 | 79.4 ± 1.3 | 74.4 ± 1.2 | 76.9 ± 1.0 | 70.0 |
| Supervised | Infomax | 68.0 ± 1.8 | 77.8 ± 0.3 | 64.9 ± 0.7 | 60.9 ± 0.6 | 71.2 ± 2.8 | 81.3 ± 1.4 | 77.8 ± 0.9 | 80.1 ± 0.9 | 72.8 |
| Supervised | EdgePred | 66.6 ± 2.2 | 78.3 ± 0.3 | 66.5 ± 0.3 | 63.3 ± 0.9 | 70.9 ± 4.6 | 78.5 ± 2.4 | 77.5 ± 0.8 | 79.1 ± 3.7 | 72.6 |
| Supervised | AttrMasking | 66.5 ± 2.5 | 77.9 ± 0.4 | 65.1 ± 0.3 | 63.9 ± 0.9 | 73.7 ± 2.8 | 81.2 ± 1.9 | 77.1 ± 1.2 | 80.3 ± 0.9 | 73.2 |
| Supervised | ContextPred | 68.7 ± 1.3 | 78.1 ± 0.6 | 65.7 ± 0.6 | 62.7 ± 0.8 | 72.6 ± 1.5 | 81.3 ± 2.1 | 79.9 ± 0.7 | 84.5 ± 0.7 | 74.2 |
Experimental Setup
5.2 实验设置
We thoroughly compare our pre-training strategy with two naïve baseline strategies: (i) extensive supervised multi-task pre-training on relevant graph-level tasks, and (ii) node-level self-supervised pre-training.
我们把预训练策略与两种朴素基线策略做了充分比较:(i)在相关图级任务上做大规模有监督多任务预训练;(ii)节点级自监督预训练。
GNN architectures. We mainly study Graph Isomorphism Networks (GINs) (Xu et al., 2019), the most expressive and state-of-the-art GNN architecture for graph-level prediction tasks. We also experimented with other popular architectures that are less expressive: GCN (Kipf & Welling, 2016), GAT (Veličković et al., 2019), and GraphSAGE (with mean neighborhood aggregation) (Hamilton et al.). We select the following hyper-parameters that performed well across all downstream tasks in the validation sets: 300 dimensional hidden units, 5 GNN layers (), and average pooling for the READOUT function. Additional details can be found in Appendix A.
GNN 架构。 我们主要研究图同构网络(GIN)(Xu et al., 2019),这是图级预测任务中表达能力最强、当时也最好的 GNN 架构。我们也试验了表达能力较弱的其他常见架构:GCN(Kipf & Welling, 2016)、GAT(Veličković et al., 2019)以及(采用均值邻域聚合的)GraphSAGE(Hamilton et al.)。我们选择了在所有下游任务验证集上表现都较好的超参数:300 维隐单元、5 层 GNN(),以及把平均池化作为 READOUT 函数。更多细节见附录 A。
Pre-training. For Context Prediction illustrated in Figure 2 (a), on molecular graphs, we define context graphs by setting inner radius . On PPI networks whose diameters are often smaller than 5, we use , which works well empirically despite the large overlap between the neighborhood and context subgraphs. For both molecular and PPI graphs, we let outer radius , and use a 3-layer GNN to encode the context structure. For Attribute Masking shown in Figure 2 (b), we randomly mask 15% of node (for molecular graphs) or edge attributes (for PPI networks) for prediction. As baselines for node-level self-supervised pre-training, we adopt the original Edge Prediction (denoted by EdgePred) (Hamilton et al.) and Deep Graph Infomax (denoted by Infomax) (Veličković et al., 2019) implementations. Further details are provided in Appendix G.
预训练。 对图 2(a)所示的上下文预测,在分子图上我们把内半径设为 来定义上下文图。PPI 网络的直径常常小于 5,我们使用 ,尽管邻域与上下文子图重叠较大,经验上仍然有效。对分子图和 PPI 图,我们都取外半径 ,并用一个 3 层 GNN 编码上下文结构。对图 2(b)所示的属性掩码,我们随机掩码 15% 的节点属性(分子图)或边属性(PPI 网络)供预测。作为节点级自监督预训练的基线,我们采用原始的边预测(记为 EdgePred)(Hamilton et al.)以及 Deep Graph Infomax(记为 Infomax)(Veličković et al., 2019)实现。更多细节见附录 G。
Table 2: Test ROC-AUC (%) performance of different GNN architectures with and without pre-training. Without pre-training, the less expressive GNNs give slightly better performance than the most expressive GIN because of their smaller model complexity in a low data regime. However, with pre-training, the most expressive GIN is properly regularized and dominates the other architectures. For results split by chemistry datasets, see Table 4 in Appendix H. Pre-training strategy for chemistry data: Context Prediction + Graph-level supervised pre-training; pre-training strategy for biology data: Attribute Masking + Graph-level supervised pre-training.
| Architecture | Chemistry Non-pre-trained | Chemistry Pre-trained | Chemistry Gain | Biology Non-pre-trained | Biology Pre-trained | Biology Gain |
|---|---|---|---|---|---|---|
| GIN | 67.0 | 74.2 | +7.2 | 64.8 ± 1.0 | 74.2 ± 1.5 | +9.4 |
| GCN | 68.9 | 72.2 | +3.4 | 63.2 ± 1.0 | 70.9 ± 1.7 | +7.7 |
| GraphSAGE | 68.3 | 70.3 | +2.0 | 65.7 ± 1.2 | 68.5 ± 1.5 | +2.8 |
| GAT | 66.8 | 60.3 | -6.5 | 68.2 ± 1.1 | 67.8 ± 3.6 | -0.4 |
表 2:不同 GNN 架构在有无预训练时的测试 ROC-AUC(%)。在没有预训练时,表达能力较弱的 GNN 由于在低数据量下模型复杂度更小,表现略好于表达能力最强的 GIN。不过经过预训练后,表达能力最强的 GIN 得到了适当正则,并优于其他架构。按化学数据集拆开的结果见表 4(附录 H)。化学数据的预训练策略:上下文预测 + 图级有监督预训练;生物数据的预训练策略:属性掩码 + 图级有监督预训练。
| Architecture | Chemistry Non-pre-trained | Chemistry Pre-trained | Chemistry Gain | Biology Non-pre-trained | Biology Pre-trained | Biology Gain |
|---|---|---|---|---|---|---|
| GIN | 67.0 | 74.2 | +7.2 | 64.8 ± 1.0 | 74.2 ± 1.5 | +9.4 |
| GCN | 68.9 | 72.2 | +3.4 | 63.2 ± 1.0 | 70.9 ± 1.7 | +7.7 |
| GraphSAGE | 68.3 | 70.3 | +2.0 | 65.7 ± 1.2 | 68.5 ± 1.5 | +2.8 |
| GAT | 66.8 | 60.3 | -6.5 | 68.2 ± 1.1 | 67.8 ± 3.6 | -0.4 |
Results
5.3 结果
We report results for molecular property prediction and protein function prediction in Tables 2 and 1 and Figure 3. Our systematic study suggests the following trends:
我们在表 2、表 1 和图 3 中报告分子性质预测和蛋白质功能预测的结果。这项系统研究显示出以下趋势:
{Observation (1):} Table 2 shows that the most expressive GNN architecture (GIN), when pre-trained, achieves the best performance across domains and datasets. Compared with gains of pre-training achieved by GIN architecture, gains of pre-training using less expressive GNNs (GCN, GraphSAGE, and GAT) are smaller and can sometimes even be negative (Table 2). This finding confirms previous observations (e.g., (Erhan et al., 2010)) that using an expressive model is crucial to fully utilize pre-training, and that pre-training can even hurt performance when used on models with limited expressive power, such as GCN, GraphSAGE, and GAT.
观察(1): 表 2 表明,表达能力最强的 GNN 架构(GIN)在经过预训练后,在各领域和数据集上都取得了最佳表现。与 GIN 从预训练中获得的收益相比,表达能力较弱的 GNN(GCN、GraphSAGE 和 GAT)的预训练收益更小,有时甚至为负(表 2)。这一发现印证了此前的观察(例如 Erhan et al., 2010):要用好预训练,表达能力强的模型至关重要;而在表达能力有限的模型(如 GCN、GraphSAGE 和 GAT)上做预训练,甚至可能损害表现。
{Observation (2):} As seen from the shaded cells of Table 1 and highlighted region in the middle panel of Figure 3, the strong baseline strategy that performs extensive graph-level multi-task supervised pre-training of GNNs gives surprisingly limited performance gain and yields negative transfer on many downstream tasks (2 out of 8 datasets in molecular prediction, and 13 out of 40 tasks in protein function prediction).
观察(2): 从表 1 的阴影格子以及图 3 中间面板的高亮区域可以看出,那种对 GNN 做大规模图级多任务有监督预训练的强基线策略,带来的性能提升出人意料地有限,并在许多下游任务上造成负迁移(分子预测 8 个数据集中的 2 个,蛋白质功能预测 40 个任务中的 13 个)。
{Observation (3):} From the upper half of Table 1 and the left panel of Figure 3, we see that another baseline strategy, which only performs node-level self-supervised pre-training, also gives limited performance improvement and is comparable to the graph-level multi-task supervised pre-training baseline.
观察(3): 从表 1 上半部分以及图 3 左面板可以看出,另一种只做节点级自监督预训练的基线策略,性能提升同样有限,与图级多任务有监督预训练基线相当。
{Observation (4):} From the lower half of Table 1 and the right panel of Figure 3, we see that our pre-training strategy of combining graph-level multi-task supervised and node-level self-supervised pre-training avoids negative transfer across downstream datasets and achieves best performance.
观察(4): 从表 1 下半部分以及图 3 右面板可以看出,把图级多任务有监督预训练与节点级自监督预训练结合起来的策略,在下游数据集上避免了负迁移,并取得了最佳表现。
{Observation (5):} Furthermore, from Table 1 and the left panel of Figure 3, we see that our strategy gives significantly better predictive performance than the two baseline pre-training strategies as well as non-pre-trained models, achieving state-of-the-art performance.
观察(5): 此外,从表 1 和图 3 左面板可以看出,我们的策略比两种预训练基线以及未预训练模型都有显著更好的预测表现,达到了当时最佳水平。
Specifically, in the chemistry datasets, we see from Table 1 that our Context Prediction + Graph-level multi-task supervised pre-training strategy gives the most promising performance, leading to an increase in average ROC-AUC of 7.2% over non-pre-trained baseline and 4.2% over graph-level multi-task supervised pre-trained baseline. On the HIV dataset, where a number of recent works (Wu et al., 2018; Li et al., 2017; Ishiguro et al., 2019) have reported performance on the same scaffold split and using the same protocol, our best pre-trained model (ContextPred + Supervised) achieves state-of-the-art performance. In particular, we achieved a ROC-AUC score of 79.9%, while best-performing graph models in Wu et al. (2018), Li et al. (2017), and Ishiguro et al. (2019) had ROC-AUC scores of 76.3%, 77.6%, and 76.2%, respectively.
具体而言,在化学数据集上,由表 1 可见,上下文预测 + 图级多任务有监督预训练的策略最为突出,平均 ROC-AUC 比未预训练基线提高 7.2 个百分点,比图级多任务有监督预训练基线提高 4.2 个百分点。在 HIV 数据集上,近期若干工作(Wu et al., 2018;Li et al., 2017;Ishiguro et al., 2019)已在相同骨架划分和相同协议下报告了结果,我们最好的预训练模型(ContextPred + Supervised)达到了当时最佳水平。具体来说,我们得到了 79.9% 的 ROC-AUC,而 Wu et al.(2018)、Li et al.(2017)和 Ishiguro et al.(2019)中表现最好的图模型,ROC-AUC 分别为 76.3%、77.6% 和 76.2%。
Also, in the biology datasets, which we have built in this work, we see from the left panel of Figure 3 that our Attribute Masking + Graph-level multi-task supervised pre-training strategy achieves the best predictive performance compared to other baseline strategies across almost all 40 downstream prediction tasks (the right panel of Figure 3). On average, our strategy improves ROC-AUC by 9.4% over non-pre-trained baseline and 5.2% over graph-level multi-task supervised pre-trained baseline, again achieving state-of-the-art performance.
同样,在我们于本文构建的生物数据集上,由图 3 左面板可见,属性掩码 + 图级多任务有监督预训练的策略,相对其他基线策略,在几乎全部 40 个下游预测任务上都取得了最好的预测表现(图 3 右面板)。平均而言,该策略的 ROC-AUC 比未预训练基线提高 9.4 个百分点,比图级多任务有监督预训练基线提高 5.2 个百分点,同样达到了当时最佳水平。
{Observation (6):} In the chemistry domain, we also report performance on classic benchmarks (MUTAG, PTC molecule datasets) in Appendix B. However, as mentioned in Section 5.1, the extremely small dataset sizes make these benchmarks unsuitable to compare different methods in a statistically reliable way.
观察(6): 在化学领域,我们也在附录 B 中报告了经典基准(MUTAG、PTC 分子数据集)上的表现。不过,如第 5.1 节所述,这些基准的数据量极小,不适合以统计上可靠的方式比较不同方法。
{Observation (7):} Beyond predictive performance improvement, Figure 4 shows that our pre-trained models achieve orders-of-magnitude faster training and validation convergence than non-pre-trained models. For example, on the MUV dataset, it took 1 hour for the non-pre-trained GNN to get 74.9% validation ROC-AUC, while it took only 5 minutes for our pre-trained GNN to get 85.3% validation ROC-AUC. The same trend holds across the downstream datasets we used, as shown in Figure 5 in Appendix I. We emphasize that pre-training is a one-time-effort. Once the model is pre-trained, it can be used for any number of downstream tasks to improve performance with little training time.
观察(7): 除了预测性能的提升,图 4 还表明,我们的预训练模型在训练和验证上的收敛速度,比未预训练模型快数个数量级。例如在 MUV 数据集上,未预训练 GNN 用了 1 小时才达到 74.9% 的验证 ROC-AUC,而我们的预训练 GNN 只用 5 分钟就达到了 85.3% 的验证 ROC-AUC。如图 5(附录 I)所示,这一趋势在我们所使用的下游数据集上都成立。我们强调,预训练是一次性工作。模型一旦预训练完成,就可以用于任意数量的下游任务,在很少的训练时间内提升表现。
As a final remark, in our preliminary experiments, we performed the Attribute Masking and Context Prediction simultaneously to pre-train GNNs. That approach did not improve performance in our experiments. We leave a thorough analysis of the approach for future work.
最后补充一点:在初步实验中,我们曾同时用属性掩码和上下文预测来预训练 GNN。这一做法在我们的实验中并未提升表现。对该做法的更彻底分析,我们留给后续工作。
Figure 3: Test ROC-AUC of protein function prediction using different pre-training strategies with GIN. (Left) Test ROC-AUC scores (%) obtained by different pre-training strategies, where the scores are averaged over the 40 fine-grained prediction tasks. {(Middle and right):} Scatter plot comparisons of ROC-AUC scores for a pair of pre-training strategies on the 40 individual downstream tasks. Each point represents a particular individual downstream task. {{(Middle):}} There are many individual downstream tasks where graph-level multi-task supervised pre-trained model performs worse than non-pre-trained model, indicating negative transfer. {(Right):} When the graph-level multi-task supervised pre-training and Attribute Masking are combined, negative transfer is avoided across downstream tasks. The performance also improves over pure graph-level supervised pre-training.
图 3:用不同预训练策略、基于 GIN 的蛋白质功能预测测试 ROC-AUC。(左)不同预训练策略得到的测试 ROC-AUC 分数(%),分数在 40 个细粒度预测任务上取平均。(中、右)在 40 个单个下游任务上,成对比较两种预训练策略的 ROC-AUC 散点图。每个点表示一个单独的下游任务。(中)有许多单个下游任务上,图级多任务有监督预训练模型的表现差于未预训练模型,表明出现了负迁移。(右)当图级多任务有监督预训练与属性掩码结合时,下游任务上的负迁移得以避免。表现也优于单纯的图级有监督预训练。
图 4:GIN 上不同预训练策略的训练曲线和验证曲线。实线和虚线分别表示训练曲线和验证曲线。
Conclusions and Future Work
6 结论与未来工作
We developed a novel strategy for pre-training GNNs. Crucial to the success of our strategy is to consider both node-level and graph-level pre-training in combination with an expressive GNN. This ensures that node embeddings capture local neighborhood semantics that are pooled together to obtain meaningful graph-level representations, which, in turn, are used for downstream tasks. Experiments on multiple datasets, diverse downstream tasks and different GNN architectures show that the new pre-training strategy achieves consistently better out-of-distribution generalization than non-pre-trained models.
我们为预训练 GNN 提出了一种新策略。该策略成功的关键,是把节点级和图级预训练与表达能力强的 GNN 结合起来。这样可以确保节点嵌入捕获局部邻域语义,再经池化得到有意义的图级表示,并进而用于下游任务。在多个数据集、多样化下游任务以及不同 GNN 架构上的实验表明,这一新的预训练策略在分布外泛化上始终优于未预训练模型。
Our work makes an important step toward transfer learning on graphs and addresses the issue of negative transfer observed in prior studies. There are many interesting avenues for future work. For example, further increasing generalization by improving GNN architectures as well as pre-training and fine-tuning approaches, is a fruitful direction. Investigating what pre-trained models have learned would also be useful to aid scientific discovery (Tshitoyan et al., 2019). Finally, it would be interesting to apply our methods to other domains, e.g., physics, material science, and structural biology, where many problems are defined over graphs representing interactions of e.g., atoms, particles, and amino acids.
本文在图上的迁移学习上迈出了重要一步,并针对先前研究中观察到的负迁移问题给出了应对办法。后续工作还有许多有意思的方向。例如,通过改进 GNN 架构以及预训练和微调方法来进一步提高泛化,就是一条有收获的路径。探究预训练模型学到了什么,对辅助科学发现也很有用(Tshitoyan et al., 2019)。最后,把我们的方法应用到其他领域也会很有意思,例如物理、材料科学和结构生物学,这些领域中的许多问题都定义在表示原子、粒子和氨基酸等相互作用的图上。
Acknowledgments
致谢
We thank Camilo Ruiz, Rex Ying, Zhenqin Wu, Shantao Li, Srijan Kumar, Hongwei Wang, and Robin Jia for their helpful discussion. W.H is supported by Funai Overseas Scholarship and Masason Foundation Fellowship. J.L is a Chan Zuckerberg Biohub investigator. We gratefully acknowledge the support of DARPA under Nos. FA865018C7880 (ASED), N660011924033 (MCS); ARO under Nos. W911NF-16-1-0342 (MURI), W911NF-16-1-0171 (DURIP); NSF under Nos. OAC-1835598 (CINES), OAC-1934578 (HDR); Stanford Data Science Initiative, Wu Tsai Neurosciences Institute, Chan Zuckerberg Biohub, JD.com, Amazon, Boeing, Docomo, Huawei, Hitachi, Observe, Siemens, UST Global.
感谢 Camilo Ruiz、Rex Ying、Zhenqin Wu、Shantao Li、Srijan Kumar、Hongwei Wang 和 Robin Jia 的有益讨论。W.H. 由 Funai Overseas Scholarship 和 Masason Foundation Fellowship 资助。J.L. 是 Chan Zuckerberg Biohub investigator。我们衷心感谢以下资助:DARPA 项目 FA865018C7880(ASED)、N660011924033(MCS);ARO 项目 W911NF-16-1-0342(MURI)、W911NF-16-1-0171(DURIP);NSF 项目 OAC-1835598(CINES)、OAC-1934578(HDR);以及 Stanford Data Science Initiative、Wu Tsai Neurosciences Institute、Chan Zuckerberg Biohub、京东、Amazon、Boeing、Docomo、华为、Hitachi、Observe、Siemens、UST Global。
The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views, policies, or endorsements, either expressed or implied, of DARPA, NIH, ARO, or the U.S. Government.
美国政府有权为政府目的复制和分发重印本,而不受其上版权标注的限制。本文中表达的任何观点、发现、结论或建议都属于作者,并不一定反映 DARPA、NIH、ARO 或美国政府的观点、政策或背书,无论明示还是暗示。
The Pande Group acknowledges the generous support of Dr. Anders G. Frøseth and Mr. Christian Sundt for our work on machine learning. The Pande Group is broadly supported by grants from the NIH (R01 GM062868 and U19 AI109662) as well as gift funds and contributions from Folding@home donors.
Pande 组感谢 Anders G. Frøseth 博士和 Christian Sundt 先生对我们机器学习工作的慷慨支持。Pande 组还广泛得到 NIH 资助(R01 GM062868 和 U19 AI109662)以及 Folding@home 捐赠者的赠款和捐助。
V.S.P is a consultant & SAB member of Schrodinger, LLC and Globavir, sits on the Board of Directors of Apeel Sciences, Asimov, BioAge Labs, Ciitizen, Devoted Health, Freenome, Insitro, Omada Health, PatientPing, and is a General Partner at Andreessen Horowitz.
V.S.P. 是 Schrödinger, LLC 和 Globavir 的顾问及科学顾问委员会成员,担任 Apeel Sciences、Asimov、BioAge Labs、Ciitizen、Devoted Health、Freenome、Insitro、Omada Health、PatientPing 的董事会成员,并且是 Andreessen Horowitz 的普通合伙人。
Details of GNN architectures
A GNN 架构细节
Here we describe GNN architectures used in our molecular property and protein function prediction experiments. For both domains we use the GIN architecture (Xu et al., 2019) with some minor modifications to include edge features, as well as center node information in the protein ego-networks.
这里我们描述分子性质预测和蛋白质功能预测实验中使用的 GNN 架构。两个领域都使用 GIN 架构(Xu et al., 2019),并做了一些小的修改,以纳入边特征,以及蛋白质自我网络中的中心节点信息。
As our primary goal is to systematically compare our pre-training strategy to the strong baseline strategies, we fix all of these hyper-parameters in our experiments and focus on relative improvement directly caused by the difference in pre-training strategies.
由于我们的主要目标是系统比较我们的预训练策略与强基线策略,实验中我们固定了所有这些超参数,并关注由预训练策略差异直接带来的相对提升。
Molecular property prediction. In molecular property prediction, the raw node features and edge features are both 2-dimensional categorical vectors (see Appendix C for details), denoted as and for node and edge , respectively. Note that we also introduce unique categories to indicate masked node/edges as well as self-loop edges. As input features to GNNs, we first embed the categorical vectors by
分子性质预测。 在分子性质预测中,原始节点特征和边特征都是 2 维类别向量(细节见附录 C),对节点 和边 分别记为 和 。注意,我们还引入了专门的类别,用来表示被掩码的节点/边以及自环边。作为 GNN 的输入特征,我们首先把这些类别向量嵌入为
where , , , and represent embedding operations that map integer indices to -dimensional real vectors, and represents the index of GNN layers. At the -th layer, GNNs update node representations by
其中 、、 和 表示把整数下标映射到 维实向量的嵌入操作, 表示 GNN 层的下标。在第 层,GNN 按如下方式更新节点表示:
where is a set of nodes adjacent to , and represents the self-loop edge. Note that for the final layer, i.e., , we removed the ReLU from (4) so that can take negative values. This is crucial for pre-training methods based on the dot product, e.g., Context Prediction and Edge Prediction, as otherwise, the dot product between two vectors would be always positive.
其中 是与 相邻的节点集合, 表示自环边。注意,对最后一层,即 ,我们从式 (4) 中去掉了 ReLU,使 可以取负值。这对基于点积的预训练方法(例如上下文预测和边预测)至关重要,否则两个向量的点积将始终为正。
The graph-level representation is obtained by averaging the node embeddings at the final layer, i.e.,
图级表示 由最后一层节点嵌入取平均得到,即
The label prediction is made by a linear model on top of .
标签预测由作用在 之上的线性模型完成。
In our experiments, we set the embedding dimension to 300. For MLPs in (4), we use the ReLU activation with 600 hidden units. We apply batch normalization (Ioffe & Szegedy, 2015) right before the ReLU in (4) and apply dropout (Srivastava et al., 2014) to at all the layers except the input layer.
实验中,我们把嵌入维数 设为 300。对式 (4) 中的 MLP,我们使用 ReLU 激活和 600 个隐单元。我们在式 (4) 的 ReLU 之前使用批归一化(Ioffe & Szegedy, 2015),并在除输入层以外的所有层上对 使用 dropout(Srivastava et al., 2014)。
Protein function prediction. The GNN architecture used for protein function prediction is similar to the one used for molecular property prediction except for a few differences. First, the raw input node features are uniform (denoted as here) and second, the raw input edge features are binary vectors (see Appendix D for the detail), which we denote as . As input features to GNNs, we first embed the raw features by
蛋白质功能预测。 用于蛋白质功能预测的 GNN 架构与分子性质预测所用的架构相近,只在几处不同。第一,原始输入节点特征是均匀的(这里记为 );第二,原始输入边特征是二值向量(细节见附录 D),记为 。作为 GNN 的输入特征,我们首先把原始特征嵌入为
where and are learnable parameters, and . At each layer, GNNs update node representations by
其中 和 是可学习参数,且 。在每一层,GNN 按如下方式更新节点表示:
where takes two vectors as input and concatenates them. Since the downstream task is ego-network classification, we use the embedding of the center node together with the embedding of the entire ego-network. More specifically, we obtain graph-level representation by
其中 以两个向量为输入并将它们拼接。由于下游任务是自我网络分类,我们同时使用中心节点 的嵌入以及整个自我网络的嵌入。更具体地说,我们按如下方式得到图级表示 :
Other GNN architectures. For GCN, GraphSAGE, and GAT, we adopt the implementation in the Pytorch Geometric library (Fey & Lenssen, 2019), where we set the number of GAT attention heads to be 2. The dimensionality of node embeddings as well as the number of GNN layers are kept the same as GIN. These models do not originally handle edge features. We incorporate edge features into these models similarly to how we do it for the GIN; we add edge embeddings into node embeddings, and perform the GNN message-passing on the obtained node embeddings.
其他 GNN 架构。 对 GCN、GraphSAGE 和 GAT,我们采用 Pytorch Geometric 库(Fey & Lenssen, 2019)中的实现,并把 GAT 的注意力头数设为 2。节点嵌入维数以及 GNN 层数与 GIN 保持一致。这些模型原先并不处理边特征。我们把边特征纳入这些模型的方式,与对 GIN 的做法类似:把边嵌入加到节点嵌入上,再在得到的节点嵌入上做 GNN 消息传递。
Experiments on classic graph classification benchmarks
B 经典图分类基准上的实验
In Table 3 we report our experiments on the commonly-used classic graph classification benchmarks (Kersting et al., 2016). Among the datasets Xu et al. (2019) used, MUTAG, PTC, and NCI1 are molecule datasets for binary classification. Out of these three, we excluded the NCI1 dataset, because it misses edge information (i.e., bond type) and therefore, we cannot recover the original molecule information, which is necessary to construct our input representations described in Appendix C.
在表 3 中,我们报告了在常用经典图分类基准(Kersting et al., 2016)上的实验。在 Xu et al.(2019)使用的数据集中,MUTAG、PTC 和 NCI1 是用于二分类的分子数据集。这三者里我们排除了 NCI1,因为它缺少边信息(即键类型),因而无法恢复原始分子信息,而这对构造附录 C 中描述的输入表示是必要的。
For fair comparison, we used exactly the same evaluation protocol as Xu et al. (2019), i.e., report 10-fold cross-validation accuracy. All the hyper-parameters in our experiments are kept the same in the main experiments except that we additionally tuned dropout rate from and the batch size from at the fine-tuning stage.
为公平比较,我们采用与 Xu et al.(2019)完全相同的评估协议,即报告 10 折交叉验证准确率。除了在微调阶段额外从 中调节 dropout 率、从 中调节批大小外,实验中的其余超参数与正文实验保持一致。
While the pre-trained GNNs (especially those with Context Prediction) give competent performance, all the accuracies (including all the previous methods) are within a standard deviation with each other, making it hard to reliably compare different methods. As Xu et al. (2019) has pointed out, this is due to the extremely small dataset size; a validation set at each fold only contains around 19 to 35 molecules for MUTAG and PTC, respectively. Given these results, we argue that it is necessary to use larger datasets to make reliable comparison, so we mainly focus on MoleculeNet (Wu et al., 2018) in this work.
尽管预训练 GNN(尤其是带上下文预测的那些)表现合格,但所有准确率(包括此前的全部方法)彼此都落在一个标准差之内,因而很难可靠地比较不同方法。正如 Xu et al.(2019)所指出的,这是因为数据量极小:每一折的验证集对 MUTAG 和 PTC 分别大约只有 19 到 35 个分子。基于这些结果,我们认为有必要使用更大的数据集才能做出可靠比较,因此本文主要关注 MoleculeNet(Wu et al., 2018)。
Table 3: 10-fold cross validation accuracy (%) on classic graph classification benchmarks using different pre-training strategies with GIN. All the previous results are excerpted from Xu et al. (2019).
| Graph-level | Node-level | MUTAG | PTC |
|---|---|---|---|
| # Molecules | 188 | 344 | |
| # Binary prediction tasks | 1 | 1 | |
| Previous results (cross validation split) | |||
| WL substree (Douglas, 2011) | 90.4 ± 5.7 | 59.9 ± 4.3 | |
| Patchysan (Niepert et al., 2016) | 92.6 ± 4.2 | 60.0 ± 4.8 | |
| GIN (Xu et al., 2019) | 89.4 ± 5.6 | 64.6 ± 7.0 | |
| Pre-training strategy (cross validation split) | |||
| -- | -- | 89.3 ± 7.4 | 62.4 ± 6.3 |
| -- | Infomax | 89.8 ± 5.6 | 65.9 ± 3.9 |
| -- | EdgePred | 91.9 ± 7.0 | 66.5 ± 5.7 |
| -- | Masking | 91.4 ± 5.0 | 64.4 ± 7.3 |
| -- | ContextPred | 92.4 ± 7.1 | 68.3 ± 7.8 |
| Supervised | -- | 90.9 ± 5.8 | 64.7 ± 7.9 |
| Supervised | Infomax | 90.9 ± 5.4 | 63.0 ± 9.3 |
| Supervised | EdgePred | 91.9 ± 4.2 | 63.5 ± 8.2 |
| Supervised | Masking | 90.3 ± 3.3 | 60.9 ± 9.1 |
| Supervised | ContextPred | 92.5 ± 5.0 | 66.5 ± 5.2 |
表 3:在经典图分类基准上,用 GIN 配合不同预训练策略得到的 10 折交叉验证准确率(%)。此前结果全部摘自 Xu et al.(2019)。
| Graph-level | Node-level | MUTAG | PTC |
|---|---|---|---|
| # Molecules | 188 | 344 | |
| # Binary prediction tasks | 1 | 1 | |
| Previous results (cross validation split) | |||
| WL substree (Douglas, 2011) | 90.4 ± 5.7 | 59.9 ± 4.3 | |
| Patchysan (Niepert et al., 2016) | 92.6 ± 4.2 | 60.0 ± 4.8 | |
| GIN (Xu et al., 2019) | 89.4 ± 5.6 | 64.6 ± 7.0 | |
| Pre-training strategy (cross validation split) | |||
| -- | -- | 89.3 ± 7.4 | 62.4 ± 6.3 |
| -- | Infomax | 89.8 ± 5.6 | 65.9 ± 3.9 |
| -- | EdgePred | 91.9 ± 7.0 | 66.5 ± 5.7 |
| -- | Masking | 91.4 ± 5.0 | 64.4 ± 7.3 |
| -- | ContextPred | 92.4 ± 7.1 | 68.3 ± 7.8 |
| Supervised | -- | 90.9 ± 5.8 | 64.7 ± 7.9 |
| Supervised | Infomax | 90.9 ± 5.4 | 63.0 ± 9.3 |
| Supervised | EdgePred | 91.9 ± 4.2 | 63.5 ± 8.2 |
| Supervised | Masking | 90.3 ± 3.3 | 60.9 ± 9.1 |
| Supervised | ContextPred | 92.5 ± 5.0 | 66.5 ± 5.2 |
Details of molecular datasets
C 分子数据集细节
Input graph representation. For simplicity, we use a minimal set of node and bond features that unambiguously describe the two-dimensional structure of molecules. We use RDKit (Landrum et al., 2006) to obtain these features.
输入图表示。 为简单起见,我们使用能无歧义描述分子二维结构的最小节点和键特征集合。我们用 RDKit(Landrum et al., 2006)提取这些特征。
- Node features:
节点特征:
- Atom number: [1, 118]
原子序数:[1, 118]
- Chirality tag: {unspecified, tetrahedral cw, tetrahedral ccw, other}
手性标记:{unspecified, tetrahedral cw, tetrahedral ccw, other}
Edge features:
边特征:
- Bond type: {single, double, triple, aromatic}
键类型:{single, double, triple, aromatic}
- Bond direction: {–, endupright, enddownright}
键方向:{--, endupright, enddownright}
Downstream task datasets. 8 binary graph classification datasets from Moleculenet (Wu et al., 2018) are used to evaluate model performance.
下游任务数据集。 使用来自 MoleculeNet(Wu et al., 2018)的 8 个二分类图分类数据集来评估模型表现。
- BBBP. Blood-brain barrier penetration (membrane permeability) (Martins et al., 2012).
BBBP。 血脑屏障穿透(膜通透性)(Martins et al., 2012)。
- Tox21. Toxicity data on 12 biological targets, including nuclear receptors and stress response pathways (Tox21).
Tox21。 关于 12 个生物学靶点的毒性数据,包括核受体和应激反应通路(Tox21)。
- ToxCast. Toxicology measurements based on over 600 in vitro high-throughput screenings (Richard et al., 2016).
ToxCast。 基于 600 多项体外高通量筛选的毒理学测定(Richard et al., 2016)。
- SIDER. Database of marketed drugs and adverse drug reactions (ADR), grouped into 27 system organ classes (Kuhn et al., 2015).
SIDER。 已上市药物与药物不良反应(ADR)数据库,按 27 个系统器官类别分组(Kuhn et al., 2015)。
- ClinTox. Qualitative data classifying drugs approved by the FDA and those that have failed clinical trials for toxicity reasons (Novick et al., 2013; AACT).
ClinTox。 将 FDA 批准的药物与因毒性原因在临床试验中失败的药物加以区分的定性数据(Novick et al., 2013;AACT)。
- MUV. Subset of PubChem BioAssay by applying a refined nearest neighbor analysis, designed for validation of virtual screening techniques (Gardiner et al., 2011).
MUV。 通过对 PubChem BioAssay 做精细的最近邻分析得到的子集,用于验证虚拟筛选技术(Gardiner et al., 2011)。
- HIV. Experimentally measured abilities to inhibit HIV replication (HIV).
HIV。 实验测定的抑制 HIV 复制能力(HIV)。
- BACE. Qualitative binding results for a set of inhibitors of human -secretase 1 (Subramanian et al., 2016).
BACE。 一组人 -分泌酶 1 抑制剂的定性结合结果(Subramanian et al., 2016)。
Details of protein datasets
D 蛋白质数据集细节
Input graph representation. The protein subgraphs only have edge features.
输入图表示。 蛋白质子图只有边特征。
- Edge features:
边特征:
- Neighbourhood: {True, False}
Neighbourhood:{True, False}
- Fusion: {True, False}
Fusion:{True, False}
- Co-occurrence: {True, False}
Co-occurrence:{True, False}
- Co-expression: {True, False}
Co-expression:{True, False}
- Experiment: {True, False}
Experiment:{True, False}
- Database: {True, False}
Database:{True, False}
- Text: {True, False}
Text:{True, False}
These edge features indicate whether a particular type of relationship exists between a pair of proteins:
这些边特征表示一对蛋白质之间是否存在某类关系:
- Neighbourhood: if a pair of genes are consistently observed in each other’s genome neighbourhood
Neighbourhood:一对基因是否被持续观察到出现在彼此的基因组邻域中
- Fusion: if a pair of proteins have their respective orthologs fused into a single protein-coding gene in another organism
Fusion:一对蛋白质各自的直系同源物是否在另一生物中融合成单个蛋白质编码基因
- Co-occurrence: if a pair of proteins tend to be observed either as present or absent in the same subset of organisms
Co-occurrence:一对蛋白质是否倾向于在同一组生物中同时出现或同时缺失
- Co-expression: if a pair of proteins share similar expression patterns
Co-expression:一对蛋白质是否具有相似的表达模式
- Experiment: if a pair of proteins are experimentally observed to physically interact with each other
Experiment:一对蛋白质是否被实验观察到发生物理相互作用
- Database: if a pair of proteins belong to the same pathway, based on assessments by a human curator
Database:一对蛋白质是否属于同一通路,依据人工策展者的评估
- Text mining: if a pair of proteins are mentioned together in PubMed abstracts
Text mining:一对蛋白质是否在 PubMed 摘要中被一同提及
Datasets. A dataset containing protein subgraphs from 50 species is used (Zitnik et al., 2019). The original PPI networks do not have node attributes, but contain edge attributes that correspond to the degree of confidence for 7 different types of protein-protein relationships. The edge weights range from 0, which indicates no evidence for the specific relationship, to 1000, which indicates the highest confidence. The weighted edges of the PPI networks are thresholded such that the distribution of edge types across the 50 PPI networks are uniform. Then, for every node in the PPI networks, subgraphs centered on each node were generated by: (1) performing a breadth first search to select the subgraph nodes, with a search depth limit of 2 and a maximum number of 10 neighbors randomly expanded per node, (2) including the selected subgraph nodes and all the edges between those nodes to form the resulting subgraph.
数据集。 使用来自 50 个物种的蛋白质子图数据集(Zitnik et al., 2019)。原始 PPI 网络没有节点属性,但含有边属性,对应 7 种不同类型蛋白质-蛋白质关系的置信度。边权从 0(表示该特定关系没有任何证据)到 1000(表示最高置信度)。我们对 PPI 网络的加权边做阈值处理,使 50 个 PPI 网络上的边类型分布变得均匀。随后,对 PPI 网络中的每个节点,按如下方式生成以该节点为中心的子图:(1)用广度优先搜索选择子图节点,搜索深度上限为 2,每个节点最多随机扩展 10 个邻居;(2)纳入所选子图节点以及这些节点之间的全部边,形成最终子图。
The entire dataset contains 394,925 protein subgraphs derived from 50 species. Out of these 50 species, 8 species (arabidopsis, celegans, ecoli, fly, human, mouse, yeast, zebrafish) have proteins with GO protein annotations. The dataset contains 88,000 protein subgraphs from these 8 species, of which 57,448 proteins have at least one positive coarse-grained GO protein annotation and 22,876 proteins have at least one positive fine-grained GO protein annotation. For the self-supervised pre-training dataset, we use all 394,925 protein subgraphs.
整个数据集包含由 50 个物种得到的 394,925 个蛋白质子图。在这 50 个物种中,有 8 个物种(arabidopsis、celegans、ecoli、fly、human、mouse、yeast、zebrafish)的蛋白质带有 GO 蛋白质注释。数据集中来自这 8 个物种的蛋白质子图有 88,000 个,其中 57,448 个蛋白质至少有一个正的粗粒度 GO 注释,22,876 个蛋白质至少有一个正的细粒度 GO 注释。自监督预训练数据集使用全部 394,925 个蛋白质子图。
We define fine-grained protein functions as Gene Ontology (GO) annotations that are leaves in the GO hierarchy, and define coarse-grained protein functions as GO annotations that are the immediate parents of leaves (Ashburner et al., 2000; Consortium, 2018). For example, a fine-grained protein function is "Factor XII activation", while a coarse-grained function is "positive regulation of protein". The former is a specific type of the latter, and is much harder to derive experimentally. The GO hierarchy information is obtained using GOATOOLS (Klopfenstein et al., 2018). The supervised pre-training dataset and the downstream evaluation dataset are derived from the 8 labeled species, as described in Appendix E. The 40-th most common fine-grained protein label only has 121 positively annotated proteins, while the 40-th most common coarse-grained protein label has 9386 positively annotated proteins. This illustrates the extreme label scarcity of our downstream tasks.
我们将细粒度蛋白质功能定义为基因本体(GO)层级中位于叶子的注释,将粗粒度蛋白质功能定义为叶子的直接父节点上的 GO 注释(Ashburner et al., 2000;Consortium, 2018)。例如,一种细粒度蛋白质功能是 “Factor XII activation”,而一种粗粒度功能是 “positive regulation of protein”。前者是后者的一种具体类型,也更难通过实验得到。GO 层级信息由 GOATOOLS(Klopfenstein et al., 2018)获得。有监督预训练数据集和下游评估数据集来自这 8 个带标注物种,如附录 E 所述。第 40 常见的细粒度蛋白质标签只有 121 个正标注蛋白质,而第 40 常见的粗粒度蛋白质标签有 9386 个正标注蛋白质。这说明我们下游任务的标签极为稀缺。
For supervised pre-training, we combine the train, validation, and prior sets described previously, with the 5,000 most common coarse-grained protein function annotations as binary labels. For our downstream task, we predict the 40 most common fine-grained protein function annotations, to ensure that each protein function has at least 10 positive labels in our test set.
对有监督预训练,我们把前面描述的训练集、验证集和 prior 集合并,并以最常见的 5,000 种粗粒度蛋白质功能注释作为二值标签。对下游任务,我们预测最常见的 40 种细粒度蛋白质功能注释,以确保每种蛋白质功能在测试集中至少有 10 个正标签。
Details of dataset splitting
E 数据集划分细节
For molecular prediction tasks, following Ramsundar et al. (2019), we cluster molecules by scaffold (molecular graph substructure) (Bemis & Murcko, 1996), and recombine the clusters by placing the most common scaffolds in the training set, producing validation and test sets that contain structurally different molecules. Prior work has shown that this scaffold split provides a more realistic estimate of model performance in prospective evaluation compared to random split (Chen et al., 2012; Sheridan, 2013). The split for train/validation/test sets is 80%:10%:10%.
对分子预测任务,我们沿用 Ramsundar et al.(2019)的做法,按骨架(分子图子结构)(Bemis & Murcko, 1996)对分子聚类,再把最常见的骨架放到训练集中重新组合这些簇,从而使验证集和测试集包含结构不同的分子。已有工作表明,与随机划分相比,这种骨架划分能对前瞻评估中的模型表现给出更符合实际的估计(Chen et al., 2012;Sheridan, 2013)。训练/验证/测试集的划分比例为 80%:10%:10%。
In the PPI network, species split simulates a scenario where we have only high-level coarse-grained knowledge on a subset of proteins (prior set) in a species of interest (human in our experiments), and want to predict fine-grained biological functions for the rest of the proteins in that species (test set). For species split, we use 50% of the protein subgraphs from human as test set, and 50% as a prior set containing only coarse-grained protein annotations. The protein subgraphs from 7 other labelled species (arabidopsis, celegans, ecoli, fly, mouse, yeast, zebrafish) are used as train and validation sets, which are split 85% : 15%. The effective split ratio for the train/validation/prior/test sets is 69% : 12% : 9.5% : 9.5%.
在 PPI 网络中,物种划分模拟的情形是:对所关心物种(实验中是人)中的一部分蛋白质(prior 集),我们只有高层的粗粒度知识,并希望对该物种中其余蛋白质(测试集)预测细粒度生物功能。对物种划分,我们把来自人的蛋白质子图的 50% 用作测试集,另外 50% 作为只含粗粒度蛋白质注释的 prior 集。来自另外 7 个带标注物种(arabidopsis、celegans、ecoli、fly、mouse、yeast、zebrafish)的蛋白质子图用作训练集和验证集,按 85% : 15% 划分。训练/验证/prior/测试集的有效划分比例为 69% : 12% : 9.5% : 9.5%。
Time complexity of pre-training
F 预训练的时间复杂度
Here we analyze the time complexity for processing graphs in Attribute Masking and Context Prediction. First, the time complexity for Attribute Masking is linear with respect to the number of edges/nodes as it only involves sampling nodes/edges to be masked. Second, the time complexity for Context Prediction is again linear with respect to the number of edges/nodes, because it involves sampling a center node per graph plus extracting -hop neighborhood and context graph. Extracting the neighborhood/context graphs is performed by the breadth-first search, which takes at most linear time with respect to the number of edges in the graph. In summary, the time complexity for both of our pre-training methods are at most linear with respect to the number of edges, which is as efficient as message-passing computation in GNNs, and thus, is as efficient as the ordinary supervised learning using GNNs. Also, there is almost no memory overhead as we transform data (e.g., mask input node/edge features, sample the context graphs) on-the-fly.
这里我们分析属性掩码和上下文预测处理图时的时间复杂度。首先,属性掩码的时间复杂度相对边/节点数是线性的,因为它只需采样要掩码的节点/边。其次,上下文预测的时间复杂度同样相对边/节点数是线性的,因为它只需每张图采样一个中心节点,并提取 跳邻域和上下文图。提取邻域/上下文图通过广度优先搜索完成,至多与图中边数成线性时间。总之,两种预训练方法的时间复杂度至多与边数成线性,这与 GNN 中的消息传递计算一样高效,因而也与用 GNN 做普通监督学习一样高效。此外,几乎没有额外的内存开销,因为我们是在运行中即时变换数据(例如掩码输入节点/边特征、采样上下文图)。
Further details of the experimental setup
G 实验设置的更多细节
Optimization. All models are trained with Adam optimizer (Kingma & Ba, 2015) with a learning rate of 0.001. We use Pytorch (Paszke et al., 2017) and Pytorch Geometric (Fey & Lenssen, 2019) for all of our implementation. We run all pre-training methods for 100 epochs. For self-supervised pre-training, we use a batch size of 256, while for supervised pre-training, we use a batch size of 32 with dropout rate of 20%.
优化。 所有模型都用 Adam 优化器(Kingma & Ba, 2015)训练,学习率为 0.001。全部实现使用 Pytorch(Paszke et al., 2017)和 Pytorch Geometric(Fey & Lenssen, 2019)。所有预训练方法都运行 100 个 epoch。自监督预训练的批大小为 256,有监督预训练的批大小为 32,dropout 率为 20%。
Fine-tuning. After pre-training, we follow the procedure in Section 3.3 to fine-tune the models on the training sets of the downstream datasets. We use a batch size of 32 and dropout rate of 50%. Datasets with multiple prediction tasks are fit jointly. On the molecular property prediction datasets, we train models for 100 epochs, while on the protein function prediction dataset (with the 40 binary prediction tasks), we train models for 50 epochs.
微调。 预训练结束后,我们按第 3.3 节的程序,在下游数据集的训练集上微调模型。批大小为 32,dropout 率为 50%。具有多个预测任务的数据集被联合拟合。在分子性质预测数据集上,我们训练 100 个 epoch;在蛋白质功能预测数据集(含 40 个二分类任务)上,我们训练 50 个 epoch。
Evaluation. We evaluate test performance on downstream tasks using ROC-AUC (Bradley, 1997) with the validation early stopping protocol, i.e., test ROC-AUC at the best validation epoch is reported. For datasets with multiple prediction tasks, we take the average ROC-AUC across all their tasks. The downstream experiments are run with 10 random seeds, and we report mean ROC-AUC and standard deviation.
评估。 我们用 ROC-AUC(Bradley, 1997)评估下游任务的测试表现,并采用验证集早停协议,即报告验证集上最佳 epoch 对应的测试 ROC-AUC。对具有多个预测任务的数据集,我们取所有任务上 ROC-AUC 的平均。下游实验用 10 个随机种子运行,并报告平均 ROC-AUC 和标准差。
Computation time for pre-training. The computation time for the two stages of our pre-training is reported below. Chemistry: Self-supervised pre-training takes about 24 hours, while supervised pre-training takes about 11 hours. Biology: Self-supervised pre-training takes about 3.8 hours, while supervised pre-training takes about 2.5 hours.
预训练的计算时间。 预训练两个阶段的计算时间如下。化学: 自监督预训练大约需要 24 小时,有监督预训练大约需要 11 小时。生物: 自监督预训练大约需要 3.8 小时,有监督预训练大约需要 2.5 小时。
Comparison of pre-training with different GNN architectures
H 不同 GNN 架构的预训练比较
Table 4 shows the detailed comparison of different GNN architectures on the chemistry datasets. We see that the most expressive GIN architectures benefit most from pre-training compared to the other less expressive models.
表 4 给出了不同 GNN 架构在化学数据集上的详细比较。可以看到,与其他表达能力较弱的架构相比,表达能力最强的 GIN 架构从预训练中获益最多。
Table 4: Test ROC-AUC (%) performance on molecular prediction benchmarks with different GNN architectures. The rightmost column averages the mean of test performance across the 8 datasets. For pre-training, we applied Context Prediction + graph-level supervised pre-training.
| Architecture | Pre-train? | BBBP | Tox21 | ToxCast | SIDER | ClinTox | MUV | HIV | BACE | Average |
|---|---|---|---|---|---|---|---|---|---|---|
| # Molecules | 2039 | 7831 | 8575 | 1427 | 1478 | 93087 | 41127 | 1513 | / | |
| # Binary prediction tasks | 1 | 12 | 617 | 27 | 2 | 17 | 1 | 1 | / | |
| GIN | No | 65.8 ± 4.5 | 74.0 ± 0.8 | 63.4 ± 0.6 | 57.3 ± 1.6 | 58.0 ± 4.4 | 71.8 ± 2.5 | 75.3 ± 1.9 | 70.1 ± 5.4 | 67.0 |
| GIN | Yes | 68.7 ± 1.3 | 78.1 ± 0.6 | 65.7 ± 0.6 | 62.7 ± 0.8 | 72.6 ± 1.5 | 81.3 ± 2.1 | 79.9 ± 0.7 | 84.5 ± 0.7 | 74.2 |
| GCN | No | 64.9 ± 3.0 | 74.9 ± 0.8 | 63.3 ± 0.9 | 60.0 ± 1.0 | 65.8 ± 4.5 | 73.2 ± 1.4 | 75.7 ± 1.1 | 73.6 ± 3.0 | 68.9 |
| GCN | Yes | 70.6 ± 1.6 | 75.8 ± 0.3 | 65.3 ± 0.1 | 62.4 ± 0.5 | 63.6 ± 1.7 | 79.4 ± 1.8 | 78.2 ± 0.6 | 82.3 ± 3.4 | 72.2 |
| GraphSAGE | No | 69.6 ± 1.9 | 74.7 ± 0.7 | 63.3 ± 0.5 | 60.4 ± 1.0 | 59.2 ± 4.4 | 72.7 ± 1.4 | 74.4 ± 0.7 | 72.5 ± 1.9 | 68.3 |
| GraphSAGE | Yes | 63.9 ± 2.1 | 76.8 ± 0.3 | 64.9 ± 0.2 | 60.7 ± 0.5 | 60.7 ± 2.0 | 78.4 ± 2.0 | 76.2 ± 1.1 | 80.7 ± 0.9 | 70.3 |
| GAT | No | 66.2 ± 2.6 | 75.4 ± 0.5 | 64.6 ± 0.6 | 60.9 ± 1.4 | 58.5 ± 3.6 | 66.6 ± 2.2 | 72.9 ± 1.8 | 69.7 ± 6.4 | 66.8 |
| GAT | Yes | 59.4 ± 0.5 | 68.1 ± 0.5 | 59.3 ± 0.7 | 56.0 ± 0.5 | 47.6 ± 1.3 | 65.4 ± 0.8 | 62.5 ± 1.6 | 64.3 ± 1.1 | 60.3 |
表 4:不同 GNN 架构在分子预测基准上的测试 ROC-AUC(%)。最右一列是 8 个数据集测试表现均值的平均。预训练采用上下文预测 + 图级有监督预训练。
| Architecture | Pre-train? | BBBP | Tox21 | ToxCast | SIDER | ClinTox | MUV | HIV | BACE | Average |
|---|---|---|---|---|---|---|---|---|---|---|
| # Molecules | 2039 | 7831 | 8575 | 1427 | 1478 | 93087 | 41127 | 1513 | / | |
| # Binary prediction tasks | 1 | 12 | 617 | 27 | 2 | 17 | 1 | 1 | / | |
| GIN | No | 65.8 ± 4.5 | 74.0 ± 0.8 | 63.4 ± 0.6 | 57.3 ± 1.6 | 58.0 ± 4.4 | 71.8 ± 2.5 | 75.3 ± 1.9 | 70.1 ± 5.4 | 67.0 |
| GIN | Yes | 68.7 ± 1.3 | 78.1 ± 0.6 | 65.7 ± 0.6 | 62.7 ± 0.8 | 72.6 ± 1.5 | 81.3 ± 2.1 | 79.9 ± 0.7 | 84.5 ± 0.7 | 74.2 |
| GCN | No | 64.9 ± 3.0 | 74.9 ± 0.8 | 63.3 ± 0.9 | 60.0 ± 1.0 | 65.8 ± 4.5 | 73.2 ± 1.4 | 75.7 ± 1.1 | 73.6 ± 3.0 | 68.9 |
| GCN | Yes | 70.6 ± 1.6 | 75.8 ± 0.3 | 65.3 ± 0.1 | 62.4 ± 0.5 | 63.6 ± 1.7 | 79.4 ± 1.8 | 78.2 ± 0.6 | 82.3 ± 3.4 | 72.2 |
| GraphSAGE | No | 69.6 ± 1.9 | 74.7 ± 0.7 | 63.3 ± 0.5 | 60.4 ± 1.0 | 59.2 ± 4.4 | 72.7 ± 1.4 | 74.4 ± 0.7 | 72.5 ± 1.9 | 68.3 |
| GraphSAGE | Yes | 63.9 ± 2.1 | 76.8 ± 0.3 | 64.9 ± 0.2 | 60.7 ± 0.5 | 60.7 ± 2.0 | 78.4 ± 2.0 | 76.2 ± 1.1 | 80.7 ± 0.9 | 70.3 |
| GAT | No | 66.2 ± 2.6 | 75.4 ± 0.5 | 64.6 ± 0.6 | 60.9 ± 1.4 | 58.5 ± 3.6 | 66.6 ± 2.2 | 72.9 ± 1.8 | 69.7 ± 6.4 | 66.8 |
| GAT | Yes | 59.4 ± 0.5 | 68.1 ± 0.5 | 59.3 ± 0.7 | 56.0 ± 0.5 | 47.6 ± 1.3 | 65.4 ± 0.8 | 62.5 ± 1.6 | 64.3 ± 1.1 | 60.3 |
Additional Training and validation curves
I 补充的训练曲线和验证曲线
Training and validation curves. In Figure 5, we plot training and validation curves for all the datasets used in the molecular property prediction experiments.
训练曲线和验证曲线。 在图 5 中,我们画出了分子性质预测实验中所用全部数据集的训练曲线和验证曲线。
Additional scatter plot comparisons of ROC-AUCs. In Figure 6, we compare our Context Prediction + graph-level supervised pre-training with a non-pre-trained model and a graph-level supervised pre-trained model. We see from the left plot that the combined strategy again completely avoids negative transfer across all the 40 downstream tasks. Furthermore, we see from the right plot that additionally adding our node-level Context Prediction pre-training almost always improves ROC-AUC scores of supervised pre-trained models across the 40 downstream tasks.
ROC-AUC 的补充散点比较。 在图 6 中,我们把上下文预测 + 图级有监督预训练,与未预训练模型以及只做图级有监督预训练的模型进行比较。左图表明,这一组合策略再次在全部 40 个下游任务上完全避免了负迁移。此外,右图表明,再加入我们的节点级上下文预测预训练,几乎总是能提高有监督预训练模型在这 40 个下游任务上的 ROC-AUC。
图 5:不同预训练策略的训练曲线和验证曲线。实线和虚线分别表示训练曲线和验证曲线。
Figure 6: Scatter plot comparisons of ROC-AUC scores of our Context Prediction + graph-level supervised pre-training strategy versus the two baseline strategies (non-pre-trained and graph-level supervised pre-trained) on the 40 individual downstream tasks of predicting different fine-grained protein function labels.
图 6:在预测不同细粒度蛋白质功能标签的 40 个单独下游任务上,对我们的上下文预测 + 图级有监督预训练策略与两种基线策略(未预训练,以及只做图级有监督预训练)的 ROC-AUC 分数做散点比较。
References
参考文献
References
参考文献
AACT. AACT database, Jan 2017. URL https://www.ctti-clinicaltrials.org/aact-database.
Michael Ashburner, Catherine A Ball, Judith A Blake, David Botstein, Heather Butler, J Michael Cherry, Allan P Davis, Kara Dolinski, Selina S Dwight, Janan T Eppig, et al. Gene ontology: tool for the unification of biology. Nature Genetics, 25(1):25, 2000.
Yunsheng Bai, Hao Ding, Yang Qiao, Agustin Marinovic, Ken Gu, Ting Chen, Yizhou Sun, and Wei Wang. Unsupervised inductive whole-graph embedding by preserving graph proximity. In International Joint Conference on Artificial Intelligence (IJCAI), 2019.
Guy W. Bemis and Mark A. Murcko. The properties of known drugs. 1. molecular frameworks. Journal of Medicinal Chemistry, 39(15):2887--2893, 1996. doi: 10.1021/jm9602928. PMID: 8709122.
Andrew P Bradley. The use of the area under the ROC curve in the evaluation of machine learning algorithms. Pattern Recognition, 30(7):1145--1159, 1997.
Suman K Chakravarti. Distributed representation of chemical fragments. ACS Omega, 3(3):2825--2836, 2018.
Bin Chen, Robert P. Sheridan, Viktor Hornak, and Johannes H. Voigt. Comparison of random forest and pipeline pilot naïve bayes in prospective QSAR predictions. Journal of Chemical Information and Modeling, 52(3):792--803, 2012. doi: 10.1021/ci200615h. PMID: 22360769.
Travers Ching, Daniel S Himmelstein, Brett K Beaulieu-Jones, Alexandr A Kalinin, Brian T Do, Gregory P Way, Enrico Ferrero, Paul-Michael Agapow, Michael Zietz, Michael M Hoffman, et al. Opportunities and obstacles for deep learning in biology and medicine. Journal of The Royal Society Interface, 15(141):20170387, 2018.
Gene Ontology Consortium. The gene ontology resource: 20 years and still going strong. Nucleic {Acids Research}, 47(D1):D330--D338, 2018.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), 2019.
Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In International Conference on Machine Learning (ICML), pp.\ 647--655, 2014.
Brendan L Douglas. The Weisfeiler-Lehman method and graph isomorphism testing. arXiv preprint arXiv:1101.5211, 2011.
Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? Journal of Machine Learning Research, 11(Feb):625--660, 2010.
Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with Pytorch Geometric. In International Conference on Learning Representations (ICLR), RLGM Workshop, 2019.
Eleanor J Gardiner, John D Holliday, Caroline O’Dowd, and Peter Willett. Effectiveness of 2d fingerprints for scaffold hopping. Future {Medicinal Chemistry}, 3(4):405--414, 2011.
Anna Gaulton, Louisa J Bellis, A Patricia Bento, Jon Chambers, Mark Davies, Anne Hersey, Yvonne Light, Shaun McGlinchey, David Michalovich, Bissan Al-Lazikani, et al. ChEMBL: a large-scale bioactivity database for drug discovery. Nucleic {Acids Research}, 40(D1):D1100--D1107, 2011.
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning (ICML), pp.\ 1273--1272, 2017.
Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp.\ 580--587, 2014.
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pp.\ 855--864. ACM, 2016.
William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems (NeurIPS), pp.\ 1025--1035, 2017a.
William L Hamilton, Rex Ying, and Jure Leskovec. Representation learning on graphs: Methods and applications. IEEE Data Engineering Bulletin, 40(3):52--74, 2017b.
Dan Hendrycks, Kimin Lee, and Mantas Mazeika. Using pre-training can improve model robustness and uncertainty. In International Conference on Machine Learning (ICML), 2019.
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning (ICML), pp.\ 448--456, 2015.
Katsuhiko Ishiguro, Shin-ichi Maeda, and Masanori Koyama. Graph warp module: An auxiliary module for boosting the power of graph neural networks. arXiv preprint arXiv:1902.01020, 2019.
Sabrina Jaeger, Simone Fulle, and Samo Turk. Mol2vec: unsupervised machine learning approach with chemical intuition. Journal of chemical information and modeling, 58(1):27--35, 2018.
Kristian Kersting, Nils M Kriege, Christopher Morris, Petra Mutzel, and Marion Neumann. Benchmark data sets for graph kernels, 2016. URL http://graphkernels. cs. tu-dortmund. de, 2016.
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
Thomas N Kipf and Max Welling. Variational graph auto-encoders. In Advances in Neural Information Processing Systems (NeurIPS), Bayesian Deep Learning Workshop, 2016.
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
DV Klopfenstein, Liangsheng Zhang, Brent S Pedersen, Fidel Ram' , Alex Warwick Vesztrocy, Aur'elien Naldi, Christopher J Mungall, Jeffrey M Yunes, Olga Botvinnik, Mark Weigel, et al. Goatools: A Python library for gene ontology analyses. Scientific Reports, 8(1):10872, 2018.
Michael Kuhn, Ivica Letunic, Lars Juhl Jensen, and Peer Bork. The sider database of drugs and side effects. Nucleic {Acids Research}, 44(D1):D1075--D1079, 2015.
Greg Landrum et al. RDKit: Open-source cheminformatics, 2006.
Junying Li, Deng Cai, and Xiaofei He. Learning graph-level representation for drug discovery. arXiv preprint arXiv:1709.03741, 2017.
Ines Filipa Martins, Ana L Teixeira, Luis Pinheiro, and Andre O Falcao. A bayesian approach to in silico blood-brain barrier penetration modeling. Journal of {Chemical Information and Modeling}, 52(6):1686--1697, 2012.
Andreas Mayr, G"unter Klambauer, Thomas Unterthiner, Marvin Steijaert, J"org K Wegner, Hugo Ceulemans, Djork-Arn'e Clevert, and Sepp Hochreiter. Large-scale comparison of machine learning methods for drug target prediction on ChEMBL. Chemical Science, 9(24):5441--5451, 2018.
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems (NeurIPS), pp.\ 3111--3119, 2013.
Annamalai Narayanan, Mahinthan Chandramohan, Lihui Chen, Yang Liu, and Santhoshkumar Saminathan. subgraph2vec: Learning distributed representations of rooted sub-graphs from large graphs. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), MLG workshop, 2016.
Nicol`o Navarin, Dinh V Tran, and Alessandro Sperduti. Pre-training graph neural networks with kernels. arXiv preprint arXiv:1811.06930, 2018.
Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In International Conference on Machine Learning (ICML), pp.\ 2014--2023, 2016.
Paul A. Novick, Oscar F. Ortiz, Jared Poelman, Amir Y. Abdulhay, and Vijay S. Pande. SWEETLEAD: an in silico database of approved drugs, regulated chemicals, and herbal isolates for computer-aided drug discovery. PLOS ONE, 8(11), 11 2013. doi: 10.1371/journal.pone.0079568. URL https://doi.org/10.1371/journal.pone.0079568.
Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345--1359, 2009.
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. In Advances in Neural Information Processing Systems (NeurIPS), Workshop, 2017.
Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pp.\ 701--710. ACM, 2014.
Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), 2018.
Bharath Ramsundar, Peter Eastman, Patrick Walters, and Vijay Pande. Deep Learning for the Life Sciences. O'Reilly Media, 2019. https://www.amazon.com/Deep-Learning-Life-Sciences-Microscopy/dp/1492039837.
Ann M. Richard, Richard S. Judson, Keith A. Houck, Christopher M. Grulke, Patra Volarath, Inthirany Thillainadarajah, Chihae Yang, James Rathman, Matthew T. Martin, John F. Wambaugh, Thomas B. Knudsen, Jayaram Kancherla, Kamel Mansouri, Grace Patlewicz, Antony J. Williams, Stephen B. Little, Kevin M. Crofton, and Russell S. Thomas. Toxcast chemical landscape: Paving the road to 21st century toxicology. Chemical Research in Toxicology, 29(8):1225--1251, 2016.
David Rogers and Mathew Hahn. Extended-connectivity fingerprints. Journal of Chemical Information and Modeling, 50(5):742--754, 2010. doi: 10.1021/ci100050t.
Michael T Rosenstein, Zvika Marx, Leslie Pack Kaelbling, and Thomas G Dietterich. To transfer or not to transfer. In Advances in Neural Information Processing Systems (NeurIPS), Workshop on transfer learning, volume 898, pp.\ 1--4, 2005.
Herbert Rubenstein and John B Goodenough. Contextual correlates of synonymy. Communications of the ACM, 8(10):627--633, 1965.
Robert P. Sheridan. Time-split cross-validation as a method for estimating the goodness of prospective prediction. Journal of Chemical Information and Modeling, 53(4):783--790, 2013. doi: 10.1021/ci400084k. PMID: 23521722.
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929--1958, 2014.
Teague Sterling and John J. Irwin. Zinc 15 – ligand discovery for everyone. Journal of Chemical Information and Modeling, 55(11):2324--2337, 2015. doi: 10.1021/acs.jcim.5b00559. PMID: 26479676.
Govindan Subramanian, Bharath Ramsundar, Vijay Pande, and Rajiah Aldrin Denny. Computational modeling of -secretase 1 (BACE-1) inhibitors using ligand based approaches. Journal of {Chemical Information and Modeling}, 56(10):1936--1949, 2016.
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the International World Wide Web Conference (WWW), pp.\ 1067--1077, 2015.
Tox21. Tox21 data challenge 2014, 2014. URL https://tripod.nih.gov/tox21/challenge/.
Vahe Tshitoyan, John Dagdelen, Leigh Weston, Alexander Dunn, Ziqin Rong, Olga Kononova, Kristin A Persson, Gerbrand Ceder, and Anubhav Jain. Unsupervised word embeddings capture latent knowledge from materials science literature. Nature, 571(7763):95, 2019.
Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In International Conference on Learning Representations (ICLR), 2018.
Petar Veli{ }kovi'c, William Fedus, William L Hamilton, Pietro Li`o, Yoshua Bengio, and R Devon Hjelm. Deep graph infomax. In International Conference on Learning Representations (ICLR), 2019.
Jingshu Wang, Divyansh Agarwal, Mo Huang, Gang Hu, Zilu Zhou, Chengzhong Ye, and Nancy R Zhang. Data denoising with transfer learning in single-cell transcriptomics. Nature Methods, 16(9):875--878, 2019.
Zhenqin Wu, Bharath Ramsundar, Evan N Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S Pappu, Karl Leswing, and Vijay Pande. MoleculeNet: a benchmark for molecular machine learning. Chemical science, 9(2):513--530, 2018.
Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learning (ICML), pp.\ 5453--5462, 2018.
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations (ICLR), 2019.
Yuting Xu, Junshui Ma, Andy Liaw, Robert P Sheridan, and Vladimir Svetnik. Demystifying multitask deep neural networks for quantitative structure--activity relationships. Journal of {Chemical Information and Modeling}, 57(10):2490--2504, 2017.
Rendong Yang, Yun Bai, Zhaohui Qin, and Tianwei Yu. EgoNet: identification of human disease ego-network modules. BMC Genomics, 15(1):314, 2014.
Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pp.\ 974--983, 2018a.
Rex Ying, Jiaxuan You, Christopher Morris, Xiang Ren, William L Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In Advances in Neural Information Processing Systems (NeurIPS), 2018b.
Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware graph neural networks. In International Conference on Machine Learning (ICML), 2019.
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European Conference on Computer Vision (ECCV), pp.\ 818--833. Springer, 2014.
Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In AAAI Conference on Artificial Intelligence, pp.\ 4438--4445, 2018.
Quan Zhou, Peizhe Tang, Shenxiu Liu, Jinbo Pan, Qimin Yan, and Shou-Cheng Zhang. Learning atoms for materials discovery. Proceedings of the National Academy of Sciences, 115(28):E6411--E6417, 2018.
Marinka Zitnik, Rok Sosic, and Jure Leskovec. Prioritizing network communities. Nature Communications, 9(1):2544, 2018.
Marinka Zitnik, Rok Sosič, Marcus W. Feldman, and Jure Leskovec. Evolution of resilience in protein interactomes across the tree of life. Proceedings of the National Academy of Sciences, 116(10):4426--4433, 2019. ISSN 0027-8424. doi: 10.1073/pnas.1818013116. URL https://www.pnas.org/content/116/10/4426.





