Graph convolutional neural networks
Oct 6th, 2022
BMI/CS 775 Computational Network Biology�Fall 2022
Anthony Gitter
Topics in this section
Goals for today
Power of deep learning on graphs
Supervised graph prediction task
One advantage of neural networks
x | y | sin(x*y) | x*y | x2*y2 | label |
-1.2 | -2.3 | 0.37 | 2.76 | 7.62 | True |
0.6 | 2.1 | 0.95 | 1.26 | 1.59 | True |
2.8 | -0.7 | -0.92 | -1.96 | 3.84 | False |
-1.9 | 1.8 | 0.27 | -3.42 | 11.69 | False |
One advantage of neural networks
x | y | sin(x*y) | x*y | x2*y2 | label |
-1.2 | -2.3 | 0.37 | 2.76 | 7.62 | True |
0.6 | 2.1 | 0.95 | 1.26 | 1.59 | True |
2.8 | -0.7 | -0.92 | -1.96 | 3.84 | False |
-1.9 | 1.8 | 0.27 | -3.42 | 11.69 | False |
How do neural networks learn feature transformations?
Actual neural network
Artificial neural network
(perceptron)
How a perceptron works
-1
-2
3
2
Fire if weighted sum > 1
1
0
1
1
Weighted sum = 1*-1 + 0*-2 + 1*3 + 1*2 = 4
1
(fire)
Inputs
Weights
Learning perceptron weights (parameters)
wx
3
True if sum > 1
x
0
1
y
?
wy
We need to choose weights wx and wy
Inputs
Weighted sum = ?
Learning perceptron weights
-1
3
True if sum > 1
x
0
1
y
?
3
Inputs
Weighted sum = ?
Random guess: wx= -1 and wy= 3
Learning perceptron weights
-1
3
True if sum > 1
1
0
1
1
?
3
Inputs
Weighted sum = ?
Random guess: wx= -1 and wy= 3
x | y | label |
1 | 1 | False |
| | |
Training data
Learning perceptron weights
-1
3
True if sum > 1
1
0
1
1
?
3
Inputs
Random guess: wx= -1 and wy= 3
x | y | label |
1 | 1 | False |
| | |
Training data
Weighted sum = 1*-1 + 1*3 = 2 (True)
Learning perceptron weights
-1
3
True if sum > 1
1
0
1
1
?
1
Inputs
x | y | label |
1 | 1 | False |
| | |
Training data
Weighted sum = ?
Update our guess: wx= -1 and wy= 1
Learning perceptron weights
-1
3
True if sum > 1
1
0
1
1
?
1
Inputs
x | y | label |
1 | 1 | False |
| | |
Training data
Update our guess: wx= -1 and wy= 1
Weighted sum = 1*-1 + 1*1 = 0 (False)
Learning perceptron weights
-1
3
True if sum > 1
9
0
1
4
?
1
Inputs
x | y | label |
1 | 1 | False |
9 | 4 | True |
Training data
Weighted sum = ?
Does it work for another example?
Learning perceptron weights
-1
3
True if sum > 1
9
0
1
4
?
1
Inputs
x | y | label |
1 | 1 | False |
9 | 4 | True |
Training data
Weighted sum = 9*-1 + 4*1 = -5 (False)
Does it work for another example?
Perceptron observations
Activation functions
Images from Wikipedia: Activation function
From perceptrons to fully connected neural networks
From perceptrons to fully connected neural networks
Input graph
Hidden layers
(perceptrons)
Prediction
Some datasets have special structure
A 1 0 0 0 1 0 0 0 0 0
C 0 0 0 1 0 0 0 0 1 0
G 0 1 1 0 0 1 0 1 0 1
T 0 0 0 0 0 0 1 0 0 0
A G G C A G T G C G
AG pattern repeats
GC pattern repeats
One hot encoding of DNA sequence
Some datasets have special structure
A 1 0 0 0 1 0 0 0 0 0
C 0 0 0 1 0 0 0 0 1 0
G 0 1 1 0 0 1 0 1 0 1
T 0 0 0 0 0 0 1 0 0 0
A G G C A G T G C G
AG pattern repeats
GC pattern repeats
w w
w w
w w
w w
8 independent parameters
Adapting convolutions for graphs
Image from Wu et al. 2019 A Comprehensive Survey on Graph Neural Networks
2D images
Look for common patterns
in local regions
Graphs
Look for common patterns
node neighborhoods
Challenge for convolutions on graphs
2D images
Fixed number of pixels
Graphs
Graph size varies
Node degree varies
One solution is to share parameters for each neighbor
Graph convolution definitions
Basic graph convolutional neural network
Graph convolution example
1.1 |
-0.3 |
2.1 |
3.0 |
0.8 |
-2.6 |
1.9 |
2.4 |
0.1 |
-0.9 |
-1.4 |
-2.3 |
0.3 |
3.2 |
2.7 |
1 | 0 | 1 |
-1 | 0 | 1 |
1 | 2 | 0 |
-1 | 1 | 1 |
Graph convolution example
3.0 |
0.8 |
-2.6 |
1.9 |
2.4 |
0.1 |
-0.9 |
-1.4 |
-2.3 |
0.3 |
3.2 |
2.7 |
1 | 2 | 0 |
-1 | 1 | 1 |
1 | 2 | 0 |
-1 | 1 | 1 |
1 | 2 | 0 |
-1 | 1 | 1 |
1 | 2 | 0 |
-1 | 1 | 1 |
4.6 |
-4.8 |
6.7 |
0.6 |
-3.7 |
-2.8 |
6.7 |
5.6 |
Graph convolution example
4.6 |
-4.8 |
6.7 |
0.6 |
-3.7 |
-2.8 |
6.7 |
5.6 |
3.6 |
-1.4 |
Elementwise average
Graph convolution example
1.1 |
-0.3 |
2.1 |
1 | 0 | 1 |
-1 | 0 | 1 |
3.2 |
1.0 |
Graph convolution example
3.6 |
-1.4 |
3.2 |
1.0 |
6.8 |
-0.4 |
6.8 |
-0.4 |
6.8 |
0 |
Apply ReLU
Interactive examples in Distill GNN articles by Sanchez-Lengeling et al. and Daigavane et al.
Multiple graph convolutional layers
Stack K graph convolutional layers
What type of prediction to make?
Aggregation or readout layer
Can follow by multilayer perceptron (fully connected)
Image from Wu et al. 2019 A Comprehensive Survey on Graph Neural Networks
Top Hat question
Example of biological graph convolutional neural networks
Protein Interface Prediction using Graph Convolutional Networks
Red: ligand
Blue: receptor
Yellow: interface
Image from Fout et al. NIPS 2017
Predict this: interacting residues
Protein Interface Prediction using Graph Convolutional Networks
Pair representations of residue x from graph 1 and residue y from graph 2
Image from Fout et al. NIPS 2017
Representing proteins as a graph
Featurizing protein graphs
Image from Fout et al. NIPS 2017
Evaluating protein interface prediction
Predicting gene essentiality
Gene 1
Gene 2
Non-essential gene
Essential gene
Predicting gene essentiality
Image from Jeong et al. 2001 Nature
Red: lethal
Orange: slow-growth
Green: non-lethal
Yellow: unknown
Predicting gene essentiality
Conclusions
Resources
Kernels for graph classification
Slide from Prof. Sushmita Roy
Kernels for graph classification