HomoFM: Continuous Flow Homography Estimation
- HomoFM is a deep learning framework for homography estimation that uses a continuous velocity field to dynamically align images.
- It employs a flow matching technique with multi-step Euler integration to achieve state-of-the-art precision and reduced computational cost.
- The architecture integrates DINOv2-Small with a Feature Pyramid Network and gradient reversal for robust, domain-invariant feature extraction.
HomoFM is a deep learning framework for homography estimation that reinterprets the alignment task as a continuous transport of pixel coordinates under a learned velocity field, employing a flow matching technique originally developed for generative modeling. Unlike traditional methods that rely on direct regression or iterative refinement, HomoFM models homography as a velocity-controlled transformation, offering enhanced robustness and accuracy, particularly under large geometric transformations and conditions of domain shift. HomoFM sets new state-of-the-art performance on multiple benchmarks while maintaining low computational footprint (He et al., 26 Jan 2026).
1. Problem Context and Historical Development
Homography estimation involves determining a 2D projective map that warps a source image onto a target image . Traditional approaches consist of photometric-based alignment, which is effective in low-texture regions but fails under large displacements, and sparse feature-based matching, which copes with large baselines but is brittle with low texture or in cross-modal scenarios. Early convolutional neural network (CNN) methods, such as HomographyNet [Detone et al. 2016], implemented direct regression of four-corner offsets using a single forward pass. Later developments in cascaded or recurrent refinement improved precision but incurred significant computational cost and were challenged by severe geometric divergences.
HomoFM diverges from these paradigms by adopting continuous flow matching from generative modeling [Lipman et al. 2022, Liu et al. 2022], formulating homography inference as the computation of pixel-wise velocity fields that chart dynamic, temporally resolved alignment trajectories rather than static displacements or sets of offsets.
2. Mathematical Formulation
A homography transformation maps points to . The classical approach parameterizes this by an 8-degree-of-freedom matrix via least squares fitting of a displacement field over a regular grid.
HomoFM introduces a continuous velocity field view: each pixel is conceptualized as a particle whose displacement evolves within , following
where is a neural field parameterized by and conditioned on the current position, continuous time, and an image context (extracted from ).
The framework minimizes a flow matching loss:
In the homography setting, and . The integral is approximated using -step Euler integration; typically, is sufficient for high precision. The final loss is the robust L2 error at , employing a robust cost function (RoMa).
Key adaptations relative to generative modeling include replacing the usual Gaussian noise prior with a Dirac delta at , and encoding the current time via FiLM layers to flexibly handle the continuous transport trajectory.
3. Network Architecture
HomoFM's backbone comprises DINOv2-Small with a Feature Pyramid Network (FPN) and cross-attention modules to extract multi-scale features at resolutions $1/14$, $1/8$, $1/4$, $1/2$, and full-scale. Low-resolution semantic features are upsampled and concatenated to the FPN to preserve fine-grained detail.
The conditional flow trajectory module, given the current displacement , time embedding , and context , employs a FiLM-modulated residual head to output the instantaneous velocity . Inference proceeds via Euler steps:
1 2 3 4 5 6 |
x = zeros(H,W,2) for n in 1..N: t = n/N v = VelocityHead(x, t, C) x = x + (1/N) * v w_pred = x |
The predicted displacement field is then fit to the homography matrix via Direct Linear Transform (DLT).
4. Domain Adaptation Strategy
HomoFM employs a gradient reversal layer (GRL), following [Ganin & Lempitsky 2015], to enhance domain invariance in scenarios with significant appearance shifts (e.g., visible-infrared or satellite-map matching). A domain discriminator is attached to the first decoder layer through the GRL. The domain adversarial loss
is applied during training, where and denote source and target image features. The GRL inverts gradients ( multiplier), encouraging the backbone to suppress domain-specific cues. The discriminator and GRL are removed at inference, introducing zero runtime overhead.
5. Training Objectives and Optimization
The complete objective function comprises the primary flow matching loss (summed across all FPN scales) and the domain adversarial loss , weighted by following a 5% warm-up:
Training is performed on a single A100 GPU, with mixed precision, gradient clipping (norm 1.0), and Euler inference steps. Multi-scale supervision is enforced by summing across each FPN level.
6. Empirical Evaluation
HomoFM is benchmarked on MSCOCO (natural scenes), VIS-IR (visible/infrared), GoogleMap (satellite/map), and zero-shot AVIID-homo (no fine-tuning). Metrics include AUC@{3,5,10,20} pixels of average corner error (ACE), mean ACE (MACE), parameter count, and MACs.
| Benchmark | HomoFM AUC@3 | GFNet AUC@3 | Params (M) | MACs (G) |
|---|---|---|---|---|
| MSCOCO | 98.45% | 97.69% | 3.37 | 147.4 |
| VIS-IR | 24.51% | 21.28% | 3.37 | 147.4 |
| GoogleMap | 54.39% | 51.44% | 3.37 | 147.4 |
HomoFM reduces computation (–91% MACs vs GFNet) while achieving superior accuracy. Ablation indicates that flow matching yields a 1.0% AUC@3 gain on MSCOCO over an 8-block convolutional regression head, and multi-step inference (N=4) provides further benefits over single-step regression.
Domain adaptation via GRL confers additional robustness, e.g., +0.98% AUC@3 gain on GoogleMap when added to flow matching. Zero-shot generalization on AVIID-homo shows HomoFM maintains the best alignment under severe domain shift (e.g., AUC@3=0.70% vs MCNet’s 0.12% and GFNet’s 0.42%).
7. Limitations and Prospects
HomoFM incurs slightly higher inference latency than single-shot regression due to extra ODE steps but retains a favorable balance between speed and precision. The current architecture assumes a planar scene; extension to nonplanar or 3D warping remains an open direction. Prospective improvements include adaptive step-size integrators to further decrease , application of flow matching to optical flow or dense stereo correspondence, and integration of uncertainty estimation for more robust RANSAC-free alignment, particularly within robotics.
Demonstrated application domains encompass AR/VR image stitching, UAV geo-localization, multimodal medical image alignment, and SLAM under challenging illumination. HomoFM introduces continuous flow modeling and robust domain-invariant feature extraction into homography estimation, attaining high accuracy, strong generalization, and computational efficiency (He et al., 26 Jan 2026).