NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Statistical transformer networks: learning shape and appearance models via self supervision.

Anil Bas, William A. P. SmitharXiv 2018

TL;DR

The Statistical Transformer Network (StaTN) generalises Spatial Transformer Networks by replacing fixed, hand-picked geometric transformations with a learnable, deformable statistical shape model. By training end-to-end, the network simultaneously learns a statistical representation of an object class (like faces or cats) and how to align inputs to it—all without manual landmark annotations or even identity labels.

What Problem Does This Paper Address?

Establishing dense, nonrigid correspondence between images of the same object class is a cornerstone of computer vision. It allows us to separate an object's true appearance from confounding factors like pose and shape deformation. While standard Convolutional Neural Networks (CNNs) achieve local translation invariance through pooling layers, they lack an explicit mechanism to establish dense, nonrigid alignments.

Spatial Transformer Networks (STNs) introduced explicit geometric warping into deep learning, but they rely on fixed, hand-picked parametric transformations (such as affine or thin-plate splines). Furthermore, traditional methods for building deformable models—like Active Appearance Models (AAMs)—require tedious, manual labeling of landmark points across thousands of training images. This paper tackles the challenge of learning both a deformable statistical shape model and its fitting mechanism directly from raw data without any landmark supervision.

Methods

The authors introduce the Statistical Transformer Network (StaTN). Instead of using a predefined grid transformation, the StaTN incorporates a linear shape model directly into the network architecture as a learnable layer.

Fig. 1. An overview of the statistical transformer network. Learnable components of the network are shown in orange.

The pipeline consists of four main components:

  1. Localiser Network: A CNN that regresses rigid pose parameters (rotation, translation, scale) and nonrigid shape parameters ($\alpha$) from the input image.
  2. Grid Generator: Uses a linear shape model ($x = F\alpha + b$) to generate a low-resolution deformable grid ($10 \times 10$ vertices), which is then scaled, rotated, and translated.
  3. Grid Upsampler: Uses precomputed barycentric weights to smoothly interpolate the low-resolution grid up to a high-resolution sampling grid ($112 \times 112$ pixels), keeping the statistical model's dimensionality low while retaining image detail.
  4. Bilinear Sampler: Resamples the input image using the high-resolution grid to produce a normalised output image.

Manifold Gradient Descent

A key mathematical innovation in this paper is how constraints are enforced during training. The principal components of the shape model ($F$) must remain strictly orthonormal (lying on a Stiefel manifold), and the mean shape ($b$) must remain centered to avoid translational ambiguity with the localiser. Standard stochastic gradient descent (SGD) would break these constraints. The authors incorporate manifold gradient descent into the backpropagation loop, projecting Euclidean gradients onto the tangent space of the manifold and applying a retraction step to update the parameters correctly.

Fig. 2. Manifold optimisation: the Euclidean descent direction −∇f(x) is transformed to the tangent plane at x, TxM, via orthogonal projection and then to the manifold M ⊂Rn via a retraction.

Hybrid Loss Functions

To train the network without landmarks, the authors use a combination of losses:

  • Classification Loss: Standard softmax loss for supervised tasks.
  • Texture Loss (MDL Principle): Inspired by the Minimum Description Length principle, the network learns a linear appearance model (autoencoder) of the warped images. The network minimises reconstruction error, effectively searching for the alignment that makes the object's appearance as compressible and redundant as possible.
  • Regularisation Losses: A Symmetry Loss to encourage bilateral symmetry, and an Area Loss to prevent the grid from collapsing into a single pixel or folding over itself.

Datasets

The model was evaluated on two primary datasets:

  • UMDFaces Dataset: A dataset of human faces. The authors selected the 750 identities with the most images, totalling 61,311 images, used for face classification and alignment tasks.
  • CAT Dataset: A dataset containing images of cat heads. 10,000 images were used to test completely unsupervised transfer learning without identity labels.

Key Insights and Ideas

  • Unsupervised AAMs: By combining an STN with the Minimum Description Length principle, a deep network can discover and build an Active Appearance Model completely from scratch.
  • Geometry via Optimization Constraints: Rather than forcing a network to learn orthogonality through soft penalties in the loss function, embedding Riemannian manifold constraints directly into the backpropagation step guarantees mathematically rigorous shape models.
  • Task-Optimal Alignment: When trained for a specific task (like face recognition), the network learns a custom notion of correspondence optimized specifically for that task, rather than relying on human-defined geometric landmarks.

Key Results

  • Classification Improvement: Incorporating the StaTN into a face recognition network yielded a modest but clear improvement in validation performance over a standard baseline CNN, despite the StaTN discarding background information by cropping tightly to the face.
  • Sharper Averages: When multiple images of the same subject were aligned via StaTN and averaged, the resulting images were significantly sharper and more recognizable than raw image averages, proving that the network successfully established accurate dense correspondence.
  • Unsupervised Transfer: The model successfully transferred its learned face alignment capabilities to the CAT dataset. Using only texture and regularisation losses, it consistently fit a meaningful grid to cat faces and constructed a plausible cat appearance model without any identity labels.

Limitations and Future Work

The primary limitation of the current StaTN framework is that it is strictly 2D. While it can accommodate minor out-of-plane rotations through nonrigid 2D deformations, it cannot explicitly model true 3D perspective or self-occlusions.

The authors note that the most promising direction for future work is extending the architecture to learn a 3D Morphable Model (3DMM) alongside a 3D-to-2D geometric projection layer. However, doing so introduces the challenge of handling non-differentiable visibility functions when parts of the object become occluded.

Summary updated

BibTeX
@misc{bas2018statistical,
  author = {Anil Bas and William A. P. Smith},
  title = {{Statistical transformer networks: learning shape and appearance models via self supervision.}},
  year = {2018},
  eprint = {1804.02541},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1804.02541},
}

Loading related content...

Figure