Annealing Group Normalization into Fixed Weights for Tile-Consistent Dense Inference

Dense prediction networks for segmentation and detection are trained on small crops with one or two images per GPU. At that batch size batch normalization breaks, so practitioners switch to group normalization: per image, it rescales each block of channels by that block's own mean and spread. That choice carries two costs once the trained network is run "fully convolutionally", meaning on a whole large image in one pass. First, the statistics are recomputed over the entire feature map for every input. The normalization therefore cannot be folded into the neighboring convolution, and it adds memory sweeps that grow with image area. Second, and less often noticed, the prediction at a pixel now depends on the whole image rather than only on the pixels the network can see around it. The standard argument that a patch-trained network can be run on a full image with identical results assumes every operation is local. Group normalization breaks that assumption. A network trained on 512-pixel crops sees different statistics at test time on a 2048-pixel image. Two overlapping tiles of a whole-slide pathology image disagree in their shared region because their statistics differ, not because their pixel context differs.

We propose to train with group normalization, where it helps optimization under tiny batches. During a short final phase we anneal its per-image statistics toward fixed running averages, so the deployed network has no normalization at all. Each normalization layer becomes a constant scale and shift, folded into the preceding convolution. The resulting network is strictly local: its output does not depend on input size or tiling, and it costs nothing extra at inference. The scientific question underneath is how much of group normalization's benefit in dense convolutional networks is an optimization aid that can be removed after training, and how much is genuine per-image adaptation that the deployed model needs. Contrast and stain normalization in pathology would be one example of the latter.

Core Claim

Our claim has two parts. First, a group-normalized dense model, annealed to frozen statistics over the last roughly 10% of training, matches the accuracy of the same model with live group normalization when evaluated at its training crop size. Second, it beats the live model when evaluated at the full image sizes or tilings actually used in deployment, because the live model suffers a train/test statistics mismatch and the annealed one does not. It also removes the latency and memory of every normalization layer.

The annealing interpolates, for each group, between the statistics of the current image ($\mu_x$, $\sigma_x$) and running averages over training images of those per-image statistics ($\bar\mu$, $\bar\sigma$):

$$\hat{x} = \gamma \, \frac{x - \big[(1-\lambda)\mu_x + \lambda\bar\mu\big]}{(1-\lambda)\sigma_x + \lambda\bar\sigma + \epsilon} + \beta,$$

where $\gamma, \beta$ are the usual learned scale and shift, and $\lambda$ ramps from 0 to 1 on a cosine schedule during the final phase. At $\lambda = 1$ the layer is a fixed affine map and folds into the convolution exactly as batch normalization does (the folding identity is spelled out in SLAB). At no point does the procedure use statistics computed across a batch, so it remains valid at batch size 1.

Relation to Prior Work

Several papers motivate the problem. Group Normalization shows that per-image group statistics fix small-batch training of Mask R-CNN on COCO, beating frozen batch normalization by 1.1 box AP. However, it computes those statistics online at test time, which is exactly the cost and non-locality we remove. Weight Standardization normalizes the convolution weights instead of the activations and raises GN Mask R-CNN from 39.8 to 40.8 AP. In its reported experiments it still keeps GN at inference.

The classic convolutionalization work rests on the locality assumption that group normalization violates. Liu et al. and Havaei et al. recast fully connected heads as convolutions so that a network can run on whole images. Dubrovina et al. report a drop from 114 to 1.8 seconds per mammogram from that switch. None of these examines what per-image normalization does to the claimed equivalence between tiled and whole-image evaluation.

Two papers supply the closest mechanism, and both differ in what statistics they converge to. SLAB progressively replaces layer normalization with batch normalization in transformers so it can be folded, reducing COCO PVT-S detection latency from 64 ms to 59.6 ms. Its endpoint is batch normalization, which needs batch statistics during training, so it cannot be used at batch size 1–2. It also needed 10 extra recalibration epochs because stochastic depth disturbed the batch statistics. Our endpoint uses no batch statistics at any stage. HIRI-ViT swaps in foldable batch normalization only in early stages, gaining 7.6% throughput, and keeps layer normalization deeper in the network.

Several results constrain the design. Transformers without Normalization reports that its element-wise tanh replacement failed to replace batch normalization in ResNet-50. We therefore do not bet on an element-wise squashing function in convolutional networks; we keep it only as an ablation. Fixup and normalizer-free ResNets show that normalization can be removed from training entirely. The cost is heavier explicit regularization; Fixup reaches 24.0% versus 23.3% top-1 error on ImageNet only with Mixup. Normalizer-free models were tested in dense prediction only as transferred backbones, on Pascal VOC and NYU Depth.

The application regime comes from whole-slide pathology. The TCGA nuclei pipeline runs a U-Net on 4000×4000 tiles because of memory limits. Locally supervised learning shows the value of single-pass whole-image processing. In both settings tile consistency and memory are the binding constraints.

Research Program

We will first measure the problem itself. We take group-normalized dense models trained on crops and evaluate each one at its training crop size, at full resolution, and under several tilings. At every normalization layer we record three things: the distance between per-image statistics on crops and on full images, the resulting accuracy change, and the disagreement between overlapping tiles. This establishes whether the non-locality is a measurable accuracy problem or only a theoretical one.

We will then build the annealed variant. The design choices to study are the anneal length, whether running averages are taken over per-image statistics or over pooled pixels, and whether annealing proceeds all at once or from shallow layers to deep ones. We expect the last choice to matter, by analogy with the anchoring needed in BHyT. After annealing, all normalization folds into the convolutions. We verify numerically that tiled and whole-image outputs then agree everywhere except at zero-padding borders.

Finally, we will probe where per-image adaptation is genuinely needed. We evaluate under distribution shift, such as held-out cancer types and staining in TCGA, and Cityscapes-to-other-city shifts where available. A frozen network may lose there what live statistics provided. If it does, we test the cheapest fix that preserves locality: keep live statistics only in the first layer, as a learned input standardization, and fold everything after it.

Baselines

The naive reference point is the same architecture with live group normalization, plus Weight Standardization where it applies. This model is evaluated the way practitioners actually deploy it: at full image size, or on tiles for slides. For COCO Mask R-CNN on ResNet-50, the reported number to match is 40.8 AP for GN+WS (Weight Standardization). Beating this baseline means landing within 0.3 AP of it at training resolution, matching or exceeding it at deployment resolution, and showing lower latency and peak memory. Latency is measured with both models compiled by the same graph compiler, so the comparison is fair.

The strongest existing fusible competitor is frozen batch normalization in the backbone with group normalization in the heads. This is the standard detection recipe that Group Normalization reports losing by 1.1 box AP. We also run a fully frozen-batch-normalization variant that folds completely. Because the gap to live group normalization is documented, this baseline isolates whether our anneal closes that gap while keeping full foldability.

The from-scratch normalization-free competitor is a normalizer-free ResNet backbone with a decoder that uses scaled weight standardization and no activation normalization. It receives the same total epochs, the same augmentation, and a hyperparameter search of the same size as our method, with its own regularizers tuned. It is foldable by construction, so it is the most serious threat to our claim.

On Cityscapes we will report BiSeNet as a real-time reference: 74.7% mIoU at 65.5 FPS with ResNet-18 on a Titan XP. Its normalization type is unspecified in the file, so it serves as a speed reference only. We found no reported result on Lacuna for a group-normalized Cityscapes segmentation model, so we train our own. For TCGA nuclei, the reference is the U-Net's reported Dice of at least 77% and instance-level Dice of at least 62%. For SelvaBox there is no reported result on Lacuna, so we establish one.

Two ablations isolate the key ingredient. The first freezes the statistics abruptly at the end of training ($\lambda$ jumps to 1 with no anneal); comparing it to the annealed model shows whether the anneal itself matters. The second replaces the annealed normalization with a dynamic-tanh layer on top of weight standardization; it tests whether an element-wise substitute becomes viable once the weights are conditioned, which is the open question left by Transformers without Normalization.

Why not just…?

Why not just keep group normalization and let the compiler fuse it? A compiler can merge the reduction into fewer kernels. It cannot fold statistics that do not exist until the image arrives, and it cannot make the output independent of tile size. Even after compilation, Transformers without Normalization reports a 52.4% per-layer gap between reduction-based and reduction-free layers in LLaMA-7B. Whether a gap that large exists in convolutional decoders working at 1/4 resolution is an empirical question. We answer it by profiling both models under the same compiler. The tile-consistency measurements address the second issue directly, and no compiler can fix that one.

Why not just train normalization-free from the start? This is the real threat. If a normalizer-free ResNet with a weight-standardized decoder matches GN+WS on COCO and Cityscapes at equal tuning budget, our anneal is unnecessary and we will say so. The evidence against assuming it in advance is that Fixup closes only most of the ImageNet gap, and only with Mixup. Normalizer-free models have also not been reported training dense decoders from scratch at micro-batch sizes. Our method keeps the familiar group-normalization recipe for 90% of training, which is the practical advantage if accuracies tie.

Why not just use overlapping tiles and blend them? Overlap blending hides seams by spending extra compute on the overlapping regions. It averages two predictions made under different statistics instead of making one consistent prediction. We measure the accuracy of blended live group normalization against unblended annealed inference at matched compute. If blending at modest overlap is just as good, the tile-consistency benefit is small, and the latency and memory gains become the remaining case for the method.

Why not just use SLAB's progressive switch to batch normalization? That switch needs batch statistics during its final phase, and batch normalization collapses at the batch sizes used here. Group Normalization reports 10.6% higher error for batch normalization than group normalization at batch size 2. We include SLAB's schedule at batch size 2 as an arm to confirm this.

Proposed Experiments

The main experiments are Mask R-CNN with a ResNet-50 GN+WS model on COCO, a group-normalized semantic segmentation model on Cityscapes trained on crops and evaluated at the full 1024×2048 resolution, a U-Net for TCGA nuclei segmentation evaluated on 4000×4000 tiles and on larger regions, and tree-crown detection on SelvaBox rasters. We report box and mask AP, mIoU, Dice, and instance-level Dice. We also report latency per megapixel, peak inference memory, and a tile-consistency score: the fraction of overlap pixels whose predicted labels differ between two tilings offset by half a tile.

Three checks are decisive. First, if live group normalization loses more than half a point of accuracy between crop-size and full-size evaluation while the annealed model does not, non-locality is a real deployment defect and not only a theoretical one. Second, if the annealed model stays within 0.3 AP of 40.8 on COCO and within the same margin on Cityscapes, while removing every normalization layer, the optimization-versus-adaptation question is answered for in-distribution data. Third, the stain-shift test in TCGA tells us whether frozen statistics give up robustness and whether keeping one live input layer recovers it. A negative answer would be informative in its own right: it would identify per-image adaptation as the part of group normalization that dense models genuinely need at inference time.