Modeling Spatial Transformations Instead of Memorizing Transformed Appearances

Alexander Gielisse, Vladimir Rullens, Soumen Sinha, Jan van GemertarXiv 2026

TL;DR

Modern image classifiers are surprisingly bad at separating what an object is from where it is—forcing them to memorize spatial transformations at a massive cost in data and parameters. By explicitly fitting a 6-parameter affine transformation alongside an implicit neural representation of appearance (TP-INR), the authors show we can slash data and capacity requirements and partially unlock the ability to recognize familiar objects in unfamiliar poses.

What Problem Does This Paper Address?

Recognizing an object requires handling two distinct sources of variation: appearance (what the object looks like) and spatial transformation (its position, rotation, scale, and shear).

Figure 1. Appearance and spatial variation. Pens vary in ap- pearance and viewing geometry while retaining their class iden- tity. Recognition must accommodate both sources of variation, although only appearance distinguishes the class. We question whether learning spatial transformations can generalize, and be reused across appearances.

Today’s vision models—from Vision Transformers (ViTs) to ConvNeXts—typically handle spatial variation by brute force: training on massive datasets with heavy data augmentation. This raises a fundamental question: Can neural networks actually learn a generalizable concept of spatial transformations, or do they just memorize every appearance–transformation combination separately?

The authors systematically isolate the cost of learning spatial transformations versus learning appearance alone. They also test compositional generalization: if a model learns to recognize pens in many orientations and markers in only one, can it recognize a marker in a new orientation?

Methods

To test whether explicitly modeling transformations beats memorizing them, the authors introduce Transform-Parameterized Implicit Neural Representations (TP-INR).

Instead of asking a classifier to digest raw, transformed pixels, TP-INR acts as a test-time preprocessing step that aligns each image into a shared reference frame:

  1. Separating Appearance and Geometry: Appearance is modeled by a SIREN (a continuous coordinate-based neural network, or INR), while spatial variation is explicitly represented by just six affine parameters acting on the INR’s input coordinates.
  2. Meta-Learned Initialization: Using Reptile (a first-order meta-learning algorithm), TP-INR learns a single shared appearance initialization across the training set.
  3. Anchored Coarse-to-Fine Fitting: For each new image, TP-INR jointly optimizes the appearance weights and the six affine parameters over 40 steps to reconstruct the image—without needing class labels or transformation annotations. To prevent the appearance network from "cheating" by memorizing the pose, the authors use:
  4. A proximal anchor that penalizes the appearance weights for drifting too far from the shared initialization.
  5. A coarse-to-fine blur schedule (gradually sharpening the target image) to provide broader alignment gradients early on.
  6. Complementary learning rates that let the affine parameters make large alignment moves first, before fine-tuning appearance.

Once fitted, the inferred affine transformation is inverted to warp the original image into the aligned reference frame for any downstream classifier.

Datasets

All experiments are conducted on MNIST ($28 \times 28$ digits centered on a $64 \times 64$ canvas) under controlled, randomly sampled affine transformations:

  • Rotations: up to $\pm 45^\circ$
  • Isotropic scaling: $[0.5, 2.0]$ (sampled log-uniformly)
  • Shear: up to $\pm 15^\circ$
  • Translations: up to $\pm 16$ pixels

The authors use 54k training images (and nested subsets of 54, 540, 5.4k, 27k, and 54k) and evaluate on the 10k MNIST test set. They compare against a ground-truth inverse condition (applying the exact inverse transformation) as an appearance-only upper bound. For compositional generalization, they create a split where even digits are affine-transformed during training, odd digits are inverse-aligned, and all digits are affine-transformed at test time.

Key Insights and Ideas

  • Spatial transformations dominate data and capacity costs: Learning appearance alone is remarkably cheap. The vast majority of training data and model parameters in standard classifiers are spent memorizing spatial transformations.
  • Inductive biases aren't enough: Even architectures with built-in spatial structure—like Spatial Transformer Networks (STNs) and $C_4$ rotation-invariant CNNs—suffer huge data-efficiency drops under affine transformations and still benefit significantly from TP-INR preprocessing.
  • A striking failure of compositional generalization: Classifiers trained on transformed even digits and aligned odd digits almost completely fail to recognize transformed odd digits at test time. Even though the models have seen both the digit classes and the transformation distribution, they cannot recombine them.
Figure 3. Should learning a transformation require seeing it in every object class? Pens and markers differ in appearance, but both can undergo the same changes in position and orientation. A recognizer that has seen pens in many orientations and markers in only one should ideally recognize a marker in a new orienta- tion: the object class and the spatial variation are already familiar, but their combination is new. Success requires transferring trans- formation robustness across classes, rather than learning it sepa- rately from transformed examples of each class. This distinction matters because learning transformation robustness separately for each class requires substantially more training data and classifier capacity than reusing transformation knowledge across classes.

Key Results

Across ViT, ConvNeXt, STN, and $C_4$ CNNs, the numbers paint a clear picture:

  • Data Efficiency: Learning spatial transformations requires 100× to 1,000× more training data to match the appearance-only upper bound. For example, a ViT trained on just 540 appearance-only examples hits ~80% accuracy, whereas a ViT trained on 54,000 affine-transformed examples with data augmentation only reaches ~60%. TP-INR substantially closes this gap across all four architectures, especially in low-data regimes.
Figure 2. The data cost of learning spatial transformations. Ac- curacy of a ViT as a function of training samples. For appearance- only, using the ground truth inverse of the affine transformations, a ViT trained on just 540 examples achieves approximately 80% accuracy, exceeding the roughly 60% achieved by a ViT trained on 54k affine-transformed examples with data augmentation. Despite using 100× more labeled examples, the augmented classifier still performs substantially worse. This illustrates the substantial data cost of learning transformations.
  • Model Capacity: An appearance-only ViT achieves strong accuracy with just 10k parameters. Adding spatial transformations demands 100× to 1,000× more parameters. At roughly 10k parameters, TP-INR reaches ~62% accuracy compared to ~32% for the affine baseline.
  • Compositional Generalization: On unseen class–transformation combinations (transformed odd digits), baseline models collapse. Online data augmentation helps by 5%–10%, while TP-INR boosts accuracy by 25%–30%.

Limitations and Future Work

The authors note two main limitations:

  1. Simple, single-object images: Experiments are restricted to MNIST and global affine transformations. Complex natural images with backgrounds, multiple objects, or local deformations would likely require richer, nonrigid transformation parameterizations or hierarchical fitting.
  2. Test-time compute: Because TP-INR runs 40 steps of iterative optimization per image, it is slower at inference than standard feed-forward networks.

Looking ahead, the authors argue that spatial invariance shouldn't be left to emerge implicitly from massive datasets and giant models—explicitly modeling known transformation structures offers a much more resource-efficient path forward.

Summary updated

BibTeX
@misc{gielisse2026modeling,
  author = {Alexander Gielisse and Vladimir Rullens and Soumen Sinha and Jan van Gemert},
  title = {{Modeling Spatial Transformations Instead of Memorizing Transformed Appearances}},
  year = {2026},
  eprint = {2612.03709},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.03709},
}
Figure