This is an official PyTorch implementation of the paper Free Lunch for Domain Adversarial Training: Environment Label Smoothing.
🔆 The repository includes a broad range of tasks, which are image classification, image retrieval, neural language processing, genomics,graph, and sequential prediction tasks.
🔥 With a very simple smoothing trick, the method can boost the generalization/adaptation performance of previous adversarial training-based methods by a large margin.
A fundamental challenge for machine learning models is how to generalize learned models for out-of-distribution (OOD) data. Among various approaches, exploiting invariant features by Domain Adversarial Training (DAT) received widespread attention. Despite its success, we observe training instability from DAT, mostly due to over-confident domain discriminator and environment label noise. To address this issue, we proposed Environment Label Smoothing (ELS), which encourages the discriminator to output soft probability, which thus reduces the confidence of the discriminator and alleviates the impact of noisy environment labels. We demonstrate, both experimentally and theoretically, that ELS can improve training stability, local convergence, and robustness to noisy environment labels. By incorporating ELS with DAT methods, we are able to yield state-of-art results on a wide range of domain generalization/adaptation tasks, particularly when the environment labels are highly noisy.
Dependencies of different settings are listed in each subfolder and are from different existing GitHub projects. Compared to all original projects, we add additional hyper-parameters such as
parser.add_argument('--label_smooth', action='store_true',
help='domain label smmoth')
parser.add_argument('--eps', type=float, default=0.1,
help='eps for domain label smmoth')
You can use the arguments to control whether use environment label smoothing for domain adversarial methods flexibly.
./Domain_Adaptation
./Domain_Generalization
./Continuous_Domain_Adaptation
./NLP_Genomics_Graph
./Image_Reterival
./Sequential_Prediction
If you find this repo useful, please consider citing:
@misc{zhang2023free,
title={Free Lunch for Domain Adversarial Training: Environment Label Smoothing},
author={YiFan Zhang and Xue Wang and Jian Liang and Zhang Zhang and Liang Wang and Rong Jin and Tieniu Tan},
year={2023},
eprint={2302.00194},
archivePrefix={arXiv},
primaryClass={cs.LG}
}