Papers › Domain-Adversarial Training of Neural Networks

Domain-Adversarial Training of Neural Networks

28 May 2015arXiv:1505.07818archive 2025-07-28

Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, Victor Lempitsky

We introduce a new representation learning approach for domain adaptation, in which data at training and test time come from similar but different distributions. Our approach is directly inspired by the theory on domain adaptation suggesting that, for effective domain transfer to be achieved, predictions must be made based on features that cannot discriminate between the training (source) and test (target) domains. The approach implements this idea in the context of neural network architectures that are trained on labeled data from the source domain and unlabeled data from the target domain (no labeled target-domain data is necessary). As the training progresses, the approach promotes the emergence of features that are (i) discriminative for the main learning task on the source domain and (ii) indiscriminate with respect to the shift between the domains. We show that this adaptation behaviour can be achieved in almost any feed-forward model by augmenting it with few standard layers and a new gradient reversal layer. The resulting augmented architecture can be trained using standard backpropagation and stochastic gradient descent, and can thus be implemented with little effort using any of the deep learning packages. We demonstrate the success of our approach for two distinct classification problems (document sentiment analysis and image classification), where state-of-the-art domain adaptation performance on standard benchmarks is achieved. We also validate the approach for descriptor learning task in the context of person re-identification application.

PaperPDFCodeCode 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="1505.07818")

Code

Syntology Ran 33 of 52 code samples harvested from 17 repositories linked to this paper; 19 have no recorded run. Of those that ran: 1 ran · honoured contract; 16 ran · our draft was wrong; 1 ran · fixture could not drive it; 15 ran with no contract checked.

By repository: community (archive-listed): 50 samples from 17 repositories, 32 ran; 2 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.

37 repositories listed; official and paper-mentioned ones first.

JorisRoels/domain-adaptive-segmentation mentioned on GitHubpytorch report
MarvinMartin24/MADA-PL mentioned on GitHubpytorch report
ShichengChen/WaveNetSeparateAudio mentioned on GitHubpytorch report
antoinedemathelin/wann mentioned on GitHubtf report
asahi417/DeepDomainAdaptation mentioned on GitHubtfMIT report
calico/scnym mentioned on GitHubpytorch report
criteo-research/pytorch-ada mentioned on GitHubpytorch report
dv-fenix/Domain-Adaptation mentioned on GitHubpytorch report
erlendd/ddan mentioned on GitHubtfMIT report
facebookresearch/DomainBed mentioned on GitHubpytorch report
gentlezhu/shift-robust-gnns mentioned on GitHubpytorch report
lywang12/cupi-domain mentioned on GitHubpytorch report
lywang12/cuti-domain mentioned on GitHubpytorch report
lzx6/pytorch_DA mentioned on GitHubpytorch report
mashaan14/DANN-toy mentioned on GitHubpytorch report
monkey0head/Domain_Adaptation_thesis mentioned on GitHubpytorch report
rpryzant/proxy-a-distance mentioned on GitHubMIT report
sangdon/pac-ps-w mentioned on GitHubpytorch report
tachitachi/GradientReversal mentioned on GitHubtf report
thuml/Transfer-Learning-Library mentioned on GitHubpytorch report
timgaripov/asa mentioned on GitHubpytorch report
vcoyette/DANN mentioned on GitHubpytorch report
vict0rsch/ArxivTools mentioned on GitHubpytorchMIT report
vict0rsch/PaperMemory mentioned on GitHubpytorchMIT report
vict0rsch/arxiv-pdf-abs mentioned on GitHubpytorchMIT report
vihari/crossgrad mentioned on GitHubtfApache-2.0 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

52 samples harvested; 33 ran; 1 honoured the contract we drafted; 19 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.

1ran · honoured contract
16ran · our draft was wrong
1ran · fixture could not drive it
15ran
19unverified

Licence: 22 of the 52 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 17 repositories linked to this paper, official or community; each sample names its own and says which. 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.

AbstractDANN facebookresearch/DomainBed/domainbed/algorithms.py community (archive-listed) ran MIT (permissive) · 8a387c444dc4c6a4 · report
AdversarialNetwork lywang12/cuti-domain/utils/network.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · f1707c22da402ad3 · report
AlexNetDANN gabrieletiboni/Domain-adaptation-on-PACS-dataset/CODE/models/AlexNetDANN.py community (archive-listed) ran · metamorphic tier: invariant no licence file found · pointer only · c601b6f644d029af · report
BaseAdaptTrainer criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 0e5b0fea39063b16 · report
CellTypeCLF calico/scnym/scnym/model.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · e2db8a3a21c6bf4c · report
ClassifierBase lywang12/cupi-domain/utils/network.py community (archive-listed) ran fingerprinted no licence file found · pointer only · f70dbf08bbfa9c34 · report
DANN dv-fenix/Domain-Adaptation/Domain-Adversarial Training of Neural Networks/model.py community (archive-listed) ran · metamorphic tier: deterministic fingerprinted GPL-3.0 (copyleft) · pointer only · 59f8b8a3c0a6bdfe · report
Discriminator lzx6/pytorch_DA/models/model.py community (archive-listed) ran no licence file found · pointer only · 87db2131110dfd0a · report
GRL MarvinMartin24/MADA-PL/Models/nets/MADA.py community (archive-listed) ran MIT (permissive) · 3ce4eba45b4ca3fc · report
GradReverse lzx6/pytorch_DA/models/model.py community (archive-listed) ran no licence file found · pointer only · 22d411c2795ced15 · report
GradReverse calico/scnym/scnym/model.py community (archive-listed) ran Apache-2.0 (permissive) · 1a6a7062274a346d · report
ResBlock calico/scnym/scnym/model.py community (archive-listed) ran Apache-2.0 (permissive) · 1a8c0c365eb16cdc · report
ReverseLayerF criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) ran Apache-2.0 (permissive) · a9713d2fe23f5ada · report
ReverseLayerF Darth-Kronos/Unsupervised-Domain-Adaptation/DANN/model.py community (archive-listed) ran MIT (permissive) · 917fb058e1f4bb05 · report
_GradReverse antoinedemathelin/wann/wann/methods/WANN.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted no licence file found · pointer only · 4c1fc418e3779b2d · report
_get_default_model antoinedemathelin/wann/wann/methods/WANN.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · ff4ee6a4efd6ea00 · report
_grad_reverse antoinedemathelin/wann/wann/methods/WANN.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · 138b0d8c38a323bc · report
alexnet AKASH2907/Forgery-Classification-via-Domain-Adaptation/DANN/dann_keras.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · d86e29f3ca97a8c2 · report
batch_generator AKASH2907/Forgery-Classification-via-Domain-Adaptation/DANN/dann_keras.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 4a9bc68de4ae0c55 · report
build_models AKASH2907/Forgery-Classification-via-Domain-Adaptation/DANN/dann_keras.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · f9776e8c18b947b6 · report
cross_entropy_logits criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 310d54a1dd86ec79 · report
entropy timgaripov/asa/support_alignment/core/algorithms.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 5b9be386bbb3d10e · report
get_aggregated_metrics criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 4113c2e807d432ee · report
get_aggregated_metrics_from_dict criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 61fd42a2e2a7cfcc · report
get_metrics_from_parameter_dict criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 704df3b8019c2aa5 · report
linear2_bn MarvinMartin24/MADA-PL/Models/nets/MADA.py community (archive-listed) ran · our draft was wrong MIT (permissive) · cd9167b485a751fd · report
linear2_dr2_bn MarvinMartin24/MADA-PL/Models/nets/MADA.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 3e123903386d5131 · report
linear3_bn2_v1 MarvinMartin24/MADA-PL/Models/nets/MADA.py community (archive-listed) ran · our draft was wrong MIT (permissive) · cec816fd8905007d · report
linear3_bn2_v2 MarvinMartin24/MADA-PL/Models/nets/MADA.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 946555f6a21e149f · report
load_backbone MarvinMartin24/MADA-PL/Models/nets/MADA.py community (archive-listed) ran · our draft was wrong MIT (permissive) · f64f43c34c4542e9 · report
load_classifier MarvinMartin24/MADA-PL/Models/nets/MADA.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 8d9374ad6935ac3d · report
vgg_16 AKASH2907/Forgery-Classification-via-Domain-Adaptation/DANN/dann_keras.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 851159feffea3b04 · report
AbstrtactDiscriminatorAlignment timgaripov/asa/support_alignment/core/algorithms.py community (archive-listed) unverified MIT (permissive) · aa6ec272928f9093 · report
BaseDANNLike criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) unverified Apache-2.0 (permissive) · 6ca780e6cedb8469 · report
DANN calico/scnym/scnym/model.py community (archive-listed) unverified Apache-2.0 (permissive) · cd0abd234c0eba6b · report
DANN sangdon/pac-ps-w/model/da.py community (archive-listed) unverified no licence file found · pointer only · fcde4e5aa7af7696 · report
DANN timgaripov/asa/support_alignment/core/algorithms.py community (archive-listed) unverified MIT (permissive) · b140a1b50f334aa6 · report
DANNModel Darth-Kronos/Unsupervised-Domain-Adaptation/DANN/model.py community (archive-listed) unverified MIT (permissive) · 9e554f3838a1af56 · report
DANNtrainer criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) unverified Apache-2.0 (permissive) · b69e7e3bd38b5a79 · report
FeatureExtractor vcoyette/DANN/models/mnist.py community (archive-listed) unverified no licence file found · pointer only · 3d0632c955417561 · report
GradientReversalLayer dv-fenix/Domain-Adaptation/Domain-Adversarial Training of Neural Networks/model.py community (archive-listed) unverified GPL-3.0 (copyleft) · pointer only · a5f777ab36b3f81e · report
MADA MarvinMartin24/MADA-PL/Models/nets/MADA.py community (archive-listed) unverified MIT (permissive) · e61d73732bf10468 · report
Method criteo-research/pytorch-ada/adalib/ada/models/architectures.py community (archive-listed) unverified Apache-2.0 (permissive) · c0ae116e1108bfcf · report
WANN antoinedemathelin/wann/wann/methods/WANN.py community (archive-listed) unverified no licence file found · pointer only · 95838026a4f67e63 · report
common_shape vict0rsch/ArxivTools/extra/imgs/concat.py community (archive-listed) unverified MIT (permissive) · 2fb3457e6f433bd8 · report
crop vict0rsch/ArxivTools/extra/imgs/concat.py community (archive-listed) unverified MIT (permissive) · 2e5319a051a23ef3 · report
domain_confusion scpark20/universal-music-translation/music_trans.py community (archive-listed) unverified GPL-3.0 (copyleft) · pointer only · 48ebff402229f303 · report
to_rgba vict0rsch/ArxivTools/extra/imgs/concat.py community (archive-listed) unverified MIT (permissive) · 5773872947986444 · report
train AKASH2907/Forgery-Classification-via-Domain-Adaptation/DANN/dann_keras.py community (archive-listed) unverified no licence file found · pointer only · 1e5fb974a2b9088c · report
write_log AKASH2907/Forgery-Classification-via-Domain-Adaptation/DANN/dann_keras.py community (archive-listed) unverified no licence file found · pointer only · 882f695d04b3d5b7 · report
grl_hook identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · 9768efb52f591b55 · report
calc_coeff identical code first harvested elsewhere unverified licence of this copy not recorded · e352afa5762c5a6b · report

Tasks

Domain AdaptationDomain GeneralizationGeneral ClassificationImage ClassificationPerson Re-IdentificationRepresentation LearningSentiment AnalysisUnsupervised Domain Adaptationimage-classification

Datasets

Introduced by this paper, per the archive.

MNIST-M

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Domain Adaptation MNIST-to-MNIST-M DANN [ganin2016domain] Accuracy 77.4 #4 of 5 Archive leaderboard report
Domain Adaptation SVNH-to-MNIST DANN [ganin2016domain] Accuracy 70.7 #9 of 9 Archive leaderboard report
Domain Adaptation Synth Digits-to-SVHN DANN [ganin2016domain] Accuracy 90.3 #2 of 4 Archive leaderboard report
Sentiment Analysis Multi-Domain Sentiment Dataset DANN Average 76.26 #6 of 6 Archive leaderboard report
Sentiment Analysis Multi-Domain Sentiment Dataset DANN Books 71.43 #6 of 6 Archive leaderboard report
Sentiment Analysis Multi-Domain Sentiment Dataset DANN DVD 75.4 #6 of 6 Archive leaderboard report
Sentiment Analysis Multi-Domain Sentiment Dataset DANN Electronics 77.67 #6 of 6 Archive leaderboard report
Sentiment Analysis Multi-Domain Sentiment Dataset DANN Kitchen 80.53 #6 of 6 Archive leaderboard report
Synthetic-to-Real Translation Syn2Real-C DANN Accuracy 57.4 #5 of 6 Archive leaderboard report
Unsupervised Domain Adaptation EPIC-KITCHENS-100 DANN Average Accuracy 39.2 #4 of 5 Archive leaderboard report
Unsupervised Domain Adaptation HMDB-UCF DANN Accuracy 88.09 #6 of 6 Archive leaderboard report
Unsupervised Domain Adaptation Jester (Gesture Recognition) DANN Accuracy 55.4 #4 of 5 Archive leaderboard report
Unsupervised Domain Adaptation Office-Home DANN [cite:JMLR16RevGrad] Accuracy 76.8 #12 of 20 Archive leaderboard report
Unsupervised Domain Adaptation UCF-HMDB DANN Accuracy 80.83 #5 of 6 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.

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