Exits That Know When the Box Is Done: Geometry-Aware Early Exiting for Oriented Aerial Detection, Tested Under Controlled Contamination

Aerial and satellite images are huge. A single scene can exceed 4000×4000 pixels, so detectors cut it into hundreds of overlapping 1024×1024 tiles and run the full network on every one. Many tiles are open water or bare field, and many others contain objects the network has already "got" after a few layers. Early exiting is the obvious remedy: attach small prediction heads partway through the network and stop as soon as the answer is good enough. In aerial detection, though, the boxes are rotated to follow each object's heading, and "good enough" means more than knowing an object's class. A shallow head can be sure that something is a ship while its estimate of the ship's angle is still wrong. We propose an exit rule for oriented detectors that stops computing on a tile only when deeper layers are unlikely to change the detections. It predicts this from how stable the boxes and angles are across stages, not from class confidence alone.

The second half of the proposal is about measurement. Public aerial benchmarks such as DOTA are widely redistributed, including inside remote-sensing training mixtures for vision-language models. Memorized scenes plausibly look "easy" to shallow layers. If so, the compute savings an early-exit detector reports on a public benchmark overstate what it would save on genuinely new imagery. We test this with controlled contamination: we deliberately expose a backbone to a held-out geographic split and measure how much the exit depth and reported savings shift. That gives an honest evaluation protocol for dynamic detectors. As a byproduct, it tests whether exit depth works as a contamination footprint for a modality that text-only contamination tools cannot handle.

Core Claim

The main claim is that the right stopping signal for an oriented detector is a prediction that further depth will not improve the oriented boxes. This covers two cases: the tile's detections have converged, or no depth will rescue them. Classification confidence does not capture either case. We further claim that efficiency gains from any learned exit rule must be reported on imagery verifiably absent from pretraining, because contamination inflates them in a measurable way.

The first claim is motivated by a known split in what oriented detection needs. Rotation-Sensitive Regression for Oriented Scene Text Detection showed that classification wants features that ignore rotation, while box regression wants features that track it. Exit criteria in the literature are built almost entirely on classifier outputs: softmax entropy in Compressing Large-Scale Transformer-Based Models: A Case Study on BERT, and changes in class probability between adjacent layers in LECO.

The method borrows directly from Rethinking Calibration for Early-Exit Neural Networks. That paper showed that well-calibrated exits are "structure-blind": a calibrated head knows only its own current accuracy, not whether later layers will fix an error. It replaced calibrated thresholds with a tiny learned failure predictor (EEFP) that reads top-k scores and the history of earlier exits. EEFP was validated only on single-label classification. We carry its logic over to dense, multi-object, rotated-box prediction, where the quantity to predict is box convergence rather than label correctness.

Research Program

The base detector is RiO-DETR. It is a transformer detector that refines a set of object queries through stacked decoder layers, and it separates angle estimation from position queries with a periodic loss on angles. Its decoder layers and backbone stages give natural exit points. We replicate the study on Oriented R-CNN, which predicts rotated boxes as a horizontal box plus two midpoint offsets, so the conclusions do not hinge on one architecture.

Exits run at two levels. Exit zero is a tile-level gate after the first backbone stage that decides whether the tile contains anything worth detecting. It handles the large share of empty tiles, and we deliberately compare it against a standalone emptiness classifier (see below). Later exits sit after intermediate backbone stages and decoder layers. Each produces a full set of oriented detections from a shared lightweight head trained with self-distillation from the final layer, following Be Your Own Teacher.

At each exit $k$ and tile $t$, the exit predictor is trained to output the probability that stopping now costs nothing. Write $D_k(t)$ for the detections at exit $k$ and $D_L(t)$ for those at the final layer. The training target is

$$ y_k(t) = \mathbb{1}\left[\, Q(D_L(t)) - Q(D_k(t)) < \epsilon \,\right] \;\lor\; \mathbb{1}\left[\, \max_{j \ge k} Q(D_j(t)) < \tau \,\right]. $$

Here $Q(\cdot)$ is a tile-level F1 score that matches boxes at a rotated-overlap threshold, $\epsilon$ is the tolerated quality loss, and $\tau$ marks tiles that no depth resolves. The second term is the "futile tile" case from EEFP, which matters for clouded or cluttered tiles.

The predictor is a two-layer network, mirroring EEFP's negligible-overhead design. Its inputs are summaries computable cheaply at exit $k$. The first group is the usual class-score statistics. The second is the change in matched box centers and sizes since the previous exit. The third is the change in matched box angles, measured with the shortest periodic distance so that a box flipping across the $0/\pi$ seam does not register as a large change. The last two are the change in detection count and how strongly the query set agrees with itself across exits.

The key ablation removes all geometric inputs and keeps only class scores. That ablation is exactly the structure-blind regime the calibration paper criticized, transplanted into detection.

The contamination study is a controlled-exposure design, in the spirit of the dose-controlled experiments in Detecting Benchmark Contamination Through Watermarking. That paper's tools are text-only, so they cannot be reused here.

We split DOTA's labeled imagery by source scene into partitions A and B, so that overlapping crops of the same scene never cross the split. Partition B is the evaluation set. A "clean" backbone is pretrained without B. "Contaminated" backbones see B's images at several exposure counts, either as unlabeled images in self-supervised pretraining or with labels in a supervised mixture. The labeled version mimics remote-sensing training collections like Qingyun/remote-sensing-sft-data, which incorporates DOTA. Detection fine-tuning and exit training are identical across conditions and use only A.

We then measure three things on B and on a cross-dataset novel set. The cross-dataset set is drawn from FAIR1M, whose imagery comes from different sources. The three measurements are:

  1. The shift in exit-depth distribution between contaminated and clean backbones.
  2. "Savings inflation," defined as compute saved on B minus compute saved on novel imagery, at matched accuracy loss.
  3. Whether the geometry-aware rule is less inflated than the class-score rule. We expect it to be, because memorization should sharpen class scores early more than it stabilizes angles.

Baselines

The naive reference point is running the full RiO-DETR-x on every tile. RiO-DETR reports 81.8% AP50 on DOTA-1.0 for this model. Every dynamic method is measured as compute saved relative to it, at a stated AP50 loss.

The strongest static competitor is RiO-DETR-n, the same family shrunk to a nano size. It reports 78.4% AP50 on DOTA-1.0 at 2.7 ms on a T4 GPU, and it has no branching overhead. We will run it and our dynamic RiO-DETR-x on the same GPU with the same tiling and batch size. We report wall-clock latency, not only operation counts, because early exits can lose on real hardware. Beating it means the dynamic model's accuracy-versus-latency curve lies above the static family's curve. In concrete terms, the dynamic model must reach higher AP50 than RiO-DETR-n at equal mean measured latency per scene, or match a mid-size variant's accuracy at lower latency.

The strongest existing exit method is EEFP from Rethinking Calibration for Early-Exit Neural Networks. We adapt it to detection by feeding it the top-k class scores of the tile's detections plus exit history, then train it with the same target, data, exits, and tuning budget as ours. No reported result for EEFP on any detection benchmark was found on Lacuna, so we run it ourselves. Two further class-confidence baselines complete the picture: a temperature-calibrated confidence threshold as in The Right Tool for the Job, and LECO-style comparison of adjacent exits.

The isolating ablation is our predictor with the geometric inputs removed. Our method beats EEFP if it dominates EEFP's curve on DOTA-v1.0 and on FAIR1M, the fine-grained case where the best reported baseline mAP is only 34.65%. The gain should be concentrated in the angle-dependent part of the error: higher AP at strict rotated-overlap thresholds, at the same compute.

Why not just…?

Why not just deploy a small static detector like RiO-DETR-n? Its 78.4% AP50 at 2.7 ms is a serious bar, and if no dynamic configuration exceeds its accuracy at its latency, the efficiency argument fails. The opening for exits is the 3.4-point gap to RiO-DETR-x, which a static nano model gives up on every tile, including the hard fine-grained ones. Whether that gap can be recovered cheaply is an empirical question. The matched-hardware latency curve settles it, and we will report a negative result if it comes out that way.

Why not just filter empty tiles with a cheap binary classifier and run the full detector on the rest? This is the most dangerous alternative, because empty tiles may account for most of the achievable savings. We therefore build it in: exit zero is exactly this gate, and a standalone emptiness classifier is a baseline. The proposal's claim then rests only on non-empty tiles. If geometry-aware exits save no meaningful latency on tiles that contain objects, beyond what the gate saves, the in-network exits are unnecessary. We will report the tile filter as the answer in that case.

Why not just calibrate the exit confidences with temperature scaling? The calibration paper shows that calibrated exits still push unresolvable samples through every layer, because a calibrated score only reports current accuracy. In detection there is a second problem: a calibrated class score is still a class score and says nothing about whether the angle has settled. The class-only ablation and the temperature baseline measure this directly, at strict rotated-overlap thresholds.

Why not just deduplicate pretraining data by image hashing, or keep test sets private? Hashing catches identical files but not overlapping crops, re-tilings, or different-resolution captures of the same airport. Those are exactly the forms in which aerial benchmarks circulate. Private sets block third-party verification, as argued in P⁴Bench. DyVal also shows that static held-out sets lose validity; models strong on static benchmarks scored near zero on regenerated items. We will include a hash-deduplicated backbone as an extra condition. If it removes the savings inflation, then simple deduplication suffices and we will say so.

Proposed Experiments

The first decisive check is the class-only versus geometry-aware ablation on DOTA-v1.0, HRSC2016, DIOR-R, and FAIR1M, run on both RiO-DETR and Oriented R-CNN. The paper's central claim fails if the two rules produce indistinguishable accuracy-versus-compute curves at strict rotated-overlap thresholds.

The second check is the tile-gate decomposition. It reports how much of the total saving comes from exit zero and how much from later exits on non-empty tiles.

The third is the contamination dose-response. It reports exit-depth histograms and savings inflation on partition B as exposure grows from zero to many repetitions, compares this against FAIR1M imagery that was never exposed, and compares the class-only and geometry-aware rules. A clear monotone shift toward shallower exits on exposed tiles, absent on novel tiles, would establish both that public-benchmark efficiency numbers need contamination controls and that exit depth carries a usable memorization signal.

The final check tests whether that signal works as a detector without labels. We run a simple hypothesis test that compares the exit-depth distribution on a suspect image set against reference novel imagery, and report its p-value as a function of exposure count. This deliberately mirrors the sensitivity curves of the watermarking work, carried over to continuous imagery without any watermark.