
An interval needs a population and a source of variation
A hyperspectral image may contain millions of labelled pixels but only a handful of independent acquisition conditions. An uncertainty interval becomes misleading when it treats those two facts as interchangeable. Before choosing a bootstrap procedure, state what could have varied: the sampled scene, spatial region, reference sample, training run or fitted model.
An interval obtained by resampling held-out pixels while keeping a trained model fixed describes one source of evaluation variation under the resampling assumptions. It does not include uncertainty from retraining, choosing hyperparameters, changing sensors or collecting labels differently. A table should identify the random unit beside the interval, not leave the reader to infer it from a ± symbol.
This guide explains a practical cluster-resampling workflow and its limits. It is not a universal guarantee of coverage for arbitrary spatial data. For the separate problem of constructing a valid development/test separation, first read spatial splits and leakage.
Why resampling individual pixels can be overconfident
Neighbouring pixels can share materials, illumination, acquisition artefacts and model receptive fields. Repeatedly drawing isolated pixels from the empirical distribution breaks those relationships. The resulting bootstrap can behave as though the evaluation contained many more independent observations than it actually does, producing intervals that are too narrow for the intended population.
Resampling methods for dependent data replace the independent-observation premise with assumptions suited to temporal or spatial structure. Lahiri provides a systematic treatment, including block methods for spatial data. The existence of such methods does not mean that any convenient tiling is valid; block geometry, dependence and the target statistic remain part of the design. [1]
Cross-validation and uncertainty estimation are also different operations. Roberts and colleagues discuss validation under structured data and the importance of matching the separation to the prediction task. A spatial test split can reduce one form of leakage while leaving correlated evaluation errors inside the test region. Its metric still needs an appropriate uncertainty analysis. [2]
Prefer the strongest genuinely replicated unit
If the claim concerns new scenes and several independently sampled held-out scenes exist, resample scenes as units. Keep all evaluated pixels from a sampled scene together. If scenes contain repeated acquisitions of the same location, decide whether location is the higher-level unit; treating repeated visits as independent scenes may understate dependence.
With only one scene, spatial blocks can support a conditional analysis of within-scene variation under additional assumptions. They do not manufacture evidence for cross-scene transfer. Choose block sizes with reference to the spatial scale of errors and acquisition structure, then examine sensitivity to plausible sizes and offsets. Larger blocks preserve more local dependence but leave fewer units to resample.
If the reference labels were collected using a probability sample, preserve that sampling design. Stratification, unequal inclusion probabilities and cluster sampling may require design weights or specialised variance estimation. Olofsson and colleagues emphasise consistency between sampling, response and analysis designs in map accuracy assessment. A convenience bootstrap of the labelled pixels can estimate the wrong quantity. [3]
| Evidence available | Possible resampling unit | What remains untested |
|---|---|---|
| Independent held-out scenes | Whole scenes | Conditions absent from those scenes |
| Repeated dates at several sites | Sites, with a declared hierarchy | New sensor or unrepresented season |
| One densely labelled scene | Spatial blocks under stated assumptions | Cross-scene generalisation |
| Probability-sampled reference labels | Units respecting the sampling design | Bias from an inadequate reference response design |
Sources: [3]
Resample sufficient counts for a fixed classifier
For a fixed hard classifier, save a confusion matrix for each eligible block. For each bootstrap replicate, sample block IDs with replacement using the chosen design, sum their matrices with the intended weights and calculate the metric from that aggregate. This avoids repeatedly loading every pixel while retaining the group-level dependence represented by the blocks.
Suppose three equally weighted test blocks have 90 correct pixels out of 100, 80 out of 100 and 50 out of 100. The pooled accuracy is 220/300, approximately 73.3%. A bootstrap draw containing blocks 1, 1 and 3 has 230 correct out of 300, approximately 76.7%. This example only illustrates resampling arithmetic; three blocks are far too little evidence for a reassuring general-purpose interval.
Distinguish pooled metrics from average block metrics. If one block has 100 pixels at 90% accuracy and another has 1,000 at 50%, pooled accuracy is 590/1,100, approximately 53.6%; equal-weight mean block accuracy is 70%. Neither number is an implementation accident. They represent different weighting of space and must match the question being asked.
Compare methods with the same resampled units
When methods A and B are evaluated on the same labelled regions, use the same sampled block IDs for both in every replicate. Compute each metric and retain the within-replicate difference A − B. Resampling the two methods independently discards their shared easy and difficult regions and changes the uncertainty of the comparison.
SciPy documents paired resampling as using the same index sample for corresponding arrays. That principle applies to a block-level representation, but setting paired=True on raw pixel arrays does not make the procedure spatial. The resampled array must already represent the appropriate units and the statistic must reconstruct the intended aggregate. [4]
For non-additive statistics such as macro-IoU, recompute the statistic from each resampled confusion matrix. Averaging per-block IoUs generally estimates a different quantity. Save the paired differences and report the chosen interval method, number of replicates and random seed. More replicates reduce simulation noise; they do not increase the number of independent scenes.
Sources: [4]
Handle absent rare classes explicitly
A rare class may occupy only one or two blocks. Some bootstrap draws will contain no reference support for it, or no support in the union used by an IoU denominator. This is a property of the evidence, not merely an error message. Report how often the statistic becomes undefined and the policy applied.
Dropping undefined draws silently can condition the analysis on the rare class being present and make the result look more stable than it is. Assigning zero or one changes the estimand as well. A class-conditional analysis or stratified resampling may be appropriate, but then the interval should be labelled as conditional on that design rather than representative of unstratified scenes.
Show the distribution of support across blocks next to the interval. A tiny-class result based on one spatial cluster remains weakly replicated even if the cluster contains hundreds of pixels. Object counts, scene counts and labelled support help readers understand what is actually repeated.
Keep training variation separate from evaluation variation
Repeated training seeds measure sensitivity to stochastic optimisation and related choices under a fixed data protocol. A bootstrap over evaluation blocks measures another component. Reporting their values in a single unexplained error bar hides which uncertainty was assessed.
If the scientific claim requires both, design a hierarchical analysis before running it: identify independently trained models, the pairing across methods, evaluation scenes and their relationship to training data. A seed is not automatically an independent draw of the whole learning problem, and repeatedly reusing the same test scenes does not create new environmental replication.
Likewise, variability across cross-validation folds is not automatically a confidence interval. Fold models share much of their training data, and their scores can have different test populations. Keep descriptive fold ranges useful and clearly labelled while choosing a formal uncertainty procedure suited to the stated target.
Report the assumptions beside the interval
A useful report names the evaluated population, fixed model, grouping unit, block construction, metric weighting, rare-class policy and interval method. Include the number of actual units, not only the number of bootstrap replicates. Preserve a block manifest and per-block confusion counts so another analyst can reproduce the calculation.
Examine whether the conclusion changes under defensible block sizes and offsets. If it does, show that sensitivity rather than selecting the narrowest interval. If there are too few independent units, report the limitation directly and provide per-scene or per-region results instead of implying precision the study cannot support.
An interval is a statement conditional on a sampling and modelling argument. It cannot repair test-set tuning, inaccurate references or an unrepresentative acquisition. When those conditions are transparent, even a wide interval is informative: it identifies where more independent evidence would change confidence in the result.
Frequently asked questions
How many bootstrap replicates are enough?
Choose enough to stabilise the reported quantiles and check Monte Carlo sensitivity. Increasing replicates does not compensate for having very few independent blocks or scenes.
Does a spatial block bootstrap prove transfer to a new scene?
No. A within-scene resampling analysis cannot create unobserved acquisition or environmental variation.
Can I bootstrap IoU from per-block values?
Only if the estimand is the average block IoU. For pooled IoU, resample block confusion counts, aggregate them and recompute the ratio.
References and further reading
Reader feedback
Reads since 1 October 2026: at least 15 seconds with the article visible, counted once per browser per day. Reactions are anonymous and can be changed.
Loading reader feedback…
Discuss this article
Ask a technical question, challenge an assumption or share evidence from your own work.