Paper commentary
Deep Transfer Learning with Joint Adaptation Networks
Joint adaptation networks align joint distributions to transfer deep features across domains
- Problem Domain adaptation methods align marginal feature distributions, so the shift in joint input and label distributions stays in the deep layers. Standard CNNs make this worse, because features move from general to specific with depth.
- Method JAN matches the joint distribution of activations in the top task-specific layers between source and target domains. It adds a kernel-based JMMD term to the source classification loss and trains with stochastic gradient descent in linear time.
- Results On Office-31 with AlexNet, JAN reached an average accuracy of 76.0 against 72.9 for DAN. With ResNet, JAN reached 84.3 against 80.4 for DAN.
Why shifts in joint distributions matter
Most deep domain adaptation methods embed an alignment module into the network and correct shifts in marginal distributions, on the assumption that conditional distributions stay the same after that correction. Once the source and target data have passed through several layers, the joint distribution of inputs and labels can still differ, and standard CNNs make this worse because their features move from general to specific along the depth.
The authors argue that the layers closest to the classifier still carry the joint shift, so the joint distribution of their activations can stand in for the joint distribution of inputs and labels. Lower layers are treated as transferable and are not matched again, which narrows the alignment to the domain-specific top layers.
Earlier conditional shift methods rely on an assumption that the conditional distribution changes only under location-scale transformations of X, which is needed to make the problem tractable. Working directly on the joint distribution avoids having to decide in advance which of its components changes.
Embedding joint distributions in a tensor product space
Each distribution is represented by its kernel mean embedding, which is the expected feature map of the samples, and an empirical version replaces the expectation by an average over a finite sample. For a single variable this empirical embedding is the average of the feature maps of the observed points, and it converges to the population embedding as the sample grows.
For several variables, the feature maps are multiplied in a tensor product feature space, so the joint embedding is an average of tensor products of per-variable feature maps. Its inner products factor into a product of per-variable kernels, which is what makes the joint term computable from the layer activations.
MMD measures the squared distance between two mean embeddings and is zero exactly when the two distributions coincide under a characteristic kernel. JMMD applies the same squared-distance idea to the joint cross-covariance embeddings of the activations in the layers in L, which gives the squared distance over the tensor product space. Its empirical estimate multiplies one kernel per layer for each pair of samples, so the kernel in each layer is weighted by the other layers, which is the difference from MMD that the authors emphasize.
Training JAN end to end
The classifier is trained on labeled source examples with a cross-entropy loss, and the convolutional layers are fine-tuned from the pretrained model rather than frozen. The domain-specific layers L are set to fc6, fc7 and fc8 for AlexNet and to pool5 and fc for ResNet, which are the top layers that the authors treat as task-specific.
The total objective adds the source loss to a JMMD term over the activations of the layers in L, weighted by a tradeoff parameter lambda greater than zero, so the network and the joint distributions are matched during the same backpropagation. Because the quadratic JMMD estimate is costly on large samples, the authors derive a linear-time estimate that pairs consecutive samples in a mini-batch.
Each mini-batch contains the same number of source and target points, which removes the bias that comes from unequal domain sizes. Because of this pairing, the term can be trained with mini-batch stochastic gradient descent and scales linearly with the number of samples.
Adversarial maximization of JMMD
The authors argue that a fixed kernel can suffer from vanishing gradients for low-bandwidth settings and may not separate complex distributions of natural images. JAN-A adds several fully connected layers with parameters theta on top of the JMMD features and maximizes JMMD with respect to theta, while the network minimizes it.
The overall objective becomes a minimization over the network parameters of the classifier loss plus lambda times JMMD, with a maximization over theta inside it. The maximization makes the source and target distributions easier to tell apart, so the feature extractor is pushed to close the remaining gap.
The authors relate this to domain-adversarial training with a logistic regression domain classifier, but use JMMD as the domain adversary instead. The authors also report that this JMMD-adversarial network can be trained more easily, citing a recent study on Wasserstein GAN training.
Datasets and training setup
Office-31 has 4,652 images in 31 categories from the Amazon, Webcam and DSLR domains, and the experiments evaluate six transfer tasks in both directions among these domains. Office-31 domains have different sizes, while the three domains of ImageCLEF-DA have the same size.
ImageCLEF-DA uses 12 shared categories from Caltech-256, ImageNet ILSVRC 2012 and Pascal VOC 2012, with 50 images per category and 600 images per domain, and yields six transfer tasks. The authors describe this benchmark as a more controlled complement to Office-31 because its domains are balanced.
Baselines include TCA, GFK, AlexNet, ResNet, DDC, DAN, RevGrad and RTN, and deep features are taken from fc7 for AlexNet and pool5 for ResNet-50. Models are fine-tuned from ImageNet pretrained Caffe models, the classifier learning rate is set to 10 times that of the other layers, and the MMD-based methods use a Gaussian kernel whose bandwidth is the median pairwise squared distance on the training data.
The adaptation factor lambda is raised from 0 to 1 with a progressive schedule, and the learning rate follows the RevGrad annealing formula with eta0 equal to 0.01, alpha equal to 10 and beta equal to 0.75.
Office-31 accuracy
With AlexNet, JAN reached an average accuracy of 76.0 and JAN-A reached 76.3, against 72.9 for DAN and 74.3 for RevGrad. The largest gains appear on the harder tasks, where JAN scored 58.3 on D to A and 55.0 on W to A, compared with 54.0 and 53.1 for DAN.
With ResNet, the baseline averages 76.1, while JAN reached 84.3 and JAN-A reached 84.6, against 80.4 for DAN and 82.2 for RevGrad. On D to W, JAN scored 97.4 and JAN-A 96.7, and the gap to the strongest baseline is small on these easy tasks, which the authors connect to their similarity.
ImageCLEF-DA accuracy
With AlexNet, JAN averages 79.3 against 76.9 for DAN and 77.9 for RTN on ImageCLEF-DA. With ResNet, JAN averages 85.8, compared with 82.5 for DAN and 83.9 for RTN.
The authors report that JAN beats the comparison methods on most transfer tasks here but by smaller margins than on Office-31.
What the feature and discrepancy analyses show
The t-SNE plots compare ResNet activations from DAN and JAN for the task A to W, and in the JAN plots the target categories separate more clearly under the source classifier. These plots are qualitative, so they support the visual separation claim but do not measure it.
The proxy A-distance is computed for A to W and W to D with CNN, DAN and JAN features, and JAN features give a smaller value than CNN and DAN features on both tasks. The A-distance does not capture the discrepancy of joint distributions, so JMMD is computed as well, on the fc7 activations with fc8 labels, without using target labels for training.
JMMD with JAN activations is smaller than with CNN and DAN activations, which the authors read as evidence that JAN reduces the joint shift.
The lambda sweep on A to W shows accuracy that rises and then falls as lambda grows, which the authors take as a balance between the classifier and the joint distribution term. On A to W, JAN converges fastest among the compared methods, and JAN-A converges at a speed similar to RevGrad while staying more accurate throughout training.
Limitations
The result tables report AlexNet and ResNet only, and the text mentions VGGnet and GoogLeNet without giving results for them. The reported benchmarks are Office-31 and ImageCLEF-DA, so no other domain adaptation datasets are covered.
The lambda sensitivity and the convergence comparison are each run on the single task A to W. JAN-A is not uniformly better than JAN, for example on D to W with ResNet (96.7 against 97.4).
Paper info
- Authors
- Mingsheng Long, Han Zhu, Jianmin Wang, Michael I. Jordan
- Venue
- arXiv · Preprint
- First published
- 2016-5-21
- Added
- 2026-11-12
- Updated
- 2017-8-17
- Version
- v2
- arXiv
- 1605.06636
- Category
- cs.LG · stat.ML
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Mingsheng Long, Han Zhu, Jianmin Wang, Michael I. Jordan (2016). Deep Transfer Learning with Joint Adaptation Networks. arXiv:1605.06636v2. https://arxiv.org/abs/1605.06636v2
BibTeX
@misc{long2016deep,
title = {{Deep Transfer Learning with Joint Adaptation Networks}},
author = {Mingsheng Long and Han Zhu and Jianmin Wang and Michael I. Jordan},
year = {2016},
eprint = {1605.06636},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1605.06636v2}
}