Affine Steerable Equivariant Layer for Canonicalization of Neural Networks

Yikang Li, Yeqing Qiu, Yuxuan Chen, Zhouchen Lin

Introduction

In deep learning, "equivariance" refers to a model's ability to respond predictably to transformations. While standard Convolutional Neural Networks (CNNs) are naturally equivariant to translations, they often struggle with more complex distortions like rotations, scaling, and shearing unless they are specifically designed for them or trained with massive amounts of augmented data.

This paper introduces the steerable EquivarLayer, the first neural network layer to achieve affine equivariance for arbitrary input and output representations (a property known as steerability). By combining this layer with a novel Det-Pooling module, the authors create a "canonicalization" wrapper. This wrapper allows standard, pre-trained models to handle complex affine transformations far more effectively than traditional data augmentation techniques.

The Challenge of Affine Equivariance

Existing Group Equivariant networks (G-CNNs) have successfully tackled rigid transformations like rotations and reflections. However, the affine group—which encompasses translation, rotation, scaling, and shearing—remains a significant challenge.

Previous attempts to handle affine transformations either required computationally expensive group sampling or were limited to "trivial" representations. This meant they could only process scalar-like features, failing to properly handle directional data like vectors or tensors. This paper fills that critical gap by enabling "steerable" affine equivariance, allowing networks to process complex feature types that transform predictably under full affine actions.

Methodology: Steerable EquivarLayer and Canonicalization

The authors build upon the existing InvarLayer framework but pivot from extracting invariants (features that remain unchanged under transformation) to constructing equivariants (features that change in a mathematically precise and predictable way).

Architecture of the steerable EquivarLayer combining invariant features and equivariant matrices.
  1. Equivariant Matrices: The core innovation is the construction of equivariant matrices. As illustrated in the architecture, the layer processes invariant features through a hidden network and multiplies them with these equivariant matrices. This allows the layer to produce output features that transform according to any specified group representation.
  2. SupNorm Normalization: Differential invariants often suffer from numerical instability (such as division-by-zero errors). To solve this, the authors introduce a normalization technique based on the "SupNorm" (the maximum value of a function over its domain), ensuring the layer remains robust during practical training.
  3. Det-Pooling: To make this framework useful for "canonicalization"—the process of "straightening" an input before passing it to a standard network—the authors developed Det-Pooling. This module evaluates a field of matrices and selects the one with the largest absolute determinant to serve as the "canonical" orientation, scale, and shear for the image.
  4. Canonicalization Wrapper: Instead of building an entirely new equivariant architecture from scratch, the EquivarLayer is used to predict a transformation that "undoes" the affine distortion. A standard, high-performance model (like a ResNet) can then process this "normalized" version of the input.

Experimental Setup and Key Results

The researchers evaluated their method across several image classification and dynamical system tasks, demonstrating that hard-coding mathematical symmetries into the architecture is significantly more efficient than teaching a network through millions of augmented examples.

  • Superior Accuracy on Distorted Data: The model was tested on MNIST-GL+(2), a dataset subjected to arbitrary rotations, scaling (0.8x to 1.2x), and shearing (±10 degrees). The EquivarLayer Canonicalizer achieved a remarkable 1.32% test error, vastly outperforming "Mild Augmentation" (47.28%) and even edging out "Full Augmentation" (1.52%).
  • Generalization: On the more complex Fashion-MNIST dataset, the method maintained competitive performance on original images while significantly outperforming baselines on transformed test sets (including rotation-scale and pure scale subsets).
  • Dynamical System PDE: The model was tested on a dataset based on a partial differential equation to predict vector field evolution under affine symmetries. The EquivarLayer achieved an RMSE of 0.218, whereas a standard SO(2) steerable CNN (which only handles rotation) struggled with an RMSE of 6.881. This highlights the critical importance of handling the full affine group in physical simulations.
  • Efficiency: The canonicalization network is highly lightweight, typically involving fewer than 0.4M parameters, allowing symmetry to be decoupled from the main prediction architecture without massive overhead.

Limitations and Future Directions

While highly effective, the current framework is specifically designed for 2D planes. Extending these mathematical derivations to 3D—which would be highly valuable for medical imaging or point cloud processing—remains a complex next step. Additionally, while inference time per image is relatively low (e.g., 1.8ms for 256x256 images), computational complexity grows proportionally with input size. Finally, the authors suggest that exploring equivariance on more general manifolds (curved surfaces) is a promising direction for future research in both computer vision and scientific computing.

Summary updated

BibTeX
@inproceedings{li2025affine,
  author = {Yikang Li and Yeqing Qiu and Yuxuan Chen and Zhouchen Lin},
  title = {{Affine Steerable Equivariant Layer for Canonicalization of Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=5i6ZZUjCA9},
}
Figure