# Maximum Classifier Discrepancy for Unsupervised Domain Adaptation

Adversarial classifier disagreement helps models adapt to unlabeled target domains

Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, Tatsuya Harada · arXiv · 2017-12-7

- **Problem** Adversarial domain adaptation trains a domain classifier that ignores task decision boundaries. So generated target features can land near class boundaries and get misclassified.
- **Method** Maximum Classifier Discrepancy uses two task classifiers on one shared generator. It finds target samples where they disagree, then trains the generator to remove that disagreement.
- **Results** On SVHN to MNIST at n = 4, the method reaches 96.2±0.4 accuracy, against 67.1 for Source Only.

## Why a domain classifier alone can misplace target features

The setting is unsupervised domain adaptation: labeled source images are available, but target images come without labels, and the model must still perform well on the target domain. A common response is adversarial feature alignment. A domain classifier tries to tell source features from target features, and a feature generator is updated to make its features look like the other domain's features to that classifier.

The weakness the authors point to is that the domain classifier never looks at the task's decision boundary, so the alignment is blind to which side of a class boundary a feature falls on. A generator can make the two feature distributions look alike while placing target features close to a class boundary, where they are more easily misclassified.

Matching the two distributions completely is also hard, because each domain has its own characteristics.

## Classifier disagreement as the adaptation signal

The method replaces the domain classifier with two task-specific classifiers, F1 and F2, that sit on top of one shared feature generator G. The generator receives either a labeled source image or an unlabeled target image. Both classifiers are trained on labeled source samples, so each one is reliable on the labeled domain before any target signal is used.

The reasoning is that target samples far from the labeled-domain support tend to receive different labels from two classifiers that start from different initializations. The disagreement between the two classifiers therefore serves as a detector for those target samples, and the generator is then trained to shrink it. The method uses no domain labels.

## The discrepancy loss and the three update steps

The disagreement is measured per target input as the mean, over the K classes, of the absolute difference between the two classifiers' probability outputs. \\\[ d(p\_1,p\_2)=\\frac{1}{K}\\sum\_{k=1}^{K}\\left\|p\_{1k}-p\_{2k}\\right\| \\\] Averaging d over the target samples gives the adversarial term used in both adversarial steps, \\( \\mathcal{L}\_{adv}(X\_t)=\\mathbb{E}\_{x\_t\\sim X\_t}\[d(p\_1(y\|x\_t),p\_2(y\|x\_t))\] \\).

The authors chose the L1 form and report that an L2 version did not work well in their experiments.

Step A trains G, F1 and F2 together on labeled source samples with softmax cross entropy, which gives the classifiers and the generator discriminative features for the labeled domain. \\\[ \\min\_{G,F\_1,F\_2}\\mathcal{L}(X\_s,Y\_s), \\quad \\mathcal{L}(X\_s,Y\_s)=-\\mathbb{E}\_{(x\_s,y\_s)\\sim(X\_s,Y\_s)}\\sum\_{k=1}^{K}\\mathbb{1}\[k=y\_s\]\\log p(y\|x\_s) \\\]

Step B freezes the generator and updates F1 and F2 to keep the source classification loss low while increasing the discrepancy on target samples. The same number of source and target samples is used in this update. Step C freezes F1 and F2 and updates only G to minimize the target discrepancy. The authors repeat this update n times on the same mini-batch, and n is a hyperparameter that sets the trade-off between the generator and the classifiers.

\\\[ \\min\_G \\mathcal{L}\_{adv}(X\_t) \\\]

The three steps repeat during training. The authors state that the order of the steps is not important, and what matters is that the classifiers and generator train adversarially while still classifying source samples correctly.

## Link to the H∆H-distance bound

Theorem 1 bounds the target error of any hypothesis h in H by its source error, plus one half of the H∆H-distance, plus the shared error term λ. The same bound holds with the H-distance in place of the H∆H-distance. \\\[ R\_T(h)\\le R\_S(h)+\\tfrac{1}{2}d\_{H\\Delta H}(S,T)+\\lambda\\le R\_S(h)+\\tfrac{1}{2}d\_{H}(S,T)+\\lambda \\\]

If the two hypotheses classify source samples correctly, their disagreement on source samples is small. Under that assumption the H∆H-distance is approximated by the supremum of the expected disagreement on target samples. Assuming the two hypotheses share the feature extractor G, with F1 and F2 as their heads, this supremum becomes a supremum over F1 and F2 of the target disagreement \\( \\mathbb{E}\_{x\\sim T}\\mathbb{I}\[F\_1\\circ G(x)\\neq F\_2\\circ G(x)\] \\) for fixed G.

The authors note that all networks must also minimize the source classification loss, which this derivation does not include, and they still describe the connection to the theory as visible.

## Two-moons toy problem

The toy problem uses two interleaving moons, labeled 0 and 1, with target samples produced by rotating the source distribution. Training uses 300 source and target samples per class, and evaluation uses 1000 target samples. Three models are compared: one trained only on source samples, one trained to increase the discrepancy without Step C, and the full method.

Without Step C, the two classifiers disagree strongly on the target samples. The source-only model's two boundaries lie nearly on top of each other, so the boundaries in the source-only case do not separate the two classifiers. With the full method, the two classifiers output nearly the same prediction on target samples, and the text says they classify most target samples correctly.

The text gives this result qualitatively, with no accuracy value for this toy setting.

## Digit and traffic sign adaptation

Table 1 covers five columns: SVHN to MNIST, SYN SIGNS to GTSRB, MNIST to USPS, MNIST\* to USPS\* and USPS to MNIST. Accuracy on target test samples is taken from classifier F1 and averaged over five repetitions. Adam is used with learning rate 2.0×10−4 and batch size 128, and n is varied from 2 to 4.

On SVHN to MNIST the method reached 96.2±0.4 at n = 4, against 67.1 for Source Only, 76.0±1.8 for ADDA and 71.1 for DANN. On SYN SIGNS to GTSRB it reached 94.4±0.3 at n = 4, against 88.7 for DANN. The table's ATDA entry is higher at 96.2, but the authors note that ATDA used a few labeled target samples for validation.

The MNIST to USPS and USPS to MNIST columns follow the ADDA and PixelDA protocols, where the method reached 94.2±0.3 and 94.1±0.3 at n = 4. In the MNIST\* to USPS\* column, PixelDA scores 95.9, which exceeds the method at n = 2 (93.1±1.9) and n = 3 (95.6±0.9); only n = 4, at 96.5±0.3, is higher. Across all five columns, accuracy rises as n goes from 2 to 4, and the authors state that the method outperformed the listed distribution-matching methods in all settings.

## VisDA object classification

The source domain has 152,397 synthetic images, and the target is the 55,388-image validation split collected from MSCOCO. The model is a ResNet101 pre-trained on ImageNet with its final fully connected layer removed, trained with SGD at learning rate 1.0×10−3 and batch size 32. Accuracy is reported after 10 epochs.

The mean accuracy of the method is 69.7 at n = 2, 70.6 at n = 3 and 71.9 at n = 4. The corresponding values are 61.1 for MMD, 57.4 for DANN and 52.4 for Source Only. MMD and DANN fall below Source Only in some categories, such as car and plant.

The authors attribute the rise with n to the large difference between synthetic renderings and real images, which requires the generator to be updated many times.

## Semantic segmentation from GTA5 and Synthia

The source is GTA5 or Synthia and the target is Cityscapes. The Cityscapes validation set serves as the test set, the training split is used for training, and the batch size is 1. Performance is measured by mIoU. The models are VGG-16 based FCN-8s and DRN-D-105. Momentum SGD uses momentum 0.9 and learning rate 1.0×10−3, inputs are resized to 1024×512, and the reported output of F1 is taken after 50,000 iterations.

On GTA5 to Cityscapes with DRN-105, Source Only reaches 22.2 mIoU and DANN 32.8. The method reaches 39.7 at k = 2, 38.9 at k = 3 and 38.1 at k = 4, so the k = 2 setting is the highest in this row. The segmentation tables write the update count as k rather than n. With VGG-16, Source Only reaches 24.9 and the method reaches 28.0, 27.3 and 28.8 at k = 2, 3 and 4.

On Synthia to Cityscapes with DRN-105, Source Only reaches 23.4 mIoU and DANN 32.5. The method reaches 36.3 at k = 2, 37.3 at k = 3 and 37.2 at k = 4.

## Role of the source classification loss in Step B

The classification loss on source samples is kept in Step B, next to the discrepancy term. Dropping it in an ablation makes performance drop significantly, according to the authors. The text does not give a numeric size for this drop, so the ablation supports keeping the source term in Step B and nothing stronger.

## Limitations

n was varied only from 2 to 4 in the digit and traffic sign experiments.

The reported gains are not monotone in n everywhere. In the DRN-105 GTA5 to Cityscapes row, k = 2 has the highest mIoU, and the segmentation values are not compared across backbones or datasets as one experiment. The claim that the method outperforms the listed methods in all settings holds for the distribution-matching rows, but the MNIST\* to USPS\* column shows PixelDA above the n = 2 and n = 3 settings.

ATDA scores higher than the method in some settings, and the authors note that ATDA used a few labeled target samples.

The link to the H∆H-distance bound is argued from the bound rather than derived for the full training procedure. The toy experiment is one two-dimensional setting with a single rotation and a qualitative description of the result. Experiments cover the listed digit, traffic sign, VisDA and Cityscapes benchmarks, with one training length for segmentation and one architecture for VisDA.

## Paper info

- **Authors**: Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, Tatsuya Harada
- **Venue**: arXiv · Preprint
- **First published**: 2017-12-7
- **Added**: 2026-11-12
- **Updated**: 2018-4-3
- **Version**: v4
- **arXiv**: 1712.02560
- **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/1712.02560v4) · [PDF ↗](https://arxiv.org/pdf/1712.02560v4)

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

Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, Tatsuya Harada (2017). Maximum Classifier Discrepancy for Unsupervised Domain Adaptation. arXiv:1712.02560v4. https://arxiv.org/abs/1712.02560v4

**BibTeX**

```
@misc{saito2017maximum,
  title = {{Maximum Classifier Discrepancy for Unsupervised Domain Adaptation}},
  author = {Kuniaki Saito and Kohei Watanabe and Yoshitaka Ushiku and Tatsuya Harada},
  year = {2017},
  eprint = {1712.02560},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.02560v4}
}
```

## Other paper commentary

- [CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification](https://refivu.com/en/papers/a8519cc4-3678-45c7-b33a-b64e061e2edf-crossvit-cross-attention-multi-scale-vision-transformer-for.md)
- [Can Spatiotemporal 3D CNNs Retrace the History of 2D CNNs and ImageNet?](https://refivu.com/en/papers/ff09b689-9e24-41cf-a1f9-f6aba563b3f5-can-spatiotemporal-3d-cnns-retrace-the-history-of.md)
- [Segmenter: Transformer for Semantic Segmentation](https://refivu.com/en/papers/f33fa10d-9d05-48d0-9506-83f7da0f5f1e-segmenter-transformer-for-semantic-segmentation.md)
- [MultiResUNet : Rethinking the U-Net Architecture for Multimodal Biomedical Image Segmentation](https://refivu.com/en/papers/e99144f0-6aca-4598-b66e-67a4575f7fe4-multiresunet-rethinking-the-u-net-architecture-for.md)
- [MLP-Mixer: An all-MLP Architecture for Vision](https://refivu.com/en/papers/bf0a9095-e638-4ae5-bab6-5abf2b479763-mlp-mixer-an-all-mlp-architecture-for-vision.md)
- [SemanticKITTI: A Dataset for Semantic Scene Understanding of LiDAR Sequences](https://refivu.com/en/papers/304a0de8-6214-4d64-8649-0176464fb2d4-semantickitti-a-dataset-for-semantic-scene-understanding-of.md)
- [Dota 2 with Large Scale Deep Reinforcement Learning](https://refivu.com/en/papers/75855eab-2276-4a17-9eaa-6ee97e11ddb7-dota-2-with-large-scale-deep-reinforcement-learning.md)
- [Connecting the Dots: Multivariate Time Series Forecasting with Graph Neural Networks](https://refivu.com/en/papers/f0231d70-9d15-48d0-aa7c-c83cefdf69ab-connecting-the-dots-multivariate-time-series-forecasting.md)
- [On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima](https://refivu.com/en/papers/9954c18e-def9-48fe-bfea-2f52f4ed7acb-on-large-batch-training-for-deep-learning-generalization.md)
- [Principles alone cannot guarantee ethical AI](https://refivu.com/en/papers/0e47907c-e3eb-4d3b-9eb2-114a78e7ef9c-principles-alone-cannot-guarantee-ethical-ai.md)
- [KGAT: Knowledge Graph Attention Network for Recommendation](https://refivu.com/en/papers/c8788d47-0620-4271-bfbc-99d522ade86e-kgat-knowledge-graph-attention-network-for-recommendation.md)
- [Tensor Fusion Network for Multimodal Sentiment Analysis](https://refivu.com/en/papers/4fa58e5a-e78c-49d2-b78b-25f6eb2e5a71-tensor-fusion-network-for-multimodal-sentiment-analysis.md)

## Terms in this paper

- [Accuracy](https://refivu.com/en/terms/1995c0cd6282-accuracy)
- [MNIST](https://refivu.com/en/terms/28b9bb66d1c6-mnist)
- [Semantic segmentation](https://refivu.com/en/terms/00dfce7ec404-semantic-segmentation)
- [Cityscapes](https://refivu.com/en/terms/1067bb006500-cityscapes)
- [SVHN](https://refivu.com/en/terms/c24d35c2e4d0-svhn)
- [Maximum Mean Discrepancy](https://refivu.com/en/terms/2b1ea1367bf7-maximum-mean-discrepancy)
- [unsupervised domain adaptation](https://refivu.com/en/terms/d063363072e6-unsupervised-domain-adaptation)
- [Theorem 1](https://refivu.com/en/terms/bef18c102f5e-theorem-1)
- [USPS](https://refivu.com/en/terms/e96c044d254d-usps)
- [ADDA](https://refivu.com/en/terms/4c6ef2751acc-adda)
- [GTSRB](https://refivu.com/en/terms/005de92918a5-gtsrb)
- [Synthia](https://refivu.com/en/terms/a10cbd630fcc-synthia)
- [GTA5](https://refivu.com/en/terms/a3a16fd3da40-gta5)
- [Object classification](https://refivu.com/en/terms/ae3cfec93bc0-object-classification)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/22b90534-4c22-46ce-8bbe-924741648b13-maximum-classifier-discrepancy-for-unsupervised-domain)
