Convolutional Networks on Graphs for Learning Molecular Fingerprints
Convolutional Networks on Graphs for Learning Molecular Fingerprints
在图上的卷积网络:学习分子指纹
David Duvenaud † Dougal Maclaurin † † thanks: Equal contribution. Jorge Aguilera-Iparraguirre Affiliation: Rafael Gómez-Bombarelli, Timothy Hirzel, Alán Aspuru-Guzik, Ryan P. Adams Affiliation: Harvard University
Abstract
摘要
We introduce a convolutional neural network that operates directly on graphs. These networks allow end-to-end learning of prediction pipelines whose inputs are graphs of arbitrary size and shape. The architecture we present generalizes standard molecular feature extraction methods based on circular fingerprints. We show that these data-driven features are more interpretable, and have better predictive performance on a variety of tasks.
我们提出一种直接在图上运算的卷积神经网络。这类网络使得输入为任意大小和形状之图的预测流水线,可以进行端到端学习。我们给出的结构,是对基于圆形指纹的标准分子特征提取方法的推广。我们表明,这些由数据驱动得到的特征更可解释,并在多种任务上具有更好的预测表现。
1 Introduction
1 引言
Recent work in materials design used neural networks to predict the properties of novel molecules by generalizing from examples. One difficulty with this task is that the input to the predictor, a molecule, can be of arbitrary size and shape. Currently, most machine learning pipelines can only handle inputs of a fixed size. The current state of the art is to use off-the-shelf fingerprint software to compute fixed-dimensional feature vectors, and use those features as inputs to a fully-connected deep neural network or other standard machine learning method. This formula was followed by [28, 3, 19]. During training, the molecular fingerprint vectors were treated as fixed.
材料设计方面的近期工作,用神经网络通过从例子中泛化,来预测新分子的性质。这项任务的一个困难是,预测器的输入——一个分子——可以有任意的大小和形状。目前,大多数机器学习流水线只能处理固定大小的输入。当时最好的做法,是用现成的指纹软件算出固定维的特征向量,再把这些特征作为全连接深度神经网络或其他标准机器学习方法的输入。[28, 3, 19] 都沿用了这一公式。在训练过程中,分子指纹向量被当作固定不变的。
In this paper, we replace the bottom layer of this stack – the function that computes molecular fingerprint vectors – with a differentiable neural network whose input is a graph representing the original molecule. In this graph, vertices represent individual atoms and edges represent bonds. The lower layers of this network is convolutional in the sense that the same local filter is applied to each atom and its neighborhood. After several such layers, a global pooling step combines features from all the atoms in the molecule.
在本文中,我们把这个堆叠的最底层——也就是计算分子指纹向量的那个函数——换成一个可微的神经网络,其输入是表示原来分子的一张图。在这张图里,顶点表示各个原子,边表示化学键。这个网络的较低层是卷积式的:同一个局部滤波器会被应用到每个原子及其邻域上。经过这样若干层之后,一个全局汇聚步骤会把分子中所有原子的特征结合起来。
These neural graph fingerprints offer several advantages over fixed fingerprints:
与固定指纹相比,这些神经图指纹有几处好处:
- • Predictive performance. By using data adapting to the task at hand, machine-optimized fingerprints can provide substantially better predictive performance than fixed fingerprints. We show that neural graph fingerprints match or beat the predictive performance of standard fingerprints on solubility, drug efficacy, and organic photovoltaic efficiency datasets.
- 预测表现。 通过使用会适应手头任务的数据,由机器优化得到的指纹,可以提供比固定指纹好得多的预测表现。我们表明,神经图指纹在溶解度、药效和有机光伏效率数据集上的预测表现,达到或不低于标准指纹。
- • Parsimony. Fixed fingerprints must be extremely large to encode all possible substructures without overlap. For example, [28] used a fingerprint vector of size 43,000, after having removed rarely-occurring features. Differentiable fingerprints can be optimized to encode only relevant features, reducing downstream computation and regularization requirements.
- 节俭。 固定指纹必须非常长,才能在不重叠的前提下编码所有可能的子结构。例如,[28] 在去掉很少出现的特征之后,仍使用了长度为 43,000 的指纹向量。可微指纹可以被优化成只编码相关特征,从而减少下游计算和正则的需求。
- • Interpretability. Standard fingerprints encode each possible fragment completely distinctly, with no notion of similarity between fragments. In contrast, each feature of a neural graph fingerprint can be activated by similar but distinct molecular fragments, making the feature representation more meaningful.
- 可解释性。 标准指纹把每一种可能的片段都完全分开来编码,片段之间没有相似性的概念。相比之下,神经图指纹的每一个特征都可以被相似但并不相同的分子片段激活,从而使特征表示更有意义。
Figure 1: Left: A visual representation of the computational graph of both standard circular fingerprints and neural graph fingerprints. First, a graph is constructed matching the topology of the molecule being fingerprinted, in which nodes represent atoms, and edges represent bonds. At each layer, information flows between neighbors in the graph. Finally, each node in the graph turns on one bit in the fixed-length fingerprint vector. Right: A more detailed sketch including the bond information used in each operation.
图 1:左:标准圆形指纹和神经图指纹的计算图示意。首先构造一张与待计算指纹的分子拓扑相一致的图,其中节点表示原子,边表示化学键。在每一层,信息在图中的邻居之间流动。最后,图中的每个节点会在固定长度的指纹向量中点亮一位。右:更细致的示意图,包含每一步运算所用到的键信息。
2 Circular fingerprints
2 圆形指纹
The state of the art in molecular fingerprints are extended-connectivity circular fingerprints (ECFP) [21]. Circular fingerprints [6] are a refinement of the Morgan algorithm [17], designed to encode which substructures are present in a molecule in a way that is invariant to atom-relabeling.
分子指纹当时最好的方法是扩展连通圆形指纹(ECFP) [21]。圆形指纹 [6] 是对 Morgan 算法 [17] 的改进,目的是以一种对原子重新标记保持不变的方式,编码分子中出现了哪些子结构。
Circular fingerprints generate each layer’s features by applying a fixed hash function to the concatenated features of the neighborhood in the previous layer. The results of these hashes are then treated as integer indices, where a 1 is written to the fingerprint vector at the index given by the feature vector at each node in the graph. Figure 1(left) shows a sketch of this computational architecture. Ignoring collisions, each index of the fingerprint denotes the presence of a particular substructure. The size of the substructures represented by each index depends on the depth of the network. Thus the number of layers is referred to as the ‘radius’ of the fingerprints.
圆形指纹通过把一个固定的哈希函数作用于上一层邻域特征的拼接,来生成每一层的特征。这些哈希结果随后被当作整数下标,在由图中每个节点的特征向量所给出的下标处,向指纹向量写入一个 1。图 1(左)给出了这一计算结构的示意。忽略碰撞的话,指纹的每一个下标表示某种特定子结构是否出现。每个下标所代表的子结构大小,取决于网络的深度。因此层数被称作指纹的“半径”。
Circular fingerprints are analogous to convolutional networks in that they apply the same operation locally everywhere, and combine information in a global pooling step.
圆形指纹类似于卷积网络:它们在各处局部地施加同一种运算,并在一个全局汇聚步骤中把信息结合起来。
3 Creating a differentiable fingerprint
3 做出可微的指纹
The space of possible network architectures is large. In the spirit of starting from a known-good configuration, we designed a differentiable generalization of circular fingerprints. This section describes our replacement of each discrete operation in circular fingerprints with a differentiable analog.
可能的网络结构空间很大。本着从已知好用的配置出发的精神,我们设计了对圆形指纹的一种可微推广。这一节描述我们如何把圆形指纹中的每一步离散运算,替换成可微的对应物。
Hashing
The purpose of the hash functions applied at each layer of circular fingerprints is to combine information about each atom and its neighboring substructures. This ensures that any change in a fragment, no matter how small, will lead to a different fingerprint index being activated. We replace the hash operation with a single layer of a neural network. Using a smooth function allows the activations to be similar when the local molecular structure varies in unimportant ways.
哈希
在圆形指纹的每一层施加哈希函数,目的是把关于每个原子及其邻近子结构的信息结合起来。这样可以保证,片段上无论多么小的变化,都会导致被激活的是另一个指纹下标。我们用一层神经网络来替换哈希运算。使用平滑函数之后,当局部分子结构只在无关紧要的方面发生变化时,激活可以比较接近。
Indexing
Circular fingerprints use an indexing operation to combine all the nodes’ feature vectors into a single fingerprint of the whole molecule. Each node sets a single bit of the fingerprint to one, at an index determined by the hash of its feature vector. This pooling-like operation converts an arbitrary-sized graph into a fixed-sized vector. For small molecules and a large fingerprint length, the fingerprints are always sparse. We use the softmax operation as a differentiable analog of indexing. In essence, each atom is asked to classify itself as belonging to a single category. The sum of all these classification label vectors produces the final fingerprint. This operation is analogous to the pooling operation in standard convolutional neural networks.
索引
圆形指纹使用一步索引运算,把所有节点的特征向量结合成整个分子的一个指纹。每个节点会在由其特征向量的哈希所决定的下标处,把指纹的某一位置为 1。这种类似汇聚的运算,把一张任意大小的图转换成一个固定大小的向量。对小分子和较长的指纹长度来说,这些指纹总是稀疏的。我们用 softmax 运算作为索引的可微对应物。本质上,是要求每个原子把自己分类到某一个类别中。把所有这些分类标签向量加起来,就得到最终指纹。这一运算类似于标准卷积神经网络中的汇聚。
Canonicalization
Circular fingerprints are identical regardless of the ordering of atoms in each neighborhood. This invariance is achieved by sorting the neighboring atoms according to their features, and bond features. We experimented with this sorting scheme, and also with applying the local feature transform on all possible permutations of the local neighborhood. An alternative to canonicalization is to apply a permutation-invariant function, such as summation. In the interests of simplicity and scalability, we chose summation.
规范化
无论每个邻域里原子的排列如何,圆形指纹都是相同的。这种不变性是靠按特征和键特征对邻近原子排序来实现的。我们试验过这种排序方案,也试验过对局部邻域的所有可能排列都施加局部特征变换。规范化的一个替代办法,是施加一种对排列不变的函数,例如求和。出于简单和可扩展的考虑,我们选择了求和。
Circular fingerprints can be interpreted as a special case of neural graph fingerprints having large random weights. This is because, in the limit of large input weights, tanh nonlinearities approach step functions, which when concatenated form a simple hash function. Also, in the limit of large input weights, the softmax operator approaches a one-hot-coded argmax operator, which is analogous to an indexing operation.
圆形指纹可以看成具有很大随机权重的神经图指纹的一个特例。这是因为,在输入权重很大的极限下, 非线性会接近阶跃函数,把它们拼接起来就形成一种简单的哈希函数。同样,在输入权重很大的极限下,softmax 算子会接近 one-hot 编码的 算子,而这类似于一步索引运算。
Algorithms 1 and 2 summarize these two algorithms and highlight their differences. Given a fingerprint length , and features at each layer, the parameters of neural graph fingerprints consist of a separate output weight matrix of size for each layer, as well as a set of hidden-to-hidden weight matrices of size at each layer, one for each possible number of bonds an atom can have (up to 5 in organic molecules).
算法 1 和算法 2 概括了这两种算法,并标出了它们的差别。给定指纹长度 ,以及每一层 个特征,神经图指纹的参数包括:每一层一个大小为 的输出权重矩阵,以及每一层一组大小为 的隐层到隐层权重矩阵,后者按一个原子可能具有的键数各有一份(在有机分子中最多为 5)。
Algorithm 1 Circular fingerprints
1: Input: molecule, radius , fingerprint length
2: Initialize: fingerprint vector
3: for each atom in molecule
4: lookup atom features
5: for to for each layer
6: for each atom in molecule
7:
8: concatenate
9: hash function
10: convert to index
11: Write 1 at index
12: Return: binary vector
Algorithm 2 Neural graph fingerprints
1: Input: molecule, radius , hidden weights , output weights
2: Initialize: fingerprint vector
3: for each atom in molecule
4: lookup atom features
5: for to for each layer
6: for each atom in molecule
7:
8: sum
9: smooth function
10: sparsify
11: add to fingerprint
12: Return: real-valued vector
Figure 2: Pseudocode of circular fingerprints (left) and neural graph fingerprints (right). Differences are highlighted in blue. Every non-differentiable operation is replaced with a differentiable analog.
算法 1 圆形指纹
1: 输入: 分子,半径 ,指纹长度
2: 初始化: 指纹向量
3: for 分子中的每个原子
4: 查找原子特征
5: for 到 对每一层
6: for 分子中的每个原子
7:
8: 拼接
9: 哈希函数
10: 转换成下标
11: 在该下标处写入 1
12: 返回: 二值向量
算法 2 神经图指纹
1: 输入: 分子,半径 ,隐层权重 ,输出权重
2: 初始化: 指纹向量
3: for 分子中的每个原子
4: 查找原子特征
5: for 到 对每一层
6: for 分子中的每个原子
7:
8: 求和
9: 平滑函数
10: 稀疏化
11: 加到指纹上
12: 返回: 实值向量
图 2:圆形指纹(左)和神经图指纹(右)的伪代码。差别用蓝色标出。每一个不可微运算都被替换成了可微的对应物。
4 Experiments
4 实验
We ran two experiments to demonstrate that neural fingerprints with large random weights behave similarly to circular fingerprints.
我们做了两个实验,以表明具有很大随机权重的神经指纹,行为与圆形指纹相似。
Figure 3: Left: Comparison of pairwise distances between molecules, measured using circular fingerprints and neural graph fingerprints with large random weights. Right: Predictive performance of circular fingerprints (red), neural graph fingerprints with fixed large random weights (green) and neural graph fingerprints with fixed small random weights (blue). The performance of neural graph fingerprints with large random weights closely matches the performance of circular fingerprints.
图 3:左: 用圆形指纹,以及具有很大随机权重的神经图指纹,测得的分子两两距离对照。右: 圆形指纹(红)、具有固定大随机权重的神经图指纹(绿),以及具有固定小随机权重的神经图指纹(蓝)的预测表现。具有大随机权重的神经图指纹,其表现与圆形指纹非常接近。
First, we examined whether distances between circular fingerprints were similar to distances between neural fingerprint-based distances. Figure 3 (left) shows a scatterplot of pairwise distances between circular vs. neural fingerprints. Fingerprints had length 2048, and were calculated on pairs of molecules from the solubility dataset [4]. Distance was measured using a continuous generalization of the Tanimoto (a.k.a. Jaccard) similarity measure, given by
首先,我们考察圆形指纹之间的距离,是否类似于基于神经指纹的距离。图 3 (左)给出了圆形指纹与神经指纹两两距离的散点图。指纹长度为 2048,计算对象是溶解度数据集 [4] 中的成对分子。距离采用 Tanimoto(又称 Jaccard)相似度的一种连续推广来度量,其定义为
There is a correlation of between the distances. The line of points on the right of the plot shows that for some pairs of molecules, binary ECFP fingerprints have exactly zero overlap.
这些距离之间的相关系数为 。图右侧那条点列表明,对有些分子对,二值 ECFP 指纹的重叠恰好为零。
Second, we examined the predictive performance of neural fingerprints with large random weights vs. that of circular fingerprints. Figure 3 (right) shows average predictive performance on the solubility dataset, using linear regression on top of fingerprints. The performances of both methods follow similar curves. In contrast, the performance of neural fingerprints with small random weights follows a different curve, and is substantially better. This suggests that even with random weights, the relatively smooth activation of neural fingerprints helps generalization performance.
其次,我们考察了具有很大随机权重的神经指纹,相对于圆形指纹的预测表现。图 3(右)给出了在溶解度数据集上的平均预测表现,指纹之上使用的是线性回归。两种方法的表现沿着相似的曲线变化。相比之下,具有较小随机权重的神经指纹走的是另一条曲线,而且明显更好。这说明即便权重是随机的,神经指纹相对平滑的激活也有助于泛化表现。
4.1 Examining learned features
4.1 考察学到的特征
To demonstrate that neural graph fingerprints are interpretable, we show substructures which most activate individual features in a fingerprint vector. Each feature of a circular fingerprint vector can each only be activated by a single fragment of a single radius, except for accidental collisions. In contrast, neural graph fingerprint features can be activated by variations of the same structure, making them more interpretable, and allowing shorter feature vectors.
为了表明神经图指纹是可解释的,我们展示最能激活指纹向量中各个特征的那些子结构。圆形指纹向量的每一个特征,除了意外碰撞之外,都只能被某一种半径下的某一个片段激活。相比之下,神经图指纹的特征可以被同一结构的变体激活,从而使它们更可解释,也允许使用更短的特征向量。
Solubility features
Figure 4 shows the fragments that maximally activate the most predictive features of a fingerprint. The fingerprint network was trained as inputs to a linear model predicting solubility, as measured in [4]. The feature shown in the top row has a positive predictive relationship with solubility, and is most activated by fragments containing a hydrophilic R-OH group, a standard indicator of solubility. The feature shown in the bottom row, strongly predictive of insolubility, is activated by non-polar repeated ring structures.
溶解度特征
图 4 给出了最能激活指纹中最有预测力的那些特征的片段。指纹网络被训练成一个线性模型的输入,用来预测 [4] 中测定的溶解度。最上一行所示的特征与溶解度有正向的预测关系,并且最常被含有亲水 R-OH 基团的片段激活,而这是溶解度的一个标准指示。最下一行所示的特征强烈预示难溶,它被非极性的重复环结构激活。
Figure 4: Examining fingerprints optimized for predicting solubility. Shown here are representative examples of molecular fragments (highlighted in blue) which most activate different features of the fingerprint. Top row: The feature most predictive of solubility. Bottom row: The feature most predictive of insolubility.
图 4:考察为预测溶解度而优化的指纹。这里给出的是最能激活指纹不同特征的代表性分子片段(用蓝色标出)。上行: 对溶解度最有预测力的特征。下行: 对难溶最有预测力的特征。
Toxicity features
We trained the same model architecture to predict toxicity, as measured in two different datasets in [26]. Figure 5 shows fragments which maximally activate the feature most predictive of toxicity, in two separate datasets.
毒性特征
我们用同一模型结构来预测毒性,毒性由 [26] 中两个不同数据集测定。图 5 给出了在两个分开的数据集上,最能激活对毒性最有预测力的那个特征的片段。
Figure 5: Visualizing fingerprints optimized for predicting toxicity. Shown here are representative samples of molecular fragments (highlighted in red) which most activate the feature most predictive of toxicity. Top row: the most predictive feature identifies groups containing a sulphur atom attached to an aromatic ring. Bottom row: the most predictive feature identifies fused aromatic rings, also known as polycyclic aromatic hydrocarbons, a well-known carcinogen.
图 5:可视化为预测毒性而优化的指纹。这里给出的是最能激活对毒性最有预测力的那个特征的代表性分子片段(用红色标出)。上行: 最有预测力的特征识别出含有连在芳香环上的硫原子的基团。下行: 最有预测力的特征识别出稠合芳香环,也称为多环芳烃,这是一种著名的致癌物。
[27] constructed similar visualizations, but in a semi-manual way: to determine which toxic fragments activated a given neuron, they searched over a hand-made list of toxic substructures and chose the one most correlated with a given neuron. In contrast, our visualizations are generated automatically, without the need to restrict the range of possible answers beforehand.
[27] 也曾构造过类似的可视化,但方式是半手工的:为了判断哪些毒性片段激活了某个神经元,他们在一份手工列出的毒性子结构清单上搜索,并选出与该神经元最相关的那一个。相比之下,我们的可视化是自动生成的,不必事先限制可能答案的范围。
4.2 Predictive Performance
4.2 预测表现
We ran several experiments to compare the predictive performance of neural graph fingerprints to that of the standard state-of-the-art setup: circular fingerprints fed into a fully-connected neural network.
我们做了若干实验,把神经图指纹的预测表现,与当时标准的最先进设置相对照:把圆形指纹送进一个全连接神经网络。
Experimental setup
Our pipeline takes as input the SMILES [30] string encoding of each molecule, which is then converted into a graph using RDKit [20]. We also used RDKit to produce the extended circular fingerprints used in the baseline. Hydrogen atoms were treated implicitly.
实验设置
我们的流水线以每个分子的 SMILES [30] 字符串编码作为输入,再用 RDKit [20] 把它转换成图。我们也用 RDKit 生成基线中使用的扩展圆形指纹。氢原子被隐式处理。
In our convolutional networks, the initial atom and bond features were chosen to be similar to those used by ECFP: Initial atom features concatenated a one-hot encoding of the atom’s element, its degree, the number of attached hydrogen atoms, and the implicit valence, and an aromaticity indicator. The bond features were a concatenation of whether the bond type was single, double, triple, or aromatic, whether the bond was conjugated, and whether the bond was part of a ring.
在我们的卷积网络中,初始的原子和键特征被选成与 ECFP 所用的相近:初始原子特征拼接了原子元素的 one-hot 编码、它的度数、所连接的氢原子数、隐式化合价,以及一个芳香性指示。键特征则拼接了该键是单键、双键、三键还是芳香键,该键是否共轭,以及该键是否属于一个环。
Training and Architecture
Training used batch normalization [11]. We also experimented with tanh vs relu activation functions for both the neural fingerprint network layers and the fully-connected network layers. relu had a slight but consistent performance advantage on the validation set. We also experimented with dropconnect [29], a variant of dropout in which weights are randomly set to zero instead of hidden units, but found that it led to worse validation error in general. Each experiment optimized for 10000 minibatches of size 100 using the Adam algorithm [13], a variant of RMSprop that includes momentum.
训练与结构
训练使用了批归一化 [11]。我们还为神经指纹网络层和全连接网络层,试验过 tanh 与 relu 两种激活函数。relu 在验证集上有轻微但一致的优势。我们也试验过 dropconnect [29],这是 dropout 的一种变体,随机置零的是权重而不是隐单元,但发现它通常会带来更差的验证误差。每个实验用 Adam 算法 [13] 优化 10000 个大小为 100 的 minibatch,Adam 是包含动量的一种 RMSprop 变体。
Hyperparameter Optimization
To optimize hyperparameters, we used random search. The hyperparameters of all methods were optimized using 50 trials for each cross-validation fold. The following hyperparameters were optimized: log learning rate, log of the initial weight scale, the log penalty, fingerprint length, fingerprint depth (up to 6), and the size of the hidden layer in the fully-connected network. Additionally, the size of the hidden feature vector in the convolutional neural fingerprint networks was optimized.
超参数优化
为了优化超参数,我们使用了随机搜索。所有方法的超参数都在每个交叉验证折上用 50 次试验来优化。被优化的超参数包括:对数学习率、初始权重尺度的对数、对数 惩罚、指纹长度、指纹深度(最多到 6),以及全连接网络中隐层的大小。此外,卷积神经指纹网络中隐特征向量的大小也被优化。
Datasets
We compared the performance of standard circular fingerprints against neural graph fingerprints on a variety of domains:
数据集
我们在多个领域上对照了标准圆形指纹与神经图指纹的表现:
- • Solubility: The aqueous solubility of 1144 molecules as measured by [4].
- 溶解度: [4] 所测定的 1144 个分子的水溶解度。
- • Drug efficacy: The half-maximal effective concentration (EC50) in vitro of 10,000 molecules against a sulfide-resistant strain of P. falciparum, the parasite that causes malaria, as measured by [5].
- 药效: 10,000 个分子对一种耐硫化物的恶性疟原虫(P. falciparum,引起疟疾的寄生虫)菌株的体外半数有效浓度(EC50),由 [5] 测定。
- • Organic photovoltaic efficiency: The Harvard Clean Energy Project [8] uses expensive DFT simulations to estimate the photovoltaic efficiency of organic molecules. We used a subset of 20,000 molecules from this dataset.
- 有机光伏效率: 哈佛清洁能源项目 [8] 用昂贵的 DFT 模拟来估计有机分子的光伏效率。我们使用了该数据集中 20,000 个分子的一个子集。
Predictive accuracy
We compared the performance of circular fingerprints and neural graph fingerprints under two conditions: In the first condition, predictions were made by a linear layer using the fingerprints as input. In the second condition, predictions were made by a one-hidden-layer neural network using the fingerprints as input. In all settings, all differentiable parameters in the composed models were optimized simultaneously. Results are summarized in Table 1.
预测精度
我们在两种条件下对照圆形指纹和神经图指纹的表现:第一种条件下,预测由以指纹为输入的线性层做出;第二种条件下,预测由以指纹为输入的单隐层神经网络做出。在所有设置中,组合模型里的全部可微参数都同时优化。结果汇总于表 1。
| Dataset | Solubility [4] | Drug efficacy [5] | Photovoltaic efficiency [8] |
|---|---|---|---|
| Units | log Mol/L | EC50 in nM | percent |
| Predict mean | 4.29 0.40 | 1.47 0.07 | 6.40 0.09 |
| Circular FPs + linear layer | 1.71 0.13 | 1.13 0.03 | 2.63 0.09 |
| Circular FPs + neural net | 1.40 0.13 | 1.36 0.10 | 2.00 0.09 |
| Neural FPs + linear layer | 0.77 0.11 | 1.15 0.02 | 2.58 0.18 |
| Neural FPs + neural net | 0.52 0.07 | 1.16 0.03 | 1.43 0.09 |
Table 1: Mean predictive accuracy of neural fingerprints compared to standard circular fingerprints.
| 数据集 | 溶解度 [4] | 药效 [5] | 光伏效率 [8] |
|---|---|---|---|
| 单位 | log Mol/L | EC50,单位 nM | 百分比 |
| 预测均值 | 4.29 0.40 | 1.47 0.07 | 6.40 0.09 |
| 圆形指纹 + 线性层 | 1.71 0.13 | 1.13 0.03 | 2.63 0.09 |
| 圆形指纹 + 神经网络 | 1.40 0.13 | 1.36 0.10 | 2.00 0.09 |
| 神经指纹 + 线性层 | 0.77 0.11 | 1.15 0.02 | 2.58 0.18 |
| 神经指纹 + 神经网络 | 0.52 0.07 | 1.16 0.03 | 1.43 0.09 |
表 1:神经指纹相对于标准圆形指纹的平均预测精度。
In all experiments, the neural graph fingerprints matched or beat the accuracy of circular fingerprints, and the methods with a neural network on top of the fingerprints typically outperformed the linear layers.
在所有实验中,神经图指纹的精度都不低于圆形指纹,而在指纹之上再接神经网络的方法,通常优于线性层。
Software
Automatic differentiation (AD) software packages such as Theano [1] significantly speed up development time by providing gradients automatically, but can only handle limited control structures and indexing. Since we required relatively complex control flow and indexing in order to implement variants of Algorithm 2, we used a more flexible automatic differentiation package for Python called Autograd (github.com/HIPS/autograd). This package handles standard Numpy [18] code, and can differentiate code containing while loops, branches, and indexing.
软件
Theano [1] 这类自动微分(AD)软件包通过自动提供梯度,显著加快了开发速度,但只能处理有限的控制结构和索引。由于我们在实现算法 2 的变体时需要相对复杂的控制流和索引,我们使用了一个更灵活的 Python 自动微分包,叫做 Autograd(github.com/HIPS/autograd)。这个包可以处理标准的 Numpy [18] 代码,并且能够对包含 while 循环、分支和索引的代码求微分。
Code for computing neural fingerprints and producing visualizations is available at github.com/HIPS/neural-fingerprint.
用于计算神经指纹并生成可视化的代码,可在 github.com/HIPS/neural-fingerprint 获取。
5 Limitations
5 局限
Computational cost
Neural fingerprints have the same asymptotic complexity in the number of atoms and the depth of the network as circular fingerprints, but have additional terms due to the matrix multiplies necessary to transform the feature vector at each step. To be precise, computing the neural fingerprint of depth , fingerprint length of a molecule with atoms using a molecular convolutional net having features at each layer costs . In practice, training neural networks on top of circular fingerprints usually took several minutes, while training both the fingerprints and the network on top took on the order of an hour on the larger datasets.
计算代价
神经指纹在原子数和网络深度上的渐近复杂度与圆形指纹相同,但由于每一步变换特征向量时需要做矩阵乘法,会多出一些项。精确地说,用每一层有 个特征的分子卷积网络,计算一个有 个原子的分子、深度为 、指纹长度为 的神经指纹,代价是 。在实践中,在圆形指纹之上训练神经网络通常只要几分钟,而同时训练指纹及其上的网络,在较大的数据集上大约需要一个小时。
Limited computation at each layer
How complicated should we make the function that goes from one layer of the network to the next? In this paper we chose the simplest feasible architecture: a single layer of a neural network. However, it may be fruitful to apply multiple layers of nonlinearities between each message-passing step (as in [22]), or to make information preservation easier by adapting the Long Short-Term Memory [10] architecture to pass information upwards.
每一层的计算有限
从网络的一层走到下一层的函数,应该做成多复杂?在本文中我们选择了可行范围内最简单的结构:一层神经网络。不过,在每一步消息传递之间施加多层非线性(如 [22]),或者改用长短期记忆 [10] 结构让信息更容易向上保存,也许会有收获。
Limited information propagation across the graph
The local message-passing architecture developed in this paper scales well in the size of the graph (due to the low degree of organic molecules), but its ability to propagate information across the graph is limited by the depth of the network. This may be appropriate for small graphs such as those representing the small organic molecules used in this paper. However, in the worst case, it can take a depth network to distinguish between graphs of size . To avoid this problem, [2] proposed a hierarchical clustering of graph substructures. A tree-structured network could examine the structure of the entire graph using only layers, but would require learning to parse molecules. Techniques from natural language processing [25] might be fruitfully adapted to this domain.
跨图的信息传播有限
本文发展的局部消息传递结构,在图的规模上扩展性很好(因为有机分子的度数较低),但它把信息传到图的远处的能力,受到网络深度的限制。对本文所用的那些表示小有机分子的小图来说,这或许是合适的。但在最坏情况下,要区分大小为 的图,可能需要深度为 的网络。为避免这个问题,[2] 提出对图的子结构做层次聚类。树状结构的网络只需 层就能考察整张图的结构,但需要学会解析分子。自然语言处理中的技术 [25] 或许可以有效地迁移到这一领域。
Inability to distinguish stereoisomers
Special bookkeeping is required to distinguish between stereoisomers, including enantomers (mirror images of molecules) and cis/trans isomers (rotation around double bonds). Most circular fingerprint implementations have the option to make these distinctions. Neural fingerprints could be extended to be sensitive to stereoisomers, but this remains a task for future work.
无法区分立体异构体
要区分立体异构体,包括对映异构体(分子的镜像)和 顺/反 异构体(绕双键的旋转),需要专门的记账。大多数圆形指纹实现都提供做出这些区分的选项。神经指纹也可以扩展成对立体异构体敏感,但这仍是留给以后的工作。
6 Related work
6 相关工作
This work is similar in spirit to the neural Turing machine [7], in the sense that we take an existing discrete computational architecture, and make each part differentiable in order to do gradient-based optimization.
这项工作在精神上类似于神经图灵机 [7]:我们取一个已有的离散计算结构,并把每一部分做成可微的,以便做基于梯度的优化。
Neural nets for quantitative structure-activity relationship (QSAR)
The modern standard for predicting properties of novel molecules is to compose circular fingerprints with fully-connected neural networks or other regression methods. [3] used circular fingerprints as inputs to an ensemble of neural networks, Gaussian processes, and random forests. [19] used circular fingerprints (of depth 2) as inputs to a multitask neural network, showing that multiple tasks helped performance.
用于定量构效关系(QSAR)的神经网络
预测新分子性质的现代标准做法,是把圆形指纹与全连接神经网络或其他回归方法组合起来。[3] 把圆形指纹作为输入,送给神经网络、高斯过程和随机森林的集成。[19] 把圆形指纹(深度为 2)作为多任务神经网络的输入,表明多个任务有助于提高表现。
Neural graph fingerprints
The most closely related work is [15], who build a neural network having graph-valued inputs. Their approach is to remove all cycles and build the graph into a tree structure, choosing one atom to be the root. A recursive neural network [23, 24] is then run from the leaves to the root to produce a fixed-size representation. Because a graph having nodes has possible roots, all possible graphs are constructed. The final descriptor is a sum of the representations computed by all distinct graphs. There are as many distinct graphs as there are atoms in the network. The computational cost of this method thus grows as , where is the size of the feature vector and is the number of atoms, making it less suitable for large molecules.
神经图指纹
最密切相关的工作是 [15],他们构建了一个以图为输入的神经网络。他们的做法是去掉所有环,并把图建成一棵树,选定一个原子作为根。然后从叶到根运行一个递归神经网络 [23, 24],得到一个固定大小的表示。因为一张有 个节点的图有 个可能的根,所有 种可能的图都会被构造出来。最终描述子是所有不同图算出的表示之和。不同图的数目与网络中的原子数一样多。因此该方法的计算代价按 增长,其中 是特征向量的大小, 是原子数,不太适合大分子。
Convolutional neural networks
Convolutional neural networks have been used to model images, speech, and time series [14]. However, standard convolutional architectures use a fixed computational graph, making them difficult to apply to objects of varying size or structure, such as molecules. More recently, [12] and others have developed a convolutional neural network architecture for modeling sentences of varying length.
卷积神经网络
卷积神经网络已被用来建模图像、语音和时间序列 [14]。不过,标准卷积结构使用固定的计算图,因而难以应用到大小或结构可变的对象上,例如分子。更近一些,[12] 等人发展了一种卷积网络结构,用来建模长度可变的句子。
Neural networks on fixed graphs
[2] introduce convolutional networks on graphs in the regime where the graph structure is fixed, and each training example differs only in having different features at the vertices of the same graph. In contrast, our networks address the situation where each training input is a different graph.
固定图上的神经网络
[2] 在图结构固定的设定下引入了图上的卷积网络,每个训练例子的差别只在于同一张图的顶点上具有不同的特征。相比之下,我们的网络处理的是每个训练输入都是一张不同的图的情形。
Neural networks on input-dependent graphs
[22] propose a neural network model for graphs having an interesting training procedure. The forward pass consists of running a message-passing scheme to equilibrium, a fact which allows the reverse-mode gradient to be computed without storing the entire forward computation. They apply their network to predicting mutagenesis of molecular compounds as well as web page rankings. [16] also propose a neural network model for graphs with a learning scheme whose inner loop optimizes not the training loss, but rather the correlation between each newly-proposed vector and the training error residual. They apply their model to a dataset of boiling points of 150 molecular compounds. Our paper builds on these ideas, with the following differences: Our method replaces their complex training algorithms with simple gradient-based optimization, generalizes existing circular fingerprint computations, and applies these networks in the context of modern QSAR pipelines which use neural networks on top of the fingerprints to increase model capacity.
依赖于输入的图上的神经网络
[22] 提出了一种图的神经网络模型,其训练过程很有意思。前向过程是把一种消息传递方案运行到平衡,这一事实使得反向模式的梯度可以在不必存储全部前向计算的情况下算出。他们把网络用到预测分子化合物的致突变性以及网页排序上。[16] 也提出了一种图的神经网络模型,其学习方案的内层循环优化的不是训练损失,而是每个新提出的向量与训练误差残差之间的相关。他们把模型用到 150 种分子化合物的沸点数据集上。本文建立在这些想法之上,差别如下:我们的方法用简单的基于梯度的优化替换了他们复杂的训练算法,推广了已有的圆形指纹计算,并把这些网络放到现代 QSAR 流水线的语境中——在指纹之上再用神经网络来增加模型容量。
Unrolled inference algorithms
[9] and others have noted that iterative inference procedures sometimes resemble the feedforward computation of a recurrent neural network. One natural extension of these ideas is to parameterize each inference step, and train a neural network to approximately match the output of exact inference using only a small number of iterations. The neural fingerprint, when viewed in this light, resembles an unrolled message-passing algorithm on the original graph.
展开的推断算法
[9] 等人注意到,迭代推断过程有时类似于循环神经网络的前馈计算。这些想法的一个自然推广,是把每一步推断参数化,并训练一个神经网络,使其只用少量迭代就能近似匹配精确推断的输出。在这个角度看,神经指纹类似于在原来的图上展开的消息传递算法。
7 Conclusion
7 结论
We generalized existing hand-crafted molecular features to allow their optimization for diverse tasks. By making each operation in the feature pipeline differentiable, we can use standard neural-network training methods to scalably optimize the parameters of these neural molecular fingerprints end-to-end. We demonstrated the interpretability and predictive performance of these new fingerprints.
我们推广了已有的手工设计分子特征,使它们可以为多样化的任务而优化。通过把特征流水线中的每一步运算做成可微的,我们可以使用标准的神经网络训练方法,可扩展地、端到端地优化这些神经分子指纹的参数。我们展示了这些新指纹的可解释性和预测表现。
Data-driven features have already replaced hand-crafted features in speech recognition, machine vision, and natural-language processing. Carrying out the same task for virtual screening, drug design, and materials design is a natural next step.
在语音识别、机器视觉和自然语言处理中,数据驱动的特征已经取代了手工设计的特征。把同一件事做到虚拟筛选、药物设计和材料设计上,是自然的下一步。
Acknowledgments
致谢
We thank Edward Pyzer-Knapp, Jennifer Wei, and Samsung Advanced Institute of Technology for their support. This work was partially funded by NSF IIS-1421780.
我们感谢 Edward Pyzer-Knapp、Jennifer Wei 以及三星综合技术院的支持。本工作部分由 NSF IIS-1421780 资助。
References
参考文献
[1] Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, James Bergstra, Ian J. Goodfellow, Arnaud Bergeron, Nicolas Bouchard, and Yoshua Bengio. Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop, 2012.
[2] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203 , 2013.
[3] George E. Dahl, Navdeep Jaitly, and Ruslan Salakhutdinov. Multi-task neural networks for QSAR predictions. arXiv preprint arXiv:1406.1231 , 2014.
[4] John S. Delaney. ESOL: Estimating aqueous solubility directly from molecular structure. Journal of Chemical Information and Computer Sciences , 44(3):1000–1005, 2004.
[5] Francisco-Javier Gamo, Laura M Sanz, Jaume Vidal, Cristina de Cozar, Emilio Alvarez, Jose-Luis Lavandera, Dana E Vanderwall, Darren VS Green, Vinod Kumar, Samiul Hasan, et al. Thousands of chemical starting points for antimalarial lead identification. Nature , 465(7296):305–310, 2010.
[6] Robert C. Glem, Andreas Bender, Catrin H. Arnby, Lars Carlsson, Scott Boyer, and James Smith. Circular fingerprints: flexible molecular descriptors with applications from physical chemistry to ADME. IDrugs: the investigational drugs journal , 9(3):199–204, 2006.
[7] Alex Graves, Greg Wayne, and Ivo Danihelka. Neural Turing machines. arXiv preprint arXiv:1410.5401 , 2014.
[8] Johannes Hachmann, Roberto Olivares-Amaya, Sule Atahan-Evrenk, Carlos Amador-Bedolla, Roel S Sánchez-Carrera, Aryeh Gold-Parker, Leslie Vogt, Anna M Brockway, and Alán Aspuru-Guzik. The Harvard clean energy project: large-scale computational screening and design of organic photovoltaics on the world community grid. The Journal of Physical Chemistry Letters , 2(17):2241–2251, 2011.
[9] John R Hershey, Jonathan Le Roux, and Felix Weninger. Deep unfolding: Model-based inspiration of novel deep architectures. arXiv preprint arXiv:1409.2574 , 2014.
[10] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation , 9(8):1735–1780, 1997.
[11] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167 , 2015.
[12] Nal Kalchbrenner, Edward Grefenstette, and Phil Blunsom. A convolutional neural network for modelling sentences. Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics , June 2014.
[13] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 , 2014.
[14] Yann LeCun and Yoshua Bengio. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks , 3361, 1995.
[15] Alessandro Lusci, Gianluca Pollastri, and Pierre Baldi. Deep architectures and deep learning in chemoinformatics: the prediction of aqueous solubility for drug-like molecules. Journal of chemical information and modeling , 53(7):1563–1575, 2013.
[16] Alessio Micheli. Neural network for graphs: A contextual constructive approach. Neural Networks, IEEE Transactions on , 20(3):498–511, 2009.
[17] H.L. Morgan. The generation of a unique machine description for chemical structure. Journal of Chemical Documentation , 5(2):107–113, 1965.
[18] Travis E Oliphant. Python for scientific computing. Computing in Science & Engineering , 9(3):10–20, 2007.
[19] Bharath Ramsundar, Steven Kearnes, Patrick Riley, Dale Webster, David Konerding, and Vijay Pande. Massively multitask networks for drug discovery. arXiv:1502.02072 , 2015.
[20] RDKit: Open-source cheminformatics. www.rdkit.org . [accessed 11-April-2013].
[21] David Rogers and Mathew Hahn. Extended-connectivity fingerprints. Journal of Chemical Information and Modeling , 50(5):742–754, 2010.
[22] F. Scarselli, M. Gori, Ah Chung Tsoi, M. Hagenbuchner, and G. Monfardini. The graph neural network model. Neural Networks, IEEE Transactions on , 20(1):61–80, Jan 2009.
[23] Richard Socher, Eric H Huang, Jeffrey Pennin, Christopher D Manning, and Andrew Y Ng. Dynamic pooling and unfolding recursive autoencoders for paraphrase detection. In Advances in Neural Information Processing Systems , pages 801–809, 2011.
[24] Richard Socher, Jeffrey Pennington, Eric H Huang, Andrew Y Ng, and Christopher D Manning. Semi-supervised recursive autoencoders for predicting sentiment distributions. In Proceedings of the Conference on Empirical Methods in Natural Language Processing , pages 151–161. Association for Computational Linguistics, 2011.
[25] Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075 , 2015.
[26] Tox21 Challenge. National center for advancing translational sciences. http://tripod.nih.gov/tox21/challenge , 2014. [Online; accessed 2-June-2015].
[27] Thomas Unterthiner, Andreas Mayr, Günter Klambauer, and Sepp Hochreiter. Toxicity prediction using deep learning. arXiv preprint arXiv:1503.01445 , 2015.
[28] Thomas Unterthiner, Andreas Mayr, G ünter Klambauer, Marvin Steijaert, Jörg Wenger, Hugo Ceulemans, and Sepp Hochreiter. Deep learning as an opportunity in virtual screening. In Advances in Neural Information Processing Systems , 2014.
[29] Li Wan, Matthew Zeiler, Sixin Zhang, Yann L. Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In International Conference on Machine Learning , 2013.
[30] David Weininger. SMILES, a chemical language and information system. Journal of chemical information and computer sciences , 28(1):31–36, 1988.




