Group Equivariant CNNs
A normal CNN notices a pattern only where it learned it. Group equivariant CNNs notice it in every rotated or flipped pose at once, with the pose carried along as extra feature channels.
Why Does This Exist?
Rotation augmentation is a tax. Quadrupling the data with rotated copies quadruples training cost, bloats the model with four copies of every filter, and still offers no guarantee — a -degree test rotation falls between the augmented angles. For aerial imagery, microscopy, and industrial inspection, where orientation is genuinely arbitrary, the tax dominates training.
Group equivariant CNNs (G-CNNs) remove it structurally. Convolution is extended from positions to positions-plus-poses, so one learned filter responds at every group element and reports where it fired. The shared principle is geometric deep learning; the continuous-angle sibling is steerable networks.
The one idea you need first. A group convolution correlates the input with transformed copies of one filter. For the group (translations plus rotations by , , , degrees), each filter produces four orientation channels instead of one. Rotating the input permutes energy across those channels rather than destroying it, which is exactly the equivariance guarantee.
Think of It Like This
A stencil you can spin
A fixed stencil prints a star pointing up. To print it pointing right, you cut a second stencil, and a third for down. Soon the workshop wall is covered in near-identical stencils and the apprentice still cannot print a star at degrees.
A G-CNN owns one stencil on a pivot. Spin the paper or spin the stencil; the print lands rotated and the pivot angle is recorded on the job sheet. One tool, every sampled orientation, and the orientation itself becomes part of the output instead of an accident of which stencil you grabbed.
The analogy stops at sampling: the pivot clicks into four detents, not a smooth spin. Between detents, the stencil still improvises.
How It Actually Works
The first layer lifts the image: at each position, it records the filter response under all four rotations, producing feature maps indexed by . Deeper layers convolve over the group itself, combining position and orientation neighborhoods with the same kernel reused across orientations — that reuse is the parameter saving versus augmentation. A final pooling over yields rotation invariance for classification, while keeping yields pose-aware features for detection.
Because the kernel is shared, a corner learned upright is automatically a corner at degrees; the response simply moves to the -degree channel. Rotating the input rotates the channel contents, which is the guarantee augmentation cannot give.
Worked example
Pattern (a dot in the top-left corner). Input (the same dot, rotated degrees clockwise about the patch center). Cross-correlate (no kernel flip) with each rotated copy of , summing elementwise products:
- : : .
- : : .
- : : .
- : : .
Response across channels: . The pattern is found, and the peak sitting in channel reports its pose: rotated degrees. A plain CNN with only would output and miss it entirely.
Code
The point of this snippet is the lift: rotate one filter four ways, correlate, and watch the peak move channels as the input rotates.
def rot90(m: list) -> list: return [list(row) for row in zip(*m[::-1])]
def correlate(x: list, k: list) -> int: return sum(x[i][j] * k[i][j] for i in range(2) for j in range(2))
P = [[1, 0], [0, 0]]filters = [P]for _ in range(3): filters.append(rot90(filters[-1])) # 0, 90, 180, 270
X = [[0, 1], [0, 0]] # P rotated 90 degreesprint([correlate(X, f) for f in filters]) # -> [0, 1, 0, 0]Watch Out For
Forty-five degrees falls between the channels
The guarantee covers the group's four angles exactly. At degrees the response smears across channels and the peak sags, so accuracy on diagonal orientations can trail the axis-aligned numbers by a wide margin.
Sweep validation rotations continuously and read the curve, not just the fourCardinal points. When the dips matter, switch to steerable networks for continuous coverage instead of pretending four samples cover the circle.
Orientation channels quadruple the memory
Lifting multiplies feature-map memory by the group size: four orientations mean four times the activations at every layer. Deep G-CNNs can exhaust memory where a plain CNN of the same width fits comfortably.
Budget channels accordingly: narrower layers with four orientations often beat wider layers with one, and pool over as soon as pose stops mattering downstream. Memory, not parameters, is the binding constraint.
The Quick Version
- A G-CNN convolves over poses as well as positions, so one filter fires at every sampled rotation.
- The worked fixture gives channel responses : found, with pose reported by the peak channel.
- Weight sharing across orientations replaces rotation augmentation with a guarantee at the sampled angles.
- Diagonal angles between samples still sag, so validate on a continuous rotation sweep.
- Feature memory multiplies by the group size, so go narrower and pool over pose early.