This is a pytorch implementation of SSAN.
Simultaneous Semantic Alignment Network for Heterogeneous Domain Adaptation
Shuang Li, Binhui Xie, Jiashu Wu, Ying Zhao, Chi Harold Liu, Zhengming Ding
ACM International Conference on Multimedia, 2020
Heterogeneous domain adaptation (HDA) transfers knowledge across source and target domains that present heterogeneities e.g., distinct domain distributions and difference in feature type or dimension. Most previous HDA methods tackle this problem through learning a domain-invariant feature subspace to reduce the discrepancy between domains. However, the intrinsic semantic properties contained in data are under-explored in such alignment strategy, which is also indispensable to achieve promising adaptability. In this paper, we propose a Simultaneous Semantic Alignment Network (SSAN) to simultaneously exploit correlations among categories and align the centroids for each category across domains. In particular, we propose an implicit semantic correlation loss to transfer the correlation knowledge of source categorical prediction distributions to target domain. Meanwhile, by leveraging target pseudo-labels, a robust triplet-centroid alignment mechanism is explicitly applied to align feature representations for each category. Notably, a pseudo-label refinement procedure with geometric similarity involved is introduced to enhance the target pseudo-label assignment accuracy. Comprehensive experiments on various HDA tasks across text-to-image, image-to-image and text-to-text successfully validate the superiority of our SSAN against state-of-the-art HDA methods.
- Python 3.6
- Pytorch 1.3.1
- numpy
- scipy
- matplotlib
- scikit_learn
- CUDA >= 8.0
$ conda create -n ssan -y python=3.6
$ conda activate ssan
# this installs the right pip and dependencies for the fresh python
$ conda install -y ipython pip
# to install the required python packages, run
$ pip install -r requirements.txt
All datasets can be downloaded here and put in <root_dir>/datasets
Image-To-Image
$ python main.py --source amazon_surf --target amazon_decaf --cuda 0 --nepoch 3000 --partition 20 --prototype three --layer double --d_common 256 --optimizer mSGD --lr 0.1 --alpha 0.1 --beta 0.004 --gamma 0.1 --combine_pred Cosine --checkpoint_path checkpoint/ --temperature 5.0
Especially thanks to Yuan Yao for helping experiments
If you find this code useful for your research, please cite our paper:
@inproceedings{li2020simultaneous,
title = {Simultaneous Semantic Alignment Network for Heterogeneous Domain Adaptation},
author = {Li, Shuang and Xie, Binhui and Wu, Jiashu and Zhao, Ying and Liu, Chi Harold and Ding, Zhengming},
booktitle = {The 28th ACM International Conference on Multimedia (MM'20))},
pages = {3866--3874},
publisher = {{ACM}},
year = {2020}
}
If you have any problem about our code, feel free to contact
or describe your problem in Issues.