Models that classify tissue in digitized microscope slides lose a large share of their accuracy when moved to a new hospital or a new slide scanner. On the Camelyon17 lymph-node benchmark, a standard model reaches about 93% accuracy on hospitals it was trained on and about 70% on a held-out hospital (WILDS). The field usually blames the data: stain colors and scanner optics differ, so the fix is better augmentation or color normalization. This note tests a different explanation, which concerns the optimizer rather than the data. The standard training loss, cross-entropy, keeps rewarding the model for growing more confident even after every training example is classified correctly. Once a few easy cues (hue, contrast, background brightness) make predictions confident, the training signal for slower-to-learn cues such as nuclear shape fades away. This effect is called gradient starvation. A model trained this way may end up with only a few redundant routes to the right answer, so when a scanner change breaks those routes, nothing is left.
The test is clean because of an unusual dataset. The Multi-Scanner Canine Cutaneous Squamous Cell Carcinoma dataset digitizes the same 44 tissue samples on five scanners and provides registered annotations. The biology is therefore held fixed, and any change in the model's internal representation of a registered region between scanners is pure hardware shift. We propose to train identical networks under losses that do or do not cap confidence growth. We then measure, region by region, how much each network's internal features move across scanners and how many independent predictive directions each network has learned. If loss choice changes cross-scanner robustness, and the change tracks confidence growth rather than the loss's name, that is a cheap, model-agnostic lever that needs neither a generative model nor unlabeled target data.
Core Claim
The claim is that much of the cross-scanner and cross-hospital drop in histopathology models trained with cross-entropy comes from unbounded growth of the model's output scores, called logits, on already-correct training data. Losses that bound this growth retain more independent morphology-driven features and transfer better at equal in-domain accuracy. Squared-error loss bounds it because its minimum sits at a finite target. Cross-entropy with a penalty on logit size, the Spectral Decoupling of Gradient Starvation, also bounds it. Plain cross-entropy does not, because on separable data its loss reaches zero only as weights go to infinity (Optimization Landscape and Expressivity of Deep CNNs).
The claim is falsifiable in a specific way. If cross-entropy stopped early, at the same logit size the bounded losses reach, matches them, then the mechanism is "how far into confident training you go" rather than "which loss you use." We treat that outcome as a real result, not a nuisance, and design the experiments to detect it.
Relation to Prior Work
Gradient Starvation supplies the mechanism and the main intervention. It shows that cross-entropy's vanishing gradient on confident examples couples feature learning, that weight decay does not fix this, and that penalizing the squared norm of the logits does. Its gains come on Colored MNIST (23.7% to 68.4%) and CelebA worst-group accuracy (40.35% to 83.24%). Those benchmarks plant a single spurious cue that is correlated with the label. Pathology scanner shift is different: the shortcut is not label-correlated at training time but simply fragile. Whether starvation matters in that regime is untested, and its analysis assumes the linearized infinite-width regime.
Two Neural Collapse papers constrain what we expect. Neural Collapse is the late-training state in which features of each class shrink to a single point and class means spread into a symmetric simplex. Neural Collapse Under MSE Loss proves that collapse also happens under squared loss and associates deeper collapse with robustness to noise. Perturbation Analysis of Neural Collapse shows that within-class variation shrinks layer by layer and is driven mostly by weight decay on the feature extractor. Read naively, this suggests squared loss might also discard within-class variation, including morphology directions not needed on the source scanner. Our representation measurements address this tension directly instead of assuming squared loss is automatically safer.
Neural Collapse Inspired Feature Alignment is the closest method-level neighbor. It fixes the classifier to a simplex and adds environment partitioning and semantic masks, with ColoredMNIST rising from 51.5% to 66.4%. It never varies the loss itself and is too heavy for slide-scale pipelines. We use it as a comparison, not a component.
The pathology papers motivate the gap. From Modern CNNs to Vision Transformers documents 20–40% AUC drops across datasets under cross-entropy training and shows that ConvNeXt-type CNNs are the most robust backbones. HistAuGAN and MixUp-MIL act on the data, through generative stain augmentation and within-slide feature interpolation. Neither touches the objective, so they are complementary rather than competing.
Research Program
The program has three parts.
The first part is a diagnostic study on the multi-scanner dataset. We train a ResNet18-encoder UNet, the architecture the dataset paper reports, on one scanner and evaluate on the other four. We use four losses on the per-pixel logits: cross-entropy, squared error to one-hot targets, cross-entropy plus logit penalty, and cross-entropy with label smoothing. Every checkpoint is logged with its mean logit norm on training pixels.
We compute two representation measures on the registered regions. Paired shift is the distance between penultimate-layer features of the same tissue region imaged on two scanners, divided by the mean distance between class means. It is near zero if the representation ignores the scanner. Redundancy asks how many directions in the features can be removed before the label stops being predictable. We repeatedly train a linear probe on source features, project out its weight direction, and retrain. The count of rounds before probe accuracy falls to chance estimates how many independent predictive directions the network learned. Gradient starvation predicts that cross-entropy yields fewer such directions and that the count falls as logit norm grows.
We also compute within-class variation on source and target features. This tells us whether the source-domain collapse described in the Neural Collapse literature survives the scanner change or breaks apart.
The second part checks that the effect is not specific to one dataset. We repeat the loss comparison on Camelyon17-WILDS patch classification with the standard hospital split, then on PCam with the cross-dataset protocol of From Modern CNNs to Vision Transformers, using a ConvNeXt backbone.
The third part is a light extension to weakly supervised whole-slide learning. Applying the same loss swap at the slide level on the frozen/paraffin thyroid cohort of MixUp-MIL tests whether the effect survives aggregation over instances. With 80 slides, this part is exploratory and will be reported with confidence intervals only.
Baselines
The naive reference point is plain cross-entropy training to convergence with the same flip-and-rotate augmentation and weight decay used for every method. On Camelyon17-WILDS this corresponds to the reported 70.8% target-hospital accuracy (Extending the WILDS Benchmark). On the multi-scanner dataset it corresponds to the reported in-domain mIoU of 0.82–0.86 with cross-scanner drops of up to 0.38 (Multi-Scanner dataset). We reproduce both numbers before comparing anything.
The strongest existing method on Camelyon17 is Noisy Student self-training, which reaches 86.7% (Extending the WILDS Benchmark). Its advantage is unfair in one respect: it uses unlabeled target-hospital data and multiple retraining rounds, while our losses use only source data. We therefore report it as a ceiling. The meaningful comparison is whether a bounded loss closes part of the 70.8-to-86.7 gap with no target data. We also test whether the two combine additively when Noisy Student's teacher and student are trained with the bounded loss.
The strongest source-only competitor is HistAuGAN stain augmentation. For its Camelyon17 classification accuracy, no exact reported number was found on Lacuna; the paper gives figures, not text values. We will run it ourselves on the same split, backbone, and epoch budget. NCFAL is run as the geometric competitor under the same conditions.
The key ablation isolates confidence growth from loss identity. For each bounded loss we record the training logit norm it settles at. We then evaluate cross-entropy checkpoints stopped at that same norm, and cross-entropy with label smoothing tuned to the same norm. All methods receive the same hyperparameter search, 20 trials selected on source-domain validation only, and the same seeds and GPU hours. To count as beating cross-entropy, a bounded loss must improve held-out-scanner mIoU or held-out-hospital accuracy by more than the seed-to-seed spread across five seeds, at matched in-domain performance.
Why not just…?
Why not just use stain augmentation or a generative stain model? Stain augmentation acts on color. The multi-scanner paper shows that part of the shift is non-chromatic, such as the white-background clipping on one scanner, and that color jitter does not address it (Multi-Scanner dataset). CycleGAN recoloring alone still cost up to 18% within one dataset (From Modern CNNs to Vision Transformers). The augmentation route is still a real competitor on Camelyon17, where shift is largely stain. That is why HistAuGAN is run head to head, and why we test bounded loss plus HistAuGAN to see whether the gains stack or overlap. If HistAuGAN alone matches the combination, the loss contributes nothing beyond what augmentation already provides, and we will say so.
Why not just stop cross-entropy training early or use label smoothing? This is the most serious threat. Both of these also limit logit growth, and gradient starvation is a late-training effect. The matched-logit-norm ablation exists to settle it. If early-stopped cross-entropy equals the bounded losses on both robustness and the redundancy count, the honest conclusion is that confidence level is the controlling variable. The practical recipe then becomes "select checkpoints by logit norm, not by source accuracy." That is still useful, because source-validation checkpoint selection is the current default.
Why not just use domain-invariance methods or a stronger backbone? CORAL- and DANN-style alignment did not beat plain training on Camelyon17 (Extending the WILDS Benchmark). Robust-optimization methods failed to help on 8 of 10 WILDS datasets (WILDS). Backbone choice matters, but even the best CNN in From Modern CNNs to Vision Transformers suffered large cross-dataset drops under cross-entropy. We hold the backbone fixed and vary only the loss, and repeat the comparison on a second backbone to check that the effect is not an architecture quirk.
Decisive Checks
The idea succeeds if three things happen together on the multi-scanner data. First, held-out-scanner mIoU under the bounded losses beats cross-entropy beyond seed noise at matched in-domain mIoU. Second, paired shift is lower and the redundancy count is higher for those losses. Third, across all checkpoints and losses, training logit norm predicts both the robustness gain and the redundancy count better than loss identity does.
The idea fails if the bounded losses help on Colored-MNIST-style benchmarks but not here. That would mean pathology brittleness is not a starvation phenomenon. It also fails if redundancy rises without any robustness gain, which would break the proposed causal chain.
A secondary check concerns Neural Collapse. If deeper source-domain collapse under squared loss correlates with larger target-domain within-class variation, that would refine the robustness claims in Neural Collapse Under MSE Loss for the domain-shift setting. Camelyon17-WILDS and PCam then show whether the scanner-level finding transfers to real multi-hospital shift.
References
- WILDS: A Benchmark of in-the-Wild Distribution Shifts
- Multi-scanner Canine Cutaneous Squamous Cell Carcinoma Histopathology Dataset
- Gradient Starvation: A Learning Proclivity in Neural Networks
- Optimization Landscape and Expressivity of Deep CNNs
- Neural Collapse Under MSE Loss: Proximity to and Dynamics on the Central Path
- Perturbation Analysis of Neural Collapse
- Neural Collapse Inspired Feature Alignment for Out-of-Distribution Generalization
- From modern CNNs to vision transformers: Assessing the performance, robustness, and classification strategies of deep learning models in histopathology
- Structure-Preserving Multi-domain Stain Color Augmentation Using Style-Transfer with Disentangled Representations
- MixUp-MIL: Novel Data Augmentation for Multiple Instance Learning and a Study on Thyroid Cancer Diagnosis
- Extending the WILDS Benchmark for Unsupervised Adaptation