Graph Learning2017intermediate11 min read

Semi-Supervised Classification with Graph Convolutional Networks

التصنيف شبه المُوجَّه باستخدام الشبكات الالتفافية الرسومية

Kipf, T. N. · Welling, M. — ICLR

The problem

By 2016, classifying nodes in a graph (e.g. papers in a citation network) required either hand-crafted graph features or expensive spectral methods that decompose the entire . Label-efficient semi-supervised methods existed but couldn't jointly leverage both graph topology and features. The question was: can we build a neural network that convolves directly on graph structure, scales to large graphs, and learns from just a handful of labeled nodes?

The contribution

The Graph Convolutional Network (GCN): a layer-wise propagation rule derived from a first-order approximation of spectral graph convolutions. Each layer aggregates a node's own features with its neighbors' features via the renormalized , then applies a linear transform and nonlinearity. A two-layer GCN with just a few dozen labeled nodes per class outperformed multi-step pipelines (label propagation + extraction + classification) on citation networks, while scaling linearly in the number of edges.

The impact

GCN is the foundational architecture of modern graph . It demonstrated that spectral theory can yield a simple, scalable spatial rule, inspiring GAT, GraphSAGE, GIN, and the entire message-passing paradigm. Today, GCN variants power drug discovery, recommendation systems, social network analysis, traffic prediction, and molecular property prediction.

Imagine a village where each house has a mailbox and a color (its feature). Only a few houses have nameplates (labels). Every morning, each house peeks at its neighbors' colors, mixes them with its own, and repaints itself. After a couple of mornings, even the houses without nameplates have absorbed enough information from their surroundings to guess what their nameplate should say.

A GCN is that morning ritual, formalized: each node averages its neighbors' features, transforms the result, and repeats. Two rounds are usually enough.

Why graphs need their own neural networks

Images have a regular grid; text has a linear sequence. Standard convolutions exploit that regularity: slide a fixed-size filter across a grid or sequence. But a social network, a molecule, or a citation graph has no fixed grid — each node may have 1 neighbor or 1,000, and there is no natural left-to-right order.

Before GCN, two families of approaches existed:

  • Feature engineering + classifier. Hand-design graph statistics (degree, centrality, PageRank), ignore the raw node features, and feed them to an SVM. This throws away the rich information sitting on each node.

  • Spectral methods. Decompose the graph Laplacian to define a Fourier transform on the graph, then convolve in the frequency domain. Mathematically elegant, but eigendecomposition costs O(n3)O(n^3) and the filters are graph-specific — train on one graph, and the learned filters cannot transfer to another.

Kipf and Welling asked: can we take the insight from spectral theory — that on a graph is multiplication in the eigenspace of the Laplacian — but simplify it until we get a spatial rule that scales?

Open in Lab
Toggle between the spectral view (eigendecomposition of the Laplacian) and the spatial view (neighbor averaging) to see how GCN bridges the gap.
The demo wakes as you arrive…

From spectral convolution to a one-line spatial rule

The journey from full spectral convolution to GCN's propagation rule has three steps. Each step trades mathematical generality for computational speed, until we arrive at a rule so simple it can be written in one line of code.

Step 1 — Spectral convolution on graphs. Given a graph with NN nodes and adjacency matrix AA, define the normalized graph Laplacian L=IN−D−1/2AD−1/2L = I_N - D^{-1/2}AD^{-1/2} where DD is the . Its eigendecomposition L=UΛUTL = U\Lambda U^T defines a Fourier basis on the graph. A spectral filter gθg_\theta convolves a signal xx by multiplying in the frequency domain: gθ⋆x=U gθ(Λ) UTxg_\theta \star x = U \, g_\theta(\Lambda) \, U^T x. This is exact but costs O(N2)O(N^2) per multiplication and requires computing all eigenvectors.

Step 2 — Chebyshev approximation. Defferrard et al. (ChebNet) approximated gθ(Λ)g_\theta(\Lambda) with a KKth-order , making the filter KK-hop localized and reducing cost to O(K⋅∣E∣)O(K \cdot |\mathcal{E}|) — linear in edges. But KK is a and the polynomial coefficients must be learned.

Step 3 — First-order + renormalization (GCN). Kipf and Welling set K=1K{=}1, producing a filter that looks at each node and its immediate neighbors only. They then apply a : add self-loops (A~=A+IN\tilde{A} = A + I_N) and symmetrically normalize (A^=D~−1/2A~D~−1/2\hat{A} = \tilde{D}^{-1/2}\tilde{A}\tilde{D}^{-1/2}). The result is a single, clean propagation rule per layer.

H(l+1)=σ ⁣(D~−1/2 A~ D~−1/2  H(l) W(l))H^{(l+1)} = \sigma\!\Bigl(\tilde{D}^{-1/2}\,\tilde{A}\,\tilde{D}^{-1/2}\;H^{(l)}\,W^{(l)}\Bigr)
GCN Layer-wise Propagation Rule — At each layer, every node updates its representation by gathering information from its neighboring nodes as well as from itself. These contributions are normalized to account for differences in connectivity, then transformed using learnable parameters and passed through a nonlinear activation function. Repeating this process allows information to spread through the graph, enabling each node to gradually build a richer representation of its local neighborhood.
Open in Lab
See how adding self-loops and renormalizing the adjacency matrix stabilizes the eigenvalue range and changes the propagation behavior.
The demo wakes as you arrive…

The two-layer GCN for node classification

For semi-supervised , Kipf and Welling stack exactly two GCN layers. The first layer takes raw node features X∈RN×CX \in \mathbb{R}^{N \times C} (e.g. a bag-of-words vector for each paper), transforms them to a hidden dimension HH, and applies . The second layer maps the hidden representation to class logits and applies .

Think of it as a two-step conversation: in the first round, each node collects its neighbors' features and builds a richer understanding of its local neighborhood. In the second round, it collects those enriched representations from neighbors — now carrying 2-hop information — and makes its classification decision.

The is computed only on the labeled nodes, but the flows through the entire graph because every node's representation depends on its neighbors, labeled or not. This is the essence of on graphs: the structure itself propagates supervision signal.

Z=softmax ⁣(A^  ReLU(A^ X W(0)) W(1))Z = \text{softmax}\!\Bigl(\hat{A}\;\text{ReLU}\bigl(\hat{A}\,X\,W^{(0)}\bigr)\,W^{(1)}\Bigr)
Two-layer GCN for Classification — The full forward pass: multiply features X by the normalized adjacency twice (once per layer), with a learnable weight matrix and ReLU in between, and softmax at the end.
L=−∑i∈VL∑f=1FYif ln⁡Zif\mathcal{L} = -\sum_{i \in \mathcal{V}_L}\sum_{f=1}^{F} Y_{if}\,\ln Z_{if}
Cross-Entropy Loss (labeled nodes only) — Training is supervised only on nodes whose correct labels are known. The model compares its predictions for these labeled nodes against the ground truth and updates its parameters to reduce the error. Even though unlabeled nodes do not contribute directly to the loss, they still influence learning because information flows through graph connections, allowing their representations to affect the predictions of nearby labeled nodes.
Open in Lab
Explore the two-layer GCN architecture. Click each stage to see dimensions, operations, and how information flows from input features to class predictions.
The demo wakes as you arrive…

Propagation in action: watching features flow

To build intuition, consider a citation network: each paper is a node, each citation is an edge, and each paper's features are its bag-of-words vector. Suppose we label just 20 papers per category (out of thousands).

Layer 1. Every paper averages its own word vector with those of papers it cites or is cited by. A machine-learning paper surrounded by NLP papers absorbs NLP vocabulary into its representation. The matrix W(0)W^{(0)} learns which combinations of neighbor features are informative — compressing, say, 1433 words into 16 hidden dimensions.

Layer 2. Now each paper averages the already-enriched representations of its neighbors. A paper two hops away from a labeled "deep learning" paper now carries some of that label's influence in its representation. The weight matrix W(1)W^{(1)} maps 16 hidden dimensions to the number of classes, and softmax produces a probability distribution.

The labeled nodes anchor the gradient signal. Because the computation graph connects every node to its neighborhood, the gradient from each labeled node ripples outward through 2-hop paths, gently nudging the representations of unlabeled nodes toward the correct classes.

Open in Lab
Watch features propagate through a small citation graph. Labeled nodes spread color (class information) to their neighbors across two GCN layers.
The demo wakes as you arrive…

Semi-supervised magic: few labels, full graph

The key insight is that a GCN does not treat labeled and unlabeled nodes differently during the forward pass — all nodes participate in every propagation step. The asymmetry enters only at the loss: gradients originate from labeled nodes but backpropagate through the shared graph structure to update every weight matrix.

On the Cora dataset (2,708 papers, 7 classes), using only 20 labeled nodes per class (140 total, about 5%), the two-layer GCN achieved 81.5% accuracy. Compare this to label propagation (68.0%), DeepWalk (67.2%), or Planetoid (75.7%). The GCN's ability to jointly learn from features and structure is what makes it so effective with minimal labels.

Why does this work? Consider two nodes connected by an edge but with different initial features. If they share a label, the GCN learns weight matrices that produce similar hidden representations for both, despite their different inputs. The graph structure acts as a regularizer: connected nodes should have similar representations, which is precisely the smoothness assumption underlying semi-supervised learning on graphs.

Open in Lab
Start with just a few labeled nodes and watch the GCN propagate class information across the graph. Toggle label counts to see how accuracy changes.
The demo wakes as you arrive…

The depth trap: why deeper is not always better

In image CNNs, depth is power — VGG, ResNet, and modern architectures go 100+ layers deep. So why does GCN peak at 2–3 layers?

The answer is . Each GCN layer averages a node's representation with its neighbors'. After KK layers, each node's representation is influenced by all nodes within KK hops. For small-world graphs (like citation networks), 6–7 hops already reach most of the graph. The result: after too many layers, every node's representation converges to the same value — all information about the node's own identity is washed out.

Imagine stirring paint colors together. One stir blends neighboring colors nicely. Two stirs create a beautiful gradient. But 10 stirs? You get a uniform brown. That is over-smoothing.

Kipf and Welling found that 2–3 layers achieve optimal performance on their benchmarks. This is not a limitation of graph networks in general — later work (GATv2, JKNet, GCNII) introduced residual connections and identity mappings to enable deeper graph networks — but it is a fundamental property of vanilla GCN that practitioners must respect.

Open in Lab
Slide the layer count from 1 to 10 and watch how node representations become indistinguishable after too many layers.
The demo wakes as you arrive…

GCN in code: surprisingly simple

A minimal two-layer GCN in PyTorchpython

Simplified to show the idea — not the real implementation.

import torch, torch.nn as nn, torch.nn.functional as F

class GCNLayer(nn.Module):
    """One GCN propagation layer: Â X W + bias, then activation."""
    def __init__(self, in_dim, out_dim):
        super().__init__()
        self.W = nn.Linear(in_dim, out_dim, bias=True)

    def forward(self, A_hat, X):
        # A_hat: precomputed D̃^(-1/2) Ã D̃^(-1/2)
        # Aggregate neighbors, then transform
        return self.W(A_hat @ X)


class GCN(nn.Module):
    def __init__(self, n_features, n_hidden, n_classes, dropout=0.5):
        super().__init__()
        self.layer1 = GCNLayer(n_features, n_hidden)
        self.layer2 = GCNLayer(n_hidden, n_classes)
        self.dropout = dropout

    def forward(self, A_hat, X):
        # Layer 1: aggregate + transform + ReLU + dropout
        H = F.relu(self.layer1(A_hat, X))
        H = F.dropout(H, self.dropout, training=self.training)
        # Layer 2: aggregate + transform + softmax
        return F.log_softmax(self.layer2(A_hat, H), dim=1)

Results: outperforming complex pipelines

Kipf and Welling evaluated on three citation network datasets — Cora, Citeseer, and Pubmed — and the NELL knowledge graph. In each, only a handful of labels per class were used for .

On Cora (2,708 nodes, 5,429 edges, 7 classes): GCN achieved 81.5% accuracy with just 140 labeled nodes. The closest competitor, Planetoid, scored 75.7%.

On Citeseer (3,327 nodes, 4,732 edges, 6 classes): GCN reached 70.3%, beating Planetoid's 64.7%.

On Pubmed (19,717 nodes, 44,338 edges, 3 classes): GCN scored 79.0%, surpassing Planetoid's 77.2%.

The GCN also scaled linearly: training time grew proportionally to edge count, not node count squared. On random graphs with up to 1 million edges, wall-clock time remained feasible on a single GPU.

Open in Lab
Compare GCN accuracy against baselines across Cora, Citeseer, and Pubmed benchmarks.
The demo wakes as you arrive…

What GCN unlocked

GCN proved that a principled simplification of spectral theory could yield a practical, scalable architecture. This single insight triggered an avalanche of research.

  1. 2017

    GCN — Graph Convolutional Network

    Kipf and Welling bridge spectral and spatial graph learning with a first-order approximation and renormalization trick. Two layers, a handful of labels, state-of- the-art results.

  2. 2017

    GAT — Graph Attention Networks

    Veličković et al. replace GCN's fixed neighbor weights (from the degree matrix) with learned attention scores, letting each node decide how much to listen to each neighbor.

  3. 2017

    GraphSAGE — Sample and Aggregate

    Hamilton et al. make GNNs inductive: instead of requiring the full graph, sample a fixed number of neighbors and aggregate. New nodes can be classified without retraining.

  4. 2017

    MPNN — Message Passing Neural Network

    Gilmer et al. unify GCN, GAT, and others under one framework: each node sends messages to its neighbors, which are aggregated and used to update the node's state.

  5. 2019

    GIN — Graph Isomorphism Network

    Xu et al. proved that standard GCN is not as expressive as the Weisfeiler-Lehman test and proposed GIN, matching that upper bound and maximizing discriminative power.

  6. 2020

    GNNs for Drug Discovery

    GCN-based models predict molecular properties by treating atoms as nodes and bonds as edges, accelerating virtual screening in pharmaceutical research.

GCN's most lasting contribution is not a number on a leaderboard — it is the proof that graphs are a first-class data type for deep learning. Before this paper, graph methods were niche and expensive. After it, graph neural networks became a standard tool in the ML toolkit, as natural as convolutions for images or attention for sequences.

CitationKipf, Welling. Semi-Supervised Classification with Graph Convolutional Networks. ICLR, 2017.

Terms in this paper