Geometric-Mean AUC Training for Tiny Organs in 3D Patches

Networks that segment 3D medical scans are trained on small sub-volumes ("patches") cut from each scan. Small structures such as the adrenal glands or the esophagus occupy a tiny share of each scan and are missing from most patches. On those patches the loss sends no signal about them, and the average over all organs is dominated by big organs like the liver. The result is that a model can post a respectable average score while never segmenting some organs at all. On the Synapse abdominal benchmark, baseline models score 0% Dice on the esophagus and adrenal glands (Gradient-Aware for Class-Imbalanced Semi-supervised Medical Image Segmentation).

We propose to train the segmenter to rank pixels correctly for every pair of classes, and to combine those per-pair ranking scores with a geometric mean instead of an arithmetic mean. The ranking score is the AUC (area under the ROC curve), the probability that a pixel of organ $i$ gets a higher "organ $i$" score than a pixel of organ $j$. A geometric mean collapses toward zero when any single pair fails, so the model cannot hide a failed pair behind the others. The obstacle is that such a loss needs every class present to compare pairs, and patch training rarely provides that. Our fix is to summarize each class by a running mean and variance of the network's scores on its pixels. With the standard square-loss AUC surrogate, those statistics are all the pairwise loss needs. Pairs involving an absent organ can therefore still be trained against its stored statistics, without pasting stored pixels into the patch.

Core Claim

The claim is that one small object does two jobs. A per-class memory of score means and variances, updated across patches, makes pairwise AUC trainable when classes are absent. The same memory also supplies the global per-pair AUC estimates that a geometric-mean objective needs to decide which pairs to push hardest. Current methods do only one of these. AUCSeg averages one-vs-one pixel AUCs arithmetically and handles missing tail classes by pasting stored tail pixels into 2D images. That pasting breaks anatomical context in 3D, and it doubles iteration time from 0.76s to 1.62s. Geometric Mean Loss optimizes the geometric mean of class recalls, but only for image classification and only by retuning a frozen classifier head. GA loss keeps gradients alive for absent organs, but it adds up per-organ overlap terms arithmetically. None of them bounds the worst class pair, and none works on moments rather than pixels.

Mechanism

Let $s_i(x)\in[0,1]$ be the network's softmax score for class $i$ at pixel $x$. Let $m_{ik}$ and $v_{ik}$ be the mean and variance of $s_i$ over pixels whose true class is $k$. The square-loss AUC surrogate for pair $(i,j)$, averaged over all pixel pairs, has a closed form in these moments:

$$L_{ij} = \big(1 - (m_{ii} - m_{ij})\big)^2 + v_{ii} + v_{ij}.$$

This decomposition is the idea behind the saddle-point reformulations of binary AUC (Liu et al. 2018; BPT-FZG). In those methods, auxiliary variables stand in for the class-conditional means, so no past samples need to be stored. We reuse that technique, extend it to all $K(K-1)$ ordered class pairs, and apply it to dense 3D prediction.

When class $k$ appears in the current patch, $m_{\cdot k}$ and $v_{\cdot k}$ come from the batch and are folded into an exponential moving average. When class $k$ is absent, the stored average is used with gradients blocked. Gradients still flow through the present classes' statistics, so those classes are pushed away from where the absent organ's scores are known to lie.

Each pair's surrogate is mapped to a proxy AUC, $\hat A_{ij} = \max(\epsilon, 1 - L_{ij}/L_{\max})$, where $L_{\max}$ is the largest possible value of $L_{ij}$. The objective adds a weight $\lambda$ times the negative mean log of the proxy AUCs to the usual Dice plus cross-entropy loss:

$$\mathcal{L} = \mathcal{L}_{\text{Dice+CE}} - \frac{\lambda}{K(K-1)} \sum_{i\neq j} \log \hat A_{ij}.$$

Differentiating the log term weights each pair's gradient by $1/\hat A_{ij}$, where $\hat A_{ij}$ is estimated from the global memory rather than a single patch. The weighting therefore reflects how badly that pair is doing across the whole dataset, not what happened to be in the current crop.

The cost is $O(K^2)$ operations on small moment tables plus one pass over pixels to compute moments. AUCSeg's pixel-pair operations cost more. We expect overhead close to cross-entropy, and we will measure it.

Research Program

The work has three parts. First, we implement the moment memory and the geometric-mean AUC term as a drop-in addition to a 3D segmenter, both fully supervised and in the semi-supervised cross-pseudo-supervision (CPS) setup used by Qi et al.

Second, we analyze the choices that decide whether it works. The memory must be fresh enough: we vary the moving-average rate and measure the gap between the stored moments and full-volume moments computed offline. The floor $\epsilon$ must be large enough to avoid exploding gradients from pairs at near-zero AUC early in training. We also test whether whole-network training destabilizes the shared features, as Du et al. warn for end-to-end geometric-mean training. We compare it against their decoupled recipe, which freezes the encoder and trains only the head.

Third, we characterize when geometric aggregation matters. We relate the gain to how spread out the per-pair AUCs are under an arithmetic-mean model. Geometric and arithmetic means agree when all pairs perform alike, so the benefit should appear only when a few pairs lag.

Baselines

The naive reference point is Dice plus cross-entropy trained with the same patch sampler, backbone, and schedule. The file reports 48.49% mean Dice for the CPS baseline on Synapse, with 0% on the esophagus and adrenal glands.

The strongest existing method is GA loss (Qi et al. 2024), which combines GADice with top-$k$ mined, dynamically weighted cross-entropy. It reports 66.39% mean Dice on Synapse inside CPS, and 27% to 51% Dice on the tail organs. It is the strongest competitor because it targets exactly the absent-organ gradient problem we target. We rerun it with the released or described settings, at the same labeled fraction, backbone, iteration budget, and number of seeds. Our method will also be stacked on top of GA loss, not only compared against it. Beating GA loss means a higher minimum per-organ Dice and a higher geometric mean of per-organ Dice, with mean Dice not lower than 66.39% minus seed noise. A mean-Dice gain alone does not count.

The second strong baseline is AUCSeg (Han et al. 2024), ported to 3D with its tail memory bank pasting stored voxel crops. On ADE20K it reports a 1.05% mIoU gain overall and 1.21% on tail classes. No reported result was found on Lacuna for AUCSeg on Synapse, AMOS, or ACDC, so we produce that number ourselves. Every method gets the same hyperparameter search budget, measured in trials per method on a held-out validation split.

The key ablation keeps our moment memory and swaps the pair aggregation. We compare the arithmetic mean (AUCSeg's objective, without pixel pasting), the geometric mean, and a soft-minimum over pairs. A fourth variant is the geometric mean computed from batch-only moments with no memory. This ablation separates the two claimed ingredients.

Why not just…?

Why not just re-weight cross-entropy by inverse organ frequency? Static weights give no gradient for an organ that is absent from the patch. Qi et al. identify this patch-level mismatch as the cause of tail collapse, and Du et al. report that heavy re-weighting conflicts with worst-class objectives. Class-balanced cross-entropy is nonetheless cheap, and we include it in the naive tier to settle the question empirically.

Why not just use GA loss, which already rescues tail organs? This is the real threat. GA loss already moves tail organs from 0% to between 27% and 51%. If stacking our term on GA loss does not raise the minimum organ Dice, then GA loss's dynamic weights are already doing what the geometric mean does, and we would report that. The stacking experiment is designed to answer this directly.

Why not just weight the worst pairs by hand, or use an arithmetic AUC with hardest-pair emphasis? The gradient of a log-mean is a reweighting by $1/\hat A_{ij}$, so a tuned per-pair weighting could match it. What the geometric mean adds is a principled weight computed from global memory rather than a tuned one. The aggregation ablation tests whether that matters. If the soft-minimum or tuned arithmetic weighting matches the geometric mean, we will say the contribution is the moment memory alone.

Why not just apply Geometric Mean Loss to a frozen segmentation head? Du et al. argue that long-tail failure is classifier bias. Tiny organs lost in early encoder layers are unlikely to be recovered by a 1×1 head, but that is an assumption, not a result. We run their decoupled recipe on our backbone to test it.

Why not just tune thresholds after training? AUC does not depend on any threshold, and METRO (Mao et al. 2025) shows that plug-in thresholding trails direct optimization of non-decomposable metrics (0.6428 vs 0.6575 Jaccard on CIFAR-10). We still report the naive model with per-organ thresholds tuned on validation.

Proposed Experiments

The main benchmarks are Synapse and AMOS, where multiple tiny organs exist. ACDC serves as a control with few, larger structures, where we predict little difference between arithmetic and geometric aggregation. ADE20K checks whether the moment memory can replace AUCSeg's pasting in 2D at lower cost.

Metrics are per-organ Dice and Hausdorff distance, the minimum and geometric mean of organ Dice, the count of organs at 0 Dice, per-pair AUC and worst-pair AUC, and iteration time. All results are averaged over at least three seeds.

Four checks decide the outcome. The first is gradient coverage: for each tail pair, we measure the fraction of iterations that deliver a nonzero gradient, with and without the memory. The second is memory fidelity: the gap between stored and full-volume moments should stay small, and performance should degrade as the moving-average rate makes the memory stale. The third is aggregation: on Synapse and AMOS, the geometric mean should beat arithmetic aggregation on minimum organ Dice under the same memory, and the two should tie on ACDC. The fourth is cost: iteration time should stay well below AUCSeg's reported doubling.

The idea fails if the gain disappears when the term is stacked on GA loss. It also fails if a tuned soft-minimum matches the geometric mean, in which case the finding would be about the moment memory rather than the geometric mean.