# StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation

StarGAN translates images across many domains with one generator

Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, Jaegul Choo · arXiv · 2017-11-24

- **Problem** Pairwise GAN translators need a separate model for each pair of domains, so k domains require k(k−1) generators. Each one sees only two domains.
- **Method** StarGAN uses one generator that takes an input image and a target domain label, instead of a model per pair. It is trained with adversarial, domain classification and reconstruction losses.
- **Results** In a CelebA user study, StarGAN had the largest vote share in every single-attribute column, including 66.2% for hair color.

## Why pairwise translators do not scale

Translation methods built on GANs have so far handled one pair of domains at a time. Pix2pix, CycleGAN and DiscoGAN each learn a mapping between two domains, so covering a set of domains means building a separate model for each pair. Counting every ordered pair of k domains, k(k−1) generators have to be trained, so four domains already require twelve generator networks.

Each of those generators sees only two of the k domains, even though features such as face shape are shared by all of them, so the images of the other domains do not inform that model. Joint training across datasets is also blocked by partial labels. CelebA labels hair color and gender but has no expression labels, and RaFD does the reverse, so a reconstruction step that needs a complete label vector has no full label to use when the two datasets are merged.

## One generator conditioned on a target label

StarGAN replaces the set of pairwise models with one generator G. G takes an input image x and a target domain label c, and returns a translated image G(x,c). The label can be binary or one-hot, and this is how domain information enters the network. During training the target label is drawn at random for each input, so the generator sees many input-target combinations instead of one fixed translation such as black-to-blond hair.

At test time the chosen label selects the output domain.

The discriminator has two outputs. One gives Dsrc(x), a distribution over sources that separates real from fake; the other gives Dcls(x), a distribution over domain labels, so the discriminator is written as \\(D: x \\rightarrow \\{D\_{src}(x), D\_{cls}(x)\\}\\). The second output is an auxiliary classifier, and it lets one discriminator cover many domains without a separate network for each.

## Adversarial, classification and reconstruction terms

The adversarial term is the usual GAN objective, written \\\[L\_{adv} = E\_x\[\\log D\_{src}(x)\] + E\_{x,c}\[\\log(1 - D\_{src}(G(x,c)))\]\\\]. The discriminator maximizes it and the generator minimizes it, which pushes translated images toward ones the discriminator cannot separate from real images.

The domain classification loss has a real-image part and a fake-image part. For a real image x with its original label c′, the discriminator minimizes \\\[L\_{rcls} = E\_{x,c'}\[-\\log D\_{cls}(c'\|x)\]\\\], so real images are assigned to their own domain. For a translated image G(x,c), the generator minimizes \\\[L\_{fcls} = E\_{x,c}\[-\\log D\_{cls}(c\|G(x,c))\]\\\], so the translated image is classified as the target domain c.

Adversarial and classification terms do not by themselves keep the input content, because they do not require the output to match the input outside the domain-related part. A cycle-style reconstruction term closes this gap: the image is translated with label c and then translated back with the original label c′, and an L1 distance is taken to x.

The reconstruction term is \\\[L\_{rec} = E\_{x,c,c'}\[\\\|x - G(G(x,c),c')\\\|\_1\]\\\], and the same generator is applied twice.

The discriminator minimizes \\(L\_D = -L\_{adv} + \\lambda\_{cls} L\_{rcls}\\), and the generator minimizes \\(L\_G = L\_{adv} + \\lambda\_{cls} L\_{fcls} + \\lambda\_{rec} L\_{rec}\\). The weights are \\(\\lambda\_{cls} = 1\\) and \\(\\lambda\_{rec} = 10\\) in every experiment.

In the implementation the adversarial term is replaced by a Wasserstein GAN objective with a gradient penalty, meant to stabilize training. The penalty is evaluated at points \\(\\hat{x}\\) sampled uniformly along straight lines between a real image and a generated image, with \\(\\lambda\_{gp} = 10\\) in all experiments. The replacement is \\\[L\_{adv} = E\_x\[D\_{src}(x)\] - E\_{x,c}\[D\_{src}(G(x,c))\] - \\lambda\_{gp} E\_{\\hat{x}}\[(\\\|\\nabla\_{\\hat{x}} D\_{src}(\\hat{x})\\\|\_2 - 1)^2\]\\\].

## Architecture and training settings

The generator follows CycleGAN: two stride-two convolutions downsample the input, six residual blocks follow, and two stride-two transposed convolutions upsample it. Instance normalization is used in the generator and not in the discriminator. The discriminator is a PatchGAN-style network that judges whether local image patches are real or fake.

All models use Adam with β1 = 0.5 and β2 = 0.999, a batch size of 16, and one generator update after every five discriminator updates. On CelebA the learning rate is 0.0001 for the first 10 epochs and then decays linearly to 0 over the next 10 epochs. On RaFD training runs for 100 epochs at 0.0001 with the same decay over the next 100 epochs.

RaFD contains 4,824 images from 67 participants, and its images are cropped to 256×256 and resized to 128×128.

## Mask vector for partly labeled datasets

The mask vector m is an n-dimensional one-hot vector, where n is the number of datasets. The unified label is \\\[\\tilde{c} = \[c\_1, \\ldots, c\_n, m\]\\\], where ci is the label vector of the i-th dataset. Labels a dataset does not provide are set to zero. Binary attributes use a binary vector and categorical attributes a one-hot vector. In the experiments n is two, for CelebA and RaFD.

The generator receives \\(\\tilde{c}\\) as its label input. Its structure is the same as in single-dataset training except for the dimension of that input, so it learns to ignore zero-valued entries and act on the labeled group. The auxiliary classifier produces outputs for the labels of all datasets, but for a batch from one dataset only the classification error on that dataset's known labels is minimized.

Training alternates between CelebA and RaFD, so the discriminator learns discriminative features from both datasets and the generator learns to control the labels of both.

## Attribute transfer on CelebA

The CelebA comparison covers single and multi-attribute transfer against DIAT, CycleGAN and IcGAN. The cross-domain baselines were trained for every pair of attribute values, and for multiple attributes they were applied in several steps. Visual quality is higher than in the cross-domain baselines. The authors attribute this to a regularization effect of multi-task training, arguing that a fixed brown-to-blond mapping is prone to overfitting.

Compared with IcGAN, the authors report better preservation of facial identity, and they conjecture this comes from keeping spatial information in convolutional activation maps instead of a low-dimensional latent vector.

Quality was judged in an AMT perceptual study. Each worker saw an input and four randomly shuffled outputs from four methods, and chose the best by realism, quality of transfer and preservation of identity. The validated workers numbered 146 for the single-attribute study and 100 for the multi-attribute study.

In the single-attribute study StarGAN has the largest vote share in each column: 66.2% for hair color, 39.1% for gender and 70.6% for aged. The best baseline shares are 20.0% for CycleGAN on hair color, 31.4% for DIAT on gender and 13.3% for CycleGAN on aged. The gender margin is small, 39.1% for StarGAN against 31.4% for DIAT, so that column supports a weaker conclusion than the other two.

In the multi-attribute study StarGAN again has the largest share in every column: 47.4% for H+G, 61.5% for H+A, 49.8% for G+A and 52.2% for H+G+A. The gap is widest for G+A, 49.8% for StarGAN against 20.3% for IcGAN. The authors attribute the advantage on combined changes to training with randomly generated target labels, which exposes the generator to many attribute combinations.

## Expression synthesis on RaFD

The input is fixed to the neutral expression, and each method translates it to the seven remaining expressions. Qualitatively, the authors describe StarGAN as keeping identity and sharpness better; they describe many DIAT and CycleGAN outputs as blurry, and IcGAN sometimes produces male images for the input.

The authors attribute the sharper results to implicit data augmentation from multi-task training. RaFD has 500 images per domain, so DIAT and CycleGAN use 1,000 images for a two-domain pair, while StarGAN uses 4,000 images from all domains.

Translated images are scored by a ResNet-18 expression classifier trained on RaFD with a 90%/10% split for training and test. The classifier reaches 99.55% accuracy. Lower classification error means the classifier recognizes the translated expression more reliably, which the authors take as evidence of more realistic expressions.

The parameter column lists 52.6M × 7 for DIAT, 52.6M × 14 for CycleGAN, 67.8M × 1 for IcGAN and 53.2M × 1 for StarGAN. The authors describe StarGAN as seven times smaller than DIAT and fourteen times smaller than CycleGAN, because it needs one generator and discriminator pair whatever the number of domains.

## Joint training on CelebA and RaFD

StarGAN-JNT is trained on CelebA and RaFD with the mask vector, while StarGAN-SNG is trained only on RaFD. Both are used to synthesize expressions for CelebA images. StarGAN-JNT produces expressions of high visual quality, whereas StarGAN-SNG produces reasonable but blurry images with gray backgrounds.

The authors attribute the difference to StarGAN-JNT having translated CelebA images during training, and they suggest that shared low-level tasks such as facial keypoint detection and segmentation benefit from both datasets. No keypoint or segmentation test is reported in the text.

The correct mask for the RaFD label is \[0, 1\]. Feeding the wrong mask \[1, 0\] makes StarGAN-JNT fail to synthesize expressions and changes the age of the input instead. The authors explain this by the model treating the expression labels as unknown and the facial attribute labels as valid under the wrong mask. Since young is one of the facial attributes, a zero expression vector leads the model to age the face.

They read this as showing that the mask vector is used as intended.

## Limits of the evidence

The attribute transfer comparison rests on user votes from 146 workers for the single-attribute study and 100 for the multi-attribute study, each with four candidate outputs. The gender column of the single-attribute study has a small margin over DIAT, 39.1% against 31.4%.

The classifier-based classification error is reported only for RaFD expression synthesis. The CelebA expression results with joint training are qualitative comparisons. The comparisons use DIAT, CycleGAN and IcGAN as baselines only.

Joint training is tested with two datasets, so n is two in the experiments, and a mask vector over more datasets is not tested. The regularization explanation for visual quality and the low-level task explanation for joint training are the authors' interpretations, not measured results.

## Paper info

- **Authors**: Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, Jaegul Choo
- **Venue**: arXiv · Preprint
- **First published**: 2017-11-24
- **Added**: 2026-11-12
- **Updated**: 2018-9-21
- **Version**: v3
- **arXiv**: 1711.09020
- **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/1711.09020v3) · [PDF ↗](https://arxiv.org/pdf/1711.09020v3)

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

Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, Jaegul Choo (2017). StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation. arXiv:1711.09020v3. https://arxiv.org/abs/1711.09020v3

**BibTeX**

```
@misc{choi2017stargan,
  title = {{StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation}},
  author = {Yunjey Choi and Minje Choi and Munyoung Kim and Jung-Woo Ha and Sunghun Kim and Jaegul Choo},
  year = {2017},
  eprint = {1711.09020},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1711.09020v3}
}
```

## Other paper commentary

- [Variational Graph Auto-Encoders](https://refivu.com/en/papers/68c3cbf9-0251-40aa-bdb7-85593b91a6b5-variational-graph-auto-encoders.md)
- [Variational Inference: A Review for Statisticians](https://refivu.com/en/papers/9499b5e2-6ec4-4fcc-8d8e-4709801c41a4-variational-inference-a-review-for-statisticians.md)
- [High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs](https://refivu.com/en/papers/ad89d7a4-6049-4da7-8901-5fe971c7ff30-high-resolution-image-synthesis-and-semantic-manipulation.md)
- [ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks](https://refivu.com/en/papers/ebad818e-19ed-4df9-8fcf-6d62836fa124-esrgan-enhanced-super-resolution-generative-adversarial.md)
- [Least Squares Generative Adversarial Networks](https://refivu.com/en/papers/de7adb03-4a8a-4e01-93e9-d9d8b2434300-least-squares-generative-adversarial-networks.md)
- [Progressive Growing of GANs for Improved Quality, Stability, and Variation](https://refivu.com/en/papers/8be12dd7-41d4-4ddd-8e8c-ec44b2d70443-progressive-growing-of-gans-for-improved-quality-stability.md)
- [A Survey on Evaluation of Large Language Models](https://refivu.com/en/papers/46dfd405-ef56-4804-b283-8d9be353baaf-a-survey-on-evaluation-of-large-language-models.md)
- [Are Transformers Effective for Time Series Forecasting?](https://refivu.com/en/papers/a7a6536f-e2ff-47d4-b119-2c6e9038e858-are-transformers-effective-for-time-series-forecasting.md)
- [Knowledge Distillation: A Survey](https://refivu.com/en/papers/20b6ef99-85b3-42b7-9c02-384c6383f2ff-knowledge-distillation-a-survey.md)
- [Concrete Problems in AI Safety](https://refivu.com/en/papers/a0a18b13-f86b-4c61-807b-da6798f08495-concrete-problems-in-ai-safety.md)
- [Fast Graph Representation Learning with PyTorch Geometric](https://refivu.com/en/papers/52635461-7e10-4f67-b534-f791859538e1-fast-graph-representation-learning-with-pytorch-geometric.md)
- [Exploring Simple Siamese Representation Learning](https://refivu.com/en/papers/d32975a6-8149-4095-86b6-ad11d1642a75-exploring-simple-siamese-representation-learning.md)

## Terms in this paper

- [ADAM](https://refivu.com/en/terms/0e9ad0199e08-adam)
- [Multi-Task Learning](https://refivu.com/en/terms/89df753d67c1-multi-task-learning)
- [CycleGAN](https://refivu.com/en/terms/aa174ef15835-cyclegan)
- [adversarial loss](https://refivu.com/en/terms/6ecebb64a13d-adversarial-loss)
- [Reconstruction Loss](https://refivu.com/en/terms/58c946085188-reconstruction-loss)
- [ResNet-18](https://refivu.com/en/terms/1cdf53b7347d-resnet-18)
- [CelebA](https://refivu.com/en/terms/37ef27628b05-celeba)
- [Instance Normalization](https://refivu.com/en/terms/a80f303a09b9-instance-normalization)
- [PatchGAN](https://refivu.com/en/terms/efd550faca6e-patchgan)
- [cycle consistency loss](https://refivu.com/en/terms/6d0fc150199d-cycle-consistency-loss)
- [auxiliary classifier](https://refivu.com/en/terms/7b680209b82b-auxiliary-classifier)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/b61e89a8-05ef-4482-bc67-b5bed59283d8-stargan-unified-generative-adversarial-networks-for-multi)
