The 8-Point Algorithm as an Inductive Bias for Relative Pose Prediction by ViTs

Chris Rockwell, Justin Johnson, David F. Fouhey

This paper from researchers at the University of Michigan presents a clever way to bake classical geometric principles into modern Vision Transformers (ViTs) to solve one of computer vision's oldest problems: relative pose estimation.

TL;DR

By introducing a specialized "Essential Matrix Module" (EMM), the authors modify a Vision Transformer to mimic the mathematical structure of the classical Eight-Point Algorithm. This geometric inductive bias allows the model to estimate relative camera rotation and translation (including scale) more accurately and with significantly less training data than standard end-to-end deep learning approaches.

What Problem Does This Paper Address?

Estimating the relative pose—the rotation and translation—between two images is fundamental for 3D reconstruction, SLAM, and AR/VR. Historically, this was solved using the Eight-Point Algorithm, which finds mathematical correspondences between points in two views. While mathematically elegant, classical methods struggle when image overlap is low (wide-baseline) and, crucially, they cannot recover the scale of translation from just two images (they only get the direction).

Modern deep learning methods have tried to solve this end-to-end, but they often require massive amounts of data and complex, multi-stage architectures because they lack an inherent understanding of the underlying geometry. This paper asks: can we give a Transformer a "head start" by forcing its internal computations to look like the Eight-Point Algorithm?

Methods

The authors propose the Essential Matrix Module (EMM), a specialized cross-attention layer placed atop a standard ViT backbone. As shown in Figure 1, the EMM processes flattened patches from two images to produce a feature representation that explicitly approximates the $U^T U$ matrix—the core data structure used in the classical Eight-Point Algorithm to compute the Essential Matrix.

Figure 1. We propose three small modifications to a ViT via the Essential Matrix Module, enabling computations similar to the Eight-Point algorithm. The resulting mix of visual and positional features is a good inductive bias for pose estimation.

To achieve this, they make three specific modifications to standard ViT cross-attention (detailed in Figure 2):

  1. Bilinear Attention: Instead of standard dot-product attention, they use a bilinear form that allows the network to compute second-order interactions between features, mimicking the Kronecker product in the Eight-Point Algorithm.
  2. Quadratic Position Encodings: They append an explicit 6D basis expansion ($[1, u, v, uv, u^2, v^2]$) to the value tokens. This provides the necessary geometric coordinates that the Eight-Point Algorithm requires.
  3. Dual-Softmax: Standard attention forces every patch to match something. Dual-softmax allows the model to "ignore" patches that have no corresponding match in the other image, which is common in wide-baseline settings.
Figure 2. Essential Matrix Module. We make three small changes to standard ViT Cross-Attention: (1) appending positional encodings to Values, (2) applying a dual softmax on Affinities, and (3) applying bilinear attention.

The final output is a mix of visual features (to resolve scale) and geometric features (to resolve pose), which are then fed into a simple MLP to regress the final 7D pose (quaternion for rotation, 3D vector for translation).

Datasets

The model was evaluated on several challenging benchmarks:

  • Matterport3D: Real-world indoor environments re-rendered with wide baselines.
  • InteriorNet: A large-scale synthetic indoor dataset.
  • StreetLearn: Outdoor panoramic images from Google Street View.
  • Synthetic Validation: Custom datasets (3D and 2D motion) used to prove that an MLP can indeed learn the mapping from $U^T U$ to pose (see Figure 6).

Key Insights and Ideas

  • Geometry as Inductive Bias: The core "aha!" moment is that you don't need to choose between "pure geometry" and "pure learning." By structuring the network's layers to match geometric first principles, you get the best of both worlds.
  • Data Efficiency: Because the model "understands" the geometric constraints of the problem, it learns much faster. In limited data regimes (e.g., training on only 32K image pairs), the EMM-equipped ViT significantly outperforms standard ViTs.
  • Resolving Scale Ambiguity: Unlike the classical algorithm, this model can recover translation scale. It uses visual cues (like the known size of a bed or a door) from the "Visual Features" part of the EMM output to resolve the scale that geometry alone cannot provide.
  • Transformers are Natural Geometric Solvers: The authors demonstrate a surprising mathematical alignment between the attention mechanism and classical matrix-based geometric solvers.

Key Results

The proposed method, despite its simplicity, outperformed or matched state-of-the-art complex pipelines (like Sparse Planes, SuperGlue, and LoFTR) across multiple datasets.

  • Matterport3D: The model achieved a median rotation error of 8.01° and translation error of 0.64m, showing better robustness to large viewpoint changes than baselines (see Figure 3 and 4).
  • Robustness: Figure 5 shows that the model maintains high precision even as the rotation between images increases, where other methods often fail catastrophically.
  • Synthetic Proof: Table 1 (Figure 6) confirms that an MLP can learn to estimate pose directly from the $U^T U$ matrix with very low error, validating the theoretical foundation of the EMM.
Figure 3. Epipolar Lines on Matterport. Our predictions better match true pose, particularly on large view changes.
Table 1. Synthetic Validation. We report the median angular er- ror across two tasks (translation & rotation) and four datasets (in decreasing difficulty: 3D, 2D Large/Medium/Small (L/M/S).

Limitations and Future Work

  • Patch Resolution: Because ViTs operate on patches, the model's precision is inherently limited by the patch size. For very small viewpoint changes where sub-pixel accuracy is needed, CNN-based methods might still have an edge.
  • Zero Overlap: The model relies on finding correspondences; it is not designed to predict pose for images with zero overlap.
  • Dataset Bias: The authors note that training on datasets like Matterport (mostly high-end homes) might lead to biases, suggesting that synthetic data like InteriorNet is a vital tool for better generalization.

Future work could involve exploring higher-resolution patch strategies or applying similar inductive biases to other geometric tasks like multi-view stereo.

Summary updated

BibTeX
@inproceedings{rockwell2022point,
  author = {Chris Rockwell and Justin Johnson and David F. Fouhey},
  title = {{The 8-Point Algorithm as an Inductive Bias for Relative Pose Prediction by ViTs}},
  booktitle = {3DV},
  year = {2022},
  url = {https://openreview.net/forum?id=A3G6oYSMqS9},
}
Figure