# Deep Domain Confusion: Maximizing for Domain Invariance

Domain confusion loss helps deep CNNs transfer across domains

Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, Trevor Darrell · arXiv · 2014-12-10

- **Problem** Deep CNNs trained on one image collection lose accuracy on images from a different distribution. Fine-tuning them on a new domain needs labeled target data that is often unavailable.
- **Method** Deep Domain Confusion inserts a low-dimensional adaptation layer into a pretrained CNN. It trains that layer with a classification loss and an MMD loss that pushes source and target features together.
- **Results** The method reaches 91.9 average multi-class accuracy on the supervised Office benchmark. On the unsupervised benchmark it reaches 81.2 average accuracy.

## Why deep features still shift between domains

Dataset bias means that a classifier trained on one collection of images tends to make more errors when the test images come from a different input distribution. Pretrained deep models transfer better than earlier bag-of-words features, which is why mid-level features from ImageNet removed much of the bias in some Office settings. Adapting a deep network by fine-tuning its parameters on a small labeled target set, however, is problematic, and in the target domain there is often little or no labeled training data.

The authors therefore look for a representation that is close across the two domains and still useful for classification, so a classifier trained on the source labels can be applied to the target domain with little loss. Earlier shallow methods could only align distributions in a feature space, and deep methods that used a two-layer network lacked the strong semantic representation that a deep supervised CNN provides.

## Joint objective with a domain confusion term

The distance between domains is measured with maximum mean discrepancy (MMD) computed on a chosen representation φ(·), so MMD(XS,XT) is the norm of the difference between the mean of φ over source points xs and the mean of φ over target points xt. The two sets are normalized by their own sizes \|XS\| and \|XT\|, so the quantity compares the average embeddings of the two domains and not individual points.

The training loss adds the classification loss on labeled data, LC(XL,y), to λ times the squared MMD between source and target data, so the classification term keeps features discriminative while the MMD term pushes the two domains together. The coefficient λ sets how strongly the domains are confused, and the paper fixes it at 0.25 for the reported fine-tuning, a value chosen so the objective stays mainly weighted toward classification while still limiting overfitting.

## Choosing layer and width with MMD

The first choice is the layer. Features from a fixed pretrained network are compared with MMD at each candidate fully connected layer, and the layer with the lowest distance is taken as the placement, which here is after fc7. The authors read this as a coordinate-descent step on the joint loss: the first stage picks a representation by its distance and then trains a classifier on it.

On the Amazon→Webcam split, MMD ranks fc7 as the best representation and fc6 as the worst, and the authors then use fc7 for the remaining experiments. Test accuracy across these layers moves in the opposite direction to MMD in the plotted comparison, which the authors take as evidence that MMD can guide the choice.

The second choice is the width. Networks with adaptation layer widths from 64 to 4096, changing by a power of two, are fine-tuned, and MMD is computed in each lower-dimensional representation. The width with the lowest MMD is selected, and for the Amazon→Webcam task this is 256 dimensions.

## Shared-weight network and training setup

The domain distance loss is placed on top of this bottleneck layer, so the adaptation layer is the representation that is pushed toward domain invariance.

A fork after the adaptation layer splits the network into two branches: one uses only labeled examples for the classifier, and the other uses all examples to compute MMD over minibatches of source and target data.

Because the adaptation layer and classifier are trained from scratch, their learning rates are set to 10 times the rate used for the lower layers copied from the pretrained model, and fine-tuning then runs as standard backpropagation. The same architecture serves both settings. In the supervised case the classifier sees labeled data from both domains, while in the unsupervised case it sees only labeled source data, and the MMD regularizer uses all data in both cases.

## Supervised Office results

The supervised evaluation uses five random train/test splits on three transfer tasks, with three labeled target examples per category, and the table reports multi-class accuracy over all 31 categories. The proposed method reached 84.1 on Amazon→Webcam, 95.4 on DSLR→Webcam, and 96.3 on Webcam→DSLR, with an average of 91.9.

On Amazon→Webcam the method is 3.4% above DeCAF, which is reported with 80.7 on that task, and the authors describe this as its margin over the strongest deep baseline.

## Unsupervised Office results

In the unsupervised setting, the same five-split protocol is used with 20 source examples per category for Amazon and 8 per category for Webcam or DSLR as sources, and no labeled target data. The method reached 59.4 on Amazon→Webcam, 92.5 on DSLR→Webcam, and 91.7 on Webcam→DSLR, with an average of 81.2.

Among the listed baselines, DLID has the highest average at 60.0, and DeCAF6 S reports 52.2 on Amazon→Webcam against 59.4 for the method. The authors describe the Amazon→Webcam unsupervised gain as 5.5% multiclass accuracy, which is the largest improvement they report on that shift.

## What the regularizer changes in training

On the unsupervised Amazon→Webcam split, the unregularized network starts faster but its test accuracy falls as it fits the source data. The regularized network learns more slowly at first, and over the first 700 fine-tuning iterations its test accuracy ends higher.

The t-SNE embedding of Amazon and Webcam images in the learned representation shows tighter class clusters that mix both domains, while in fc7 most tight clusters contain points from only one domain. This is a qualitative view of one split and does not measure domain invariance directly.

## Limitations

The width chosen by MMD, 256 dimensions, is not the one that maximizes test accuracy, and the authors describe it as a reasonable choice rather than the optimum. The width-accuracy plot has several irregularities, and the authors suggest finer sampling could make the choice more accurate.

Experiments use only the Office dataset with its three domains and cover the Amazon, Webcam and DSLR transfer tasks, with the width search done on Amazon→Webcam. The evaluation has no separate test of the λ value beyond the one reported setting, and the authors describe the effect of λ only qualitatively.

## Paper info

- **Authors**: Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, Trevor Darrell
- **Venue**: arXiv · Preprint
- **First published**: 2014-12-10
- **Added**: 2026-11-12
- **Updated**: 2014-12-10
- **Version**: v1
- **arXiv**: 1412.3474
- **Category**: cs.CV
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1412.3474v1) · [PDF ↗](https://arxiv.org/pdf/1412.3474v1)

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

Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, Trevor Darrell (2014). Deep Domain Confusion: Maximizing for Domain Invariance. arXiv:1412.3474v1. https://arxiv.org/abs/1412.3474v1

**BibTeX**

```
@misc{tzeng2014deep,
  title = {{Deep Domain Confusion: Maximizing for Domain Invariance}},
  author = {Eric Tzeng and Judy Hoffman and Ning Zhang and Kate Saenko and Trevor Darrell},
  year = {2014},
  eprint = {1412.3474},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1412.3474v1}
}
```

## Other paper commentary

- [SphereFace: Deep Hypersphere Embedding for Face Recognition](https://refivu.com/en/papers/f6744cc0-1f38-4983-a7df-1f878512f241-sphereface-deep-hypersphere-embedding-for-face-recognition.md)
- [Performance Measures and a Data Set for Multi-Target, Multi-Camera Tracking](https://refivu.com/en/papers/9fda5f2a-866b-4d9c-a173-3e82bc5e8e0e-performance-measures-and-a-data-set-for-multi.md)
- [VGGFace2: A dataset for recognising faces across pose and age](https://refivu.com/en/papers/71a96842-a08d-49a9-b6a5-7cdbf9f76e4f-vggface2-a-dataset-for-recognising-faces-across-pose.md)
- [CCNet: Criss-Cross Attention for Semantic Segmentation](https://refivu.com/en/papers/0b5bae85-f19c-40ec-85a8-6d588ce0497b-ccnet-criss-cross-attention-for-semantic-segmentation.md)
- [Deep Learning for Anomaly Detection: A Review](https://refivu.com/en/papers/f9b3200a-543c-4a6c-8593-e6e80704328f-deep-learning-for-anomaly-detection-a-review.md)
- [RefineNet: Multi-Path Refinement Networks for High-Resolution Semantic Segmentation](https://refivu.com/en/papers/ab95d2b5-2254-4fd6-9e48-b56d4580e670-refinenet-multi-path-refinement-networks-for-high-resolution.md)
- [A Tutorial on Principal Component Analysis](https://refivu.com/en/papers/6c1b9168-7aa0-40d4-97a5-859e8217739b-a-tutorial-on-principal-component-analysis.md)
- [Embedding Entities and Relations for Learning and Inference in Knowledge Bases](https://refivu.com/en/papers/d1a4fc27-43e3-48ba-b0b6-d1a50a552670-embedding-entities-and-relations-for-learning-and-inference.md)
- [PointRCNN: 3D Object Proposal Generation and Detection from Point Cloud](https://refivu.com/en/papers/fd8426c6-d509-42eb-acc7-0541fd5f7fdd-pointrcnn-3d-object-proposal-generation-and-detection-from.md)
- [A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks](https://refivu.com/en/papers/22cf25fe-084f-44ca-aecf-bc06457c3a2c-a-baseline-for-detecting-misclassified-and-out-of.md)
- [$π\_0$: A Vision-Language-Action Flow Model for General Robot Control](https://refivu.com/en/papers/ad843b5e-218a-430e-9583-5911212661b1-0-a-vision-language-action-flow-model-for.md)

## Terms in this paper

- [Maximum Mean Discrepancy](https://refivu.com/en/terms/2b1ea1367bf7-maximum-mean-discrepancy)
- [DaNN](https://refivu.com/en/terms/49c630ccc398-dann)
- [DeCAF](https://refivu.com/en/terms/fda9cdae5064-decaf)
- [multi-class accuracy](https://refivu.com/en/terms/abab52b00964-multi-class-accuracy)
- [Ofﬁce dataset](https://refivu.com/en/terms/ca4833a31cbd-office-dataset)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/78355c0b-ea0b-40c0-919e-e78a08fdcf93-deep-domain-confusion-maximizing-for-domain-invariance)
