NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

In-Context Learning for Remote Sensing Vision: A Semantic-Aware Rotation-Robust Diffusion Framework

Jing Geng, Chuanlong Zhang, Jiayi Su, Wencheng HanNeurIPS 2026

TL;DR

Showing an AI a single annotated example to teach it a brand-new visual task—known as Visual In-Context Learning (VICL)—works remarkably well for everyday photographs, but tends to break down on satellite and aerial imagery. This paper introduces SRDM, a diffusion-based framework that adapts VICL to overhead views by solving two fundamental headaches: tiny objects getting lost in early diffusion noise, and objects pointing in every possible direction. With just one example and zero task-specific retraining, SRDM achieves dramatic gains in remote sensing segmentation and object detection.

What Problem Does This Paper Address?

In Large Language Models, you can paste an example of a task into a prompt, and the model figures out what to do next. Computer vision researchers have recently replicated this magic using diffusion models: feed the model a "reference" image alongside its segmentation mask, give it a new "target" image, and let it denoise a brand-new mask for the target. Because dense annotations for satellite imagery are notoriously expensive to collect—especially for rare events like disasters—this one-shot paradigm is hugely appealing.

However, overhead remote sensing breaks two unspoken assumptions of standard visual models:

  1. Tiny objects emerge late: In diffusion models, broad structures form early in the denoising process, while fine details appear late. Because cars or ships seen from space are tiny, their semantic identity doesn't materialize until the very end of generation. Early cross-attention between the reference and target images ends up matching random background textures instead of actual objects.
  2. There is no "up" from space: Natural photos obey gravity—trees grow up, cars sit flat. Overhead images have arbitrary orientations. If a reference ship points north and a target ship points east, standard cross-image feature matching falls apart, causing wild swings in prediction quality.
Figure 1: Denoising-stage semantics and rotation-induced instability. (a) In remote sensing im- agery, semantic features of small targets emerge only at later stages of the diffusion denoising process, leaving early features dominated by low-level structures and making early matching unreliable. In contrast, objects in natural images become semantically recognizable at relatively earlier denoising stages. (b) When the target and reference are the same image, rotating only the reference image by 0◦, 90◦, 180◦, and 270◦still causes substantial changes in the segmentation output, showing that visual in-context learning is sensitive to arbitrary orientations in remote sensing scenes.

Methods

The authors build their Semantic-Aware Rotation-Robust Diffusion Model (SRDM) on top of a pre-trained Stable Diffusion backbone. Following recent diffusion-VICL setups, SRDM encodes four streams into latent space (reference image, reference label, target image, and an initialized target label) and uses cross-attention inside a shared U-Net to transfer annotations from the reference pair to the target. To Select the best reference prompt, they use RemoteCLIP to find the candidate image most similar to the target.

Figure 2: Pipeline of SRDM. The overall framework contains four branches, including the target image, target label, reference image, and reference label branches. The right part illustrates the Semantic-Aware Cross-Attention module, which combines semantic and structural cues to align the target and reference features.

What makes SRDM novel are two targeted interventions:

  • Semantic-Aware Cross-Attention (SACA): Instead of relying purely on noisy diffusion features to match objects early on, SACA brings in a frozen DINOv2 vision encoder to extract crisp semantic features directly from the clean images. It then blends three attention streams over a three-stage temporal schedule: early denoising steps rely on standard target self-attention for stability; middle steps lean heavily on DINOv2 cross-attention to lock onto the right semantic objects; and late steps transition to diffusion-feature cross-attention for fine-grained structural boundaries.
  • RotationFormer & Rotation-Robust Learning (RRL): The authors insert lightweight, trainable bottleneck adapters (RotationFormer) into the frozen U-Net encoder. Crucially, they train these adapters without any manual labels by inventing a self-supervised pseudo-task using simple Canny edge maps. By rotating the reference prompt across four angles ($0^\circ, 90^\circ, 180^\circ, 270^\circ$), the pipeline identifies the "best" and "worst" predictions against the Canny edges. Alternating across training steps, it pulls the worst-angle prediction toward the best one while using a frozen copy of the model as an anchor so the network doesn't drift away from its pre-trained knowledge.
Figure 3: Rotation-Robust Learning. The training pipeline runs multi-rotation inference and selects the best- and worst-rotation predictions using Canny edge cues. A frozen reference model and the dynamic best prediction provide pseudo labels to supervise RotationFormer.

Datasets

No new datasets were introduced; SRDM was evaluated across three established high-resolution remote sensing benchmarks covering distinct tasks:

  • Potsdam: 38 urban aerial images ($6000 \times 6000$ pixels, 5 cm resolution) across 6 classes (buildings, cars, trees, etc.) for multi-class semantic segmentation.
  • HRSC2016: 1,061 images containing 2,976 ship instances, preprocessed for single-object detection.
  • iSAID-$5^i$: A standard few-shot foreground segmentation benchmark derived from iSAID, featuring $256 \times 256$ image crops across 15 object categories split into three folds.

Key Insights and Ideas

  • Timing is everything in feature fusion: Simply averaging DINOv2 and diffusion features across all timesteps yields 63.45 mIoU on HRSC2016, whereas the three-stage temporal schedule jumps to 68.10 mIoU. Knowing when to trust external semantics versus internal diffusion geometry is critical.
  • Naive data augmentation hurts in-context diffusion: You might think randomly rotating prompts during training—or averaging rotated predictions at test time—would fix orientation sensitivity. Surprisingly, both degraded baseline performance on Potsdam (dropping from 46.69 to 44.22 and 41.49 mIoU, respectively), because they don't fix the underlying feature mismatch across branches. Explicitly aligning best- and worst-case views via RRL was required to push performance up to 47.47 mIoU.
  • Free geometric supervision: Using classical Canny edge detection to supervise rotation consistency means the model learns orientation invariance without touching a single human-annotated mask.

Key Results

SRDM consistently outperforms both general-domain VICL baselines (Visual Prompting, SD-VICL) and specialized few-shot remote sensing models:

  • Semantic Segmentation (Potsdam): Achieved 47.47 mIoU, beating SD-VICL (43.90) and Visual Prompting (12.07), with standout improvements on structured targets like Buildings (+9.63 IoU) and Cars (+9.33 IoU).
  • Single-Object Detection (HRSC2016): Reached 68.10 mIoU and 46.18 $\text{mAP}_{50:95}$, more than doubling SD-VICL's $\text{mAP}_{50:95}$ of 22.36—proving much tighter localization on arbitrarily oriented ships.
  • One-Shot Foreground Segmentation (iSAID-$5^i$): Scored a mean 64.00 mIoU across folds, leaping 10.87 points ahead of the strongest few-shot baseline, ViRefSAM (53.13), while cleanly separating dense clusters of small vehicles.

Limitations and Future Work

  • Computational Overhead: Running 50 iterative Stable Diffusion denoising steps alongside high-resolution ($896 \times 896$) DINOv2 feature extraction makes inference relatively heavy.
  • Sensor Modalities: Because it relies on RGB-pretrained backbones, SRDM currently focuses on standard optical RGB imagery (with only preliminary exploration into Near-Infrared). Extending this in-context paradigm to multispectral and Synthetic Aperture Radar (SAR) data—and speeding up generation—are the primary targets for future work.

Summary updated

BibTeX
@inproceedings{geng2026context,
  author = {Jing Geng and Chuanlong Zhang and Jiayi Su and Wencheng Han},
  title = {{In-Context Learning for Remote Sensing Vision: A Semantic-Aware Rotation-Robust Diffusion Framework}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=N0NAWBW9UA},
}
Figure