EUDA (Efficient Unsupervised Domain Adaptation) is a novel approach leveraging self-supervised Vision Transformers for domain adaptation tasks. This method significantly reduces the number of learnable parameters, making the adaptation process more efficient while maintaining high performance.
The implementation includes a submodule from DINOv2, which provides the self-supervised pre-training backbone for our Vision Transformer model.
- Efficient Parameter Usage: Utilizes 42% to 99.7% fewer learnable parameters.
- Self-Supervised Learning: Leverages Vision Transformers pre-trained in a self-supervised manner.
- Scalable: Designed to be scalable and adaptable to various domain adaptation scenarios.
- Flexible Architecture: Built with modularity and flexibility, allowing easy modifications and extensions.
The architecture consists of a Vision Transformer backbone pre-trained using self-supervised learning techniques provided by DINOv2. This backbone is then adapted using our efficient unsupervised domain adaptation methodology.
- Python >= 3.8
- Additional dependencies as listed in
requirements.txt
- Clone the Repository
git clone --recurse-submodules https://github.com/A-Abedi/EUDA
cd EUDA
- Install Dependencies
pip install -r requirements.txt
Download the datasets from Office-31, Office-Home, VisDA-2017 and place them in a directory of your choice.
Specify the path to this directory using the --dataset_path
argument in the running command.
Run training process using this command:
python3 Main.py --train_batch_size BATCHSIZE --dataset DATASET_NAME --name EXPERIEMENT_NAME --train_list TRAIN_LIST --test_list TEST_LIST --num_classes NUM_CLASSES --backbone_size BACKBONE_SIZE --bottleneck_size BOTTLENECK_SIZE --num_steps NUM_STEPS --img_size IMAGE_SZIE --gpu_id GPU_ID --dataset_path /Datasets/
For example:
python3 Main.py --train_batch_size 32 --dataset office-home --name office_home_da --train_list Data/office-home/Art.txt --test_list Data/office-home/Clipart.txt --num_classes 65 --backbone_size base --bottleneck_size base --num_steps 2000 --img_size 224 --gpu_id 0 --dataset_path /Datasets/
Test the trained model using command like this:
python3 Main.py --eval_batch_size 64 --test_list Data/office/amazon_list.txt --num_classes 65 --backbone_type DINOv2 --backbone_size base --bottleneck_size base --img_size 224 --gpu_id 0 --is_test --pretrained_dir /Output/checkpoint.bin
- DINOv2
- Our code is based on the TVT code base. We extend our gratitude to the authors for their contributions.
Include references to the paper:
@article{abedi2024euda,
title={EUDA: An Efficient Unsupervised Domain Adaptation via Self-Supervised Vision Transformer},
author={Abedi, Ali and Wu, Q M Jonathan and Zhang, Ning and
Pourpanah, Farhad},
journal={arXiv preprint arXiv:2407.21311},
year={2024}
}