Joint Distribution Alignment via Adversarial Learning for Domain Adaptive Object Detection

If you find our code or paper useful to your research work, please consider citing our work using the following bibtex:

  title={Joint distribution alignment via adversarial learning for domain adaptive object detection},
  author={Zhang, Bo and Chen, Tao and Wang, Bin and Li, Ruoyao},
  journal={IEEE Transactions on Multimedia},

Code Environment

  1. Our experimental settings: (a) CUDA version >= 9.0; (b) NVIDIA Titan XP or GeForce RTX 2080ti; (c) Ubuntu 16.04.6 LTS

  2. Dependency libraries of caffe platform are needed (

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev
sudo apt-get install libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install python-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
  1. Build the Caffe libraries:

make -j32
make pycaffe -j32

Note: Our Makefile.config file is recommended for building the caffe

Preparation Step

Download the dataset

You can download the LMDB format of the PASCAL VOC and Clipart datasets [Dataset Page], or preprocess the your own datasets according to the following steps:

  1. Construct a dataset folder in JADF-caffe/data/VOCdevkit with the following form:

  1. Create LMDB format file

Generate the LIST FILE of your dataset, such as test_name_size.txt and trainval_name_size.txt:

cd JADF-caffe/data/VOC0712/
  1. Generate the LMDB file:

Download the pretrained model

  1. For pre-training a source model, you can use the ImageNet-pretrained-model:

  2. You can perform the adversarial adaptation by using the pre-trained source model (on PASCAL VOC0712 trainval.txt):

Train and Evaluate Our Method

  1. cd JADF-caffe

  2. Download the LMDB format of the clipart dataset:

  3. Copy the to JADF-caffe/data/VOCdevkit/ and extract it:

  4. Download the pretrained-model.

  5. Copy VGG_ILSVRC_16_layers_fc_reduced.caffemodel(or VGG_VOC0712_SSD_300x300_iter_120000.caffemodel) to JADF-caffe/model/VGGNet/

  6. cd JADF-caffe

  7. make -j32 && make pycaffe -j32(If you are having issues compiling, and please refer to requirement.txt for installing several dependencies of caffe)

  8. For pre-training the source model:

    sh job/VGGNet/VOC0712_Clipart/DA_SSD_300/

    For performing the Unsupervised Domain Adaptation (UDA) from the source model:

    sh job/VGGNet/VOC0712_Clipart/DA_SSD_300/

    For performing the Unsupervised Few-shot Domain Adaptation (UFDA, 3-shot) from the source model:

    sh job/VGGNet/VOC0712_Clipart/DA_SSD_300/

Selected cross-domain objec detection results

Here we report some mAP comparisons under UDA and UFDA settings for cross-domain adaptation from PASCAL VOC to Clipart:

Visual detection results of SSD model:

Visual detection results of our JADF model:


We have tried our best to verify the correctness of our released data, code and trained model weights.
However, there are a large number of experiment settings, all of which have been extracted and reorganized from our original codebase.
There may be some undetected bugs or errors in the current release.
If you encounter any issues or have questions about using this code, please feel free to contact us via [email protected]


View Github