- This repository contains code for reproducing the experiments reported in the paper Joint Domain Alignment and Discriminative Feature Learning for Unsupervised Deep Domain Adaptation. which has been accepted by AAAI2019.
- In the source code, the JDDA_C is denoted by 'center_loss' in Digital_JDDA_C and the JDDA_C is denoted by 'Manifold' in Digital_JDDA_I.
- Another qualified repository completed by the co-author can be seen JDDA repository
This code requires Python 2 and implemented in Tensorflow 1.9. You can download all the datasets used in our paper from here and place them in the specified directory.
cd Digital_JDDA_I or Digital_JDDA_C
python trainLenet.py
- Create a txt file for the image path of the Office dataset as shown in amazon.txt
- Download the ResNet-L50 pre-training model
cd Office_JDDA_C or Office_JDDA_I/JDDA_I
python train_JDDA.py
We mainly compare our proposal with DDC, DAN,DANN, CMD, ADDA and CORAL.
- If you want to use these methods, you can modify them in trainLenet.py.
93 self.CalDiscriminativeLoss(method="CenterBased")
94 self.CalDomainLoss(method="CORAL")
or in train_JDDA.py
84 # domain_loss=tf.maximum(0.0001,KMMD(source_model.avg_pool,target_model.avg_pool))
85 domain_loss=coral_loss(source_model.avg_pool,target_model.avg_pool)
86 centers_update_op,discriminative_loss=CenterBased(source_model.avg_pool,y)
87 # domain_loss = mmatch(source_model.avg_pool,target_model.avg_pool, 5)
88 # domain_loss = log_coral_loss(source_model.adapt, target_model.adapt)
The results (accuracy %) for unsupervised domain adaptation can be seen here
- If you want to use t-SNE visualization, you can open the comment in train_JDDA.py
94 # self.conputeTSNE(step, self.SourceData, self.TargetData,self.SourceLabel, self.TargetLabel, sess)