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

Group-equivariant CNNs

Ordinary CNNs are equivariant to translations: shift the image and the feature maps shift. They are not equivariant to rotations or reflections. Group-equivariant CNNs (G-CNNs; Cohen and Welling, ICML 2016) build those symmetries in. A lifting layer applies each filter in all rotated (and reflected) versions, producing feature maps indexed by position and group element. Later group convolutions keep this structure, so rotating the input rotates the features predictably, and pooling over the group yields invariance. This page covers groups, equivariance, lifting and group convolutions, and the p4 and p4m groups. In the exercises you implement a p4 lifting layer and verify equivariance, then classify shapes after training only on upright images. A plain CNN scored 0.75 upright but 0.11–0.36 on rotated images. The p4 G-CNN scored 0.49 at every rotation (invariance error 3 × 10⁻¹⁵): invariance cost upright accuracy but guaranteed it under rotation.

Level 0: Foundation

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

Recognise it at any angle

A normal CNN learns that an edge pointing right is an edge pointing right; rotate the picture and it has to learn the rotated edge all over again. A group-equivariant CNN applies every filter in all of its rotated versions at once, so whatever orientation a pattern appears in, some copy of the filter responds. Taking the strongest response across orientations gives a feature that ignores rotation entirely. The demo rotates a pattern and compares a plain filter with the rotation-pooled filter.

Geometric deep learning lab
Standard filter's best response: 2.0 (changes with rotation). Max over the filter's 4 rotations: 5.0 (the same for every rotation). That is rotation invariance by construction.
Why engineers care

Aerial and satellite images, microscopy and inspection photos have no preferred “up.” Building in rotation symmetry saves data and makes predictions consistent at every orientation.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A plain CNN is equivariant to…
  2. 2. A G-CNN applies each filter…
  3. 3. Pooling over rotations gives…

Level 1: Beginner

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

By hand

  • Group: a set of transformations closed under composition. p4 has 4 rotations by 90°; p4m adds reflections, for 8 elements.
  • Equivariance: f(T_g x) = T′_g f(x), so transforming the input transforms the output predictably. Invariance is the special case T′_g = identity.
  • Lifting layer: [f ⋆ ψ](x, r) = Σ_y f(y) ψ(R_r⁻¹(y − x)) for r = 0..3. Each filter gives 4 rotation channels (16 filters give 64 maps).
  • Under input rotation by k·90°: the maps rotate spatially and the rotation channel shifts cyclically, r → (r + k) mod 4.
  • Group convolution: later layers convolve over position and rotation, keeping equivariance. Pooling over r (max or mean) at the end gives invariance.
  • Weight sharing: parameters per filter are unchanged, but each filter is reused |G| times.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Elements of p4m:
  2. 2. Rotation channel 3 after rotating the input by 90°:
  3. 3. Maps from 16 filters in a p4 lifting layer:

Level 2: Intermediate

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

G-CNNs in code

Exercise 1.

  • Rotating the input rotated the lifting maps and shifted the rotation channel.
  • The rotation-pooled feature was identical for rotated images.

Practice.

  • Libraries: escnn (E(2)/E(3)-equivariant layers, successor of e2cnn) and GrouPy (the original G-CNN code).
  • Choose the group to match the data’s real symmetries (p4m for aerial images; finer rotation groups for microscopy).
  • Keep orientation information until late, then pool, if orientation matters for the task (for example “upright” versus “fallen”).
import escnn.gspaces as gs, escnn.nn as enn
r2 = gs.rot2dOnR2(N=4)                                   # p4: rotations by 90 degrees
inp = enn.FieldType(r2, [r2.trivial_repr])               # grayscale image
hid = enn.FieldType(r2, 16 * [r2.regular_repr])          # 16 filters x 4 orientations
net = enn.SequentialModule(enn.R2Conv(inp, hid, 3), enn.ReLU(hid), enn.GroupPooling(hid))
🐍 Exercise 1: a p4 lifting layer
Build the rotated filter stack, compute lifting responses and a rotation-invariant feature.
📝 Quick check (Level 2)
0/3 answered
  1. 1. A library for E(2)-equivariant CNNs:
  2. 2. If orientation matters for the task, pool…
  3. 3. Aerial images often suit…

Level 3: Advanced

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

Theory

Equivariance from weight sharing. A convolution shares weights across positions, giving translation equivariance. Sharing them across group elements as well (by applying transformed filters) gives equivariance to the whole group. Cohen and Welling showed that group convolutions are, in fact, the most general equivariant linear maps between such feature spaces.

Invariance versus equivariance.

  • Pooling over the group early gives invariance but discards orientation, which may be needed (for example, to tell 6 from 9).
  • Keeping equivariant features through the network and pooling only at the end preserves relative orientations between parts while making the final decision invariant.

Data efficiency. Building symmetry in means the network never has to learn the same pattern at multiple orientations. This reduces the effective hypothesis space and the data needed, and guarantees consistent behaviour on unseen orientations, which data augmentation only encourages.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Group convolutions are…
  2. 2. Pooling over the group too early can lose…
  3. 3. Built-in symmetry versus augmentation:

Level 4: Expert

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

What does built-in rotation invariance buy, and what does it cost?

History.

  • T. Cohen and M. Welling, “Group equivariant convolutional networks” (ICML 2016).
  • M. Weiler and G. Cesa, “General E(2)-equivariant steerable CNNs” (NeurIPS 2019).
  • M. Bronstein, J. Bruna, T. Cohen and P. Veličković, Geometric Deep Learning (2021).

Exercise 2.

  • Data: 12 × 12 images of 4 asymmetric shapes (corner, T, zig-zag, S) at random positions with noise.
  • Features: one layer of 64 random 3 × 3 filters, either a plain CNN (max and mean pooling over space) or a p4 lifting layer with pooling over space and rotation.
  • Protocol: a linear classifier trained only on upright images, tested on images rotated by 0°, 90°, 180° and 270°.
features upright 90° 180° 270° mean
plain CNN 0.745 0.105 0.362 0.122 0.334
p4 G-CNN 0.492 0.492 0.492 0.492 0.492

The G-CNN’s features differed by at most 3 × 10⁻¹⁵ between an image and its 90° rotation; the CNN’s by 3.06.

  • Invariance is exact and so is the guarantee: the G-CNN gives identical predictions at every rotation.
  • The plain CNN collapses on rotated inputs: below chance at 90° and 270°, because it learned orientation-specific features from upright data.
  • Invariance has a price: pooling over rotations throws away orientation cues the upright classifier could use, so upright accuracy is lower (0.49 against 0.75). Averaged over orientations the G-CNN wins (0.49 against 0.33). Seeds 1 and 2 showed the same pattern (CNN 0.76 and 0.85 upright, 0.11–0.43 rotated; G-CNN 0.48 and 0.51 everywhere).
🐍 Exercise 2 (research): what does built-in rotation invariance buy, and what does it cost?
Train on upright shapes with plain-CNN and p4 G-CNN features, then test at four rotations.

G-CNNs in AI, robotics and aerospace

  • Remote sensing: object detection in satellite and aerial images at arbitrary headings.
  • Inspection and microscopy: defects and cells with no canonical orientation.
  • Design lesson: build in the symmetries the task truly has, and decide deliberately where to pool them away.

References

  1. T. Cohen and M. Welling (2016). “Group equivariant convolutional networks.” Proc. ICML.
  2. M. Weiler and G. Cesa (2019). “General E(2)-equivariant steerable CNNs.” NeurIPS.
  3. M. M. Bronstein, J. Bruna, T. Cohen and P. Veličković (2021). “Geometric deep learning: grids, groups, graphs, geodesics, and gauges.” arXiv:2104.13478.