Foundations to Frontier
Tests
E. Deep Learning › E18 Geometric and Equivariant Networks

DGCNN (Dynamic Graph CNN)

DGCNN (Wang, Sun, Liu, Sarma, Bronstein and Solomon, ACM Transactions on Graphics 2019) treats a point cloud as a graph. Its EdgeConv operator applies an MLP to each edge, combining a point's feature with the difference to a neighbour, and max-pools over neighbours. The key twist is that the k-nearest-neighbour graph is rebuilt after every layer in feature space, so points that look alike become neighbours even when far apart. This page covers EdgeConv, dynamic graphs, the architecture and its cost. In the exercises you implement kNN graphs and EdgeConv. You then test clouds made of two small motifs placed far apart, labelled 'same type' or 'different'. A random-weight two-layer EdgeConv network scored 1.00 when its second graph was rebuilt in feature space, against 0.56 with a fixed coordinate graph. Feature-space edges joined the two motifs 56% of the time when they matched and 27% when they differed.

Level 0: Foundation

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

Neighbours that change as the network learns

DGCNN connects every point to its k nearest neighbours and passes messages along those edges, like a graph neural network. After each layer it rebuilds the neighbour lists, not by position but by learned features. Two wing tips on opposite sides of an aircraft can then become neighbours because they look alike. The demo shows a k-nearest-neighbour graph over positions; DGCNN’s later layers build the same kind of graph in feature space.

Geometric deep learning lab
42 directed edges (3 per point). DGCNN rebuilds this graph in feature space after every layer, so "neighbours" change as features evolve.
Why engineers care

DGCNN is a strong, simple baseline for point-cloud classification and part segmentation, used for lidar scenes, scanned parts and molecular point sets.

📝 Quick check (Level 0)
0/3 answered
  1. 1. DGCNN connects each point to…
  2. 2. After each layer the graph is rebuilt using…
  3. 3. So distant but similar points can become…

Level 1: Beginner

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

By hand

  • EdgeConv: x_i′ = max over j in N(i) of h_Θ(x_i, x_j − x_i).
    • x_i carries the global position or feature.
    • x_j − x_i carries the local geometry.
    • The max makes it permutation-invariant over neighbours (permutation-equivariant over points).
  • Edges: a kNN graph has n·k directed edges (1024 points, k = 20: 20,480).
  • Dynamic graph: layer l uses the kNN graph of layer l − 1’s features. Rebuilding it costs n² distances per layer (about a million for 1024 points).
  • Architecture (classification): 4 EdgeConv layers (64, 64, 128, 256), outputs concatenated (512) → 1 × 1 layer to 1024 → global max and average pooling → MLP.
  • Relation to others: with h(x_i, x_j − x_i) = h(x_i) it reduces to PointNet; with h(x_j − x_i) it is a PointNet++-style local operator.
📝 Quick check (Level 1)
0/3 answered
  1. 1. EdgeConv's input for edge (i, j) is…
  2. 2. Edges for 1024 points with k = 20:
  3. 3. With h depending on x_i only, EdgeConv reduces to…

Level 2: Intermediate

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

DGCNN in code

Exercise 1.

  • kNN graphs and edge features [f_i, f_j − f_i] are simple to build.
  • EdgeConv is permutation-equivariant: permuting the points permutes the outputs.

Practice.

  • Use PyTorch Geometric’s DynamicEdgeConv (which rebuilds the kNN graph) or EdgeConv with a fixed graph.
  • k = 20 is the usual choice.
  • The n² kNN step dominates memory for large clouds; subsample to a few thousand points or use a static graph for the first layer.
from torch_geometric.nn import DynamicEdgeConv, global_max_pool
mlp = lambda i, o: nn.Sequential(nn.Linear(2 * i, o), nn.ReLU())
conv1, conv2 = DynamicEdgeConv(mlp(3, 64), k=20), DynamicEdgeConv(mlp(64, 64), k=20)
x1 = conv1(pos, batch); x2 = conv2(x1, batch)            # graph rebuilt from x1
out = head(global_max_pool(torch.cat([x1, x2], 1), batch))
🐍 Exercise 1: kNN and EdgeConv
Build kNN indices, EdgeConv edge features and the EdgeConv operator.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The usual neighbour count is…
  2. 2. The memory bottleneck is…
  3. 3. PyTorch Geometric's layer is…

Level 3: Advanced

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

Theory

Equivariance. EdgeConv is permutation-equivariant over points because the same h is applied to every edge and the max is symmetric over each neighbour set. The kNN graph itself is defined by distances, so it permutes with the points.

Why dynamic graphs. A fixed spatial graph limits information to travel a few hops per layer, as in any message-passing GNN. Rebuilding the graph in feature space lets a layer connect points whose features are similar. These can be parts of the same semantic class anywhere in the cloud. It is a learned, non-local receptive field, related to attention, which connects every pair with learned weights.

Limitations. The kNN graph is discontinuous in the features (neighbour sets change abruptly), and quadratic in n. Like PointNet++, EdgeConv is not rotation-invariant unless trained with rotation augmentation or given invariant inputs.

📝 Quick check (Level 3)
0/3 answered
  1. 1. EdgeConv is ___ over points:
  2. 2. A feature-space graph gives…
  3. 3. DGCNN's kNN step scales as…

Level 4: Expert

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

Does rebuilding the graph in feature space connect distant similar parts?

History.

  • Y. Wang, Y. Sun, Z. Liu, S. E. Sarma, M. M. Bronstein and J. M. Solomon, “Dynamic graph CNN for learning on point clouds” (ACM Transactions on Graphics, 2019).
  • Reported 92.9% on ModelNet40.

Exercise 2.

  • Data: 2-D clouds of two randomly rotated motifs (16 points each, ring or plus sign), placed 1.2–2 apart.
  • Label: 1 if both motifs are the same type, 0 otherwise. This is an XOR-like task: the average of the two motif features cannot separate it linearly.
  • Network: random-weight EdgeConv with k = 8.
    • Layer 1 works on relative coordinates in the coordinate kNN graph.
    • Layer 2 uses either the same coordinate graph (static) or the kNN graph of layer-1 features (dynamic).
  • Classifier: linear, on averaged features.
graph in layer 2 test accuracy
static (coordinates) 0.557
dynamic (layer-1 features) 1.000
feature-space edges joining the two motifs fraction
motifs of the same type 0.564
motifs of different types 0.265
  • The dynamic graph solves the task; the static graph cannot. In coordinate space every neighbour lies in the same motif, so no layer-2 feature compares the two motifs. The classifier is near chance (0.56).
  • Mechanism: in feature space, ring points find other ring points, including those in the far motif. When the motifs match, about 56% of edges cross between them, carrying large coordinate offsets into EdgeConv. When they differ, only 27% do. This difference is linearly readable.
  • Seeds: seeds 1 and 2 gave static 0.513/0.513 and dynamic 1.0/1.0.
  • Caveat: this task was designed so that similar parts are far apart; on tasks needing only local geometry the two graphs perform similarly.
🐍 Exercise 2 (research): does rebuilding the graph in feature space connect distant similar parts?
Classify same-or-different motif pairs with random-weight EdgeConv using a static coordinate graph or a dynamic feature-space graph; measure cross-motif edges.

DGCNN in AI, robotics and aerospace

  • Part segmentation: labelling wings, fuselage and tail in scanned aircraft models (ShapeNet-Part).
  • Lidar scenes: semantic segmentation of indoor and outdoor scans.
  • Molecules and materials: point-set representations of atoms.
  • Design lesson: let the network decide who its neighbours are when related parts are far apart.

References

  1. Y. Wang, Y. Sun, Z. Liu, S. E. Sarma, M. M. Bronstein and J. M. Solomon (2019). “Dynamic graph CNN for learning on point clouds.” ACM Transactions on Graphics 38(5).
  2. C. R. Qi et al. (2017). “PointNet++.” NeurIPS.
  3. M. Fey and J. E. Lenssen (2019). “Fast graph representation learning with PyTorch Geometric.” ICLR Workshop.