Papers › Safe Self-Refinement for Transformer-based Domain Adaptation

Safe Self-Refinement for Transformer-based Domain Adaptation

16 Apr 2022CVPR 2022 1arXiv:2204.07683archive 2025-07-28

Tao Sun, Cheng Lu, Tianshuo Zhang, Haibin Ling

Unsupervised Domain Adaptation (UDA) aims to leverage a label-rich source domain to solve tasks on a related unlabeled target domain. It is a challenging problem especially when a large domain gap lies between the source and target domains. In this paper we propose a novel solution named SSRT (Safe Self-Refinement for Transformer-based domain adaptation), which brings improvement from two aspects. First, encouraged by the success of vision transformers in various vision tasks, we arm SSRT with a transformer backbone. We find that the combination of vision transformer with simple adversarial adaptation surpasses best reported Convolutional Neural Network (CNN)-based results on the challenging DomainNet benchmark, showing its strong transferable feature representation. Second, to reduce the risk of model collapse and improve the effectiveness of knowledge transfer between domains with large gaps, we propose a Safe Self-Refinement strategy. Specifically, SSRT utilizes predictions of perturbed target domain data to refine the model. Since the model capacity of vision transformer is large and predictions in such challenging tasks can be noisy, a safe training mechanism is designed to adaptively adjust learning configuration. Extensive evaluations are conducted on several widely tested UDA benchmarks and SSRT achieves consistently the best performances, including 85.43% on Office-Home, 88.76% on VisDA-2017 and 45.2% on DomainNet.

PaperPDFConference PDFCodeCode Syntology ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 19 code samples: 18 from 1 repository linked to this paper, 1 identical to code harvested from another paper's repository. Across all 19: 9 ran (of which 3 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 0 violated, 3 with no contract checked; 6 where Syntology's instrument failed) · 10 unverified. Where Syntology's instrument failed: 2 where our contract draft was wrong; 4 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 18 samples from 1 repository, 8 ran (3 with no instrument failure; 5 where Syntology's instrument failed); 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.

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

tsun/ssrt officialmentioned in papermentioned on GitHubpytorchMITSyntology: 18 samples, 8 ran (5 instrument-failed) · 10 unverified 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

19 samples harvested: 9 ran (of which 3 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 0 violated, 3 with no contract checked; 6 where Syntology's instrument failed) · 10 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · our draft was wrong
4ran; the contract check could not run
3ran
10unverified

Licence: 1 of the 19 samples is 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 tsun/ssrt. 1 sample is listed last, in a group without a repository. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

tsun/ssrt official repository 18 samples, 8 ran (5 instrument-failed) · 10 unverified
GradientReverseFunction model/SSRT.py ran MIT (permissive) · 3d0a0d378c8dbc24 · report fixture: returned GradientReverseFunction · level recorded 2026-09-22
PatchEmbed in 123 papers
census: 9 implementations from 9 papers, 6 distinct outputs on one shared input
model/SSRT.py ran · metamorphic tier: deterministic MIT (permissive) · 22050c4d1bca63e0 · report fixture: returned PatchEmbed · level recorded 2026-09-22
WarmStartGradientReverseLayer model/SSRT.py ran · metamorphic tier: deterministic MIT (permissive) · ec88df6f428e3f61 · report fixture: returned WarmStartGradientReverseLayer · level recorded 2026-09-22
_no_grad_trunc_normal_ in 16 papers
census: 16 implementations from 16 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
model/SSRT.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant MIT (permissive) · fa2dd3be10cf9804 · report fixture: signature tensor:Tensor/2/float, mean:float/0/float, std:float/0/float, a:float/0/float, b:float/0/float · returned Tensor · level recorded 2026-09-22
_ntuple in 17 papers model/SSRT.py ran · our draft was wrong MIT (permissive) · 553ee0765abad219 · report fixture: signature n:int/0/int · returned function · level recorded 2026-09-22
named_apply in 32 papers model/SSRT.py ran · our draft was wrong MIT (permissive) · 75e11c702145c5c3 · report fixture: signature fn:callable/0/?, module:callable/0/?, name:str/0/str, depth_first:bool/0/bool, include_root:bool/0/bool · returned SimpleModel · level recorded 2026-09-22
resize_pos_embed in 102 papers model/SSRT.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant MIT (permissive) · b01c11b0a035cd40 · report fixture: signature posemb:Tensor/3/float, posemb_new:Tensor/3/float, num_tokens:int/0/int, gs_new:tuple/1/int · returned Tensor · level recorded 2026-09-22
trunc_normal_ in 154 papers
census: 37 implementations from 54 papers, 4 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
model/SSRT.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant MIT (permissive) · 02566da69866c48c · report fixture: signature tensor:Tensor/2/float, mean:float/0/float, std:float/0/float, a:float/0/float, b:float/0/float · returned Tensor · level recorded 2026-09-22
SSRT model/SSRT.py unverified MIT (permissive) · be99cca89b88af5e · report
SSRTNet model/SSRT.py unverified MIT (permissive) · 0904466d7926c365 · report
VT model/SSRT.py unverified MIT (permissive) · 17aa99cd0717e1d0 · report
VisionTransformer in 53 papers model/SSRT.py unverified MIT (permissive) · 2a0271883efece1e · report
_init_vit_weights in 9 papers model/SSRT.py unverified MIT (permissive) · ddbeb989cf002f02 · report
_load_weights in 6 papers model/SSRT.py unverified MIT (permissive) · 3c95bc9517c87684 · report
lecun_normal_ in 7 papers model/SSRT.py unverified MIT (permissive) · 50805d05a18a031e · report
variance_scaling_ in 5 papers model/SSRT.py unverified MIT (permissive) · 1a6538cd23fa0b1a · report
Repository not located 1 sample, 1 ran (1 instrument-failed) · 0 unverified
1 sample is identical to code Syntology harvested from another paper's repository; this paper's own copy was not located, so no repository is named and no licence is recorded.
adapt_input_conv in 8 papers
census: 2 implementations from 5 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 4, kind float, dtype float32
repository not located ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted licence of this copy not recorded · 552d614343c6f5b0 · report fixture: signature in_chans:int/0/int, conv_weight:Tensor/4/float · returned Tensor · level recorded 2026-09-22

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it.

1 assembly on this paper: 1 harvested, 0 generated.

harvested Assembly for SSRT (Safe Self-Refinement for Transformer-based domain adaptation) (graph method: SSRT (Safe Self-Refinement for Transformer-based domain adaptation)). 22 bricks; individually on a fixture: 12 ran (of which 5 constructed an object rather than computing a result; 5 with no instrument failure: 0 honoured, 0 violated, 5 with no contract checked; 7 where Syntology's instrument failed) · 10 unverified. The assembly has not been run end-to-end.

  1. SSRT entry · level 0 · unverified · be99cca89b88af5e
  2. SSRTNet model · level 0 · unverified · 0904466d7926c365
  3. VT model · level 0 · unverified · 17aa99cd0717e1d0
  4. WarmStartGradientReverseLayer update_rule · level 1 · ran · ec88df6f428e3f61
  5. Block helper · level 0 · unverified · eb8b342e174c85c9
  6. PatchEmbed helper · level 1 · ran · 22050c4d1bca63e0
  7. VisionTransformer helper · level 0 · unverified · 2a0271883efece1e
  8. GradientReverseFunction helper · level 1 · ran · 3d0a0d378c8dbc24
  9. Attention helper · level 0 · unverified · bbf9328517c62d43
  10. DropPath helper · level 1 · ran · 75f5c156267fccbd
  11. Mlp helper · level 1 · ran · a1715055832f71fd
  12. drop_path helper · level 1 · ran; the contract check could not run · 3ac6b7d76e8e3584
  13. _init_vit_weights helper · level 0 · unverified · ddbeb989cf002f02
  14. _load_weights helper · level 0 · unverified · 3c95bc9517c87684
  15. named_apply helper · level 1 · ran · our draft was wrong · 75e11c702145c5c3
  16. trunc_normal_ helper · level 1 · ran; the contract check could not run (RAISES) · 02566da69866c48c
  17. lecun_normal_ helper · level 0 · unverified · 50805d05a18a031e
  18. adapt_input_conv helper · level 1 · ran; the contract check could not run (RAISES) · 552d614343c6f5b0
  19. resize_pos_embed helper · level 1 · ran; the contract check could not run (RAISES) · b01c11b0a035cd40
  20. _no_grad_trunc_normal_ helper · level 1 · ran; the contract check could not run (RAISES) · fa2dd3be10cf9804
  21. variance_scaling_ helper · level 0 · unverified · 1a6538cd23fa0b1a
  22. _ntuple helper · level 1 · ran · our draft was wrong · 553ee0765abad219

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2204.07683") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

Domain AdaptationTransfer LearningUnsupervised Domain Adaptation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Domain Adaptation Office-31 SSRT-B (ours) Average Accuracy 93.5 #4 of 40 Archive leaderboard report
Unsupervised Domain Adaptation Office-Home SSRT-B Accuracy 85.43 #7 of 20 Archive leaderboard report
Unsupervised Domain Adaptation VisDA2017 SSRT-B (ours) Accuracy 88.76 #8 of 13 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

AttentionDense ConnectionsLayer NormalizationLinear LayerMulti-Head AttentionResidual ConnectionSoftmaxVision Transformer

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