Papers › Contrastive Test-Time Adaptation

Contrastive Test-Time Adaptation

21 Apr 2022CVPR 2022 1arXiv:2204.10377archive 2025-07-28

Dian Chen, Dequan Wang, Trevor Darrell, Sayna Ebrahimi

Test-time adaptation is a special setting of unsupervised domain adaptation where a trained model on the source domain has to adapt to the target domain without accessing source data. We propose a novel way to leverage self-supervised contrastive learning to facilitate target feature learning, along with an online pseudo labeling scheme with refinement that significantly denoises pseudo labels. The contrastive learning task is applied jointly with pseudo labeling, contrasting positive and negative pairs constructed similarly as MoCo but with source-initialized encoder, and excluding same-class negative pairs indicated by pseudo labels. Meanwhile, we produce pseudo labels online and refine them via soft voting among their nearest neighbors in the target feature space, enabled by maintaining a memory queue. Our method, AdaContrast, achieves state-of-the-art performance on major benchmarks while having several desirable properties compared to existing works, including memory efficiency, insensitivity to hyper-parameters, and better model calibration. Project page: sites.google.com/view/adacontrast.

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="2204.10377")

Code

Syntology Ran 23 of 32 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 4 ran · honoured contract; 2 ran · violated contract; 8 ran · our draft was wrong; 2 ran · fixture could not drive it; 7 ran with no contract checked.

By repository: official repository: 31 samples from 1 repository, 23 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.

DianCh/AdaContrast officialmentioned 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

32 samples harvested; 23 ran; 4 honoured the contract we drafted; 9 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.

4ran · honoured contract
2ran · violated contract
8ran · our draft was wrong
2ran · fixture could not drive it
7ran
9unverified

Licence: 32 of the 32 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 DianCh/AdaContrast. 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.

AdaMoCo DianCh/AdaContrast/target.py official repository ran · metamorphic tier: deterministic no licence file found · pointer only · 9b777416ee4b9661 · report
AverageMeter DianCh/AdaContrast/target.py official repository ran no licence file found · pointer only · 52b386c85c15f1f1 · report
GaussianBlur DianCh/AdaContrast/target.py official repository ran no licence file found · pointer only · aea0d8d156ae8f0e · report
ImageList DianCh/AdaContrast/target.py official repository ran no licence file found · pointer only · ac8ac005970ac1fd · report
NCropsTransform DianCh/AdaContrast/target.py official repository ran fingerprinted no licence file found · pointer only · dfe72857fdcd0631 · report
ProgressMeter DianCh/AdaContrast/target.py official repository ran no licence file found · pointer only · b4cae627da9d4b40 · report
adjust_learning_rate DianCh/AdaContrast/target.py official repository ran · honoured contract no licence file found · pointer only · 2944a9ae1c818935 · report
calculate_acc DianCh/AdaContrast/target.py official repository ran · honoured contract fingerprinted no licence file found · pointer only · e4f0afadad927f4c · report
classification_loss DianCh/AdaContrast/target.py official repository ran · our draft was wrong no licence file found · pointer only · 4769519334699711 · report
cross_entropy_loss DianCh/AdaContrast/target.py official repository ran · our draft was wrong no licence file found · pointer only · 7f2f33aeb9dd8ed3 · report
div DianCh/AdaContrast/target.py official repository ran · honoured contract fingerprinted no licence file found · pointer only · 2bb0642fa17353c2 · report
diversification_loss DianCh/AdaContrast/target.py official repository ran · our draft was wrong no licence file found · pointer only · b7348e1772bfba11 · report
get_augmentation DianCh/AdaContrast/target.py official repository ran · our draft was wrong no licence file found · pointer only · 3277bef847b54b5d · report
get_augmentation_versions DianCh/AdaContrast/target.py official repository ran · our draft was wrong no licence file found · pointer only · aa067e5e8cb4bee4 · report
get_distances DianCh/AdaContrast/target.py official repository ran · fixture could not drive it no licence file found · pointer only · 9a1f0bd5002fe561 · report
get_target_optimizer DianCh/AdaContrast/target.py official repository ran · our draft was wrong no licence file found · pointer only · b01220197705c453 · report
instance_loss DianCh/AdaContrast/target.py official repository ran fingerprinted no licence file found · pointer only · 1f34a1638da5703f · report
is_master DianCh/AdaContrast/target.py official repository ran · violated contract no licence file found · pointer only · 5db12a48f3a9c2a9 · report
load_image DianCh/AdaContrast/target.py official repository ran · honoured contract no licence file found · pointer only · d41e65573feeba36 · report
per_class_accuracy DianCh/AdaContrast/target.py official repository ran · fixture could not drive it no licence file found · pointer only · dd980e064cdbfe0e · report
refine_predictions DianCh/AdaContrast/target.py official repository ran · our draft was wrong no licence file found · pointer only · d974e249f37878d2 · report
soft_k_nearest_neighbors DianCh/AdaContrast/target.py official repository ran · our draft was wrong no licence file found · pointer only · 6651e12b55f05e5d · report
use_wandb DianCh/AdaContrast/target.py official repository ran · violated contract no licence file found · pointer only · 412b38636159f8fa · report
Classifier DianCh/AdaContrast/target.py official repository unverified no licence file found · pointer only · 291ff0547fe08f00 · report
CustomDistributedDataParallel DianCh/AdaContrast/target.py official repository unverified no licence file found · pointer only · f6f503974907329f · report
eval_and_label_dataset DianCh/AdaContrast/target.py official repository unverified no licence file found · pointer only · 1fb8be6b7baba941 · report
remove_wrap_arounds DianCh/AdaContrast/target.py official repository unverified no licence file found · pointer only · ee1a4a51e75b6f4e · report
save_checkpoint DianCh/AdaContrast/target.py official repository unverified no licence file found · pointer only · df95bf057b7a70cf · report
train_epoch DianCh/AdaContrast/target.py official repository unverified no licence file found · pointer only · ee293b943ff80976 · report
train_target_domain DianCh/AdaContrast/target.py official repository unverified no licence file found · pointer only · 56ce9a1463e90b9f · report
update_labels DianCh/AdaContrast/target.py official repository unverified no licence file found · pointer only · 8eb94c91b5bcfa39 · report
concat_all_gather identical code first harvested elsewhere unverified licence of this copy not recorded · a2ae53d34bc13317 · report

Tasks

Contrastive LearningDomain AdaptationTest-time AdaptationUnsupervised Domain Adaptation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Batch NormalizationContrastive LearningInfoNCEMoCo

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