Skip to content

v1.5.0 — Levenberg-Marquardt Optimizer for Deformable Registration

Latest

Choose a tag to compare

@rohitrango rohitrango released this 21 Mar 19:51
· 6 commits to main since this release
f0d53d0

FireANTs v1.5.0 — Levenberg-Marquardt Optimizer for Deformable Registration

We're releasing FireANTs 1.5.0 with a new second-order optimizer: Levenberg-Marquardt (LM) for deformable image registration.

What's new

Levenberg-Marquardt optimizer

The LM optimizer is a second-order method that approximates the local Hessian of the loss at each voxel, taking more informed steps than plain gradient descent. It adapts a damping parameter λ at every iteration:

  • If the loss decreases → λ is shrunk (more Newton-like, larger steps)
  • If the loss increases → λ is grown (more gradient-descent-like, safer steps)

This makes the optimizer self-tuning and robust to poorly-scaled gradients, without requiring manual learning-rate tuning beyond the initial optimizer_lr.

The optimizer is supported for both Greedy and SyN registration and uses a tiled implementation for memory efficiency.

Usage

Switching to LM requires a single argument change:

reg = GreedyRegistration(
    scales=[8, 4, 2, 1],
    iterations=[200, 150, 100, 50],
    fixed_images=fixed_batch,
    moving_images=moving_batch,
    loss_type="fusedcc",
    optimizer="levenberg",   # <-- that's it
    optimizer_lr=0.75,
)

Defaults are tuned for 3-D brain MRI and work well out of the box. Advanced users can tune three damping hyperparameters via optimizer_params:

Parameter Default Role
lambda_init 1e-2 Initial damping (also accepts 'auto')
lambda_increase_factor 1.5 Multiply λ by this when loss worsens
lambda_decrease_factor 0.975 Multiply λ by this when loss improves

Tests & ablations

New tests in tests/test_optimizer_comparison.py benchmark LM against Adam for both Greedy and SyN on a held-out brain MRI pair (Dice > 0.75 threshold). A tile-size ablation sweeps tile_size 1–8 to characterize the memory/accuracy tradeoff of the tiled Hessian approximation.

Documentation

A new how-to guide covers:

  • Drop-in usage with default parameters
  • Full description of all three damping parameters
  • A self-contained evaluation script for registering image pairs and computing per-label Dice scores

Full changelog

  • Added fireants/registration/optimizers/levenberg.py — full LM optimizer with tiled Hessian and adaptive λ
  • Added tests/test_optimizer_comparison.py — Adam vs LM ablations for Greedy and SyN
  • Added docs/docs/howto/levenberg-marquardt.md — how-to guide
  • Bumped version to 1.5.0