Spending Tile Overlap Where Context Matters

Large images such as aerial maps, pathology slides and 8K photographs are usually too big for a network to process in one pass. The standard fix is to cut them into overlapping tiles, run the model on each tile, and blend the results. The blending weights are almost always fixed: a uniform average, a linear ramp, or a Gaussian bump that trusts tile centers more than tile edges. The amount of overlap is also fixed and identical everywhere. Fixed overlap is expensive (50% overlap in 2D means roughly four times the forward passes). It is also wasteful, because over a flat field a tile edge barely changes the model's output, while next to a building corner just outside the window the same edge can change it a lot.

This note proposes measuring that difference instead of assuming it away. When two overlapping tiles both predict the same pixel from windows at different positions, the gap between their predictions, divided by how far the window moved, is a local estimate of how sensitive the model's output is to missing context. This is the same "secant" trick that adaptive optimizers use to estimate local curvature from two gradients, with no extra evaluations. We turn that estimate into a per-pixel bound on the remaining tiling error. Extra tiles then go only where the bound is high. The target is a frozen, padded, pretrained model whose tiled output matches its own full-image output closely, at a fraction of the cost of uniform dense overlap.

Core Claim

For off-the-shelf models that cannot be redesigned, the error caused by tiling at a pixel is mostly the product of two factors. The first is a model-specific profile in the pixel's distance to the nearest tile edge. The second is a content-specific amplitude. The amplitude can be estimated for free from disagreements between already-computed overlapping tiles. Allocating overlap adaptively according to this amplitude should reach a given seam-error level with substantially fewer forward passes than uniform overlap. It should also beat a model-calibrated fixed blending window at equal compute.

If the content amplitude turns out to be nearly constant across an image, the claim fails. In that case a once-calibrated fixed window is all one needs. The program is built so that this outcome is detected early and reported.

Where This Sits

Continuous Patch Stitching for Block-wise Image Compression shows that seams come from padding and truncated receptive fields. It removes them exactly, so that tiled output is bit-identical to whole-image output under 4GB for 8K images, by building a padding-free CNN and computing the precise overlap it needs. That paper motivates our error target: the deviation from full-image inference. It also constrains our scope. Its exactness depends on re-engineering the network, which is impossible for padded transformers such as SwinIR or the DINO-based detectors used with SelvaBox. We take its target and drop its architectural requirement, accepting approximate rather than exact agreement.

The blending literature supplies the baselines we must beat. It includes linear decay (Zhou et al.), spline windows (Benjdira et al.), Gaussian weighting (Edirimuni) and center cropping (Ho et al.). All of them use one geometry-only weight everywhere and a fixed overlap everywhere. The Power of Tiling for Small Object Detection uses fixed 25% overlap with box-level merging on VisDrone; it shows that tiling matters but gives no way to decide where overlap is needed.

The estimation method comes from optimization. Adaptive Gradient Descent without Descent estimates local smoothness as the ratio of gradient change to iterate change and grows or shrinks the step size accordingly; Δ-SGD does the same on federated clients. Our analogue replaces the step size with tile stride, and the gradient difference with the prediction difference between windows.

The allocation rule borrows from Certificate-Guided Pruning for Stochastic Lipschitz Optimization. That work refines a discretization only in cells whose local Lipschitz certificate cannot yet rule them out. Here a region is refined with extra tiles only while its certified residual error exceeds a tolerance.

Patch-based diffusion samplers average noise estimates across overlaps at every denoising step: MultiDiffusion, WeatherDiff and UniMIE. Any-Size-Diffusion instead shifts the grid at random between steps. We deliberately leave these out of the core study, because the stochasticity of sampling would contaminate the disagreement signal. Section 1.2 of the research file notes that secant estimates already turn noisy under mini-batch noise.

The Mechanism

Fix a frozen model $f$ and a pixel $p$ covered by windows $i=1,\dots,k$. Let $y_i(p)$ be window $i$'s output at $p$, let $y^*(p)$ be the full-image output, and let $m_i(p)$ be the distance from $p$ to the nearest edge of window $i$. We posit

$$\|y_i(p) - y^*(p)\| \approx c(p)\, g(m_i(p)),$$

where $g$ is a decreasing profile specific to the model and $c(p)$ is a content-dependent amplitude.

The profile $g$ is calibrated once per model. We run full-image inference on a handful of moderate-size images, which fit on a large GPU or on CPU, and regress tiled error on margin.

At inference time, any two windows $i,j$ covering $p$ give a secant estimate

$$\hat c(p) = \frac{\|y_i(p) - y_j(p)\|}{|g(m_i(p)) - g(m_j(p))|},$$

which needs no extra forward passes. This mirrors how AdGD reads curvature off two gradients it has already computed. The predicted residual error after blending is then $r(p) = \hat c(p)\, g(m_{\max}(p))$, where $m_{\max}$ is the best margin available at $p$.

Under this model, blending weights at a single pixel depend only on $g$, because $c(p)$ cancels. Content therefore enters through allocation, not through weighting. We state this explicitly because it determines which ablation matters.

The algorithm runs in three stages. It starts with a cheap grid with small overlap, around one eighth of the tile width. It estimates $\hat c$ in the overlap bands, smoothing spatially and extrapolating to tile interiors where the margin is large. It then greedily places new windows centered on the largest-$r$ regions until either $r$ falls below a tolerance everywhere or a pass budget runs out.

A second variant relaxes the separable model in a way that lets content also change the weights. It lets the amplitude depend on which tile edge is missing, so that a window whose truncated side faces strong structure is down-weighted. We test whether this extra freedom helps.

Research Program

The work proceeds in three phases. Phase one tests the premise. For several frozen models we measure how much of the per-pixel tiling error (relative to full-image output) is explained by margin alone, and how much more is explained by margin times a content amplitude. The models are a padded CNN and a Swin-based segmenter on ISPRS Potsdam and INRIA aerial imagery, a SwinIR-style restorer on DIV8k crops small enough for a full-image reference, and a DINO-based crown detector's dense score map on SelvaBox. We also measure how well the secant estimate $\hat c$ correlates with the true amplitude.

Phase two builds the allocation algorithm and plots error against forward passes. Phase three checks that lower deviation from full-image output translates into task metrics, especially metrics sensitive to boundaries. The research file notes that area-dominated scores such as PSNR and IoU hide 1–2 pixel seams.

Baselines

The naive reference point is non-overlapping tiling, plus uniform pixel averaging at fixed overlap. Overlapping Patch Inference for High Resolution Images already notes that uniform averaging lets edge errors leak through. For context on how much tiling matters at all, The Power of Tiling for Small Object Detection reports VisDrone2018 mAP rising from 11% for single-frame processing to 36% with a 5x3 tiling grid.

The standard fixed-window methods are linear ramp, spline and Gaussian blending (Zhou et al., Benjdira et al., Edirimuni) and center cropping (Ho et al.). Each is run at overlaps of 12.5%, 25% and 50%, with the overlap fraction and window width tuned on the same held-out images we use to calibrate $g$.

The strongest competitor is one we construct ourselves: a calibrated fixed window. It uses our learned profile $g$ to weight overlapping tiles, applied with uniform overlap. It contains everything in our method except content-adaptive allocation, and it is exactly what a skeptic would build. It therefore doubles as the ablation that isolates our key ingredient. Beating it requires lower seam error at an equal number of forward passes, or equal error with clearly fewer passes. We set the bar at a statistically reliable reduction across images at matched budget, not a single best-case image.

A second ablation replaces the secant estimate $\hat c$ with a content proxy that needs no overlap, namely local image gradient magnitude. This tests whether the disagreement signal carries information beyond plain edge density.

POPS is reported only as the exact reference in the compression setting where it applies, because its numbers (BD-rate -34.19% on DIV8k, -28.96% on Kodak, artifacts "completely" eliminated by PSNR-B) come from a redesigned network rather than a frozen one.

All methods share the same frozen weights, the same images and the same accounting of forward passes and pixel-FLOPs. Our primary metric is deviation from full-image inference. No reported result found on Lacuna for this metric on any of the chosen benchmarks, so every method is measured fresh. On secondary task metrics the reference points the file provides are these: Potsdam IoU of 93.85% with the boundary loss of Bokhovkin & Burnaev, compared with 92.56% for standard IoU loss, and SelvaBox $RF1_{75}$ of 48.60 on its test set (Baudchon & Ouaknine). These numbers come from those papers' own trained models and pipelines, not our frozen ones. We use them only to check that our models operate in a sensible regime.

Why not just…?

Why not just calibrate a better fixed window once per model? This is the real threat. If tiling error is close to a function of margin alone, a calibrated window captures nearly all of it, and adaptive allocation adds bookkeeping without benefit. Phase one settles this before anything else is built. If margin alone explains almost all of the error variance on Potsdam, DIV8k and SelvaBox, we report that negative result and recommend the calibrated window. That recommendation would still be a useful, model-specific improvement over hand-picked Gaussians. The proposal only proceeds to allocation if the content amplitude varies substantially within images.

Why not just use more uniform overlap, or crop the margins away? Both reduce seam error, but they pay for it everywhere. Fifty percent overlap in 2D costs about four times the passes, and cropping throws away computed pixels. Discarded margins that do not match the network's true receptive field leave residual seams, as the receptive-field analysis in Continuous Patch Stitching explains. The error-versus-passes curves answer this directly: our method wins only if its curve lies below uniform overlap at matched budget.

Why not just weight tiles by the model's own confidence or entropy? Work on confocal microscopy mosaics observes that confidence drops near tile margins, so confidence is a reasonable weighting signal for classifiers. It does not exist for regression outputs such as restored pixels. It also measures uncertainty about the label, not sensitivity to missing context: a model can be confidently wrong at a truncated edge. We include entropy weighting as a baseline for the segmentation and detection models, and test whether it predicts deviation from full-image output as well as $\hat c$ does.

Why not just shift the tile grid at random, as Any-Size-Diffusion does? FSTD halves inference time (75s versus 166s) because many denoising steps average out the random offsets. Our target models run a single deterministic pass, so there is nothing to average over. Extending the disagreement-based allocation to diffusion samplers is a natural follow-up but is outside this study.

Decisive Checks

Three results decide the proposal. The first is the variance decomposition in phase one: does content explain a meaningful share of tiling error beyond margin, and does the free secant estimate track it? The second is the matched-budget comparison against the calibrated fixed window on deviation from full-image output, measured both inside seam bands and at the 99th percentile. The third is whether those gains survive into boundary F1 on Potsdam and INRIA and into $RF1_{75}$ on SelvaBox, where bisected crowns are the failure mode the research file highlights.

As a sanity check, applying the method to a POPS-style padding-free network should show $\hat c \approx 0$ beyond the receptive-field margin and trigger no refinement. If the estimator flags seams there, it is measuring something other than context truncation.