Skip to content

Experimental: stabilize MEI intrinsics optimization - #103

Draft
heiwang1997 wants to merge 2 commits into
mainfrom
experiment/mei-brown-distortion
Draft

heiwang1997 wants to merge 2 commits into
mainfrom
experiment/mei-brown-distortion

Conversation

@heiwang1997

Copy link
Copy Markdown
Collaborator

Summary

This experimental PR investigates stabilizing MEI intrinsics optimization on a two-sequence Brown/OpenCV k1=-0.3 benchmark.

It includes three default-path correctness fixes:

  • preserve the dimensionless MEI xi Jacobian when scaling image resolution;
  • apply sparse block damping epsilon only to diagonal entries;
  • use a canonical BA group order so cross-Hessian terms are accumulated consistently.

It also adds default-off experimental controls:

  • an MEI center-focal/log-distortion parameterization;
  • per-coordinate intrinsics damping;
  • monotone adaptive BA retries;
  • deterministic sparse reductions and deterministic GeoCalib initialization when PyTorch deterministic algorithms are enabled.

All experimental options default to the existing behavior.

Evaluation

On two 180-frame sequences:

Configuration Live ATE Frozen ATE
ViPE 1.2.0 pinhole 112.1 mm 105.9 mm
ViPE 1.2.0 MEI 321.2 mm 10.6 mm
Strict deterministic experimental recipe 20.3 mm 9.6 mm

The strict result reproduced across seeds 0/1/2. With default stochastic initialization and reductions, live ATE remained basin-sensitive (156.0 / 8.5 / 152.7 mm).

This is not evidence that MEI accurately represents Brown distortion: optimized xi remains large, and a true Brown/OpenCV camera model is still the appropriate long-term solution.

Experimental configuration

pipeline:
  slam:
    optimize_intrinsics: true
    ba:
      fused: false
      intrinsics_parameterization: mei_center_log
      intrinsics_damping_scale: 10.0
      intrinsics_distortion_damping_scale: 1.0
      adaptive_intrinsics: true
      adaptive_all_groups: false
      adaptive_intrinsics_max_trials: 8

Strict deterministic evaluation additionally used CUBLAS_WORKSPACE_CONFIG=:4096:8 before importing PyTorch and torch.use_deterministic_algorithms(True).

Validation

  • pytest -q: 102 passed
  • ruff check .: passed
  • mypy: passed
  • generated configuration docs check: passed
  • mkdocs build --strict: passed
  • composite MEI Jacobian agrees with autograd to approximately 3.6e-15
  • deterministic sparse BA and cross-hash-seed Hessian ordering have regression coverage

Scope

This is experimental infrastructure for reproducing and studying the benchmark. It does not add a Brown/OpenCV camera model, and the experimental optimizer settings should not be promoted to defaults based on these two sequences.

Signed-off-by: Jiahui Huang <jiahuih@nvidia.com>
Signed-off-by: Jiahui Huang <jiahuih@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant