Seam-Aware Teachers for Domain-Adaptive Detection on Tiled Aerial Imagery

Aerial and drone images are too large to feed to a detector whole, so practitioners cut them into tiles. Cutting creates seams. An object that straddles a seam appears in each tile as a fragment, and a detector sees each fragment without the rest of the object or the surrounding scene. This problem is already known for ordinary detection. This note argues that it becomes much worse when the detector is being adapted to a new geography or sensor by self-training, a method in which a "teacher" copy of the detector labels unlabeled target images and a "student" copy learns to imitate those labels. On a tiled target image, the teacher is least reliable exactly at the seams. Its uncertain or wrong predictions on fragments become training targets. The student then learns to under-detect and mis-localize objects near tile borders, and repeated rounds of self-training compound the error.

The proposal is to stop the teacher from seeing the same seams the student sees. During target-domain self-training, the teacher sees each student tile with extra context. It gets a larger, offset crop, so that every student seam falls in the interior of a teacher view, plus a cheap low-resolution view of the whole scene. Each training target is weighted by how much of the object the teacher could actually see. The question is empirical and falsifiable: does the gap between seam-adjacent and interior objects grow during standard self-distillation, and does decoupling teacher and student tiling close it? We test this on tiled cross-geography benchmarks where current domain adaptation code has never been evaluated.

Core Claim

The strongest current recipe for domain-adaptive object detection is Align and Distill (ALDI++). It showed that most of the gains attributed to adversarial feature alignment disappear against a well-augmented source-only model. It also showed that the real engine of adaptation is self-distillation from a moving-average teacher using soft, continuous targets for classification, box location, and objectness. That paper assumes whole-frame inputs such as Cityscapes. Soft targets are exactly what makes it vulnerable to tiling. A hard-threshold pipeline would drop a low-confidence fragment, but soft distillation passes the teacher's diffuse, truncated-context belief straight into the student's loss.

Our claim has two parts. The diagnostic part: under tiled target-domain self-distillation, seam-stratified accuracy degrades relative to interior accuracy over training. The degradation should be larger with soft distillation than with source-only training. The constructive part: a seam-aware teacher removes most of that degradation without paying for overlapping inference at test time. Its three ingredients are the offset context crop, a global low-resolution context stream, and completeness weighting.

The paper closest to this question is Adapting Vehicle Detectors for Aerial Imagery to Unseen Domains with Weak Supervision. It adapts aerial vehicle detectors across DOTA, LINZ, and UGRC by synthesizing target-style imagery with a fine-tuned diffusion model. Its pseudo-labels come from the generator's cross-attention maps, which are layout-like spatial maps. The authors explicitly report failures on vehicles bisected by their 112-pixel patch borders. That paper motivates ours: it is direct evidence that seams corrupt cross-domain pseudo-labels. We differ in where we intervene. They change the source of the labels, a generator processing isolated patches. We change how the teacher sees the real target image relative to the student's tiling.

Research Program

The method sits on top of the public ALDI codebase (justinkay/aldi), which provides the robust burn-in phase, the moving-average teacher, and multi-task soft distillation.

During target training, we sample a student tile of side $s$. The teacher receives a crop of side $s + 2m$, centered on the same location but taken from a teacher grid offset by half a tile. Every student seam therefore lies deep inside some teacher view. The teacher's predictions on its larger crop are clipped and re-projected into student tile coordinates, and the student imitates them as in ALDI++.

The second ingredient addresses the problem that the teacher still sees only a local window. It borrows the idea behind JoLT. JoLT runs a low-resolution whole-image diffusion trajectory alongside high-resolution tiles and injects the global estimate into every tile at every step. We use the analogous discriminative construction. The whole scene is downsampled once and encoded into a small set of global tokens. A single cross-attention layer, placed after the backbone, lets every tile's features read those tokens. This is the long-range context component. Its cost scales with the number of tiles times the token count, not quadratically with the full raster. That matters because full self-attention over a 4000×4000 mosaic is infeasible.

JoLT is a generator that relies on one-shot clean-image estimates from a 4-step distilled model. It reports a "crowding" failure when too much local detail is pushed into the global stream. We send information only one way, global to local, and evaluate whether that avoids crowding in a detection setting.

The third ingredient is completeness weighting. Let $c_j \in [0,1]$ be the fraction of teacher box $j$ that lies inside the teacher's own crop. A box clipped by the teacher's border has $c_j < 1$. The student's distillation loss becomes

$$\mathcal{L}_{\text{distill}} = \sum_j c_j^{\gamma}\, \ell\big(p^{S}_j, p^{T}_j\big),$$

where $p^{S}_j$ and $p^{T}_j$ are the student and teacher soft predictions for box $j$, $\ell$ is the ALDI++ per-task soft loss, and $\gamma \ge 0$ controls how sharply incomplete teacher evidence is down-weighted. With the offset crop, $c_j < 1$ should be rare. The weight is a safeguard for objects larger than the margin $m$, such as large tree crowns.

The analysis half of the program is as important as the method. We stratify every target-domain object by its truncation fraction under the student's tiling. We then track three quantities across self-training iterations: teacher calibration (expected calibration error), soft-target entropy, and student AP, each separately for seam-crossing and interior objects. If the seam gap does not widen under plain ALDI++, the diagnostic part of the claim is false. The method would then reduce to a test-time trick, and we would report that.

Spatial layout control plays a deliberately minor role. The cross-attention pseudo-labeling pipeline of Adapting Vehicle Detectors is one way of reading spatial layout off a generator. Training-free layout methods such as Cross Attention Control and grounded generators such as GLIGEN all assume a single isolated canvas and degrade on small or overlapping boxes. These are exactly the conditions of aerial vehicles at seams. We therefore treat generative layout-derived labels as an alternative teacher, not as a component of the method. We apply the same seam-stratified analysis to that teacher to test whether seam corruption is specific to discriminative teachers.

Baselines

The naive reference point is a source-only detector, trained with ALDI++'s robust burn-in augmentations, applied to non-overlapping target tiles. A second naive point is the same detector on the whole raster downsampled to its native input size. That point should collapse on small objects: The Power of Tiling for Small Object Detection reports 11% mAP non-tiled versus 36% with a 5×3, 25%-overlap grid on VisDrone2018, and DOTA reports that over 57% of its instances are 10–50 pixels.

The strongest existing method is ALDI++ itself, run on tiled target data with random crops. It is the strongest competitor because it already beats adversarial methods such as Domain Adaptive Faster R-CNN when those are given fair baselines. ALDI++ reports Target AP50 gains of +3.5 on Foggy Cityscapes and +5.7 on Sim10k→Cityscapes over prior art, and comes within 1.0 AP of the target-supervised oracle on several tasks. We found no reported result on Lacuna for ALDI++ on any tiled aerial or orthomosaic benchmark, so we must establish that number ourselves. The comparison will be fair in three ways. ALDI++ and our method share the same backbone, burn-in checkpoint, tile size, training iterations, and number of tuning trials. Hyperparameters for both are selected with the same label-free criterion, because unsupervised validation is an open problem that ALDI++ acknowledges. Both are evaluated with the same stitched test-time inference. Beating ALDI++ means two things: a statistically reliable gain, across three seeds, in seam-crossing AP; and no loss in interior AP. An overall-AP gain driven entirely by interior objects would not count.

On SelvaBox, the external anchor is the reported DINO Swin-L detector of SelvaBox. It scores RF1₇₅ of 48.60 on the internal test set and 41.91 in zero-shot transfer to BCI50ha, against 34.97 for Detectree2. This anchor relies on multi-resolution training and dataset pooling, with no adaptation mechanism. Our adapted detector, trained with the same backbone, should exceed 41.91 on BCI50ha to show that self-training adds something beyond scale augmentation.

The ablations isolate each ingredient: offset context crop alone, global token stream alone, completeness weighting alone, and all three combined. A particularly important one is the "context-padded teacher without offset", described below.

Why not just…?

Why not just tile with overlap and merge with non-maximum suppression, as Unel et al. do? Overlapping inference fixes duplicate boxes at test time. It does nothing about the training targets the student received during adaptation. It also multiplies test-time compute, and it is reported to fail when dense objects cluster on seam intersections, as in parking lots or tree canopies. We will nonetheless run it on top of every training method, because it is a real threat: if overlap-plus-NMS applied to plain ALDI++ matches our seam-stratified AP, then the training-time fix is unnecessary and we will say so. Our method should match that baseline using non-overlapping test tiles, at roughly the compute of a single pass.

Why not just give the teacher a bigger crop, or mask out seam-adjacent pseudo-labels? This is the most serious alternative, because it is the simplest version of our own idea. A context-padded teacher without the half-tile offset, and a variant that zeroes the distillation loss within $k$ pixels of a seam, are both included as ablations. Masking throws away supervision for exactly the objects that most need adaptation, which are small objects near borders. Padding without the offset still leaves objects larger than the margin truncated. If either simple variant recovers most of the gain, the paper's contribution narrows to the diagnosis plus that simple fix, and we will frame it that way.

Why not just rely on ALDI++'s random cropping, which already moves seams around? Random crops vary where seams fall, but the teacher evaluates the same crop as the student. Every truncated object is therefore still labeled by a teacher that sees it truncated. The bias moves around the image instead of averaging out. The seam-stratified tracking across training iterations directly tests whether random cropping suffices.

Why not just add a global attention backbone and skip the teacher changes? Full global attention is quadratic in raster size and infeasible at orthomosaic scale. A global stream on the student alone leaves the teacher's targets unchanged. The "global stream alone" ablation measures how much of the gain context provides without changing the teacher's view.

Proposed Experiments

The primary benchmark is SelvaBox (CanopyRS/SelvaBox). It spans 14 orthomosaics across Brazil, Ecuador, and Panama, already tiled into more than 2,400 sub-images, and its large tree crowns are frequently bisected by tiles. We use leave-one-country-out adaptation with the target labels hidden, report RF1₇₅, and add BCI50ha zero-shot transfer.

The second benchmark is the DOTA/LINZ/UGRC vehicle adaptation suite from Adapting Vehicle Detectors, reported in AP50. On this suite we also run that paper's generative cross-attention pseudo-labels as an alternative teacher. That paper reports only relative gains (4–23% AP50 over source-only), so we will reproduce absolute numbers ourselves. VisDrone2018 serves as an in-domain check that seam-aware training does not hurt standard tiled detection. Cityscapes→Foggy Cityscapes serves as a no-harm check on whole-frame inputs, where our method should reduce to ALDI++.

Across all benchmarks, the decisive measurements are three. First, the seam-stratified AP gap: AP on objects with truncation fraction above 0.3, minus interior AP. Second, its trajectory over self-training iterations under ALDI++ versus our method. Third, teacher calibration error as a function of truncation.

The proposal succeeds only if all three of the following hold. The seam gap widens under plain ALDI++ but stays flat under seam-aware teaching. The improvement holds with non-overlapping test tiles. The simple context-padded and seam-masked ablations recover clearly less of the gain than the full method.