This code is an implementation of the DRCN algorithm presented in [1].
[1] M. Ghifary, W. B. Kleijn, M. Zhang, D. Balduzzi, and W. Li. "Deep Reconstruction-Classification Networks for Unsupervised Domain Adaptation (DRCN)", European Conference on Computer Vision (ECCV), 2016
Contact:
Muhammad Ghifary (mghifary@gmail.com)
- Python 2.7
- Tensorflow-1.0.1
- Keras-2.0.0
- numpy
- h5py
Original datasets are not provided, this repo uses datasets as follows:
- for MNIST, we use
mnist.pkl.gz
from https://www.kaggle.com/adrienchevrier/mnist.pkl.gz and an altered version ofload_mnist
- for SVHN, we use
prep_data.py
to create the grayscaled SVHN dataset,svhn_gray.pkl.gz
. You can also download the processed dataset here, including only train and test set.
To run the experiment with the (grayscaled) SVHN dataset as the source domain and the MNIST dataset as the target domain
python main_sm.py
The core algorithm is implemented in drcn.py. Data augmentation and denoising strategies are included as well.
The source to target reconstruction below (SVHN as the source) indicates the successful training of DRCN.
python reconstruct_images.py
The classification accuracies of one DRCN run are plotted as follows -- the results may vary due to the randomness:
python plot_results.py