When a flood-mapping or building-detection model is moved to a region it never saw, the share of pixels belonging to the rare class changes sharply. One flood event covers 2% of a scene, another covers 30%. Standard fixes for majority-class bias, meaning the tendency of a model trained on skewed data to under-predict rare classes, all assume the deployment class balance is either the training balance or a balanced one. Neither holds for a new region. This proposal tests a specific claim. A large part of the accuracy drop seen in leave-one-region-out evaluation is a mis-set decision threshold caused by this change in class balance, and it can be largely recovered without labels. The correction works by estimating the new region's rare-class fraction from the model's own predictions on that region's unlabeled pixels, and it measures the model's bias against the prior the network actually learned, not against the raw training counts.
The fixed-design idea from statistics enters in two ways. A fixed-design analysis conditions on the realized inputs and treats only the labels as random. At deployment, the unlabeled target region is exactly such a fixed design: every pixel location is known, and the open question is how many of those pixels are flooded. Conditioning on that layout gives the correct uncertainty for the estimated prior. Spatially clustered labels mean a scene with a million pixels may carry the information of only a few hundred independent ones. The same conditioning also gives the correct estimand for evaluation: performance on this region, rather than on an imagined random draw of regions. Spatial generalization testing supplies the protocol, and majority-class bias supplies the mechanism being corrected.
Core Claim
The proposal makes two claims, one diagnostic and one corrective. The diagnostic claim is that held-out-region losses in imbalanced spatial segmentation split into a prior-shift part, which is fixable post hoc, and a part caused by the image features themselves changing. On standard flood and building benchmarks, the prior-shift part is a substantial fraction of the total. The corrective claim is that this part can be recovered in two steps. First, anchor the source prior at the model's effective prior, the class balance implied by averaging the network's posteriors, following Prior2Posterior. Second, re-estimate the target prior on the fixed target design with shrinkage sized to the spatially correlated effective sample size. This two-step correction should beat both raw-frequency logit adjustment and label-shift adaptation anchored at empirical frequencies.
If an oracle that knows each target region's true prevalence recovers little of the drop, the diagnostic claim is false and the project stops there. That is a cheap and decisive first check.
Relation to Prior Work
Several papers motivate the gap. Challenges in data-driven geospatial modeling is a review. It documents that random cross-validation inflates accuracy by up to 40% and that imbalance and spatial autocorrelation co-occur, but it offers no correction that accounts for the shift in class balance between regions. Assessing Geo-Foundational Models for Flood Inundation Mapping runs leave-one-region-out evaluation on FloodPlanet and finds strong regional failures, for example in Kansas and Uzbekistan. It does not ask whether those failures reflect prevalence differences. We reuse its protocol and ask that question directly.
The method draws on two sources. Prior2Posterior shows that a trained network's effective prior departs from training counts and corrects logits post hoc. However, it assumes the test distribution is identical to training apart from balancing, and it uses a single global prior. We keep its effective-prior estimate as the source anchor and replace its fixed target with a per-region estimate. Classification Imbalance as Transfer Learning frames imbalance as label shift toward a balanced target. We generalize the target to an unknown, region-specific prior.
Other work constrains the design. Negatives-Dominant Contrastive Learning shows that when domain shift and imbalance co-occur, pure prior corrections are insufficient, because the conditional feature distribution also moves. This is why we commit to a decomposition rather than claiming prior correction solves spatial transfer. NDCL also works only with discrete image domains and requires retraining. Our method is post hoc and region-specific. Cross-validation for Geospatial Data corrects spatial cross-validation for covariate shift through importance weighting (IBCV), but only for regression losses. Cross Validation for Correlated Data in Classification Models bias-corrects cross-validation for correlated binary data, and it explicitly leaves imbalanced and rank-based metrics open. Both treat evaluation as a random-design average. Our evaluation conditions on a specific target region.
Finally, Fixed Design Analysis of Regularization-Based Continual Learning shows the analytical payoff of conditioning on realized inputs: exact risk decompositions. We borrow that stance, not its regression bounds.
Research Program
The first component is a decomposition of held-out-region loss. For each held-out region we compute three quantities. The first is the uncorrected metric. The second is the metric after an oracle logit shift of $\log(\pi_r/\pi_{\text{eff}})$. Here $\pi_r$ is the true rare-class fraction in region $r$, and $\pi_{\text{eff}}$ is the effective training prior, meaning the mean predicted rare-class probability over training pixels. The third is the in-region upper bound from a model trained with region $r$ included. The gap between the first and second quantities is the prior-shift loss. The gap between the second and third is the loss caused by the features themselves changing.
We also report how much of the intersection-over-union (IoU) change is mechanical. IoU depends on prevalence even when per-class error rates stay constant, so holding the source per-class error rates fixed and plugging in the target prevalence separates a genuine drop in the model's ability to tell the classes apart from a scoring artifact.
The second component is the label-free correction. On the unlabeled target region, we estimate $\pi_r$ by iterating between adjusting posteriors and re-averaging them, starting from $\pi_{\text{eff}}$ rather than the raw training fraction. We then apply the logit shift.
The fixed-design analysis supplies the uncertainty. Treat the $n$ target pixel locations as fixed and their labels $y_i$ as random with spatial covariance $C_{ij}$. Then the prevalence estimate $\hat\pi_r$ has variance
$$\operatorname{Var}(\hat\pi_r) = \frac{1}{n^2}\sum_{i,j} C_{ij},$$
which defines an effective sample size $n_{\text{eff}} = \pi_r(1-\pi_r)/\operatorname{Var}(\hat\pi_r)$. We fit $C$ from a variogram of the predicted probabilities, an empirical curve of how quickly two pixels' values decorrelate with distance. We then shrink $\log \hat\pi_r$ toward $\log \pi_{\text{eff}}$ with weight $n_{\text{eff}}/(n_{\text{eff}}+\kappa)$, where $\kappa$ is chosen once on source folds. Small or highly clustered regions are corrected cautiously, and large heterogeneous ones are corrected aggressively. This step distinguishes the method from naive label-shift adaptation, which treats a million correlated pixels as a million independent votes.
The third component is a region-conditional performance estimate. Using source folds, we predict the corrected model's IoU on the target region from its estimated prevalence and the per-class error rates measured on source folds. We compare that prediction with the realized IoU. This asks whether a model's IoU on one specific region can be anticipated before any labels from that region exist.
Baselines
The naive reference is the trained segmentation model with its default 0.5 threshold and no correction, evaluated with leave-one-region-out. On FloodPlanet, Assessing Geo-Foundational Models reports leave-one-region-out mIoU for Clay of 0.72 on PlanetScope, 0.66 on Sentinel-2, and 0.51 on Sentinel-1. These are the numbers to beat. We rerun Clay and DeepLabv3+ ourselves with identical folds, and every correction is applied on top of the same frozen checkpoints, so all methods share data, compute, and training.
The first standard majority-bias fix is frequency-based logit adjustment: shift logits by the log of the training pixel fraction toward a balanced or training prior. The strongest existing post-hoc method is Prior2Posterior with a single global effective prior. Prior2Posterior reports 52.92% accuracy against 43.39% for its baseline on CIFAR100-LT at imbalance factor 200, a test without spatial shift. No reported result was found on Lacuna for Prior2Posterior on any spatial benchmark.
The most direct competitor is label-shift adaptation with an empirical source prior: the same iterative prevalence estimate, but anchored at raw training frequency and run without shrinkage. No reported result was found on Lacuna for this method on FloodPlanet, Sen1Floods11, or Inria.
Two ablations isolate the proposal's ingredients. The first swaps the anchor between effective and empirical priors while keeping shrinkage. The second removes the correlation-aware shrinkage while keeping the effective anchor. Two oracles bound the problem from above: the true-prevalence logit shift, and a threshold tuned on target labels.
The method beats the competition if it closes a clearly larger share of the oracle gap than empirical-anchored label-shift adaptation. That comparison is made across held-out regions with a paired test over regions, using the same hyperparameter budget, namely one $\kappa$ chosen on source folds only. For the evaluation component, the baselines are plain leave-one-region-out averages, IBCV-style covariate weighting from Cross-validation for Geospatial Data, and the correlated-classification correction of Yuval & Rosset, adapted to pixel cross-entropy. Success means lower absolute error between predicted and realized per-region IoU.
Why not just…?
Why not just use a geo-foundational model and accept its transfer? Fine-tuned foundation models still lose ground across regions. Clay falls from 0.79 overall to 0.72 leave-one-region-out on PlanetScope, and to 0.51 on Sentinel-1, per Assessing Geo-Foundational Models. Our correction is post hoc and applies on top of Clay. The decomposition will show directly whether Clay's residual drop comes from prior shift or from feature change.
Why not just run standard label-shift adaptation, which already estimates the target prior from unlabeled data? This is the real threat. If its estimates are accurate, our contribution shrinks to the variance shrinkage. Two pieces of evidence suggest it will be miscalibrated. Prior2Posterior shows the network's implicit prior is not the training frequency, so the starting point is wrong. Spatial clustering also makes the estimate far noisier than its nominal pixel count suggests, which is the content of the variance equation above. The two ablations settle this directly. If empirical-anchored, unshrunk adaptation matches our method, we will report that, and the paper becomes the decomposition plus a recommendation to use the simpler method.
Why not just tune the threshold on spatially blocked validation folds? A threshold tuned on source folds encodes the source folds' average prevalence. It cannot follow a target region whose flood fraction differs by an order of magnitude. The per-region analysis tests this directly: if prior shift matters, the gain over a source-tuned threshold should grow with the gap between target prevalence and source prevalence.
Why not just rebalance training with SMOTE-style oversampling? Interpolated minority samples in spatial imagery can be physically implausible (Challenges in data-driven geospatial modeling). More fundamentally, rebalancing still fixes one deployment prior at training time, so it does not address variation in prevalence between regions.
Proposed Experiments
The main testbeds are FloodPlanet leave-one-region-out across PlanetScope, Sentinel-1, and Sentinel-2. Sen1Floods11 provides a second flood testbed: we hold out one flood event at a time on its hand-labeled chips. Sen1Floods11 reports 0.3389 flood mIoU for a ResNet50 network trained on Sentinel-2 weak labels and 0.4571 for Otsu thresholding on permanent water. The Inria cross-city benchmark (Maggiori et al.) has reported test IoU of about 53.82% for an FCN and about 60% for the multi-scale MLP variant. The country-level civil-unrest tasks from Deep Spatial Domain Generalization test the method beyond pixels. No reported per-country number was found on Lacuna for these tasks.
Metrics are minority-class IoU, minority recall, and mIoU. For the estimation component we add the absolute error of the predicted per-region IoU.
Three checks decide the outcome. The first runs before anything else: if the true-prevalence oracle shift recovers less than a small fraction of the gap between leave-one-region-out and in-region performance, prior shift is not the main problem and the project pivots to the feature-change component. The second check is the effective-versus-empirical anchor ablation, which tests whether the Prior2Posterior bias gap persists under spatial transfer. The third check is a plot of correction gain against $n_{\text{eff}}$ and against the gap between target and source prevalence. The fixed-design account predicts that shrinkage helps most in small, clustered regions, and that unshrunk adaptation overcorrects exactly there. If neither pattern appears, the fixed-design component adds nothing and should be dropped.
References
- Prior2Posterior: Model Prior Correction for Long-Tailed Learning
- Challenges in data-driven geospatial modeling for environmental research and practice
- Assessing Geo-Foundational Models for Flood Inundation Mapping: Benchmarking models for Sentinel-1, Sentinel-2, and Planetscope
- Classification Imbalance as Transfer Learning
- Negatives-Dominant Contrastive Learning for Generalization in Imbalanced Domains
- Cross-validation for Geospatial Data: Estimating Generalization Performance in Geostatistical Problems
- Cross Validation for Correlated Data in Classification Models
- Fixed Design Analysis of Regularization-Based Continual Learning
- Sen1Floods11: a georeferenced dataset to train and test deep learning flood algorithms for Sentinel-1
- Can semantic labeling methods generalize to any city? the inria aerial image labeling benchmark
- Deep Spatial Domain Generalization