Skip to content
AI.info

Research

Factorized Gradients for Scalable Highly-expressive Parametric Diffeomorphisms

Overview Research area: Computer vision and computational geometry, specifically learning and optimizing diffeomorphic (smooth, invertible, topology-preserving) spatial transformations for image regis

arXiv
2610.34766
Published
2026-10-26
Authors
Amit Aflalo, Eran Treister, Chaim Baskin, Oren Freifeld

AI summary

Overview

Research area: Computer vision and computational geometry, specifically learning and optimizing diffeomorphic (smooth, invertible, topology-preserving) spatial transformations for image registration and spatial modeling.

Technical level: Advanced. The paper builds on the Continuous Piecewise-Affine Based (CPAB) transformation framework and requires familiarity with ordinary differential equations, adjoint sensitivity methods, matrix exponentials, and GPU kernel design.

Scope: The paper introduces FG-CPAB, a factorized-gradient formulation that decouples trajectory integration from parameter-space projection, making fine-tessellation CPAB diffeomorphisms practical in 1D, 2D, and 3D.

What This Paper Is About

Diffeomorphisms are the natural tool for modeling deformations that must not tear, fold, or self-intersect, but existing methods either use dense-grid parameters that scale with image resolution or, in the CPAB case, have a gradient computation whose cost is tied to the number of parameters and therefore becomes prohibitive for finely tessellated domains. The paper's goal is to break that coupling: it reformulates the backward pass so that the expensive trajectory work never touches the parameter dimension, and only a final sparse projection does. This makes highly expressive fine-tessellation CPAB transformations computationally feasible for the first time in 2D and 3D.

Key Contributions

  1. FG-CPAB (factorized gradients). A gradient-factorized backward pass based on discrete-adjoint moment accumulation. Unlike standard adjoint methods, which still carry parameter dependence through the backward integration, this method exploits the linear CPA basis structure to accumulate parameter-independent cell-wise moment matrices and recover all gradients only in a final sparse projection step. Complexity drops from O(dTN) to O(TN + dC), where T is the number of integration steps, N the number of transformed points, C the number of tessellation cells, and d = dim(θ).

  2. An efficient implementation. The paper combines factorized gradients with optimized GPU kernels and a sparse construction of the basis matrix B (derived in Appendix F), which reduces memory footprint and lets the projection step exploit basis sparsity. Segmented checkpointing with segment length S = 4 reduces per-thread storage from O(T) to O(T/S + S).

  3. Scalable diffeomorphic optimization in 2D and 3D. The formulation makes fine-tessellation CPAB practical for spatial modeling and competitive with other diffeomorphic primitives, demonstrated on synthetic registration, the IXI brain MRI benchmark, and a neural-operator learning task.

  4. Composition as a route to non-stationary fields. Because the method is cheap, composing m CPAB transformations becomes practical; this increases expressiveness beyond a single stationary CPA velocity field (CPAB diffeomorphisms are not closed under composition) while each stage remains topology-preserving.

Main Findings

  • Orders-of-magnitude speedups over libcpab (2D): Up to 75× faster forward passes, 10^4× faster gradient computation, and over 500× lower peak memory. The standard implementation does not run beyond N_tess = 12 because its backward pass couples the parameter dimension directly to kernel-launch geometry; FG-CPAB keeps scaling to finer resolutions. Figure 1's evaluation used a single RTX A6000 GPU with 125,000 2D points and a batch size of 16, with C = 4N_tess^2 triangular cells in 2D.

  • Consistent gains in other dimensions: In 3D, up to 60× forward acceleration, 4,477× backward acceleration, and a 180× reduction in peak memory; in 1D, up to a 301× backward speedup.

  • Faster than optimized diffeomorphic baselines: On 2D (512×512) and 3D (128×128×128) grids with batch size 32, a 15×15 tessellation in 2D (4×15^2 triangles) and a 15×15×15 tessellation in 3D (5×15^3 tetrahedra), FG-CPAB reduces total runtime by 2.4× relative to VoxelMorph SVF and 21.4× relative to torch-lddmm in 2D, and by 2.3× and 21.2× respectively in 3D. Absolute 2D numbers: 1.69 ± 0.06 ms forward, 8.64 ± 0.02 ms gradient, 197.97 MiB peak memory, versus 11.41 ± 0.02 / 13.42 ± 0.08 / 1330.13 for VoxelMorph and 51.23 ± 0.41 / 169.75 ± 0.06 / 3162.13 for torch-lddmm. In 3D: 31.10 ± 0.18 ms forward, 117.50 ± 0.34 ms gradient, 2351.61 MiB for FG-CPAB, versus 119.14 ± 0.03 / 220.21 ± 0.24 / 14432.13 and 732.81 ± 0.40 / 2414.12 ± 0.53 / 43288.13.

  • Compact parameterization optimizes better than a dense SVF under a matched budget: On a synthetic blob-registration benchmark with 1000 fit steps and a dense SVF integrated with 7 scaling-and-squaring steps, FG-CPAB reached 8.853e-05 ± 3.9e-05 MSE in 2D (842 parameters) versus 2.651e-03 ± 1.2e-03 for the dense SVF (524,288 parameters), fitting in 0.525 ± 0.044 s versus 1.356 ± 0.007 s, with 0.028% versus 0.178% non-positive Jacobians. In 3D, 7.255e-05 ± 2.5e-05 (8,232 parameters) versus 1.676e-04 ± 4.1e-05 (6,291,456 parameters), 6.140 ± 0.021 s versus 12.906 ± 0.021 s, and 0.012% versus 0.021% non-positive Jacobians.

  • The advantage is practical, not representational: Appendix C.1 reports that heavily regularized dense SVFs can eventually approach, and in some cases surpass, CPAB in final reconstruction error, but only after orders of magnitude more optimization steps.

  • Competitive 3D deformable registration without pre-training: On IXI, a single CPAB transformation reaches 0.760 ± 0.023 Dice with fewer than 0.0001% non-positive Jacobians, converging in approximately 5 seconds per volume pair on an RTX A6000 GPU versus approximately 135 seconds for LDDMM. This edges past learned baselines such as TransMorph (0.753 ± 0.123) and ScaMorph (0.755 ± 0.132), and classical methods such as SyN and NiftyReg (both 0.645).

  • Composition steadily improves Dice: 0.760 for i = 1, 0.762 ± 0.024 for i = 2, 0.763 for i = 3, and 0.765 ± 0.024 for i = 4, with non-positive Jacobians remaining below 0.0001% throughout. A synthetic two-blob crossing-trajectory example shows a single CPAB cannot capture the motion but a composition can.

  • CPAB works as a geometry code for operator learning: In a DIMON-style reaction–diffusion setting, using the CPAB parameter vector directly as the geometry code (matched in dimension to the PCA encoding, and removing the separate compression step) gives a test relative L2 mean of 0.052811 with std 0.022436, versus 0.082821 and 0.033168 for the PCA-based LDDMM deformation encoding.

Methodology in Plain English

CPAB works by covering the domain with a tessellation (triangles in 2D, tetrahedra in 3D) and letting the velocity field be affine within each cell while remaining continuous across cell boundaries. The resulting motion is obtained by integrating that velocity field forward through time, and the free parameters θ control the affine coefficients. The trouble was the backward pass: the conventional approach tracks how sensitive each of the N points is to each of the d parameters at every one of the T integration steps, which costs O(dTN).

The new approach reformulates this in three phases. First, it integrates the trajectories forward but only saves occasional checkpoints (every S = 4 steps) rather than the whole path. Second, it sweeps backward segment by segment, re-running each segment from its checkpoint, propagating an adjoint vector via a transposed midpoint rule (second-order Runge–Kutta), and, crucially, accumulating for each cell a small moment matrix M_c of size K×(K+1) that is built from the adjoint and position vectors. That moment matrix has no dependence on the parameter dimension d at all. Third, once all moments are accumulated, the entire gradient is recovered by a single projection ∇θL = B^T vec({M_c}), which is the only step that touches d, and it exploits the sparsity of the basis matrix B.

Two subtleties are handled explicitly. The forward pass uses the exact matrix exponential exp(hÃ_c) per cell, while the gradient uses the midpoint rule; because the velocity field is typically non-differentiable across cell boundaries, an optimize-then-discretize adjoint could follow a different cell sequence than the forward pass, so the authors use a discretize-then-optimize treatment for the backward pass (with a numerical gradient check in Appendix I). The total cost becomes O(TN + dC): the O(TN) integration and adjoint work is independent of d, and the O(dC) projection is independent of N and T.

Why This Matters

Impact on research. The paper removes what it calls the long-standing bottleneck that restricted CPAB to coarse tessellations, turning a compact but previously hard-to-scale parameterization into a practical primitive for large-scale nonrigid spatial modeling. Because CPAB's parameter count depends on tessellation fineness rather than data resolution, the method offers an interpretable expressiveness–complexity trade-off that dense SVF and LDDMM formulations do not. The results also suggest that compact, structured parameterizations can outperform far larger dense ones under realistic compute budgets, which is a useful counterpoint to the prevailing "more parameters" trend in deformable registration.

Real-world applications:

  • Medical imaging: per-volume-pair brain MRI registration, where the reported 0.760 Dice at roughly 5 seconds per pair with near-zero topology violations matters for clinical throughput.
  • Scientific computing and simulation: learning PDE operators across varying geometries in the reaction–diffusion setting, with CPAB parameters serving directly as the geometry descriptor.
  • Time-series alignment and trainable activation functions in 1D, where the reported 301× backward speedup applies.
  • Generative modeling and 2D vision tasks, plus parameter-efficient multi-task fine-tuning, all of which have prior CPAB usage that this work makes cheaper.

Industry relevance. Registration, spatial alignment, and geometric warping pipelines in medical imaging, autonomous-sensing, and content-production all need deformations that never fold or tear. A 10^4× gradient speedup and 500× memory reduction change what hardware tier is sufficient, and the near-zero non-positive-Jacobian rates reported on IXI are directly actionable for regulated clinical and industrial workflows.

Future Directions

  • Characterizing what single CPAB still cannot represent. The paper notes that some orientation-preserving diffeomorphisms cannot be represented or well approximated by a single CPAB transformation. How many composed stages are needed, and how to choose that number or the tessellation automatically, remains open.
  • Reconciling the forward/backward discretization mismatch more rigorously. The authors adopt a discretize-then-optimize backward pass specifically to avoid the inconsistency that ANODE identifies; a deeper analysis of gradient error at cell boundaries, beyond the numerical check in Appendix I, would be valuable.
  • Extending beyond the tested scales. The 3D experiments use 128×128×128 grids and 15×15×15 tessellations, while Figure 3 investigates up to tessellation 30 (5×30^3 = 135,000 unique cells) on IXI. Behavior at substantially finer tessellations and higher resolutions is not reported.
  • Broadening the operator-learning role. The CPAB geometry code is demonstrated only on the DIMON reaction–diffusion benchmark; whether it generalizes to other PDE families and other operator backbones is untested here.

Target Audience

Researchers and practitioners in medical image registration, computational anatomy, and diffeomorphic shape modeling who need topology-preserving deformations at scale; machine-learning engineers building differentiable spatial-transformation layers, particularly those who have hit the performance wall of libcpab or dense SVF/LDDMM implementations; and scientific-computing developers interested in structured, low-dimensional parameterizations of geometry for operator learning. Readers should be comfortable with ODE integration, adjoint methods, and GPU performance analysis.

Authors’ abstract

Diffeomorphisms provide a flexible, topology-preserving mathematical tool for modeling complex spatial or temporal deformations and are used in various scientific fields. However, making these deformations simultaneously highly expressive and computationally efficient remains challenging. Continuous Piecewise-Affine Based (CPAB) transformations (Freifeld et al., ICCV 2015; IEEE TPAMI 2017) offer an attractive solution by parameterizing a family of diffeomorphisms via continuous velocity fields that are piecewise affine with respect to a chosen tessellation of the domain. Importantly, $d=\dim(θ)$, the dimension of the parameter vector $θ$, depends on the fineness of the tessellation rather than on the data resolution. Despite this compact parameterization, CPAB optimization has long been hindered by the tight coupling between trajectory integration and gradient computation with respect to $θ$. We introduce FG-CPAB, a factorized-gradient formulation for scalable CPAB transformations. By separating integration from parameter-space projection, our method reduces gradient computation complexity from $\mathcal{O}(dTN)$ to $\mathcal{O}(TN+dC)$, where $T$ is the number of integration steps, $N$ is the number of transformed points, and $C$ is the number of tessellation cells. This reformulation yields speedups of up to four orders of magnitude (e.g., $\approx 10^4\times$ in 2D), substantial memory savings (e.g., $\approx 500\times$ reduction in peak GPU memory usage in 2D), and dramatically higher expressiveness. This makes fine-tessellation CPAB practical in 2D and 3D for the first time, enabling highly expressive parametric diffeomorphisms.

Read the original paper