{"id":13577575,"url":"https://github.com/BIT-DA/EADA","last_synced_at":"2025-04-05T12:30:44.139Z","repository":{"id":46756827,"uuid":"434217186","full_name":"BIT-DA/EADA","owner":"BIT-DA","description":"[AAAI 2022] Official Implementation of Active Learning for Domain Adaptation: An Energy-based Approach https://arxiv.org/abs/2112.01406","archived":false,"fork":false,"pushed_at":"2023-11-04T09:09:25.000Z","size":1055,"stargazers_count":79,"open_issues_count":0,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-05T14:46:20.958Z","etag":null,"topics":["active-learning","data-efficiency","domain-adaptation","energy-based-model"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2112.01406","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BIT-DA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-12-02T12:44:57.000Z","updated_at":"2024-10-23T01:47:27.000Z","dependencies_parsed_at":"2023-01-23T12:15:57.923Z","dependency_job_id":"e86d7564-e701-41b6-b4d2-b8513532146e","html_url":"https://github.com/BIT-DA/EADA","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIT-DA%2FEADA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIT-DA%2FEADA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIT-DA%2FEADA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIT-DA%2FEADA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BIT-DA","download_url":"https://codeload.github.com/BIT-DA/EADA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247338519,"owners_count":20922985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["active-learning","data-efficiency","domain-adaptation","energy-based-model"],"created_at":"2024-08-01T15:01:22.617Z","updated_at":"2025-04-05T12:30:39.125Z","avatar_url":"https://github.com/BIT-DA.png","language":"Python","readme":" ---\n\n\u003cdiv align=\"center\"\u003e    \n \n# Active Learning for Domain Adaptation: An Energy-based Approach\n\n[Binhui Xie](https://binhuixie.github.io), [Longhui Yuan](https://yuanlonghui.github.io), [Shuang Li](https://shuangli.xyz), [Chi Harold Liu](https://scholar.google.com/citations?user=3IgFTEkAAAAJ\u0026hl=en), [Xinjing Cheng](https://scholar.google.com/citations?user=8QbRVCsAAAAJ\u0026hl=en) and [Guoren Wang](https://scholar.google.com.hk/citations?hl=en\u0026user=UjlGD7AAAAAJ)\n\n\n[![Paper](http://img.shields.io/badge/paper-arxiv.2112.01406-B31B1B.svg)](https://arxiv.org/abs/2112.01406)\u0026nbsp;\u0026nbsp;\n[![Bilibili](https://img.shields.io/badge/Video-Bilibili-%2300A1D6?logo=bilibili\u0026style=flat-square)](https://www.bilibili.com/video/BV1qa411h7Xm/?share_source=copy_web\u0026vd_source=2536293932098e7a347341a231b3fb8b)\u0026nbsp;\u0026nbsp;\n[![Slides](https://img.shields.io/badge/Poster-Dropbox-%230061FF?logo=dropbox\u0026style=flat-square)](https://www.dropbox.com/s/8ozwc8uw1q1tqlf/eada_slides.pdf?dl=0)\u0026nbsp;\u0026nbsp;\n\n\u003c/div\u003e\n\n\nUnsupervised domain adaptation (UDA) has recently emerged as an effective paradigm for generalizing deep neural networks to new target domains. However, there is still enormous potential to be tapped to reach the fully supervised performance. \n\nWe start from an observation that energy-based models exhibit free energy biases when training (source) and test (target) data come from different distributions. Inspired by this inherent mechanism, we empirically reveal that a simple yet efficient energy-based sampling strategy sheds light on selecting the most valuable target samples than existing approaches requiring particular architectures or computation of the distances. \n\nOur algorithm, Energy-based Active Domain Adaptation (EADA), queries groups of target data that incorporate both domain characteristic and instance uncertainty into every selection round. Meanwhile, by aligning the free energy of target data compact around the source domain via a regularization term, domain gap can be implicitly diminished. \n\n![UDA over time](docs/eada.png)\n\nThrough extensive experiments, we show that EADA surpasses state-of-the-art methods on well-known challenging benchmarks with substantial improvements, making it a useful option in the open world.\n\nFor more information on EADA, please check our **[[Paper](https://arxiv.org/pdf/2112.01406.pdf)]**.\n\nIf you find this project useful in your research, please consider citing:\n\n```bib\n@inproceedings{xie2022active,\n  title={Active learning for domain adaptation: An energy-based approach},\n  author={Xie, Binhui and Yuan, Longhui and Li, Shuang and Liu, Chi Harold and Cheng, Xinjing and Wang, Guoren},\n  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},\n  volume={36},\n  number={8},\n  pages={8708--8716},\n  year={2022}\n}\n```\n\n\n##  Setup Environment\n\nFor this project, we used python 3.7.5. We recommend setting up a new virtual environment:\n\n**Step-by-step installation**\n\n```bash\nconda create --name activeDA -y python=3.7\nconda activate activeDA\n\n# this installs the right pip and dependencies for the fresh python\nconda install -y ipython pip\n\npip install -r requirements.txt\n```\n\n### Setup Datasets\n- Download [The Office-31 Dataset](https://faculty.cc.gatech.edu/~judy/domainadapt/)\n- Download [The Office-Home Dataset](http://hemanthdv.org/OfficeHome-Dataset/)\n- Download [The VisDA-2017 Dataset](https://github.com/VisionLearningGroup/taskcv-2017-public/tree/master/classification)\n\nThe data folder should be structured as follows:\n```\n├── data/\n│   ├── office31/\t\n|   |   ├── amazon/\n|   |   ├── dslr/\n|   |   ├── webcam/\t\n│   ├── home/     \n|   |   ├── Art/\n|   |   ├── Clipart/\n|   |   ├── Product/\n|   |   ├── RealWorld/\n│   ├── visda2017/\n|   |   ├── train/\n|   |   ├── validation/\n│   └──\t\n```\n\nSymlink the required dataset\n```\nln -s /path_to_office31_dataset data/office31\nln -s /path_to_home_dataset data/home\nln -s /path_to_visda2017_dataset/clf/ data/visda2017\n```\n\n## Running the code\n\nFor Office-31\n```\npython main.py --cfg configs/office.yaml\n```\n\nFor Office-Home\n```\npython main.py --cfg configs/home.yaml\n```\n\nFor VisDA-2017\n```\npython main.py --cfg configs/visda2017.yaml\n```\n\n## Acknowledgements\n\nThis project is based on the following open-source projects. We thank their authors for making the source code publicly available.\n- [Transferable-Query-Selection](https://github.com/thuml/Transferable-Query-Selection)\n\n## Contact\n\nIf you have any problem about our code, feel free to contact\n\n- [binhuixie@bit.edu.cn](mailto:binhuixie@bit.edu.cn)\n\nor describe your problem in Issues.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBIT-DA%2FEADA","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBIT-DA%2FEADA","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBIT-DA%2FEADA/lists"}