Teaching Segmenters to Ignore Tile Edges and Pixel Size

Satellite images are too large to push through a neural network whole, so every mapping pipeline cuts them into tiles, predicts each tile separately, and stitches the results back together. Two things break when this happens. Pixels near a tile edge lose the surrounding context the network relies on, so predictions change depending on where the tiling grid happens to fall. And a model trained at one pixel size, called the ground sample distance (GSD, the width of ground covered by one pixel), degrades when deployed on imagery from a different sensor or altitude. Today's fixes are expensive or blunt. Overlapping tiles with blending multiply inference cost. Multi-scale resizing during training only partly helps, and resizing does not reproduce the look of native low-resolution imagery.

This note proposes treating both problems as known nuisances: variables we can deliberately change for the same ground location, and whose effect on the network's internal features we can therefore measure. We measure how a pixel's feature vector moves when only its position within the tile changes, or only its GSD changes. We collect these displacements per class into a covariance matrix. We then train the classifier with a closed-form "infinite augmentation" loss, borrowed from implicit semantic data augmentation, that makes it robust to exactly those displacements. The claim, in two sentences: generic feature-space augmentation perturbs features along directions of ordinary within-class variation, but tiling and resolution shift features along specific, measurable directions. Augmenting along the measured directions should give non-overlapping tiled inference and cross-GSD transfer most of the benefit of heavy overlap and multi-scale testing, at the training cost of a loss term.

Core Claim and Relation to Prior Work

The method comes from Implicit Semantic Data Augmentation for Deep Networks (ISDA). ISDA tracks each class's feature covariance $\Sigma_k$. It then replaces the expected cross-entropy under Gaussian feature perturbations $\mathcal{N}(0,\lambda\Sigma_k)$ with a deterministic upper bound, which costs about 5–7% extra training time. That covariance describes how features of class $k$ vary across different examples. Under a tiling or resolution shift, the relevant variation is how the same example's feature moves. These need not share directions. The research file's own gap analysis suggests a scale-conditioned class covariance $\Sigma_k(s)$. We think that is the wrong object: it still describes spread across examples at each scale, not the displacement a scale change causes.

We define, for class $k$ and nuisance $\nu$ (tile position or GSD), the displacement covariance

$$\Sigma_k^{\nu} = \mathbb{E}\big[(a(x,\nu_1)-a(x,\nu_2))(a(x,\nu_1)-a(x,\nu_2))^\top \,\big|\, y(x)=k\big],$$

where $a(x,\nu)$ is the per-pixel feature at ground location $x$ computed under nuisance setting $\nu$. We then substitute it into the ISDA bound for the per-pixel linear classifier with weights $w_j$ and biases $b_j$:

$$\mathcal{L} = -\log \frac{e^{w_y^\top a + b_y}}{\sum_j e^{w_j^\top a + b_j + \frac{\lambda}{2}(w_j-w_y)^\top \Sigma_y^{\nu}(w_j-w_y)}}.$$

The penalty term only grows when the classifier's decision directions align with directions the nuisance actually moves features. Directions of legitimate intra-class variety are left alone.

Two other lines of work set up the contrast. Deep Covariance Alignment for Domain Adaptive Remote Sensing Image Segmentation uses class covariances on LoveDA to align source and target statistics. It samples no perturbations, and it pools edge and centre pixels together. We use second-order statistics to augment, and we treat edge position as the quantity of interest. Boundary losses, such as Boundary Loss for Remote Sensing Imagery Semantic Segmentation and the Mahalanobis-angle loss of BASeg, sharpen object contours in the output mask. They do not target disagreement between tiles, and their fixed-pixel structuring elements are themselves resolution-bound.

Several papers motivate the problem. Foundation Models for Remote Sensing: An Analysis of MLLMs for Object Localization finds localization performance peaks near 0.3 m/pixel. Preanalytic variable effects on segmentation and quantification machine learning algorithms for amyloid-β analyses on digitized human brain slides shows that downsampling does not reproduce native low magnification, a warning we take seriously below. Tiling studies such as The Power of Tiling for Small Object Detection document truncation at borders.

Two papers constrain the design. ISDA's linearity assumption means we apply the loss only at the last feature layer before the per-pixel classifier, not inside the backbone. How to Efficiently Adapt Foundation Models to Remote Sensing for Object Detection? reports that parameter-efficient tuning struggles on overhead imagery. We therefore test the loss both under full fine-tuning and under low-rank adaptation, and we do not assume it rescues the latter.

Research Program

The first step is measurement, and it is useful even if the method fails. For a trained segmenter, we tile each scene with several random grid offsets, so every ground pixel is observed at a range of distances from the tile edge. We record its feature at each offset. For resolution, we render each scene at several GSDs. On LoveDA and Potsdam this has to be done by downsampling. Following Oliveira et al., we treat the resulting covariance as an approximation and test on native cross-dataset GSD gaps rather than on held-out downsampled copies. From these records we estimate $\Sigma_k^{\nu}$ as a function of distance to tile edge.

We then ask three questions. How low-rank are these covariances? How much do their leading directions overlap with the ordinary ISDA class covariance? Is the edge displacement concentrated within a band whose width scales with the backbone's receptive field? If the displacement subspace is nearly identical to the class-covariance subspace, the proposal collapses into plain ISDA, and we will report that.

The second step is training. We maintain $\Sigma_k^{\nu}$ online, as ISDA does. Each batch includes a small fraction of pixels observed under two tilings or two scales, which supply the displacement statistics. The augmented loss above then applies to all pixels, paired or not. For tile position we also try making $\Sigma_k^{\nu}$ depend on distance to the edge, so that centre pixels are barely perturbed. Inference then uses non-overlapping tiles at native GSD, with no blending and no multi-scale testing.

Baselines

The naive reference is standard training with random crops, plus non-overlapping tiled inference. Every other method is measured as a gain over this, both on overall mean intersection-over-union (mIoU) and on the edge-band metrics defined below.

The strongest inference-time competitor on the seam question is 50%-overlap sliding windows with distance-weighted blending, run on the same trained model. It is the practical upper reference for seam quality, at roughly four times the tile count. Beating it means matching its edge-band mIoU within one point while using one quarter of the inference compute. We will not claim to exceed it outright.

On resolution, the strongest cheap competitor is multi-scale training and testing. LoveDA reports HRNet at 49.79% mIoU without it and 52.14% mIoU with it on the LoveDA test set. We reproduce the HRNet recipe, with the same data, schedule and tuning budget, and add our loss both with and without multi-scale training. Beating it means higher mIoU on a native cross-GSD transfer with single-scale inference. Adding our loss on top of multi-scale training should also give a further gain.

The strongest overall system in the file is A Billion-scale Foundation Model for Remote Sensing Images, which reports 54.4% mIoU on LoveDA and 92.12% mF1 on Potsdam. We cite it as a ceiling rather than a target: our backbones are far smaller. For Potsdam boundary quality, the Boundary $F_1$ loss reports 93.85% IoU against 92.56% for an IoU loss, and it is combined with ours as a complementary term. For the urban-to-rural transfer setting, DCA reports a 9.19% (rural→urban) and 9.65% (urban→rural) mIoU improvement over prior adaptation methods. We rerun DCA under our protocol rather than comparing against its published numbers.

Two ablations isolate the key ingredient. The first is plain ISDA with the ordinary class covariance, with $\lambda$ tuned identically. It tests whether measured displacement directions matter at all. The second is an explicit paired-consistency loss, which penalizes prediction disagreement for the same pixel across two tilings or two scales. It uses exactly the same pairs our method consumes, and it tests whether the closed-form covariance adds anything beyond the pairs themselves. All methods get the same number of hyperparameter trials.

Why not just…?

Why not just train with random crops, since the model already sees edges? It does see edges, and that is precisely the naive baseline. Truncated-context pixels are a small minority of training pixels, and nothing tells the classifier that an edge pixel and a centre pixel of the same location should agree. The edge-band metric on the baseline will show whether this implicit exposure already suffices. If the gap between edge-band and centre mIoU is under a point, the seam half of this proposal is unnecessary.

Why not just use heavy overlap with blending? Because tile count roughly quadruples. Also, Learnable Prompt for Few-Shot Semantic Segmentation in Remote Sensing Domain found that framing overlaps as inpainting beat averaging, which suggests blending leaves quality on the table even at that cost. Our claim is about the compute trade-off, and the experiment reports the full curve of edge-band mIoU against overlap fraction for both methods.

Why not just enforce paired consistency directly? This is the real threat. A consistency loss uses the same information and may work as well. The argument for the covariance form is that it aggregates displacement directions across the whole dataset and then regularizes every pixel's classifier margin along them in closed form. A pairwise loss regularizes only the pairs sampled in a batch. If consistency matches us at equal pairing budget, we will report that the contribution is the measurement study and the edge-band evaluation, not the loss. If it matches us only at a larger pairing budget, the covariance form is justified by its cost.

Why not just use multi-scale resizing? It is a baseline and is combinable with our loss. Resizing trains on downsampled views, which Oliveira et al. show are not native low-resolution imagery. Both methods share that limitation, which is why we test resolution transfer on a native gap rather than on resized copies.

Proposed Experiments

For tiling we use ISPRS Potsdam and LoveDA scenes stitched at native size. Models are trained on crops and evaluated with non-overlapping tiling at four random grid offsets. We report three things. The first is standard mIoU. The second is edge-band mIoU, computed on pixels within a fixed ground distance of a tile border and stated in metres so that it is comparable across GSDs. The third is tiling-offset disagreement: the fraction of pixels whose predicted label changes between offsets. This last metric needs no labels and directly measures seam instability.

For resolution we train on Potsdam and evaluate on LoveDA classes shared under a class mapping, and the reverse. This gives a native GSD gap confounded with a geographic gap. To separate the two, we also run within-LoveDA downsampled evaluation, clearly labelled as synthetic. The urban→rural split tests whether gains persist under geographic shift.

We run HRNet and a ViT backbone under both full fine-tuning and low-rank adaptation, three seeds each.

The decisive checks are three. First, measured displacement covariance should differ from class covariance, with low subspace overlap. Second, our loss should beat plain ISDA on edge-band mIoU and offset disagreement while not hurting centre mIoU. Third, it should reach near-overlap seam quality at one quarter of the inference cost, or it should improve native cross-GSD transfer over multi-scale training. If none of these hold, and paired consistency explains everything, the negative result still gives the field a labelled-free seam metric and a measurement of how tiling moves features.