Foundations to Frontier
Tests
E. Deep Learning › E14 Graph Neural Networks

Graph Convolutional Network (GCN)

The Graph Convolutional Network (Kipf and Welling, ICLR 2017) is the simplest widely used graph neural network. Each layer multiplies the node features by a weight matrix and averages them over each node's neighbourhood (itself included), with symmetric degree normalisation: H' = σ(D̃^(−1/2)(A + I)D̃^(−1/2) H W). It is ChebNet cut to first order, and it made semi-supervised node classification on citation graphs such as Cora a standard benchmark. This page covers the propagation rule, the renormalisation trick, and why GCNs work well with few labels but poorly when deep. In the exercises you implement the normalised propagation and a 2-layer GCN, then compare an MLP and GCNs on a 4-community graph with 5 labels per class. The MLP reached 0.72 accuracy and the 2-layer GCN 0.96 on every seed. An 8-layer GCN fell back to 0.84.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Average with your neighbours, then transform

A GCN layer does two things to every node: it mixes the node’s features with those of its neighbours, and it passes the result through a learned linear map and a nonlinearity. Two such layers let each node use information from two steps away. Because linked nodes often share a label (papers citing each other share topics), a GCN can classify nodes accurately even when only a handful are labelled. The demo shows how repeated averaging blends neighbours, and what happens when it goes too far.

Graph neural network lab
01234567891011
Feature spread across nodes: 0.7284. Repeated averaging pulls every node toward the same value, washing out the two communities (oversmoothing).
Why engineers care

GCNs are a fast, strong baseline for any graph task: classifying components in a network, predicting faults in a grid, labelling parts of a mesh, or recommending items.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A GCN layer mixes each node's features with…
  2. 2. GCNs work well with few labels because…
  3. 3. A typical GCN has…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Propagation rule: H’ = σ( H W) with  = D̃^(−1/2)(A + I)D̃^(−1/2), where D̃ is the degree matrix of A + I.
  • Entries: Â_ij = 1/√((d_i + 1)(d_j + 1)) for an edge, and 1/(d_i + 1) on the diagonal. Two nodes of degree 3 get 1/√16 = 0.25.
  • Model: Z = softmax(Â ReLU(Â X W₁) W₂), trained with cross-entropy on the labelled nodes only.
  • Cora (citation graph): 2708 nodes, 1433 bag-of-words features, 7 classes, 140 labels (about 5%).
    • The [1433, 16, 7] GCN has 23,063 parameters and reaches about 81% accuracy.
  • From ChebNet: with K = 1, λ_max ≈ 2 and θ₀ = −θ₁ = θ, the filter becomes θ(I + D^(−1/2)AD^(−1/2)). Adding self-loops before normalising (the renormalisation trick) keeps eigenvalues in a stable range when layers are stacked.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Â entry for an edge between nodes of degree 3 and 3:
  2. 2. Cora's label rate:
  3. 3. The renormalisation trick adds…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

GCNs in code

Exercise 1.

  • The normalised matrix  was symmetric, with Â₀₀ = 1/2 and Â₀₁ = 1/√6 on a 3-node path, and eigenvalues in [−1, 1].
  • A 2-layer GCN produced valid class probabilities.

Practice.

  • In PyTorch Geometric, GCNConv(in, out); standard settings are 2 layers, 16–64 hidden units, dropout 0.5, weight decay 5 × 10⁻⁴ and Adam with learning rate 0.01.
  • For very large graphs, use neighbour sampling (GraphSAGE) or precompute Â^K X (SGC).
  • On graphs where linked nodes tend to differ (heterophily), plain GCNs struggle; use models that separate self and neighbour features.
from torch_geometric.nn import GCNConv
class GCN(nn.Module):
    def __init__(self, d_in, d_hid, k):
        super().__init__(); self.c1 = GCNConv(d_in, d_hid); self.c2 = GCNConv(d_hid, k)
    def forward(self, x, edge_index):
        x = F.dropout(F.relu(self.c1(x, edge_index)), 0.5, self.training)
        return self.c2(x, edge_index)                  # loss on labelled nodes only
🐍 Exercise 1: the GCN propagation rule
Implement the renormalised propagation matrix and a 2-layer GCN.
📝 Quick check (Level 2)
0/3 answered
  1. 1. PyG layer for Kipf–Welling convolution:
  2. 2. SGC precomputes…
  3. 3. Plain GCNs struggle under…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Low-pass filtering.

  • Â has eigenvalues in (−1, 1], and its top eigenvector is the degree-weighted constant.
  • Multiplying by  keeps smooth (low-frequency) signals and damps others, so a GCN is a learned low-pass graph filter.
  • It works when labels vary smoothly over the graph (homophily).

Why few labels suffice. The loss is computed on labelled nodes, but every layer’s output for a labelled node depends on its unlabelled neighbours’ features. Training therefore uses the whole neighbourhood structure, spreading label information along edges, like label propagation with learned features.

Why deep GCNs fail.

  • Each layer multiplies by  again, so features converge toward the top eigenvector (oversmoothing).
  • Deep stacks of  and ReLU are also harder to optimise.
  • Remedies include residual connections (GCNII), initial-feature mixing (APPNP), normalisation and jumping knowledge.
📝 Quick check (Level 3)
0/3 answered
  1. 1. A GCN acts as a…
  2. 2. Unlabelled nodes help because…
  3. 3. A remedy for deep GCNs:

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

Does the graph help, and how deep should a GCN be?

History.

  • T. N. Kipf and M. Welling, “Semi-supervised classification with graph convolutional networks” (ICLR 2017).
  • F. Wu et al., “Simplifying graph convolutional networks” (ICML 2019), showed that removing nonlinearities (SGC) loses little.
  • GCNII (2020) trained 64-layer GCNs with residual and identity connections.

Exercise 2.

  • Graph: 4 communities, 200 nodes (edge probability 0.08 within communities, 0.008 between), with 16-dimensional noisy features that carry a weak class signal.
  • Labels: 5 per class (20 of 200, a 10% label rate).
  • Models: an MLP (2 dense layers, no edges), a 2-layer GCN and an 8-layer GCN, each with 16 hidden units, trained for 300 Adam steps. Results are averaged over 3 graphs.
model accuracy (mean of 3) per seed
MLP (no edges) 0.722 0.667, 0.772, 0.728
GCN, 2 layers 0.957 0.961, 0.967, 0.944
GCN, 8 layers 0.839 0.767, 0.872, 0.878
  • The graph adds 23.5 accuracy points: the 2-layer GCN beat the MLP on every seed, its worst result (0.944) far above the MLP’s best (0.772). Averaging over neighbours pools the noisy features within communities.
  • Depth hurts: 8 plain GCN layers lost 12 points, through oversmoothing (features blending across communities) and harder optimisation. Two layers are the sweet spot here, as on most citation benchmarks.
🐍 Exercise 2 (research): does the graph help, and how deep should a GCN be?
Train an MLP and 2- and 8-layer GCNs on a 4-community graph with 5 labels per class.

GCNs in AI, robotics and aerospace

  • Networks: node classification in communication, power and transport networks; anomaly detection on sensor graphs.
  • Meshes and point clouds: per-node labelling of parts and surfaces (often with more expressive variants).
  • Design lesson: start with a 2-layer GCN as a baseline. If it already beats feature-only models, the graph carries signal; then decide whether more expressive models are worth their cost.

References

  1. T. N. Kipf and M. Welling (2017). “Semi-supervised classification with graph convolutional networks.” ICLR.
  2. F. Wu, T. Zhang, A. H. de Souza Jr., C. Fifty, T. Yu and K. Q. Weinberger (2019). “Simplifying graph convolutional networks.” Proc. ICML.
  3. M. Chen, Z. Wei, Z. Huang, B. Ding and Y. Li (2020). “Simple and deep graph convolutional networks.” Proc. ICML.