Deformable image registration warps one scan so it lines up with another, for example two brain MRIs or the same lung at inhale and exhale. A valid warp must not fold tissue onto itself or tear it apart. Learned registration networks get this property indirectly. They are trained to make the images match while also paying a penalty for any warp that is not smooth, and smoothness then acts as a stand-in for "no folding." The stand-in is expensive. Real anatomy slides and shears: the lung glides along the chest wall, and cortical folds shift sharply. A smoothness penalty strong enough to prevent folding also blurs exactly these motions. We propose to stop using smoothness as a proxy and instead treat "no folding" as the thing actually enforced during training. The registration network is trained with very little smoothing. Whenever an image-matching update would create folds, that update is geometrically projected so that, to first order, it cannot increase folding.
The projection borrows from gradient surgery, a family of multi-objective training methods that modify each loss's gradient before the parameter update so that improving one loss does not undo another. The key design choice is that the hierarchy is asymmetric. Topology is a hard priority, and image similarity is pursued only in directions that do not violate it. This differs from symmetric conflict removal, which we argue would silently disable regularization in registration. The decisive question is whether this moves the accuracy-versus-plausibility Pareto front of registration outward, or whether it only slides along the same front that tuning a scalar weight already reaches. The proposal is built so that experiments answer that question either way.
Core Claim
Registration networks such as VoxelMorph, its diffeomorphic variant, and TransMorph all minimize a fixed weighted sum of an image-similarity loss and a smoothness loss. A diffeomorphism is a smooth, invertible warp. The diffeomorphic variants parameterize the warp as an integrated velocity field computed by "scaling and squaring," which repeatedly composes a tiny warp with itself. This yields near-zero folding: Dalca et al. report 0.2 folded voxels on average. However, that guarantee holds only when the velocity field is smooth enough for the discrete integration to be faithful, so the smoothness weight is never really optional.
We claim that a large part of the accuracy lost to smoothing comes from asking smoothness to do topology's job. If folding is controlled directly, through an asymmetric, optimizer-aware projection against a folding penalty, then the smoothness weight can be pushed close to zero. Sliding and shearing motions are then recovered without the spatial weight maps of TM-SPR and without anatomical masks.
Why symmetric gradient surgery is the wrong tool here
The obvious combination of the two research directions would apply PCGrad or ConFIG to the similarity and smoothness gradients. The research file found no paper that does this. We think the idea is flawed rather than merely untried. In registration, the smoothness gradient is supposed to oppose the similarity gradient wherever similarity is fitting noise or intensity artifacts; that opposition is the whole function of a regularizer. Removing the "conflicting" component of either gradient therefore removes regularization precisely where it acts.
ConFIG's own result points the same way. It shows that reweighting cannot remove a conflict and only chooses which loss loses. Yet at any Pareto-optimal point the two gradients are anti-parallel, so persistent conflict between similarity and smoothness is the expected signature of a good solution, not a pathology.
Folding is different. A folding penalty is zero on every valid warp. Its gradient is nonzero only near an actual violation. It encodes a physical constraint, since tissue cannot invert, rather than a preference. This makes it a constraint to be respected, which is exactly the setting of asymmetric projection. DiGraP uses asymmetric projection to protect pretrained features: it projects task gradients off a weight-distance regularizer, with learned strength. We transplant the asymmetric idea but change the protected quantity. Instead of a static penalty in weight space, we protect a functional, geometric constraint computed on the integrated warp.
Method
The network predicts a stationary velocity field, integrated by scaling and squaring as in Dalca et al., on a TransMorph backbone. The folding penalty is the hinge loss $L_f = \sum_x \max(0, \epsilon - \det J_\phi(x))$, where $J_\phi$ is the finite-difference Jacobian of the integrated warp and the margin $\epsilon > 0$ activates the penalty slightly before an actual fold forms.
Let $g_s$ and $g_f$ be the parameter gradients of the similarity loss (with its now very small smoothness term folded in) and of $L_f$. The descent direction is
$$d = g_s + \left(\alpha L_f - \frac{\min(0, \langle g_s, g_f\rangle)}{\|g_f\|^2}\right) g_f .$$
The second term removes any component of the similarity step that would increase folding to first order. The restoration coefficient $\alpha \ge 0$ pushes back toward the feasible set in proportion to the current violation. This is classical gradient projection for constrained optimization, applied per minibatch. When no voxel is near folding, $g_f = 0$ and the update is plain descent on similarity. Memory overhead is one extra gradient copy, about 2P for P parameters, which is affordable for TransMorph-sized models. Gap 5 in the file flags this cost as the bottleneck for M-loss methods.
The second ingredient addresses a problem identified by Gradient-Update Mismatch. That paper shows Adam's momentum and per-parameter scaling can turn a conflict-free gradient into a conflicting update, with conflict rates up to 86.3% in its PDE experiments. Its fix, Gradient-Update Alignment (GUA), projects the optimizer's proposed update back into the conflict-free cone under Adam's metric and resynchronizes the momentum state.
Every registration network we know of trains with Adam. If this mismatch occurs here, projecting $g_s$ alone would let momentum re-inject folding pressure step after step. We therefore apply the half-space constraint $\langle u_t, g_f\rangle \ge 0$ to Adam's final update $u_t$, following GUA, rather than only to the raw gradient. Whether this matters in registration is an open empirical question (Gap 2) that we measure directly.
Research Program
The work has three stages.
The first stage is diagnostic. We train diffeomorphic TransMorph on OASIS and lung 4DCT across a sweep of smoothness weights. Throughout training we log the cosine between $g_s$ and $g_f$, the fraction of steps on which the raw gradient conflicts with the folding gradient, and the fraction on which the Adam update conflicts even after gradient-level projection. This establishes whether the conflict and the gradient-update mismatch exist in this domain and when they appear. We expect them to concentrate at low smoothness weights and late in training.
The second stage builds the projected trainer in two versions, gradient-level and update-level (GUA-style). We sweep the residual smoothness weight down by orders of magnitude to trace a full front rather than a single operating point.
The third stage is analytic. We examine where in the image the method permits large Jacobian variation: whether it concentrates at sliding interfaces such as the pleura, or spreads as high-frequency jitter. We also check whether the constraint, enforced only on training pairs, generalizes to folding-free warps on unseen test pairs, because amortized inference gives no per-instance guarantee.
Baselines
The naive reference is diffeomorphic TransMorph trained with its standard weighted-sum loss at the default smoothness weight. On inter-patient brain MRI, TransMorph reports a mean Dice of 0.745 with essentially no folding. It shows what the field gets with no special treatment.
The strongest competitor on this specific question is not a single run but the full scalar-weight front: the same model trained at eight or more smoothness weights, with and without an added soft Jacobian penalty at several weights. This is the honest version of the "just tune λ" argument. It receives the same total GPU budget as our method's sweep over residual smoothness and α, on identical data splits, backbone, and training length. Beating it means a point on our front that dominates it, meaning higher Dice or lower TRE at equal or lower folding fraction and SDlogJ (the standard deviation of the log Jacobian determinant, Learn2Reg's measure of warp plausibility). The dominance must hold across seeds. Matching the front is a negative result, not a win.
The strongest existing method for sliding motion is TM-SPR. It learns a per-voxel regularization weight map with Beta hyperpriors tuned by Bayesian optimization. It reports a lung 4DCT target registration error (TRE) of 1.356 mm and autoPET Dice of 0.677, against 0.661 for TransMorph and 0.633 for SyN. We will rerun it on our splits with its published hyperprior search budget and also cite these figures. Beating it means matching or improving lung 4DCT TRE and autoPET Dice with no auxiliary decoder and no hyperprior search. Matching it with that simpler pipeline would itself be a useful result.
For brain MRI at scale, the reference is the LUMIR winner in Learn2Reg 2024, with TRE 3.09 mm and Dice 0.785. We do not expect to beat a challenge-tuned entry outright. The comparison instead asks whether applying our trainer to a comparable backbone improves it at matched folding.
Symmetric gradient surgery, meaning PCGrad and ConFIG applied between similarity and smoothness, is included as a baseline we predict will fail. We expect it to raise Dice while sharply increasing SDlogJ and folding, confirming the argument above.
Two ablations isolate the key ingredients. The first applies the gradient-level projection without update-level alignment, to test whether Adam's mismatch matters here. The second sets the restoration term α to zero, to test whether pure projection without restoration lets violations accumulate.
Why not just…?
Why not just rely on scaling-and-squaring, which already guarantees diffeomorphisms? The guarantee holds for the continuous flow, but the discrete integration is only faithful when the velocity field is smooth. This is why diffeomorphic VoxelMorph and TransMorph still carry a smoothness loss, and why TM-SPR finds global smoothing drags the chest wall with the lung. We test this alternative directly: the low-smoothness end of the scalar sweep is precisely "scaling-and-squaring alone." If it shows near-zero folding at low smoothness weights, our projection is redundant and we will report that.
Why not just tune the smoothness weight, or add a heavily weighted soft Jacobian penalty? This is the most serious threat. A penalty-weighted Jacobian term defines its own Pareto front, and a constrained method can in principle reach the same points. ConFIG's argument that reweighting cannot remove conflict does not settle the matter, because the goal here is a better front, not fewer conflicts. The matched-budget front comparison is designed to decide this. A plausible mechanism for our method to win is that a large penalty weight distorts the warp everywhere, whereas projection acts only on steps that would actually create folds. That mechanism is a hypothesis, not established.
Why not just learn spatially varying regularization as TM-SPR does? TM-SPR is the strongest evidence that the trade-off is local, and it works: it reports 1.356 mm TRE on lung 4DCT. It requires an extra decoder and an external hyperprior search, and it still regularizes smoothness rather than topology. We compare directly on lung 4DCT and autoPET. We also test the combination of TM-SPR's weight map with our projection, since the two act in different spaces (the image domain versus the parameter space) and may be complementary rather than competing.
Why not just use instance optimization such as ConvexAdam or NiftyReg? These methods win where data are scarce or anatomy changes. Learn2Reg 2024 reports NiftyReg at 2.87 mm against 4.42 mm for the best learned method on post-resection ReMIND2Reg. They cannot amortize registration into a sub-second forward pass or learn population priors, and on data-rich LUMIR a learned method won. We therefore scope claims to amortized registration and exclude resection tasks, where topology genuinely changes and our constraint would be wrong by design.
Proposed Experiments
We use OASIS from Learn2Reg and LUMIR for brain MRI, where smoothing mainly costs cortical detail. We use lung 4DCT and autoPET whole-body CT, following TM-SPR, as sliding-motion tests. IXI provides a secondary brain set comparable to TransMorph's reported numbers. Metrics are Dice, HD95 (the 95th-percentile Hausdorff distance), landmark TRE where available, the percentage of voxels with non-positive Jacobian determinant, SDlogJ, and training cost per step. Everything is reported over three seeds.
The first decisive check is the diagnostic. If the folding gradient rarely conflicts with the similarity gradient at low smoothness weights, the premise fails and we stop.
The second is front dominance over the matched-budget scalar sweep on lung 4DCT and OASIS.
The third is spatial. On lung 4DCT, the gain over the scalar baseline should come from landmarks near the pleural interface. If gains are uniform, or SDlogJ rises through jitter in homogeneous tissue, the method is buying accuracy with implausibility rather than permitting sliding.
The fourth is test-time topology. The folded-voxel fraction on held-out pairs must stay comparable to the 0.2-voxel level reported for diffeomorphic VoxelMorph. If it does not, the training-time constraint does not transfer and a test-time correction step would be needed.
A final measurement records whether the update-level alignment changes any of these outcomes, giving the first evidence on whether Adam's gradient-update mismatch exists in spatial-transformer training.
References
- VoxelMorph: A Learning Framework for Deformable Medical Image Registration.
- Unsupervised learning of probabilistic diffeomorphic registration for images and surfaces
- TransMorph: Transformer for unsupervised medical image registration
- Unsupervised learning of spatially varying regularization for diffeomorphic image registration
- Gradient Surgery for Multi-Task Learning
- ConFIG: Towards Conflict-free Training of Physics Informed Neural Networks
- Directional Gradient Projection for Robust Fine-Tuning of Foundation Models
- Gradient-Update Mismatch: Rethinking Conflict-Free Training of Physics-Informed Neural Networks
- Learn2Reg 2024: New Benchmark Datasets Driving Progress on New Challenges
- Learn2Reg: Comprehensive Multi-Task Medical Image Registration Challenge, Dataset and Evaluation in the Era of Deep Learning