Papers › DAFormer: Improving Network Architectures and Training Strategies for Domain-Adaptive...

DAFormer: Improving Network Architectures and Training Strategies for Domain-Adaptive Semantic Segmentation

29 Nov 2021CVPR 2022 1arXiv:2111.14887archive 2025-07-28

Lukas Hoyer, Dengxin Dai, Luc van Gool

As acquiring pixel-wise annotations of real-world images for semantic segmentation is a costly process, a model can instead be trained with more accessible synthetic data and adapted to real images without requiring their annotations. This process is studied in unsupervised domain adaptation (UDA). Even though a large number of methods propose new adaptation strategies, they are mostly based on outdated network architectures. As the influence of recent network architectures has not been systematically studied, we first benchmark different network architectures for UDA and newly reveal the potential of Transformers for UDA semantic segmentation. Based on the findings, we propose a novel UDA method, DAFormer. The network architecture of DAFormer consists of a Transformer encoder and a multi-level context-aware feature fusion decoder. It is enabled by three simple but crucial training strategies to stabilize the training and to avoid overfitting to the source domain: While (1) Rare Class Sampling on the source domain improves the quality of the pseudo-labels by mitigating the confirmation bias of self-training toward common classes, (2) a Thing-Class ImageNet Feature Distance and (3) a learning rate warmup promote feature transfer from ImageNet pretraining. DAFormer represents a major advance in UDA. It improves the state of the art by 10.8 mIoU for GTA-to-Cityscapes and 5.4 mIoU for Synthia-to-Cityscapes and enables learning even difficult classes such as train, bus, and truck well. The implementation is available at https://github.com/lhoyer/DAFormer.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2111.14887")

Code

Syntology Ran 6 of 6 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 2 ran · honoured contract; 3 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: community (archive-listed): 5 samples from 1 repository, 5 ran; 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

lhoyer/DAFormer officialmentioned in papermentioned on GitHubpytorchNOASSERTION report
dbash/visda2022-org mentioned on GitHubpytorch report
kw01sg/crda mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

6 samples harvested; 6 ran; 2 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · honoured contract
3ran · our draft was wrong
1ran · fixture could not drive it

Licence: 6 of the 6 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from kw01sg/crda. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

calc_consistency_loss kw01sg/crda/mmseg/models/uda/dacs.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · 308b4bd2e8245ded · report
cosine_pairwise kw01sg/crda/mmseg/models/uda/dacs.py community (archive-listed) ran · fixture could not drive it fingerprinted no licence file found · pointer only · 9df38eda1ae4112c · report
get_backbone_cfg kw01sg/crda/experiments.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 903b0922a749302e · report
get_model_base kw01sg/crda/experiments.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 3578196ac2abaecf · report
get_pretraining_file kw01sg/crda/experiments.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 7063030b369b4ce1 · report
calc_grad_magnitude identical code first harvested elsewhere ran · honoured contract licence of this copy not recorded · be78c4e9ca31118d · report

Tasks

Domain AdaptationImage-to-Image TranslationSemantic SegmentationSynthetic-to-Real TranslationUnsupervised Domain Adaptation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Domain Adaptation Cityscapes to ACDC DAFormer mIoU 55.4 #11 of 16 Archive leaderboard report
Domain Adaptation GTA5 to Cityscapes DAFormer mIoU 68.3 #10 of 28 Archive leaderboard report
Domain Adaptation SYNTHIA-to-Cityscapes DAFormer mIoU 60.9 #11 of 33 Archive leaderboard report
Image-to-Image Translation GTAV-to-Cityscapes Labels DAFormer mIoU 68.3 #8 of 22 Archive leaderboard report
Image-to-Image Translation SYNTHIA-to-Cityscapes DAFormer mIoU (13 classes) 67.4 #7 of 28 Archive leaderboard report
Semantic Segmentation Dark Zurich DAFormer mIoU 53.8 #7 of 14 Archive leaderboard report
Semantic Segmentation DensePASS DAFormer mIoU 54.67% #5 of 36 Archive leaderboard report
Semantic Segmentation GTAV-to-Cityscapes Labels DAFormer mIoU 68.3 #6 of 12 Archive leaderboard report
Semantic Segmentation SYNTHIA-to-Cityscapes DAFormer Mean IoU 60.9 #6 of 7 Archive leaderboard report
Synthetic-to-Real Translation GTAV-to-Cityscapes Labels DAFormer mIoU 68.3 #11 of 73 Archive leaderboard report
Synthetic-to-Real Translation SYNTHIA-to-Cityscapes DAFormer MIoU (13 classes) 67.4 #9 of 38 Archive leaderboard report
Synthetic-to-Real Translation SYNTHIA-to-Cityscapes DAFormer MIoU (16 classes) 60.9 #9 of 38 Archive leaderboard report
Unsupervised Domain Adaptation GTAV-to-Cityscapes Labels DAFormer mIoU 68.3 #10 of 20 Archive leaderboard report
Unsupervised Domain Adaptation SYNTHIA-to-Cityscapes DAFormer mIoU 60.9 #10 of 23 Archive leaderboard report
Unsupervised Domain Adaptation SYNTHIA-to-Cityscapes DAFormer mIoU (13 classes) 67.4 #10 of 23 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections