Annealed Depth-Axis Smoothing of the Segmentation Loss

Models that segment CT or MRI one 2D slice at a time lose the third dimension. Each slice is predicted on its own, so organ boundaries jump between neighbouring slices, and small structures that appear in only a few slices get almost no training signal. The standard fix is to blur the stacked predictions along the depth axis after training. In pancreas CT that one step raised Dice from 56% to 68% (Roth et al.), which shows how much is lost. But the network never sees that blur while it learns.

We propose moving the blur into the training objective and turning it into a schedule. Training starts with a loss that compares depth-blurred predictions to depth-blurred labels. The blur width is then shrunk to zero during a single training run, so the model finishes on the ordinary loss. This is graduated optimization, the old idea of solving an easy smoothed problem first and tracking its solution back to the hard one. Here the smoothing is along one spatial coordinate of the output rather than over the millions of network weights.

Core Claim

Graduated optimization has a known problem in deep networks. Adding Gaussian noise to the weights, which is the textbook way to smooth the loss, works on 50-dimensional test functions but hurts training at scale (Explicit and Implicit Graduated Optimization in Deep Neural Networks). That paper motivates us by ruling out weight-space smoothing, and it constrains us: whatever we smooth must be low-dimensional.

Our claim is that volumetric segmentation offers such a coordinate for free. It is the depth axis of the predicted probability volume. Let $P_\theta$ be the stacked per-slice class probabilities from a network with weights $\theta$, and $Y$ the one-hot labels. Let $G_\sigma *_z$ denote 1D Gaussian convolution along depth with standard deviation $\sigma$, measured in millimetres so that anisotropic slice spacing is respected. We train on

$$\mathcal{L}(\theta,\sigma)=\ell\big(G_\sigma *_z P_\theta,\; G_\sigma *_z Y\big),$$

where $\ell$ is the usual Dice plus cross-entropy loss. We decrease $\sigma$ from $\sigma_0$ to $0$ within one run. At $\sigma=0$ this is exactly the standard objective, so the end target is unchanged and only the path to it differs.

Early in training, the blur mixes predictions across slices. A slice that misses a structure present two slices away therefore receives a gradient, which is the volumetric coupling that post-hoc filtering never supplies. The blur also widens the target region for thin or tiny structures. Soft Dice on such structures is nearly flat when the prediction does not overlap the label, and a wider target turns that flat region into a basin. This resembles how Rana et al. stretch kernel length-scales to restore gradients in flat acquisition spaces.

The depth coordinate brings a second advantage. Gaussian blur obeys the heat equation, so the derivative of the blurred volume with respect to the blur width has a closed form:

$$\frac{\partial}{\partial\sigma}\big(G_\sigma *_z P\big)=\sigma\,\partial_z^2\big(G_\sigma *_z P\big).$$

Here $\partial_z^2$ is a second finite difference along depth. It follows from the Gaussian variance $\sigma^2$ evolving as $\tfrac12\partial_z^2$. As a result, $\partial\mathcal{L}/\partial\sigma$ costs one extra convolution.

This removes the main obstacle of the derivative-driven single-loop homotopy method, SLGHd (Iwakiri et al.). SLGHd updates weights and blur width together, but it needs the trace of the Hessian in weight space, which is prohibitive in deep networks. We reuse its single-loop update structure but evaluate the derivative in output space, where it is nearly free.

Relation to Prior Work

Two existing works use "smoothing" or "homotopy" near segmentation, and neither does what we do.

Roth et al. apply a fixed 3D Gaussian to the outputs of a 2D ConvNet trained with plain cross-entropy. They supply our strongest evidence that depth context is missing, but their smoothing is post-hoc and fixed-width. We make it part of training and anneal it to zero.

Structure-Aware Image Segmentation with Homotopy Warping uses "homotopy" in the digital-topology sense. It flips voxels that do not change connectivity, on binarized masks, and penalizes the voxels that are critical to topology. The loss surface itself is never smoothed, and the method is biased toward thin curvilinear binary structures. We borrow only its Betti-error metric for evaluation.

Du et al. enforce inter-slice consistency in 2D diffusion models by interpolating the sampling noise across depth. That is an inference-time change with no new training loss. Their report that total-variation penalties erase small lesions is a constraint on our design: a fixed smoothness penalty is not acceptable.

On the optimization side, Mobahi et al. supply the scale-space view of continuation. Chapelle et al. show that tracking a minimizer from a heavily smoothed to an unsmoothed loss avoids poor local minima; their semi-supervised SVM error on Uspst fell from 13.0% to 2.9%. These works supply the method, but they validate it only at low dimension.

A known failure of plain Gaussian blur is that it dilutes thin structures and can shift where they appear. Global Optimization with a Power-Transformed Objective and Gaussian Smoothing show that raising the objective to a power before smoothing keeps the peak from moving. Power-mean annealing in clustering (Chakraborty et al.; Vellal et al.) makes the related point that the aggregation operator itself can be annealed. We therefore include one variant that replaces the weighted average along depth with a weighted power mean of order $s>1$. As $s$ grows this approaches a weighted maximum, so a structure present in one slice is spread to its neighbours rather than washed out.

Research Program

We will build the loss as a drop-in module for two regimes.

The first regime, and the main case, is slice-based 2D and 2.5D networks, where volumetric context loss is worst. This includes an ImageNet-pretrained 2D encoder of the kind Swin-UMamba shows is valuable when medical data is scarce. We treat that paper as motivation: pretrained 2D models are worth keeping, so fixing their depth blindness during training matters.

The second regime is native 3D networks, specifically nnU-Net-style 3D U-Nets and UNETR++ (Shaker et al.). The UNETR++ authors themselves report failures on thin borders and abnormal shapes.

We will study three schedules for the blur width. The first shrinks $\sigma$ at a fixed geometric rate, an analogue of the fixed-rate variant SLGHr. The second takes monotone steps driven by the closed-form $\partial\mathcal{L}/\partial\sigma$, an analogue of SLGHd. The third holds $\sigma$ fixed as a control. We will also compare arithmetic and power-mean aggregation. An optional in-plane blur is reported separately so that the depth-specific effect stays isolated.

On the analysis side, we will measure how often a slice-independent model's small-structure Dice sits on a flat plateau early in training, with and without depth blur. We will also track whether the $\sigma$-path of solutions bifurcates, which Mobahi et al. flag as the way continuation breaks. Operationally, we check whether restarts at intermediate $\sigma$ diverge.

Baselines

The naive reference is the same network trained with standard Dice plus cross-entropy, that is $\sigma=0$ throughout, with the identical optimizer, epochs, augmentation and number of tuning trials.

The second baseline is that same network followed by Roth et al.'s post-hoc 3D Gaussian filter, with the filter width tuned on validation data. This is the most direct competitor for the slice-based regime. Roth et al. report Dice of 56% raw and 68% ± 10% after post-hoc smoothing on their 82-volume pancreas CT set. Beating it means our annealed model without any post-processing matches or exceeds the post-processed baseline, and that adding the same filter on top of our model still helps or at least does not hurt.

The third baseline is an inter-slice total-variation or squared-difference penalty. Its weight gets the same tuning budget as our $\sigma_0$ and schedule rate. It is the cheapest way to inject depth coupling during training.

The fourth is a 2.5D network that receives neighbouring slices as input channels. It gives the model depth context directly rather than through the loss. For it and for the total-variation penalty, no reported result was found on Lacuna for these exact benchmarks, so both will be run by us.

The strongest existing methods on the native 3D side are UNETR++, reported at 83.28% mean DSC on BTCV and 87.2% on Synapse (Shaker et al.), and MLRU++, reported at 87.57% DSC and 7.53 mm HD95 on Synapse (Yadav et al.). The Decathlon's automated nnU-Net pipeline is also a reference. On its hardest small-structure tasks, Antonelli et al. report 0.21 DSC for pancreas tumour and 0.16 DSC for colon cancer.

We will retrain UNETR++ and a 3D nnU-Net configuration ourselves under our splits and compute. We then add our loss without changing anything else. Beating these means a statistically reliable gain in small-structure Dice or HD95 across seeds, not only a gain in mean DSC.

Two ablations isolate the key ingredient. The first uses a fixed $\sigma$ equal to the schedule's average, which tests whether annealing matters or blur alone does. The second is a schedule-matched in-plane-only blur, which tests whether the depth axis specifically matters.

Why not just…?

Why not just add a total-variation or inter-slice smoothness penalty? Such a penalty stays on for the whole of training and pushes every slice pair toward equality. Du et al. report that it over-smooths and erases small lesions. Our loss ends at $\sigma=0$, so it places no lasting pressure against sharp depth transitions. If the penalty matches us on small-structure recall and Betti error at equal tuning budget, the annealing story is wrong, and the head-to-head comparison is designed to show exactly that.

Why not just use a native 3D network such as nnU-Net or UNETR++? This is the most serious threat. For native 3D models, the depth-coupling argument is weaker because context is already in the architecture. What remains is only the plateau argument for thin and tiny structures, which UNETR++ still fails on (Shaker et al.). If our loss gives no gain on 3D backbones, we will say so and restrict the claim to slice-based and 2D-pretrained models. That scope still matters, because Swin-UMamba shows 2D pretraining is a real advantage, and Wolf et al. show 2D-slice vision models remain spatially blind. The experiment reports both regimes separately so the answer is not hidden in an average.

Why not just blur the predictions after training, or train with a fixed blur? Post-hoc blur gives the network no training signal about neighbouring slices, and a fixed blur changes the final objective and biases boundaries. The fixed-$\sigma$ ablation and the Roth-filter baseline are the direct tests. If fixed blur equals annealed blur, then the contribution reduces to depth-aware label and prediction smoothing, and we will report it that way.

Why not just tune the learning rate and momentum schedule, since SGD noise already smooths the loss? Sato and Iiduka show that this implicit smoothing is real, but it acts equally in all weight directions and knows nothing about anatomy or slice spacing. We will give the baseline their polynomial-decay learning-rate and momentum schedule from Explicit and Implicit Graduated Optimization in Deep Neural Networks, and test whether our loss adds a gain on top of it.

Proposed Experiments

The first benchmark is the 82-volume pancreas CT set, with 2D and 2.5D backbones. It is the regime where the post-hoc number above exists. The second is BTCV (13 organs) and Synapse (8 organs), each with a 2D pretrained backbone, UNETR++ and a 3D nnU-Net configuration. The third is the MSD pancreas-tumour and colon-cancer tasks, where structures are small and the reported Dice is low. Every configuration uses at least three seeds and an equal number of hyperparameter trials per method.

The metrics are per-class DSC and HD95, plus two depth-consistency measures. One is the fraction of predicted connected components that span a single slice. The other is Betti error computed on the 3D mask, following Hu et al.. We also report recall on structures smaller than a volume threshold.

The first decisive check is whether a 2D model with annealed depth loss and no post-processing reaches the Dice of the same model with the Roth filter on pancreas CT. The second is whether annealing beats fixed $\sigma$ at equal tuning budget. The third is whether the power-mean variant improves small-structure recall over the arithmetic average without worsening HD95 on large organs. The fourth is whether any of these gains survive on native 3D backbones.

Finally, we will train with the derivative-driven schedule and the fixed-rate schedule under identical budgets. This tells us whether the closed-form heat-equation derivative earns its place or whether a plain geometric decay suffices.