Deep networks for medical image registration predict, in under a second, a dense warp that maps one scan onto another. These warps are supposed to preserve topology: tissue should never fold over itself, which in math means the local volume change (the Jacobian determinant of the warp) must stay positive at every point. In practice the networks still fold. VoxelMorph-style models with built-in diffeomorphic layers leave 0.6895% of voxels folded on OASIS brain MRI. The best published repair layer still leaves 0.0207% folded. We propose to remove folding exactly with a short test-time optimization of the network's warp. The optimization starts from a guaranteed fold-free version of the prediction. It then improves image alignment with a logarithmic barrier, a penalty that grows to infinity as any local volume approaches zero, so no iterate can ever cross into folding. A step-size rule checks every local volume before each step is accepted.
The key design choice is where the barrier acts. The obvious move is to add a voxel-wise log-barrier on the Jacobian to the network's training loss. That only constrains warps on training pairs. A trained network gives no feasibility guarantee on a new pair, so the barrier's defining property, that iterates never leave the feasible set, is lost exactly where it matters. We instead apply the barrier to the per-pair optimization at inference. We place it on the signed volumes of the tetrahedra that tile each voxel cube, not on a finite-difference determinant. If every tetrahedron keeps positive volume, the piecewise-linear warp is locally orientation-preserving everywhere, not merely positive at a sampling stencil. Together with the identity boundary condition, that makes it globally one-to-one.
Core Claim
Starting from a strictly feasible scaled-down copy of a network's predicted warp, an interior-point refinement can produce registrations with zero negative tetrahedra on every test pair, which is a certificate rather than a statistic. Its alignment quality should match or beat unconstrained instance optimization, soft folding penalties, and matrix-exponential postprocessing, within a few seconds of GPU time. Training the network with an extended barrier is a secondary component. Its role is to make the prediction nearly feasible so the refinement needs fewer iterations. It is not the source of the guarantee.
Research Program
Let $u$ be the predicted displacement on a voxel grid and $\phi = \mathrm{Id} + u$. Split each voxel cube into five tetrahedra, and let $V_k(\phi)$ be the signed volume of tetrahedron $k$ after warping, normalized by its rest volume. All $V_k$ are cubic polynomials of $u$, so their values and gradients cost little to compute on a GPU even for 35 million tetrahedra.
Phase one: find a feasible start. For $\phi_\alpha = \mathrm{Id} + \alpha u$ we have $V_k(\phi_0) = 1$. We bisect on $\alpha \in [0,1]$ for the largest value at which all $V_k > \epsilon$. This start is fold-free and lies on a path back to the identity. That path matters for the following reason. Jeon et al. show that barrier repulsion can trap trajectories in disconnected feasible pieces. Starting on the identity's piece means we never need to cross between pieces.
Phase two: barrier refinement. We minimize
$$ \mathcal{L}_t(\phi) = \mathcal{S}(m \circ \phi, f) + \lambda R(\phi) - \frac{1}{t}\sum_k \log\big(V_k(\phi) - \epsilon\big), $$
where $\mathcal{S}$ is the image dissimilarity between the warped moving image $m\circ\phi$ and the fixed image $f$, $R$ is the usual smoothness term with weight $\lambda$, $t$ is the barrier sharpness, and $\epsilon$ is a small positive volume floor. We use a first-order or limited-memory quasi-Newton step. Each step passes a fraction-to-boundary test: if any $V_k$ would drop below $\epsilon$, the step is shrunk. We increase $t$ along a short continuation schedule so the barrier fades away from the boundary.
Expected difficulty: ill-conditioning. As $t$ grows the barrier becomes steep, which the file names as the classic failure mode of barrier methods under SGD and Adam. We will compare Adam with backtracking against a Hessian-free Newton-CG solver of the kind O'Neill et al. analyze for nonconvex bound-constrained problems. Their method supplies the solver; our constraints are nonlinear rather than bounds.
Training-time component. We will also train the predictor with the log-barrier extension of Kervadec et al.. That method extends $-\frac{1}{t}\log(-z)$ linearly into the infeasible region so randomly initialized networks can be trained. It was used only for a handful of scalar constraints on segmentation outputs, such as organ size and box tightness. We apply it to dense volume constraints and measure whether it moves the phase-one $\alpha$ closer to 1 and shortens phase two.
What theory we can and cannot claim. Lasserre gives global convergence of barrier methods when the feasible set is convex. The set of positive-volume warps is not convex, so we claim only two things. First, every iterate is feasible. Second, the method converges to a stationary point. The duality-gap bound of order (number of constraints)/$t$ from Kervadec et al. will be reported as a local diagnostic, not as a global certificate.
Baselines
Naive reference points. The first is the network prediction alone: VoxelMorph with scaling and squaring, as in Dalca et al. and VoxelMorph, plus a TransMorph backbone. Scaling and squaring integrates a smooth velocity field by repeatedly composing a small step with itself. It is diffeomorphic in theory but folds after grid discretization. The second is the phase-one output alone, the scaled-back warp $\phi_\alpha$ with no refinement. It is fold-free by construction, and it isolates how much accuracy the barrier refinement recovers.
Strongest existing repair method. The strongest published competitor is the matrix-exponential postprocessing of Pal et al.. It exponentiates each voxel's Jacobian matrix, then refits a displacement field by Poisson reconstruction. On OASIS it reports 0.0207% non-positive Jacobians, down from 0.6895% for VoxelMorph. It keeps Dice near 0.80 at about 1.2 seconds of extra GPU time. We will rerun it on our splits from the same base network.
Strongest soft-penalty competitor. This is the same test-time instance optimization with the barrier replaced by a hinge penalty on $\epsilon - V_k$. It gets the same iteration count, the same optimizer, the same similarity term, and a grid search over the penalty weight with a budget equal to our tuning of $t$. Instance optimization of this kind is part of the SAME++ pipeline, which reports folding cut from about 29% to under 1% with a soft regularizer in its coarse stage. We will also run the official SAME++ code end to end on abdomen CT.
Sliding-motion reference. For lung CT the reference is TM-SPR from Chen and Wei, which learns spatially varying regularization. It reports a target registration error of 1.356 mm on Lung 4DCT and a Dice of 0.677 on autoPET.
What counts as winning. Beating the baselines means two things together. The refinement must reach zero negative tetrahedra on 100% of test pairs. Its Dice, HD95 (the 95th-percentile surface distance), and landmark error must also be no worse than the best fold-producing method, judged by paired tests across pairs, with total runtime within a small multiple of Pal et al.'s overhead.
Ablations. The ablations isolate the key ingredients. We replace the tetrahedral constraint with a central-difference determinant, and we test whether the result is still bijective. We drop the fraction-to-boundary rule. We start from the raw infeasible prediction using the Kervadec extension in place of phase one. We remove the barrier-trained predictor.
Why not just…?
Why not just use scaling and squaring with more integration steps? Folding persists under scaling and squaring because of interpolation error. Dalca et al. still report 0.2 folding voxels per scan on average, and Pal et al. measure 0.6895% on OASIS. We will sweep the number of squaring steps and the grid resolution. If folding reaches zero at an acceptable cost, that weakens our case on brain MRI. We expect it to fail in large-deformation abdomen and lung pairs.
Why not just add a hinge penalty on negative Jacobians at test time? This is the real threat. With a large enough weight it may reach zero folds on most pairs. A penalty allows violations by design, so zero folds would be an empirical outcome, not a guarantee. A large weight also distorts the alignment term everywhere the penalty is active. The matched-budget hinge baseline above settles the question by tracing Dice against folding rate for both methods. If the hinge reaches zero on every pair with equal Dice, our contribution shrinks to the certificate plus the tetrahedral bijectivity. We will report that plainly.
Why not just use Pal et al.'s matrix-exponential layer? Its Poisson refit cannot exactly match a non-integrable matrix field, which is why 0.0207% of voxels remain folded. Our method never leaves the space of real displacement fields, so this failure mode cannot arise. The head-to-head comparison on the same predictions tests whether we gain this guarantee at a lower accuracy cost.
Why not just train with the barrier and skip test-time optimization? A trained network has no feasibility guarantee on unseen pairs. The ablation that removes phase two measures the residual folding a barrier-trained network leaves on held-out data.
Proposed Experiments
We will use three tasks from Learn2Reg: OASIS brain MRI, Abdomen CT-CT, and Lung CT. Each is evaluated with the challenge metrics: Dice, DSC30, HD95, landmark error on lung, SDlogJ (the standard deviation of the log Jacobian determinant), and runtime. To these we add the percentage of non-positive central-difference Jacobians, for comparability with Pal et al., and the percentage of negative tetrahedra. No reported Learn2Reg leaderboard numbers were found on Lacuna for these tasks, so all challenge-task baselines will be rerun.
First decisive check. Does the refinement give zero negative tetrahedra on every test pair while matching Pal et al.'s Dice of about 0.80 on OASIS?
Second decisive check. Is the barrier's Dice-versus-folding curve strictly better than the matched hinge penalty's on Abdomen CT, where deformations are large?
Third check. On Lung CT, does the positive-volume constraint hurt landmark error near sliding interfaces relative to TM-SPR's 1.356 mm? If it does, we will test a lower volume floor $\epsilon$ within thin bands at the lung boundary.
We will also log optimizer conditioning and iteration counts across the $t$ schedule, which shows whether the steep-barrier instability actually appears and whether Newton-CG is needed.
References
- Efficient Diffusion Models under Nonconvex Equality and Inequality constraints via Landing
- A log-barrier Newton-CG method for bound constrained optimization with complexity guarantees
- Constrained deep networks: Lagrangian optimization via Log-barrier extensions
- On convex optimization without convex representation
- Unsupervised learning of probabilistic diffeomorphic registration for images and surfaces
- VoxelMorph: A Learning Framework for Deformable Medical Image Registration.
- Towards Positive Jacobian: Learn to Postprocess for Diffeomorphic Image Registration with Matrix Exponential
- SAME++: A Self-supervised Anatomical eMbeddings Enhanced medical image registration framework using stable sampling and regularized transformation
- Unsupervised learning of spatially varying regularization for diffeomorphic image registration
- Learn2Reg: Comprehensive Multi-Task Medical Image Registration Challenge, Dataset and Evaluation in the Era of Deep Learning