Sparse All-Layer Connector for Domain Generalised Semantic Segmentation

Ruoyu Guo, Xin Kun Lin, Maurice Pagnucco, Yang SongNeurIPS 2026

TL;DR

When combining two foundation models to tackle unfamiliar visual environments, standard practice fuses layer 5 of Model A with layer 5 of Model B—implicitly assuming both models process the world at the exact same pace. This paper shows that assumption is flawed because different models organize their internal representations along completely different depth hierarchies. By introducing a smart, sparse "switchboard" that lets every layer dynamically cherry-pick the most useful preceding layers from its partner model, the authors boost segmentation performance on unseen domains.

What Problem Does This Paper Address?

Imagine training a self-driving car's vision system exclusively inside a video game (like Grand Theft Auto V) and expecting it to wake up tomorrow and seamlessly parse pixel-by-pixel scenes on real streets in Zurich or Berkeley. That is Domain Generalised Semantic Segmentation (DGSS): learning to label every pixel of an image in arbitrary, unseen target environments using only source-domain training data.

Recently, researchers realized that pairing two different frozen foundation models—say, a Vision-Language Model like CLIP (great at high-level semantics) with a Vision Foundation Model like DINOv2 (great at fine spatial geometry)—yields much sturdier features than relying on one alone.

To connect them, existing approaches almost universally default to depth-aligned fusion: wiring layer $l$ of Model A directly to layer $l$ of Model B. Yet models trained with different objectives don't build features at the same rate. When the authors measured cross-domain sensitivity across layers (using Maximum Mean Discrepancy, or MMD), they found stark differences: DINOv2 becomes steadily more domain-invariant as you go deeper, whereas CLIP hits its sweet spot in the middle layers before becoming domain-sensitive again near the end.

Simply mashing all preceding layers together isn't the answer either—dense aggregation floods the network with redundant or domain-specific noise, hurting generalisation. The challenge is letting models communicate across different depths selectively.

Methods

The authors keep two pretrained foundation model encoders frozen, run them in parallel, and feed their combined final outputs into a standard Mask2Former segmentation decoder. What is new is how the two encoders talk to each other along the way via the Sparse All-Layer Connector (SALC).

Detailed diagram of the Sparse All-Layer Connector (SALC)

Attached at every layer $l$ of a "query" model, SALC looks at all preceding layers ($1$ through $l$) of the "candidate" model and executes three steps independently for every spatial token:

  1. Importance Scoring: An RMSNorm layer normalizes feature magnitudes across depths, and a lightweight MLP scores each candidate layer's relevance.
  2. Dynamic Sparse Projection: Standard softmax attention assigns non-zero weight to everything (letting noise slip through), while Top-$K$ routing forces a rigid, hand-picked $K$ everywhere. Instead, SALC uses Sparsegen projection paired with a learnable, token-wise sparsity factor ($\lambda_t$) predicted from the current depth's feature. This acts like an adaptive threshold—zeroing out unhelpful layers so a sky pixel and a pedestrian boundary pixel can each pull from a different number of layers.
  3. Frequency-Based Candidate Dropout: During training, SALC can get lazy, either spreading weights too thinly or over-relying on one dominant layer. The authors track how often each candidate layer is used via an exponential moving average and randomly drop over-used layers during training. This zero-inference-cost regularisation forces SALC to explore diverse layers and make decisive, sparse choices.

Datasets

No new benchmarks are introduced; the authors use five standard urban driving datasets sharing 19 semantic classes:

  • Synthetic (Training): GTAV (24,966 images) and SYNTHIA (9,400 images).
  • Real-World (Training/Evaluation): Cityscapes (2,975 train / 500 validation images), BDD100K (1,000 validation), and Mapillary (2,000 validation).

Models are tested across three classic generalisation protocols: GTAV $\rightarrow$ {Cityscapes, BDD100K, Mapillary}, SYNTHIA $\rightarrow$ {Cityscapes, BDD100K, Mapillary}, and Cityscapes $\rightarrow$ {BDD100K, Mapillary}.

Key Insights and Ideas

  • Complementary, asymmetric appetites: When inspecting learned weights between DINOv2 and CLIP, a neat division of labor emerges. CLIP queries heavily from DINOv2’s shallow layers (borrowing the local spatial structure CLIP lacks), while DINOv2 reaches into CLIP’s middle layers (where CLIP's semantic transferability peaks).
  • Dynamic per-token selection beats "knowing" the best layers: Even if you identify the top-2 or top-4 most frequently chosen layers offline and retrain a model locked onto them, performance drops by ~1.8–2.0 mIoU. Different images and spatial tokens genuinely need on-the-fly routing.
  • Targeted dropout beats coin-flipping: Dropping candidate layers uniformly at random during training actually hurts performance compared to no dropout at all (67.85 vs. 68.98 mIoU), because it occasionally blinds the model to crucial features. Only by selectively penalising over-used candidates does generalisation jump to 69.40 mIoU.
  • Depth mismatches are easily bridged: Because SALC doesn't require strict 1-to-1 layer pairing, a simple depth-mapping ratio lets a 24-layer CLIP-Large fuse cleanly with a 12-layer DINOv2-Base.

Key Results

Tested across five foundation models—DINOv2, SAM, CLIP, SigLIP, and DepthAnythingV2—SALC consistently outperforms depth-aligned baselines (measured in mean Intersection-over-Union, or mIoU):

  • DINOv2 + CLIP: Achieves 69.40 mIoU average when trained on GTAV (+1.58 over depth-aligned MFuser) and 52.99 mIoU when trained on SYNTHIA (+2.65 over MFuser).
  • DINOv2 + DepthAnythingV2: Jumps from 67.03 to 69.39 mIoU on GTAV (with a massive +4.16 mIoU single-domain gain on Cityscapes), and surges from 48.27 to 52.37 mIoU on SYNTHIA (+4.10 gain) compared to DepthForge.
  • Sanity-checking the weights: Masking out SALC's top-3 most-selected layers at test time causes a sharp 2.29 mIoU drop, whereas masking the top-3 least-selected layers leaves accuracy virtually untouched (+0.05 mIoU), proving the connector isolates genuinely critical signals.

Limitations and Future Work

The main text notes that when pairing SAM with CLIP, SALC’s gains are much smaller (+0.51 mIoU on GTAV) and occasionally slightly negative compared to depth-aligned fusion (-0.32 mIoU on SYNTHIA and -0.48 mIoU on Cityscapes), pointing readers to the appendix for deeper analysis of this specific pairing. Broader limitations or explicit future work directions are not discussed in the main body of the paper.

Summary updated

Abstract

Domain generalised semantic segmentation (DGSS) has recently benefited from combining multiple foundation models, such as vision-language and vision foundation models, to leverage their diverse representations for generalisation. Existing multi-model approaches share a common design choice: cross-model fusion is restricted to depth-aligned layers, implicitly assuming that mutually beneficial information resides at the same depth across models. However, foundation models pretrained under different objectives may develop distinct representation hierarchies, making the optimality of depth-aligned fusion questionable. Moreover, we observe that the foundation models exhibit different depth-wise domain sensitivity. Motivated by these observations, we propose a Sparse All-Layer Connector (SALC) that enables each layer to access information from preceding layers of another model. As the number of accessible layers grows with depth, dense aggregation may hurt generalisation. SALC therefore learns to adaptively select a sparse subset of informative layers. We further introduce a candidate dropout regularisation that strengthens sparsity and encourages SALC to explore diverse layers, leading to more robust selection. Across four foundation model combinations and three DGSS evaluation settings, the proposed design demonstrates stronger generalisation than conventional depth-aligned fusion. The code is available at \url{https://github.com/RuoyuGuo/SALC}.
BibTeX
@inproceedings{guo2026sparse,
  author = {Ruoyu Guo and XIN KUN LIN and Maurice Pagnucco and Yang Song},
  title = {{Sparse All-Layer Connector for Domain Generalised Semantic Segmentation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=OPMdo1lyMp},
}
Figure