Building Rome with Convex Optimization

Haoyu Han, Heng Yang

TL;DR

This paper introduces XM, a novel approach to Structure from Motion (SfM) that leverages convex optimization and learned depth estimation to achieve highly accurate 3D reconstructions. By reformulating the challenging bundle adjustment problem into a solvable convex optimization problem, XM offers significant speedups and scalability, making it practical for large-scale datasets without requiring manual initialization.

What Problem Does This Paper Address?

Structure from Motion (SfM) and Simultaneous Localization and Mapping (SLAM) pipelines rely heavily on a process called "bundle adjustment" (BA) to reconstruct 3D scenes and camera poses from 2D image keypoints. Classical BA is notoriously difficult to optimize due to its inherent nonconvexity and massive scale, often requiring good initial guesses and getting stuck in suboptimal solutions. Existing solvers, while powerful, can be slow and struggle with very large datasets. This paper aims to overcome these limitations by developing a BA solver that is initialization-free, scalable, and guarantees global optimality.

Methods

The core of the proposed solution, XM, lies in a two-pronged approach:

  1. Scaled Bundle Adjustment (SBA) with Learned Depth: The authors first reformulate the standard BA problem. Instead of directly using 2D keypoints, they lift them to 3D using depth predictions from pre-trained monocular depth estimation models. This introduces a "scale" parameter for each camera, allowing the system to correct for potential inaccuracies in the learned depth. This "scaled bundle adjustment" formulation removes the complex reprojection function, simplifying the optimization.
  2. Convex SDP Relaxation and Fast Solver: The simplified SBA problem is still nonconvex. To address this, the authors employ a powerful technique: a convex Semidefinite Programming (SDP) relaxation. This relaxation provides a certifiably optimal solution to the convexified problem. To solve this large-scale SDP efficiently, they utilize:
  3. Burer-Monteiro (BM) Factorization: This technique exploits the expected low-rank structure of the optimal SDP solution, reducing the problem's dimensionality.
  4. Riemannian Trust-Region Optimizer (XM): A custom, highly optimized solver implemented in C++/CUDA is developed to solve the nonconvex subproblems arising from the BM factorization on the manifold of matrices. This solver is significantly faster than existing CPU-based alternatives.

Datasets

The paper evaluates its approach on several established datasets:

  • BAL Dataset: A benchmark for bundle adjustment with varying numbers of camera frames.
  • Replica Dataset: A synthetic dataset of indoor scenes.
  • Mip-Nerf and Zip-Nerf Datasets: Real-world datasets focused on single objects, used for evaluating learned depth and novel view synthesis.
  • IMC, TUM, and C3VD Datasets: Challenging datasets with varying environments and image quality, including medical data.

The authors also utilize pre-trained monocular depth estimation models like UNIDEPTH, Depth-pro, DepthAnything-v2, and Metric3D-v2.

Key Insights and Ideas

  • Learned Depth as a Game Changer: Lifting 2D keypoints to 3D using learned depth, along with a learnable scale parameter per camera, significantly simplifies the bundle adjustment problem, making it amenable to convex optimization techniques.
  • Convex Relaxation for Certifiable Optimality: The use of SDP relaxation is crucial for guaranteeing that the final solution is globally optimal, a feat difficult to achieve with traditional iterative BA solvers.
  • BM Factorization and Riemannian Optimization for Scale: The combination of Burer-Monteiro factorization and a custom CUDA-accelerated Riemannian optimizer is key to solving these large-scale SDPs efficiently, pushing the boundaries of what's computationally feasible.
  • Initialization-Free is a Major Win: The entire pipeline, from depth estimation to the final optimization, is designed to be initialization-free, a significant advantage over many existing SfM systems.

Key Results

  • Speed: XM is up to 100 times faster than MANOPT and significantly faster than other baselines like COLMAP and GLOMAP, especially on large datasets. For instance, it can solve datasets with thousands of frames in seconds or minutes, whereas others take hours.
  • Scalability: XM scales to datasets with over 10,000 camera frames, a scale that is challenging for many existing solvers.
  • Accuracy: XM-SfM achieves comparable or superior reconstruction quality (measured by ATE and RPE) to state-of-the-art methods, even when compared to solvers that require good initializations.
  • Global Optimality: The method demonstrates certifiable global optimality on most tested datasets, as evidenced by small suboptimality gaps and near-zero minimum eigenvalues of the dual matrix.

Limitations and Future Work

  • Depth Model Dependency: The performance of XM is dependent on the quality of the learned depth estimation model. While the system can correct for some inaccuracies, highly erroneous depth predictions can still impact results.
  • Sparse Matrix Operations: The current GPU solver relies on dense matrix-vector multiplication. Extending it to handle sparse patterns, common in SLAM camera sequences, could further improve efficiency.
  • Preprocessing Bottlenecks: While the XM solver is extremely fast, components like feature matching and indexing can still be time-consuming. Future work aims to accelerate these through CUDA implementation.
  • Data Scarcity for Depth Models: Training effective depth predictors, especially for specialized domains like medical imaging, can be challenging due to data scarcity.

Summary updated

BibTeX
@misc{han2025building,
  author = {Haoyu Han and Heng Yang},
  title = {{Building Rome with Convex Optimization}},
  year = {2025},
  eprint = {2502.04640},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.04640},
}
Figure