To date, many scholars have proposed graph convolution networks (GCNs) in the spectral perspective, such as GCN with Chebyshev expansion (ChebConv) (Defferrard et al., 2016) and semi-supervised classification with GCN (GCNConv) (Kipf and Welling, 2017). Other non-spectral graph neural networks (GNNs) have also been proposed, such as GraphSAGE (Hamilton et al., 2017) and Graph Attention Network (GAT) (Velickovic et al., 2018), which have a similar function as GCN. However, all of these GCNs focus on the graph information aggregation rather than the pooling mechanism.
Pooling (downsampling) (Krizhevsky et al., 2012)(Lee et al., 2018) plays an important role in CNN because it can reduce the amount of data and acceletare the calculation, which facilitates the design of deep CNN and obtains improved performance. In recent years, a few methods studied graph pooling to utilize the pooling mechanism in GCN, which is used to reduce the number of nodes and edges in the graph. Some of the graph pooling methods use clusters of nodes to generate the pooled graph topology, such as DiffPool (Ying et al., 2018) and EigenPooling (Ma et al., 2019), where several nodes are combined to generate new nodes through the assignment matrix. Others are top-k selection methods, such as gPool (H. and S, 2019) and SAGPool (Lee et al., 2019), in which node features and local structural information are used to compute the importance of the node, and then top-k nodes are selected as the pooling results. The pooled graph topology is decided by the selected top-k graph nodes.
However, the existing top-k selection graph pooling methods face two problems. First, in generating the pooled graph topology, these methods do not explicitly consider the graph structure and node feature representation together. Second, regarding the feature representations of the pooled nodes, the original features of the selected nodes are used as a new feature, and the features of the unselected nodes are discarded. Therefore, substantial graph information is lost in the pooling process, which may be important information on the graph.
In this paper, we propose a graph self-adaptive pooling (GSAPool) method to address these problems. Regarding the graph topology generation, our method evaluates in multiple ways the importance of nodes in accordance with the local structure and the feature information of the nodes. Regarding the feature generation after the pooling nodes are chosen, the feature aggregating process is used to ensure that the feature representation of the pooled nodes contain sufficiently effective information from the graph.
2. Related Work
A graph is a data structure that can be represented by a set , where is the set of nodes and is the set of edges. Generally, the adjacency matrix indicates which nodes are connected and which edges are attributed. Therefore, this matrix is used to describe the structural information of the graph. In addition, the feature matrix is used to represent the node feature representation of the graph.
2.1. Graph Convolution
GCNs (Bruna et al., 2014)(Yan et al., 2018)(Yao et al., 2019) can be divided into two domains: spectral and non-spectral methods. Spectral methods utilize Laplacian matrix as spectral operator to refine the convolution in Fourier field. ChebConv (Defferrard et al., 2016)
uses the Laplacian matrix directly as a convolution operator. Without eigenvector decomposition, the number of parameters is reduced and the calculation can be accelerated. GCNConv(Kipf and Welling, 2017) extends convolution to the data of graph structure, which can obtain better graph representation and performs well in the semi-supervised task. By contrast, non-spectral approaches are meant to work directly on graphs in which the central node aggregates features from the neighbor nodes layer by layer. GraphSAGE (Hamilton et al., 2017) generates node embeddings by aggregating node feature information in neighborhood. GAT (Velickovic et al., 2018) uses attention mechanism and calculates the attention score of adjacent nodes as weight value for feature information in the aggregation process.
2.2. Graph Pooling
Pooling can enable CNNs to decrease the amount of parameters by scaling down the size of the input, which makes the training process highly efficient. Similar to CNN, the pooling mechanism can enable GNNs to reduce the parameters for better performance. From our perspective, the current pooling methods can be divided into two categories: cluster and top-k selection poolings.
Cluster Pooling: DiffPool (Ying et al., 2018) and EigenPooling (Ma et al., 2019) use cluster algorithms to decide the pooled graph topology, i.e., to select the new nodes in the pooling process. Assignment matrix is utilized to generate node clusters. In the assignment matrix, each column corresponds to the nodes of the graph before pooling, and the rows represent the nodes in the pooling results. The concrete expression of the updating process for the adjacency and the feature matrices are denoted as follows:
where indicates the assignment matrix, is the adjacency matrix, and is the feature matrix.
Similarly, in EigenPooling, the assignment matrix is used to update the graph information. The difference is that a pooling operator is utilized to refine the feature matrix. First, the graph is divided into several subgraphs in accordance with the assignment matrix. Then, the eigenvectors of the subgraphs are calculated by the Laplacian matrix as the pooling operator.
Top-k Selection Pooling: SAGPool (Lee et al., 2019) is a top-k selection pooling method in which the pooled graph topology is decided by the selected nodes. In SAGPool, GCNConv (Kipf and Welling, 2017) is used to evaluate the importance of the nodes. Although GCNConv considers structure and feature information simultaneously, it uses the information implicitly. When obtaining the importance value of every node, several nodes with high scores are selected as the pooled graph.
In gPool (H. and S, 2019)
, a learning vector maps the node feature into the importance scores. Then, the nodes are selected in accordance with the score. The following equation describes the calculation of the score:
where is the score vector that saves the feature scores of all nodes. is the feature matrix and is the learning vector of layer . Compared with SAGPool, gPool does not consider the graph structural information as a part of the importance score.
In cluster pooling algorithms, when generating the assignment matrix, the structure and feature information are used implicitly, thereby leading to the unreasonableness of the assignment matrix. In top-k selection pooling methods, the importance of nodes is considered from a single perspective, which is simplistic. Moreover, the features of the pooled nodes are still the original features, and the feature information of the unselected nodes is directly lost. To address these problems, we consider that in generating the pooled graph topology, the node selection approaches should be diverse, and the feature information of the pooled nodes should include features of the adjacent nodes. Therefore, we use additional evaluation standards for each node to generate highly accurate pooled graph topology. Furthermore, we use feature fusion method to enhance the feature representation ability of the pooled graph. As a result, our method of pooled graph generation is considerably diverse, objective, and accurate.
3. Proposed Methods
3.1. Pooling Topology Learning
The pooling topology learning method contains three parts: the structure-based topology learning (SBTL), the feature-based topology learning (FBTL), and the structure-feature topology learning (SFTL). The details of the learning method are illustrated in Figure 1.
SBTL: In general, a graph contains numerous nodes and edges, which indicate rich structural information. Therefore, it is effective to evaluate the importance of each node in accordance with its structural information. Given that GCNConv (Kipf and Welling, 2017) considers structural information, this method is suitable for evaluating the importance of a node. The expression of GCNConv is illustrated as follows:
where is the structural information score of a node calculated by GCNConv, is the sum of the degree and identity matrices of a graph, is composed of the adjency matrix and identity matrices, is the feature matrix and is the weight vector.
is the activate function often used in neural networks, such astanh and sigmoid.
As a complement, the score function kernel can be easliy replaced by other GNNs, such as ChebConv (Defferrard et al., 2016), GraphSAGE (Hamilton et al., 2017) and GAT (Velickovic et al., 2018), which can be expressed as follows:
FBTL: In graph data, nodes usually contain feature information. Utilizing the node feature information for evaluation is important because a node can be largely represented by its feature. The effect of a node feature cannot be ignored.
We take a MLP (Hopfield, 1982)
as the node feature extracting method because it is adaptive to aggregate feature information. The expression is as follows:
where X is the node feature matrix and is the activate function. is the aggregation of node feature, which can be regarded as node evaluation value. In accordance with the aggregation results, it can reserve additional important nodes.
SFTL: GCNConv (Kipf and Welling, 2017) is effective in refining the local structural information of a graph. Moreover, MLP (Hopfield, 1982) focuses on the feature information of a node. To make the standard of node evaluation highly objective and robust, we use the two methods to calculate the importance scores of the nodes. The diversity of the evaluation effectively increased by considering two different node evaluation methods synthetically, which reinforces the objectivity of the selection of final nodes. The combination is expressed as follows:
is a user-defined hyperparameter. We sort the nodes in accordance with their scores, and use the top-k nodes as the pooling results.
3.2. Pooled Node Feature Representation
In the top-k selection pooling methods, only parts of nodes are selected as the pooling results. To use the information of the unselected nodes, we have to aggregate the features of the nodes before discarding them. The feature information of the nodes can be used more sufficiently, which makes the final graph embedding vector more representative. Figure 2 shows the details of the feature fusion.
where is the feature vector of node and represents the neighbor nodes of node . is the number of the adjacent nodes of node . is the attention value between and and is the weight matrix.
With the help of these fusion methods, the selected nodes can carry the feature information from the neighbor nodes. In this manner, the pooling result can highly represent the entire graph, as proven by our experimental results.
3.3. Model Architecture
To verify whether our proposed method is effective, four graph datasets (K et al., 2016b) are used in the experiments. DD (D and J, 2013)(N et al., 2011) contains graphs representing protein structures and the node is an amino acid. The graph labels indicate whether the protein is an enzyme. NCI-1 (N. et al., 2008)(N et al., 2011) and NCI-109 (N. et al., 2008)(N et al., 2011) are biological datasets used for anticancer activity classification. Every graph represents a chemical compound structure in which nodes and edges correspond to atoms and chemical bonds. Mutagenicity (Kazius et al., 2005)(Riesen and Bunke, 2008) is a dataset that contains compounds used for medicine. The label of the compound indicates whether it has mutagenicity attributes. Table 1 summarizes the statistics of the datasets.
|Datasets||Number of Graphs||Number of Classes||Average Number of Nodes||Average Number of Edges|
|Evaluation Functions||Type||Datasets||Average Accuracy|
|GraphSAGE(Hamilton et al., 2017)||✓||69.76|
|GAT(Velickovic et al., 2018)||✓||70.85|
|GCNConv(Kipf and Welling, 2017)||✓||✓||71.11|
|ChebConv(Defferrard et al., 2016)||✓||✓||75.18|
|gPool(H. and S, 2019)||68.90|
|SAGPool(Lee et al., 2019)||72.16|
|SET2SET(O et al., 2015)||74.50||71.50||68.60||76.40||72.75|
|DiffPool(Ying et al., 2018)||78.00||76.00||74.10||80.60||77.18|
|EigenPooling(Ma et al., 2019)||78.60||77.00||74.90||79.50||77.50|
4.2. Training Configurations
4.3. Ablation Study
Hyperparameter Analysis: Two hyperparameters are used in our experiments: pooling ratio and combination weight . For the pooling ratio, there are three value used: 0.25, 0.5 and 0.75. When the pooling ratio is 0.25, the pooling method performs not so well because the selected feature information is little. And the performance is not good when pooling ratio is 0.75, for the graph retaining too much redundant information. Therefore, 0.5 is finally taken as the pooling ratio. is an empirical value, and several values are tested to find the best. Finally, we find that when the dataset is DD (D and J, 2013)(N et al., 2011), the best value of is 0.6, and for the other three datasets, 0.4 is the best value. Table 2 and Table 3 show all the hyperparameters used in this study, respectively.
Topology Learning Strategy Analysis: We compare GCNConv
(Kipf and Welling, 2017), ChebConv (Defferrard et al., 2016), GraphSAGE (Hamilton et al., 2017) and GAT (Velickovic et al., 2018) in GSAPool as graph pooling topology learning methods on four datasets (DD (D and J, 2013)(N et al., 2011), NCI-1 (N. et al., 2008)(N et al., 2011), NCI-109 (N. et al., 2008)(N et al., 2011), and Mutagenicity (Kazius et al., 2005)(Riesen and Bunke, 2008)
). The average accuracies of graph classification and corresponding standard deviations are expressed in percentages. Table4 shows that GCNConv and ChebConv are better than GraphSAGE and GAT. MLP (Hopfield, 1982) is excellent on NCI-1, NCI-109, and Mutagenicity.
GCNConv and ChebConv consider structural information when calculating the node importance score, whereas GAT and SAGE do not. Therefore, GCNConv can use additional graph information to create more representative graph vectors. As a result, GCNs perform best on graph classification task. MLP performs well on NCI-1 , NCI-109 and Mutagenicity but not so well on DD. For example, the average number of nodes and edges in each graph of DD is more than that in NCI-1, which means that the graph structure in DD is highly complex. MLP focuses on feature information rather than structural information, so it can get better performance in NCI-1, of which the graph structure is simpler than that of DD. NCI-109 and Mutagenicity are similar. However, when combining GCNConv and other GNNs, such as GAT, the result is not as good as the combination with MLP. From our perspective, GCNConv is more similar with GAT than MLP; thus, the area of overlap in the learning space of GCNConv and GAT is larger than that of GCNConv and MLP. Therefore, the combination of GCNConv and MLP can learn more features than that of GCNConv and GAT, which is why MLP is better than GAT as a feature mode selection.
Feature Fusion Strategy Analysis: The GCNConv-based (Kipf and Welling, 2017) fusion performs well on DD (D and J, 2013)(N et al., 2011), while GAT-based fusion (Velickovic et al., 2018) performs well on NCI-1 (N. et al., 2008)(N et al., 2011), NCI-109 (N. et al., 2008)(N et al., 2011) and Mutagenicity (Kazius et al., 2005)(Riesen and Bunke, 2008) (see Table 5). The reason for the success of the fusion mechanism is that the use rate of the node feature information increases. As a result, the fusion mechanism creates a highly representative graph vector; thus, it has a high accuracy on graph classification. In addition, GCNConv considers the structural information when aggregating the information of the nodes while structure is not considered by GAT. Thus, the GCNConv performs well highly intricate structure while GAT is effective on the simple datasets.
Table 6 shows that graph pooling topology generation and node feature fusion measure perform better when combined than when each method is used alone. Moreover, our proposed method is higher than the best one of the current pooling methods on DD (D and J, 2013)(N et al., 2011), NCI-109 (N. et al., 2008)(N et al., 2011) and Mutagenicity (Kazius et al., 2005)(Riesen and Bunke, 2008). Our method is not as good as DiffPool (Ying et al., 2018) and EigenPooling (Ma et al., 2019) only on NCI-1 (N. et al., 2008)(N et al., 2011). However, our method has the highest average accuracy. Table 6 demonstrates that our method reaches state-of-the-art level. Figure 4 shows the t-SNE (van der Maaten and Hinton, 2008) visual comparison results of SAGPool (Lee et al., 2019) and the proposed GSAPool on the graph classification task. Graphs can be easily separated by a horizontal or vertical line and the gap between the two categories is highly evident in GSAPool.
Compared with DiffPool and EigenPooling, the proposed GSAPool used structure and feature information explicitly at the same time. Therefore, GSAPool can use additional graph information to construct the pooled graph. GSAPool outperforms gPool and SAGPool because GSAPool considers the information of the node synthetically and uses feature fusion mechanism, which enables the pooled graph to represent the original graph reasonably and accurately. Thus, GSAPool can obtain an improved performance.
In this study, we proposed GSAPool to solve the problems in the top-k selection graph pooling. On the one hand, our method used three graph pooling topology generation strategies. On the other hand, node feature fusion was adopted before the unimportant nodes were discarded so that the node information could be used efficiently. Lastly, we combined the two approaches and compared them with the current approaches. The experimental results demonstrated that our proposed method achieved state-of-the-art graph classification performance on the benchmark datasets. Our GSAPool method can be easily integrated into other deep GNN architectures.
This research is supported by National key research and development plan (2019YFB1311600) and Ningbo 2025 Key Project of Science and Technology Innovation (2018B10071)
- Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems (), pp. 1097–1105. Note: External Links: Cited by: §1.
Large-scale video classification with convolutional neural networks..
In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition(), pp. 1725–1732. Note: External Links: Cited by: §1.
- Automatic differentiation in pytorch.. In NIPS-W (), pp. . Note: External Links: Cited by: §4.2.
- Spectral networks and locally connected networks on graph. Computer Vision and Pattern Recognition (). Note: External Links: Cited by: §2.1.
- Distinguishing enzyme structures from non-enzymes without alignments. Journal of molecular biology (), pp. 771–783. Note: Cited by: §4.1, §4.3, §4.3, §4.4.
- Life in the network: the coming age of computational social science. Science (), pp. 721–723. Note: External Links: Cited by: §1.
- Convolutional neural networks on graphs with fast localized spectral filtering. In neural information processing systems (). Note: External Links: Cited by: §1, §2.1, §3.1, §4.3, Table 4.
- Deep neural networks for acoustic modeling in speech recognition: the shared views of four research groups.. IEEE Signal processing magazine (), pp. 82–97. Note: External Links: Cited by: §1.
In Proceedings of the 36th International Conference on Machine Learning(). Note: External Links: Cited by: §1, §2.2, Table 6.
- Inductive representation learning on large graphs. neural information processing systems (). Note: External Links: Cited by: §1, §2.1, §3.1, §4.3, Table 4.
- Neural networks and physical systems with emergent collective computational abilities. Proceedings of the National Academy of Sciences of the United States of America 79 (8), pp. . Note: External Links: Cited by: §3.1, §4.3, Table 4.
- Deep residual learning for image recognition.. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition (), pp. 770–778. Note: External Links: Cited by: §1.
- Benchmark data sets for graph kernels. neural information processing systems (). Note: External Links: Cited by: §4.1.
- Convolutional networks on graphs for learning molecular fingerprints. In neural information processing systems (), pp. 2224–2232. Note: External Links: Cited by: §1.
- Derivation and validation of toxicophores for mutagenicity prediction. American Chemical Society (), pp. 48(1):312–20. Note: External Links: Cited by: §4.1, §4.3, §4.3, §4.4.
- Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (). Note: External Links: Cited by: §1, §2.1, §2.2, §3.1, §3.1, §3.2, §4.3, §4.3, Table 4.
- On valid optimal assignment kernels and applications to graph classifcation. In Neural Information Processing Systems (), pp. 1623–1631. Note: External Links: Cited by: §1.
- ImageNet classifcation with deep convolutional neural networks.. In Advances in Neural Information Processing Systems (), pp. 1097–1105.. Note: Cited by: §1, §1.
- Generalizing pooling functions in cnns: mixed, gated, and tree.. IEEE Transactions on Pattern Analysis and Machine Intelligence (), pp. . Note: External Links: Cited by: §1.
- Self-attention graph pooling. International Conference on Machine Learning (). Note: External Links: Cited by: §1, §2.2, Figure 3, §3.3, Figure 4, §4.4, Table 6.
- Fast graph representation learning with pytorch geometric.. In ICLR Workshop on Representation Learning on Graphs and Manifolds (), pp. . Note: External Links: Cited by: §4.2.
- Graph convolutional networks with eigenpooling. Knowledge Discovery in Database (). Note: External Links: Cited by: §1, §2.2, §4.4, Table 6.
- Weisfeiler-lehman graph kernels. Journal of Machine Learning Research (), pp. 1193–1216. Note: Cited by: §4.1, §4.3, §4.3, §4.4.
- Comparison of descriptor spaces for chemical compound retrieval and classification.. Knowledge and Information Systems (), pp. 347–375. Note: Cited by: §4.1, §4.3, §4.3, §4.4.
- Order matters: sequence to sequence for sets. International Conference on Learning Representations (), pp. . Note: External Links: Cited by: Table 6.
- IAM graph database repository for graph based pattern recognition and machine learning. Structural, Syntactic, and Statistical Pattern Recognition (), pp. 287–297. Note: External Links: Cited by: §4.1, §4.3, §4.3, §4.4.
- Visualizing data using t-sne. Journal of Machine Learning Research (), pp. 2579–2605. Note: External Links: Cited by: Figure 4, §4.4.
- Graph attention networks. International Conference on Learning Representations (). Note: External Links: Cited by: §1, §2.1, §3.1, §3.2, §4.3, §4.3, Table 4.
Spatial temporal graph convolutional networks for skeleton-based action recognition.
In the Association for the Advance of Artificial Intelligence(). Note: External Links: Cited by: §2.1.
- Graph convolutional networks for text classification. the Association for the Advance of Artificial Intelligence (), pp. . Note: Cited by: §2.1.
- Hierarchical graph representation learning with differentiable pooling. neural information processing systems (). Note: External Links: Cited by: §1, §2.2, §4.4, Table 6.