GNN-Ensemble: Towards Random Decision Graph Neural Networks
Graph Neural Networks (GNNs) have enjoyed wide spread applications in
graph-structured data. However, existing graph based applications commonly lack
annotated data. GNNs are required to learn latent patterns from a limited
amount of training data to perform inferences on a vast amount of test data.
The increased complexity of GNNs, as well as a single point of model parameter
initialization, usually lead to overfitting and sub-optimal performance. In
addition, it is known that GNNs are vulnerable to adversarial attacks. In this
paper, we push one step forward on the ensemble learning of GNNs with improved
accuracy, generalization, and adversarial robustness. Following the principles
of stochastic modeling, we propose a new method called GNN-Ensemble to
construct an ensemble of random decision graph neural networks whose capacity
can be arbitrarily expanded for improvement in performance. The essence of the
method is to build multiple GNNs in randomly selected substructures in the
topological space and subfeatures in the feature space, and then combine them
for final decision making. These GNNs in different substructure and subfeature
spaces generalize their classification in complementary ways. Consequently,
their combined classification performance can be improved and overfitting on
the training data can be effectively reduced. In the meantime, we show that
GNN-Ensemble can significantly improve the adversarial robustness against
attacks on GNNs.
Wenqi Wei, Mu Qiao, Divyesh Jadav
# GNN-Ensemble: Towards Random Decision Graph Neural Networks

###### Abstract

Graph Neural Networks (GNNs) have enjoyed wide spread applications in graph-structured data. However, existing graph based applications commonly lack annotated data. GNNs are required to learn latent patterns from a limited amount of training data to perform inferences on a vast amount of test data. The increased complexity of GNNs, as well as a single point of model parameter initialization, usually lead to overfitting and sub-optimal performance. In addition, it is known that GNNs are vulnerable to adversarial attacks. In this paper, we push one step forward on the ensemble learning of GNNs with improved accuracy, generalization, and adversarial robustness. Following the principles of stochastic modeling, we propose a new method called GNN-Ensemble to construct an ensemble of random decision graph neural networks whose capacity can be arbitrarily expanded for improvement in performance. The essence of the method is to build multiple GNNs in randomly selected substructures in the topological space and subfeatures in the feature space, and then combine them for final decision making. These GNNs in different substructure and subfeature spaces generalize their classification in complementary ways. Consequently, their combined classification performance can be improved and overfitting on the training data can be effectively reduced. In the meantime, we show that GNN-Ensemble can significantly improve the adversarial robustness against attacks on GNNs.

 graph neural networks, ensemble learning, random decision making, overfitting, adversarial robustness

## I Introduction

Graph is widely used to model many real-world relationships, ranging from social and rating networks [1], financial transactions [2], healthcare [3], to protein and molecule networks [4, 5]. Graph neural network (GNN) [6, 7] has become the mainstream methodology for deep learning on graphs. GNN has shown promising performance on various applications on graph data, for example, identifying components in protein molecules by node classification, anomaly detection for financial transactions with link prediction, and interest group finding with community detection. Through GNNs, each node in the graph builds its representation based on its node feature as well as the features of its neighbors through message passing. The representation of the node is updated using an aggregation of these messages.

While GNNs can obtain reasonably good accuracy on many graph learning tasks, their increased representational capacity comes from higher model complexity. This can lead to overfitting and therefore weakens the generalization ability. In both transductive and inductive settings, graph data are typically with a small amount of labeled training data and a large amount of unlabeled test data. A trained GNN may easily overfit the small training data. In the meantime, although the current GNN models utilize the neighborhood sampling of the target node and aggregate such neighborhood information as its representation, a single trial of model parameter initialization for deep learning could converge to local optima. DropOut [8] is a popular regularization technique for deep learning models to avoid overfitting. However, in GNNs, [7] indicates that DropOut alone is ineffective in preventing overfitting. This is partially due to the fact that when GNN becomes very deep, the Laplacian smoothing will make all nodes' representations converge to a stationary point such that they are no longer related to node features [9].

Additionally, like other deep learning methods, GNNs are vulnerable to adversarial attacks [10]. If the attacker maliciously adds or drops edges concerning a target victim node, the prediction related with that node may change. For example, a malicious merchant may link her products to specific items in order to fool the graph recommendation systems for higher exposure. In another example, a malicious user may manipulate her profile to build connections with targeted users to mislead the friend recommendation system. Such kind of vulnerability poses serious threats to GNNs, especially under safety-critical scenarios.

Ensemble learning has been widely used to boost the generalization and training stability with the combined wisdom [11, 12]. Deep neural network ensembles have gained increasing popularity in the deep learning community for improving the accuracy performance and robustness [13, 14, 15]. It is equally important to improve the accuracy performance of the GNN models as well as their robustness against adversarial attacks. In this paper, we aim to shed some insight into the following research questions: (1) Can we utilize an ensemble of GNN models, despite their different local optimal results, to achieve better classification performance? (2) Can we generate GNN ensembles with better generalization power and reduce overfitting? (3) Can we increase the robustness of GNN against adversarial attacks via GNN ensemble?

In this paper, we present GNN-Ensemble, an ensemble learning approach that combines multiple GNN models trained with both randomly selected substructures in the topological
space and randomly selected subfeatures in the feature space. The development of GNN-Ensemble consists of three main steps. First, we subsample the graph structure for subgraphs and the node features for subfeatures, assuming the graph is attributed. Second, we train multiple base GNN models, e.g., GraphSage [4] with different sets of subgraphs and subfeatures for independent decision making. The third and final step is to aggregate multiple GNN decisions with ranking or voting. By the theory of stochastic modeling with a discriminant function for joint decision making [16], these GNNs in different substructure and subfeature spaces generalize their classification in complementary ways. Consequently, their combined classification can be monotonically improved and overfitting on the training data can be reduced. With experimental results on four benchmark graph datasets1 (two for small graphs Cora and PubMed, and two for large graphs PPI and Reddit), we demonstrate that the proposed GNN-Ensemble method is general and can be used with many other backbone GNN models. GNN-Ensemble improves the accuracy performance, reduces overfitting, and improves the robustness against adversarial attack when compared to a single GNN model.

Footnote 1: [https://pytorch-geometric.readthedocs.io/en/latest/modules/datasets.html](https://pytorch-geometric.readthedocs.io/en/latest/modules/datasets.html)

The rest of the paper is organized as follows. Section II reviews the related work in GNNs, adversarial attacks and defense on the graph, and ensemble learning. In Section III, we provide a preliminary of the problem formulation and graph neural networks. In Section IV, we present the systematic creation of the GNN-Ensemble method with graph structure and node feature sampling and a discussion on diverse model generation. We further define the discriminant function, followed by the rules on decision aggregation and complexity analysis. Experimental results are reported in Section V. We finally conclude in Section VI.

## II Related Work

**Graph Neural Networks.** GNNs apply deep learning to graph data by capturing local graph structure and feature information in a trainable fashion to derive powerful node representations [17]. Over the past few years, GNNs have achieved great success in solving machine learning problems on graph data. Under the umbrella of Graph Convolutional Networks (GCNs), there are two main families of GNNs for graph convolution, i.e., spectral methods and spatial methods. For the former, [18] uses the Fourier bases of a given graph for graph convolution. [19] utilizes Chebyshev polynomials as the convolution filter. [7] proposes GCN based on the first-order approximation of spectral graph convolution. For the latter, graph convolution aggregates and transforms local information of a given node in the spatial domain. GraphSage [4] learns aggregators by sampling and aggregating neighbor information. FastGCN [20] proposes an ad hoc sampling scheme to restrict the neighborhood size. ClusterGCN [21] restricts the neighborhood search within a subgraph identified by a graph clustering algorithm. [22] restricts neighborhood size by requiring only two support nodes in the previous layer. Graph Attention NeTwork (GAT) [23] introduces attention mechanism for neighbor information aggregation. GraphSaint [24] preprocesses the training graph by subsampling, similar to our substructure sampling for base model training. However, the subgraph sampling in GraphSaint serves as the bootstrap sampling for training a single GCN model while our subgraph sampling is used for bagging. For a thorough review, we refer readers to recent surveys [25, 26].

Overfitting reduction of GNNs is usually discussed with over-smoothing reduction [9]. DropEdge [27] removes edges uniformly as a data augmentation technique for node classification. GraphCrop [28] crops the contiguous subgraphs from the original graph to generate novel and valid augmented graphs. [29] introduces DropOut as a Bayesian approximation and uses Monte Carlo estimation of GNN outputs to evaluate the predictive posterior uncertainty. While these approaches focus on enabling deep GCN with more layers by reducing over-smoothing and gradient vanishing, our work aims to reduce overfitting on training data to improve the node classification performance of existing GNN methods. Our method is motivated by the relation between decision tree and random forests.

**Ensemble Learning.** Ensemble learning has been widely adopted to improve the accuracy, stability, and robustness of machine learning systems. The main idea of ensemble learning is to construct a set of individual machine learning models (i.e., base model) and combine their predictions to yield better performance. Ensemble learning can be categorized into three threads. The first trains tens or hundreds of weak models for decision making, such as bagging [11] and boosting [30]. For example, random forests [12] is the most influential bagging approach while XGBoost [31] is the most well-known boosting method. The dropout operation and layerwise feedforward process of neural networks benefit from such decision ensemble with improved accuracy and reduced overfitting. The second aims to identify high-quality ensembles from a pool of strong deep learning base models with high individual model accuracy and different neural network backbones [13]. Since different deep learning models converge to different local minima [32], ensembles of diverse high-quality deep neural network are typically used to improve accuracy and adversarial robustness [14, 15]. The third centers on voting methods during decision aggregation, such as simple averaging, majority voting, and plurality voting. Existing GNN ensembles leverage multiple GNN learners for domain-specific applications. [33] trains multiple GNNs on molecular graphs for molecular property prediction. [34] models the comorbidity statistics from ensembles of CNN models as a graph and uses GNN for chest radiograph screening. The most related work to ours leverages the idea of adaboost [35] for deeper graph learning. Different from all the existing works, our proposed GNN-Ensemble integrates all three threads of efforts in ensemble learning. We sample substructure and subfeature of the original graph and train hundreds of base models for decision making using the bagging method. Different voting methods can be exploited in GNN-Ensemble during
the decision aggregation phase. Our method is further open to optimizing with diverse base model selection for high-quality ensemble.

**Adversarial attacks and defenses on the graph.** GNNs are known to be vulnerable to adversarial attacks. The adversary can mislead GNNs to make wrong predictions by manipulating a few edges and nodes or modifying the node features. Adversarial attacks on the graph can be performed at the training phase as poisoning [36, 37] or at the prediction phase as evasion [38, 39, 40, 10, 41]. We refer readers to the latest survey for a comprehensive overview [42]. Since adversarial robustness is considered as an efficient tool to analyze both the theoretical properties as well as the practical accountability [43], we draw our attention to the robustness against adversarial attacks on the graph in addition to the accuracy performance. We focus on adversarial attack mitigation at the inference phase.

## III Preliminary

Our method draws the theoretical foundation from random forests [16]. The discriminant power from stochastic modeling in random forests seeks to solve a classification problem in a given feature space. Therefore, we need to identify the information needed for constructing the base model. Then we provide an overview of how a single base GNN model utilizes these information for graph learning.

### _Graph Information_

**Two types of graph information.** Given a graph \(G=(V,E)\) with the node set \(V\) and the edge set \(E\), an attributed graph contains two types of information, i.e., structure information which describes the connectivity of nodes, and node feature information which describes the attributes of nodes. The edge connections can be represented by an adjacency matrix: \(A\in\{0,1\}^{n\times n}\), where \(n=|V|\), the total number of nodes. Let \(d\) denote the dimension of node features. The node feature matrix is denoted as \(F\in\mathbb{R}^{n\times d}\). **Figure 1** illustrates the two types of graph information in an academic collaboration graph. On the left side, each author is represented as a node, and the collaboration relationship is modeled as an edge. The table on the right side lists the attributes of each author, such as the number of published papers, number of citations, and research interests.

**Node classification.** We focus on the task of node classification in this paper. Given a graph with some labeled nodes, the classification task predicts the class for those unlabeled nodes. There are two kinds of settings in node classifications, i.e., transductive and inductive settings.

* The transductive setting observes all the data beforehand, including both the training and test datasets. We learn from the already labeled training data and then predict the node labels of the test data. Even though we do not know the labels of the test data, we can still leverage the graph connections and additional information present in the test data during the training process.
* The inductive setting is about learning general rules from observed training data. The test data is disjoint from the training data and unseen during the training process. The classification model is trained with only the training dataset. The trained model is then applied to predict the labels of a test dataset.

### _Graph Neural Networks_

Given a graph \(G=(V,E)\), a GNN takes the following two types of information as input: (1) an input feature matrix \(F\), and (2) an adjacency matrix \(A\). The forward propagation rule in GNNs determines how the information from the input will go to the output side of the neural network. We will cover the commonly used shallow-layer GNNs, which typically have three layers: the input layer, the hidden layer for latent representation, and the output layer. Given a node \(v\), its representation at each layer can be modeled as:

\[h_{v}^{l}=\sigma\bigg{(}\mathcal{W}_{l}\sum\nolimits_{u\in\eta(v)}\frac{h_{u }^{l-1}}{\eta(v)}+\mathcal{B}_{l}h_{v}^{l-1}\bigg{)}.\]

where \(l=1,..L\) is the layer number, \(\sigma\) is the ReLU activation function, and \(\eta(v)\) is the neighborhoods of node \(v\). \(\mathcal{W}\) and \(\mathcal{B}\) are the weight and bias of the GNN model, respectively. The

Fig. 1: Topological and node attribute information.
first part on the right side averages all the neighbors of node \(v\) and the second part is the previous layer embedding of node \(v\) multiplied by a bias \(\mathcal{B}_{l}\). Then the output will be the embedding after \(L\) layers of neighborhood aggregation. GraphSage [4] modifies the function of this simple neighborhood aggregation as

\[h_{v}^{l}=\sigma\bigg{(}\big{[}\mathcal{W}_{l}\cdot AGG\big{(}\{h_{u}^{l-1},\, \forall u\in\eta(v)\}\big{)},\mathcal{B}_{l}h_{v}^{l-1}\big{)}\bigg{)},\]

where AGG denotes the aggregation function. Other GNN models used in this paper, e.g., FastGCN [20], ClusterGCN [21], GraphSaint [24], GAT [23], introduce graph convolution layer, graph sampling, attention mechanism, and alternative techniques to refine the simple neighborhood aggregation rule for more generalized and advanced graph learning.

## IV Systematic Creation of GNN Ensemble

In this section, we will present the proposed GNN-Ensemble method. We will first introduce the substructure sampling and subfeature sampling, followed by a discussion on the model diversity. Then, we will define the discriminant function and discuss the decision aggregation rules. Finally, we will analyze the time and space complexity for GNN-Ensemble.

### _GNN Ensemble_

**Substructure and Subfeature Sampling.** The underlying idea behind GNN-Ensemble is to first generate many base models and then combine these base models to form a new stochastic model. The key point is that the "projectability" of the combined stochastic model will be comparable to that of the base models from which it is built, where the projectability is defined as 1 minus the difference in performance between training and test (the larger the projectability, the more projectable the model) [44]. Our method to create multiple GNN base models is to construct GNNs in randomly selected subspaces of the feature space as well as randomly selected subgraphs of the topological space. For a given topological space with \(n\) number of nodes, \(m\) number of edges, and feature space of \(d\) dimensions, there are in total \(2^{(n+m+d)}\) subspaces in which a base GNN can be constructed. We use randomization to introduce differences into classifiers, i.e., randomly select the substructures and subfeatures.

The base GNN model is trained in each selected substructure and subfeature space. Each of these base GNN models classifies the training data with high accuracy, aiming to discern between the inputs of different classes while not discerning between training and test data of the same class [44]. Consequently, the classification is invariant for points that are different from the training points only in the unselected dimensions [16]. Thus each base GNN generalizes its classification in a different way. The vast number of substructures and subspaces provides more choices than can be used in practice. The performance on the training set of the stochastic model can be made arbitrarily good if enough base models are used.

With substructure and subfeature sampling, we generate different random subgraphs out of the original graph. Such randomness and diversity of the input graphs can serve as a data augmentation approach. In addition to the understanding of ensemble from random forests, we provide another intuitive understanding of GNN-Ensemble from the perspective of graph learning. The key in the GNN model is to aggregate neighbors' information for each node as a weighted sum of the neighbor features (the weights are associated with the edges). Those approaches used for neighborhood sampling in GNNs, such as GraphSage and ClusterGCN, enable a random subset aggregation instead of the full aggregation during GNN training. In GNN-Ensemble, when GraphSage and ClusterGCN are used as the backbone models, the neighbor aggregation is more sparse. Therefore, the trained GNN model is less likely to remember random error patterns encoded in the training data.

**Model Diversity.** The randomness in the selected substructure and subfeature enables the initialization of training algorithms with different input data, and therefore eventually yields different classifiers. Similar to the performance of decision trees in random forests, the base GNN model can also provide very high accuracy on training data. This may lead to overfitting [45], although much reduced compared to the single GNN model and GNN ensemble with each model trained with full sets of the structure and feature space. The best scenario is when all base GNNs of an ensemble can learn and predict with uncorrelated errors. Then a simple averaging method can effectively reduce the average error of a base model. However, with a sufficiently large pool of base GNN models in the ensemble, it is unrealistic to assume that the errors from these individual base learners are completely uncorrelated. The worst scenario represents another end of the spectrum: the errors are duplicated for all base GNN models, which we aim to avoid. While our focus is on overfitting reduction with substructure and subfeature sampling, model diversity by exploring different model architectures and post-processing diversity improvement [13] for GNNs can be considered in future work.

Our approach is fundamentally different from the existing GNN ensemble literature [33, 34] and implementations2. These methods train multiple GNN models on the full set of the graph and feature space and perform ensemble learning based on model stacking. In contrast, our method trains the base GNN model on the subgraphs which are sampled from the power set of the graph structure and node feature space. **Figure 2** illustrates an overview of GNN-Ensemble during training and at inference for the node classification task. During the training pipeline, we first perform substructure sampling and subfeature sampling. Then we train multiple GNN models in each sampled substructure and subfeature space. During the test phase, a test node is submitted to GNN-Ensemble and is evaluated with each base model. Finally, we aggregate these independent predictions and make the final decision on the nodclass label of the test node. Our method is especially suitable for parallel implementation of both the
generation and evaluation of base models in the ensemble.

### _The Discriminant Function_

Similar to the relation of random forests and decision tree [16], the theoretical foundation of the discriminant power for GNN-Ensemble is built on the theory of stochastic modeling.

For a given node \(x\), let \(g_{j}(x)\) be the GNN trained on the \(j\)th sampled subgraph \(G_{j}\)\((j=1,2,...,k)\). Let the posterior probability that \(x\) is predicted as class \(c\)\((c=1,2,...,s)\) be denoted as \(P(c|g_{j}(x))\).

\[P(c|g_{j}(x))=\frac{P(c,g_{j}(x))}{\sum_{c=1}^{s}P(c,g_{j}(x))}\]

can be estimated by the fraction of class \(c\) nodes over all nodes that are assigned to the decision region of \(g_{j}(x)\).

For an unseen node for prediction, our method averages over the posterior probabilities \(P(c|g_{j}(x))\) that are conditioned on each of the independently trained GNN models. Accordingly, the discriminant function is defined as:

\[g_{j}(x)=\frac{1}{k}\sum\nolimits_{j=1}^{k}P(c|g_{j}(x)).\]

The decision rule is to assign \(x\) to class \(c\) for which \(g_{j}(x)\) is the maximum. Geometrically, each GNN model defines a neighborhood around the decision region of that node in the chosen subfeature space and substructure space.

By averaging over the posterior probabilities in these neighborhoods (decision regions), the discriminant function approximates the posterior probability for a given input in the original structure and feature space. The averaging of GNNs lowers the overall variance and prediction error. Similar to random forests [12], according to the Law of Large Numbers [44], the variance of generalization error is decreasing to zero in GNN-Ensemble when more GNNs are added to the ensemble. Therefore, GNN-Ensemble is an effective method to overcome the overfitting problem.

### _Decision Aggregation_

GNN-Ensemble makes the final decision by combining individual predictions from all the base GNN models via a committee consensus method. With the decisions made by \(K\) GNN models separately trained on different substructures of the graph and subfeatures of the node features, these decisions are aggregated using the voting method. The setting of three common voting methods is listed below.

* Hard voting: the final decision is determined by the majority vote of the prediction results from all decision-makers. If two classes have the same number of votes, we will compare their average prediction confidence and output the higher one.
* Soft voting: the final decision is determined by the highest prediction confidence in all classes by averaging the precision vector of all decision-makers. Unlike hard voting which is based on the decision made by the decision maker, soft voting averages the confidence (prediction probability vector) of the decision makers for decision making.
* Weighted voting: the final decision is determined by the weighted combination of decisions. For hard voting, this can be done by assigning weight to the single model based on its past accuracy while equal weights are assigned to all single base GNN models at the beginning. For soft voting, the weight can be given in proportion to the prediction confidence.

Given different decision aggregation approaches, we observe that no single voting method can consistently outperform the others. Specifically, we find that hard voting and soft voting only have a slight difference: \(\pm 0.2\%\). Therefore, we only report the results based on soft voting for brevity.

Fig. 2: An overview of GNN-Ensemble for node classification. For the transductive setting, the input training graph and input test graph form the full graph.
### _Complexity Analysis_

We analyze and compare the time and space complexity of GNN-Ensemble with different GNN models as the backbone, based on the complexity analysis from [21]. For better readability, we provide **Table Ia** to list all the notations in the complexity analysis. With GraphSage [4], fastGCN [20], and ClusterGCN [21] as examples, **Table Ib** shows the complexity analysis. We make the following two observations:

1. While we have \(k\) base GNN models in the ensemble and the time complexity is multiplied by a \(k\) factor, GNN-Ensemble can run training and evaluation in parallel.
2. By simply stacking multiple GNN models, GNN-Ensemble will introduce additional memory overhead compared to the single model setting, just like all other ensemble models. However, with a smaller \(\alpha\) subgraph percentage and \(\beta\) subfeature percentage, the overall time and space complexity can be significantly reduced.

## V Experiment

In this section, we will discuss and analyze the performance of the proposed GNN-Ensemble method. We conduct thorough experiments to validate the superiority of our method from three aspects: (i) improvement of the prediction accuracy; (ii) alleviation of overfitting and (iii) robustness against adversarial attacks. Before diving into experimental results and analysis, we start with the experimental setup.

### _Experiment Setup_

In this section, we briefly describe the experimental setup, including datasets, evaluation metrics, and baseline methods.

**Dataset.** We evaluate the proposed GNN-Ensemble method on four benchmark graph datasets: two of a small scale, i.e., Cora and PubMed, and two of a larger scale, i.e., PPI and Reddit. Cora and PubMed are citation datasets. Protein-protein interaction (PPI) dataset is a multi-class classification dataset and Reddit is a large social network dataset. Detailed information of these datasets are shown in **Table II**. For the split of training and test data, we follow the original setting in [7]. Cora and PubMed datasets are used for the transductive learning while PPI and Reddit datasets are used for the inductive learning. For all four datasets, we perform the node classification task.

**Evaluation metrics.** Due to the imbalance of classes in the datasets, we use micro-f1 instead of accuracy for measurement. F1 score is the harmonic mean of precision and recall:

\[F1=\frac{2*\text{precision}*\text{recall}}{\text{precision}+\text{recall}}.\]

Precision is the ratio \(\frac{tp}{(tp+fp)}\) of correctly identified positive samples in all predicted positive samples, where \(tp\) is the number of true positives and \(fp\) is the number of false positives. Recall is the ratio \(\frac{tp}{(tp+fn)}\) of correctly identified positive samples in all observed positive instances, where \(fn\) is the number of false negatives.

**Baseline methods.** We use GraphSage [4] as the primary backbone in the evaluation and plug into our method FastGCN [20], ClusterGCN [21], GraphSAINT [24, 46], and GAT [23] as a demonstration of universal add-on. We take these models from the PyTorch Geometric package3. and use their default hyperparameter settings in the package. In particular, for GraphSage, the model has three layers with a hidden dimension of 256.

Footnote 3: [https://github.com/pyg-team/pytorch_geometric](https://github.com/pyg-team/pytorch_geometric)

### _Accuracy Improvement_

In this set of experiments, we first show the accuracy improvement of GNN-Ensemble with subfeature sampling on the full graph structure (i.e., no substructure sampling). GraphSage is used as the base GNN model. We then extend the GNN-Ensemble method with the best parameter setting to FastGCN, ClusterGCN, GraphSAINT, and GAT. We consider a single GraphSage model trained with the full graph and all node features as the baseline. We randomly sample 10%, 30%, 50%, and 70% of the original node features, as well as keep the full set of original features (i.e., 100%). Meanwhile, we build a massive amount of GNN base models for the ensemble. Empirically, we select the number of base models as 100. **Table III** shows the result with node feature sampling on the full graph structure. We make four observations below:

\begin{table}
\begin{tabular}{|c|c|c|c|} \hline  & Cora & PubMed & PPI & Reddit \\ \hline \# nodes & 2708 & 19717 & 56928 & 232965 \\ \hline \# edges & 5429 & 44338 & 1587264 & 114615892 \\ \hline \# features & 1433 & 500 & 50 & 602 \\ \hline \# classes & 7 & 3 & 121, multiple & 41 \\ \hline \# training & 140 & 60 & 44809 & 153431 \\ \hline \# testing & 1000 & 1000 & 5525 & 55703 \\ \hline \multicolumn{2}{|c|}{type} & \multicolumn{2}{c|}{transductive} & \multicolumn{2}{c|}{inductive} \\ \hline \end{tabular}
\end{table} TABLE II: Benchmark datasets and settings.

\begin{table}
\begin{tabular}{|c|c|} \hline \(l\) & \# layers in GNN \\ \hline \(k\) & \# base models in ensemble learning \\ \hline \(n\) & \# nodes in the graph \\ \hline \(m\) & \# edges in the graph \\ \hline \(\alpha\) & \% subgraph \\ \hline \(d\) & \# features \\ \hline \(\beta\) & \% subfeature \\ \hline \(b\) & batch size \\ \hline \(r\) & \# sampled neighbors \\ \hline \end{tabular}
\end{table} TABLE I: Time and Space complexity analysis. \(\alpha^{*}\) denotes the percentage of edges preserved due to the subgraph sampling.
* When the sampling percentage of node features is 100% (i.e., using the full set of original features and full graph structure), GNN-Ensemble stacks 100 GraphSage models. Its classification accuracy on the Cora dataset is 0.797, while the accuracy of a single GraphSage model is 0.789. Simply stacking 100 GNN models can already improve the performance and the randomness introduced by the node subfeature sampling can further boost the improvement.
* GNN-Ensemble improves the performance when there is rich node feature information in the dataset. Specifically, GNN-Ensemble achieves about more than 1% improvement on Cora, which has 1433 node features, and 0.4% for PubMed with 500 node features.
* Although GNNs do not directly act on the hyperplane of each node feature like the decision trees in random forests, GNN-Ensemble can benefit from sampling node features. Empirically, the boost of accuracy is maximized when the subfeature sampling rate falls into a certain range, i.e., 30% \(\sim\) 70% of total features in the measurement.
* Even with as small as 10% of the total features, the resulting GNN-Ensemble model can be as nearly accurate as the model with full features.

Then we look at the combined impact of the substructure sampling and subfeature sampling. **Table IV** shows the results of different percentages of subfeatures with 30% and 70% sampled graph structures when training a base GNN model in GNN-Ensemble. That is, we keep only 30% and 70% of the nodes in the full graph and their corresponding edges, and vary the sampling percentage of node features at the same time. We make three observations:

* Compared to Table III, when 70% of the graph nodes are randomly sampled, for the Cora dataset, GNN-Ensemble consistently outperforms GNN-Ensemble with only subfeature sampling. GNN-Ensemble with both substructure and subfeature sampling is able to improve the performance over the single model baseline when we maintain a certain percentage of the graph structure for each model.
* The size of the subgraph will affect the overall performance even with full node features. Empirically, we find that the subgraph size of 70% can be a reasonable setting for preserving the needed structural information. Only keeping 30% of the nodes would remove too much graph information and therefore lower the f1 score.
* Another merit of GNN-Ensemble is privacy protection. Suppose each party holds a subgraph (with subfeatures), without access to the full graph due to privacy restrictions, we can apply GNN-Ensemble to train a GNN at each party and then ensemble them for final predictions. This is similar to the vertical federated learning setup [47].

Next, we investigate the generalization of GNN-Ensemble using other types of GNN models as backbones. Based on the aforementioned results, we use the best setting of 70% of sampled graph structures and 50% of sampled node features to train the GNN base model in the ensemble. In practice, the sampling percentages of structure and feature are hyper-parameters and can be optimized through cross-validation. **Table V** shows the result. We make three observations.

* GNN-Ensemble is not limited to GraphSage and can be applied to many other types of GNN models, such as FastGCN, ClusterGCN, GraphSaint, and GAT. It can be further extended beyond those GNN models provided in the PyTorch Geometric package and can serve as a universal add-on.
* GNN-Ensemble is not limited to the transductive setting, such as classifications on Cora and PubMed. It can be applied to the inductive setting as well, such as classifications on PPI and Reddit. In our experiment, GNN-Ensemble is able to improve the f1 score 1% \(\sim\) 2% under the transductive setting and around 1% under the inductive setting.
* While the baseline model may converge to different local optimums, all types of sub-optimal results can be improved with GNN-Ensemble. For example, although the f1 score of GraphSage on PPI is 0.598, GNN-Ensemble improves its performance to 0.614. The GAT on PPI is well converged to 0.988, but GNN-Ensemble can still increase its f1 score to 0.993.
of test data. While in the reversed setup, we reverse the training and test data, that is, 55,703 training nodes and 153,431 test nodes, so that the training data becomes much smaller. In addition, we purposely increase the number of embeddings in the hidden layer of GraphSage from 256 to 2048, in order to make a heavily parameterized GNN model. As a result, in the reversed setup, overfitting becomes very evident since there are many more training parameters in the GNN model with much less training data. **Table VI** shows the result and we make two observations:

* GNN-Ensemble is able to reduce overfitting. Specifically, the difference between training and test performance of GNN-Ensemble is smaller than that of the single model baseline. Such observation holds for both vanilla and reversed setups as well as for both 256 and 2048 dimensional embedding. The performance of GNN-Ensemble on test data is consistently better than that of the baseline.
* GNN-Ensemble can reduce overfitting more effectively when the complexity of the model is higher. Under the reversed setting, when the dimension of embedding is 2048, GNN-Ensemble increases the f1 score by 2% in the test dataset.

### _Adversarial Robustness_

At last, we measure the adversarial robustness of GNN-Ensemble. We conduct the experiment using DeepRobust4 and consider four graph evasion attacks [42]: RL-S2V [38], PGD [39], GF-Attack [40], and IG-FGSM [41]. All four attacks perturb the input graph by adding and deleting edges. IG-FGSM, in addition, modifies the features as well. We set the maximum perturbation threshold to 10%, that is, allow the attacker to add or delete at most 10% of the edges. To satisfy the imperceptibility requirement of adversarial attacks, the attacker can only modify such a limited percentage of nodes or edges. We compare GNN-Ensemble with three representative adversarial defense approaches: GCN-SVD [48], GCN-Jaccard [41] and ProGNN [49]. These defense approaches are applied in their default settings in DeepRobust. This set of experiments are conducted on Cora and PubMed under the transductive setting. **Table VII** shows the adversarial robustness results. We make three observations:

Footnote 4: [https://github.com/DSE-MSU/DeepRobust](https://github.com/DSE-MSU/DeepRobust)

* For all four adversarial attacks on the graph, GNN-Ensemble consistently and significantly outperforms the four defense methods on both datasets. Since the attacker is limited to modifying at most 10% of the edges, the majority of the nodes and edges remain unchanged during the adversarial attack. Since GNN-Ensemble explores the structural information of the graph and uses multiple subgraphs of the original graph for learning and prediction, subgraphs containing the victim node will be less likely to be impacted by the maliciously modified edges. Therefore, GNN-Ensemble can achieve better classification performance on the victim nodes in an adversarially sabotaged graph.
* GNN-Ensemble is very effective in mitigating the adversarial effect of IG-FGSM, where attacks occur by adding and deleting edges as well as modifying features. GNN-Ensemble trains the base GNN models on sampled substructures and subfeatures of the original graph. The adversarial effect is much less eminent in the sampled subspaces. Therefore, GNN-Ensemble is very robust to adversarial attacks.
* Due to the different optimization goals under every possible combination of substructure and subfeatures, it now becomes very difficult to make adversarial examples via

\begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|c|} \hline  & \multicolumn{2}{c|}{Cora} & \multicolumn{2}{c|}{PubMed} & \multicolumn{2}{c|}{PPI} & \multicolumn{2}{c|}{Reddit} \\ \cline{3-8}  & baseline & GNN-Ensemble & baseline & GNN-Ensemble & baseline & GNN-Ensemble & baseline & GNN-Ensemble \\ \hline Fast-GCN & 0.674 & **0.692** & 0.718 & **0.735** & cannot converge & 0.937 & **0.951** \\ \hline Cluster-GCN & 0.812 & **0.831** & 0.768 & **0.774** & 0.982 & **0.989** & 0.954 & **0.967** \\ \hline GraphSage & 0.789 & **0.805** & 0.781 & **0.785** & 0.598 & **0.614** & 0.953 & **0.965** \\ \hline GraphSaint & 0.787 & **0.806** & 0.751 & **0.764** & 0.98 & **0.989** & 0.964 & **0.968** \\ \hline GAT & 0.832 & **0.849** & 0.779 & **0.786** & 0.988 & **0.993** & 0.967 & **0.979** \\ \hline \end{tabular}
\end{table} TABLE V: GNN-Ensemble with different types of GNN models as the base model: aggregate 100 base models, each of which is trained with 70% subgraph and 50% subfeatures.

\begin{table}
\begin{tabular}{|c|c|c|c|c|c|} \hline  & \multicolumn{1}{c|}{benign} & RL-S2V & PGD & GF-attack & IG-FGSM \\ \hline \multirow{4}{*}{\begin{tabular}{c} vanilla \\ \end{tabular} } & baseline & 0.789 & 0.712 & 0.72 & 0.726 & 0.025 \\ \cline{2-6}  & GCN-SVD & 0.756 & 0.683 & 0.691 & 0.678 & 0.566 \\ \cline{2-6}  & GCN-Jaccard & 0.773 & 0.741 & 0.745 & 0.737 & 0.736 \\ \cline{2-6}  & ProGNN & 0.782 & 0.745 & 0.738 & 0.741 & 0.739 \\ \cline{2-6}  & GNN-Ensemble & **0.805** & **0.769** & **0.773** & **0.761** & **0.775** \\ \hline \multirow{4}{*}{
\begin{tabular}{c} reverse \\ \end{tabular} } & baseline & 0.781 & 0.709 & 0.715 & 0.714 & 0.011 \\ \cline{2-6}  & GCN-SVD & 0.738 & 0.688 & 0.684 & 0.689 & 0.557 \\ \cline{2-6}  & GCN-Jaccard & 0.774 & 0.745 & **0.746** & 0.743 & 0.725 \\ \cline{2-6}  & ProGNN & 0.776 & 0.723 & 0.730 & 0.731 & 0.754 \\ \cline{2-6}  & GNN-Ensemble & **0.785** & **0.751** & 0.744 & **0.748** & **0.759** \\ \hline \end{tabular}
\end{table} TABLE VII: Adversarial robustness measurement: GNN-Ensemble aggregates 100 base models, each of which is trained with 70% subgraph and 50% subfeature.

\begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|} \hline  & \multicolumn{2}{c|}{\# embedding} & \multicolumn{2}{c|}{baseline} & \multicolumn{2}{c|}{GNN-Ensemble} \\ \cline{2-6}  & training & testing & training & testing \\ \hline \multirow{2}{*}{vanilla} & 256 & 0.9766 & 0.953 & 0.9648 & 0.965 \\ \cline{2-6}  & 2048 & 0.9789 & 0.954 & 0.9781 & 0.970 \\ \hline \multirow{2}{*}{reverse} & 256 & 0.9993 & 0.95 & 0.9987 & 0.966 \\ \cline{2-6}  & 2048 & 0.9999 & 0.951 & **0.9999** & **0.973** \\ \hline \end{tabular}
\end{table} TABLE VI: Overfitting reduction measurement on original and reversed Reddit dataset: GraphSage is used with two settings of hidden parameters: 256 and 2048. GNN-Ensemble aggregates 100 base models, each of which is trained with 70% subgraph and 50% subfeature.
optimizing the graph in favor of the attackers. Therefore, different base models in GNN-Ensemble can hardly be jointly optimized to perform the cross-model attack [50].

## VI Conclusion

We propose a new graph learning method called GNN-Ensemble to construct an ensemble of random decision graph neural networks. GNN-Ensemble consists of multiple base models that are trained with randomly selected substructures in the topological space and subfeatures in the node feature space. The discriminant function of GNN-Ensemble approximates the posterior probability for a given input in the original topological and feature space. GNN-Ensemble is easily parallelized, where each base model can be trained and perform inference independently. In addition, different types of GNN models can be used as the base model in the ensemble. Extensive experimental results on four real-world benchmark graph datasets show that GNN-Ensemble consistently outperforms all the baselines on various node classification tasks. Similar to random forests, GNN-Ensemble is also very effective in overcoming the overfitting problem. Last but not the least, GNN-Ensemble significantly improves the adversarial robustness against attacks on single GNN model.
