Contrastive Self-supervised Learning for Graph Classification
Abstract
Graph classification is a widely studied problem and has broad applications. In many real-world problems, the number of labeled graphs available for training classification models is limited, which renders these models prone to overfitting. To address this problem, we propose two approaches based on contrastive self-supervised learning (CSSL) to alleviate overfitting. In the first approach, we use CSSL to pretrain graph encoders on widely-available unlabeled graphs without relying on human-provided labels, then finetune the pretrained encoders on labeled graphs. In the second approach, we develop a regularizer based on CSSL, and solve the supervised classification task and the unsupervised CSSL task simultaneously. To perform CSSL on graphs, given a collection of original graphs, we perform data augmentation to create augmented graphs out of the original graphs. An augmented graph is created by consecutively applying a sequence of graph alteration operations. A contrastive loss is defined to learn graph encoders by judging whether two augmented graphs are from the same original graph. Experiments on various graph classification datasets demonstrate the effectiveness of our proposed methods.
Benchmark Results
Tested on 2 datasets 6 baseline values reported too low
Tables show presented results in global context (best 3 papers + GCN + MLP).
TU Dortmund
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | WL-MLP | 0.9954 | |
| 2 | GIN | 0.9934 | |
| 3 | GCN | 0.9727 best reported | best at pub: Graph Neural Tangent Kernel: Fusing Graph Neural Networks with Graph Kernels (NeurIPS 2019) best today: 1-WL Expressiveness Is (Almost) All You Need (2022) |
| 4 | GAT | 0.9623 best reported | best today: 1-WL Expressiveness Is (Almost) All You Need (2022) |
| 5 | DiffPool | 0.7773
±0.0083 | prev best: Graph Neural Networks in TensorFlow and Keras with Spektral (2020) best today: Where to Mask: Structure-Guided Masking for Graph Masked Autoencoders (IJCAI 2024) |
| 12 | WL | 0.8590
±0.0010 best reported | best at pub: Propagation Kernels (2014) |
| 131 | GraphSAGE | 0.8200
±0.0100 best reported | best at pub: Graph Neural Tangent Kernel: Fusing Graph Neural Networks with Graph Kernels (NeurIPS 2019) best today: Weisfeiler and Leman Go Infinite: Spectral and Combinatorial Pre-Colorings (TMLR 2022) |
| 222 | CSSL-Reg A3-specific | 0.8009
±0.0107 | This paper |
| 223 | CSSL-Reg A1-specific | 0.8007
±0.0060 | This paper |
| 250 | CSSL-Pretrain A3-specific | 0.7944
±0.0067 | This paper |
| 259 | SAGPool | 0.7788
±0.0159 | prev best: Graph Neural Networks in TensorFlow and Keras with Spektral (2020) Improvement within reported uncertainty; not highlighted. |
| 267 | EdgePool | 0.7893
±0.0222 best reported | best today: Graph Parsing Networks (ICLR 2024) Difference within reported uncertainty; not counted as underperformance. |
| 278 | EigenPool | 0.7870
±0.0190 best reported | best today: GraphCrop: Subgraph Cropping for Graph Classification (2020) Difference within reported uncertainty; not counted as underperformance. |
| 285 | CSSL-Pretrain A1-specific | 0.7862
±0.0063 | This paper |
| 299 | HGP-SL | 0.7845
±0.0077 | This paper |
| 338 | InfoGraph | 0.7750
±0.0074 best reported | best today: Graph Masked Autoencoders with Transformers (2022) |
| 373 | DGCNN | 0.7650
±0.0190 best reported | best at pub: Deep Learning on Attributed Graphs: A Journey from Graphs to Their Embeddings and Back (2018) best today: GraphCrop: Subgraph Cropping for Graph Classification (2020) Difference within reported uncertainty; not counted as underperformance. |
| 386 | gPool | 0.7625
±0.0139 | This paper |
| 421 | SP | 0.7450
±0.0030 best reported | best at pub: On Valid Optimal Assignment Kernels and Applications to Graph Classification (NeurIPS 2016) |
| 456 | CSSL-Freeze A3-specific | 0.7270
±0.0194 | This paper |
| 459 | CSSL-Freeze A1-specific | 0.7260
±0.0143 | This paper |
| 463 | Set2Set | 0.7170
±0.0073 best reported | best at pub: Graph Convolutional Networks with EigenPooling (KDD 2019) |
| 472 | GCC-finetuning | 0.7100
±0.0178 | This paper |
| 515 | GCC-freezing | 0.6633
±0.0265 | This paper |
| 533 | Graphlet | 0.6248
±0.0211 | prev best: The Multiscale Laplacian Graph Kernel (NeurIPS 2016) Improvement within reported uncertainty; not highlighted. |
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | GC-GNN (GCN) | 0.9210
±0.0810 | |
| 2 | SUGAR | 0.8403
±0.0133 | |
| 3 | Ortho-g-U-Nets | 0.8387 | |
| 8 | CSSL-Reg A1-specific | 0.8218
±0.0134 | This paper |
| 9 | CSSL-Pretrain A1-specific | 0.8202
±0.0142 | This paper |
| 14 | HGP-SL | 0.8096
±0.0126 | This paper |
| 15 | SAGE | 0.8088
±0.0233 | |
| 16 | CSSL-Pretrain A1-all | 0.8084
±0.0124 | This paper |
| 17 | CSSL-Pretrain A3-specific | 0.8084
±0.0154 | This paper |
| 18 | DiffPool | 0.8064 best reported | best at pub: Graph U-Nets (2019) best today: Orthogonal Graph Neural Networks (AAAI 2021) Difference within reported uncertainty; not counted as underperformance. |
| 19 | CSSL-Reg A1-all | 0.8050
±0.0134 | This paper |
| 21 | CSSL-Pretrain A3-all | 0.8025
±0.0141 | This paper |
| 25 | WL | 0.7978
±0.0036 best reported | best at pub: Dynamic Edge-Conditioned Filters in Convolutional Neural Networks on Graphs (2017) best today: Graph Learning with Distributional Edge Layouts (2024) Difference within reported uncertainty; not counted as underperformance. |
| 29 | CSSL-Reg A3-specific | 0.7966
±0.0171 | This paper |
| 31 | CSSL-Reg A3-all | 0.7958
±0.0141 | This paper |
| 37 | DGCNN | 0.7937 best reported | best at pub: Deep Learning on Attributed Graphs: A Journey from Graphs to Their Embeddings and Back (2018) best today: Orthogonal Graph Neural Networks (AAAI 2021) |
| 41 | EdgePool | 0.7920
±0.0261 | This paper |
| 43 | GCN | 0.7912
±0.0307 best reported | best at pub: Graph Convolutional Networks with EigenPooling (KDD 2019) best today: Hierarchical Graph Capsule Network (AAAI 2020) Difference within reported uncertainty; not counted as underperformance. |
| 45 | SP | 0.7900
±0.0060 best reported | best at pub: On Valid Optimal Assignment Kernels and Applications to Graph Classification (NeurIPS 2016) Difference within reported uncertainty; not counted as underperformance. |
| 54 | CSSL-Freeze A1-specific | 0.7874
±0.0092 | This paper |
| 56 | SAGPool | 0.7870
±0.0229 | prev best: MathNet: Haar-Like Wavelet Multiresolution-Analysis for Graph Representation and Learning (2020) Improvement within reported uncertainty; not highlighted. |
| 57 | EigenPool | 0.7863
±0.0136 | prev best: MathNet: Haar-Like Wavelet Multiresolution-Analysis for Graph Representation and Learning (2020) Improvement within reported uncertainty; not highlighted. |
| 61 | CSSL-Freeze A3-specific | 0.7849
±0.0094 | This paper |
| 62 | Graphlet | 0.7845 best reported | best at pub: MathNet: Haar-Like Wavelet Multiresolution-Analysis for Graph Representation and Learning (2020) Difference within reported uncertainty; not counted as underperformance. |
| 83 | CSSL-Freeze A3-all | 0.7773
±0.0173 | This paper |
| 99 | GAT | 0.7730
±0.0368 | prev best: Graph Neural Networks With Convolutional ARMA Filters (2019) Improvement within reported uncertainty; not highlighted. |
| 104 | gPool | 0.7702
±0.0132 | This paper |
| 109 | GraphSAGE | 0.7660 best reported | best at pub: Graph Convolutional Networks with EigenPooling (KDD 2019) Difference within reported uncertainty; not counted as underperformance. |
| 120 | CSSL-Freeze A1-all | 0.7596
±0.0160 | This paper |
| 126 | GCC-freezing | 0.7563
±0.0322 | This paper |
| 131 | GCC-finetuning | 0.7546
±0.0244 | This paper |
| 146 | Set2Set | 0.7450 best reported | best at pub: Graph Convolutional Networks with EigenPooling (KDD 2019) |
| 148 | InfoGraph | 0.7424
±0.0086 | This paper |
