HomoFM: Deep Homography Estimation with Flow Matching
Mengfan He, Liangzheng Sun, Chunyu Li, Ziyang Meng
TL;DR
HomoFM introduces a flow-matching formulation for homography estimation by modeling the alignment as a continuous velocity-field transport from the identity grid to the ground-truth warp. It employs a Dirac initialization, an ODE-inspired trajectory with an Euler solver, and a FiLM-conditioned velocity predictor to achieve accurate, multi-step displacement refinement. A training-time gradient reversal layer enforces domain-invariant features, yielding robust cross-domain performance without inference overhead. Empirically, HomoFM attains state-of-the-art accuracy on standard and multimodal benchmarks while dramatically reducing MACs, and demonstrates strong zero-shot generalization on AVIID-homo. This framework offers a robust, efficient approach to geometry-aware vision tasks under domain shifts.
Abstract
Deep homography estimation has broad applications in computer vision and robotics. Remarkable progresses have been achieved while the existing methods typically treat it as a direct regression or iterative refinement problem and often struggling to capture complex geometric transformations or generalize across different domains. In this work, we propose HomoFM, a new framework that introduces the flow matching technique from generative modeling into the homography estimation task for the first time. Unlike the existing methods, we formulate homography estimation problem as a velocity field learning problem. By modeling a continuous and point-wise velocity field that transforms noisy distributions into registered coordinates, the proposed network recovers high-precision transformations through a conditional flow trajectory. Furthermore, to address the challenge of domain shifts issue, e.g., the cases of multimodal matching or varying illumination scenarios, we integrate a gradient reversal layer (GRL) into the feature extraction backbone. This domain adaptation strategy explicitly constrains the encoder to learn domain-invariant representations, significantly enhancing the network's robustness. Extensive experiments demonstrate the effectiveness of the proposed method, showing that HomoFM outperforms state-of-the-art methods in both estimation accuracy and robustness on standard benchmarks. Code and data resource are available at https://github.com/hmf21/HomoFM.
