Toward Learning a Unified Many-to-Many Mapping for Diverse Image Translation

05/21/2019 ∙ by Wenju Xu, et al. ∙ 0

Image-to-image translation, which translates input images to a different domain with a learned one-to-one mapping, has achieved impressive success in recent years. The success of translation mainly relies on the network architecture to reserve the structural information while modify the appearance slightly at the pixel level through adversarial training. Although these networks are able to learn the mapping, the translated images are predictable without exclusion. It is more desirable to diversify them using image-to-image translation by introducing uncertainties, i.e., the generated images hold potential for variations in colors and textures in addition to the general similarity to the input images, and this happens in both the target and source domains. To this end, we propose a novel generative adversarial network (GAN) based model, InjectionGAN, to learn a many-to-many mapping. In this model, the input image is combined with latent variables, which comprise of domain-specific attribute and unspecific random variations. The domain-specific attribute indicates the target domain of the translation, while the unspecific random variations introduce uncertainty into the model. A unified framework is proposed to regroup these two parts and obtain diverse generations in each domain. Extensive experiments demonstrate that the diverse generations have high quality for the challenging image-to-image translation tasks where no pairing information of the training dataset exits. Both quantitative and qualitative results prove the superior performance of InjectionGAN over the state-of-the-art approaches.



There are no comments yet.


page 4

page 7

page 13

page 15

page 17

page 18

page 19

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Deep neural network models have shown great success in many pattern recognition and computer vision applications

[8, 20]. In recent years, image-to-image translation, which learns an one-to-one mapping by mapping the input images from the source domain to the target domain has attracted a lot of attention. Image translation requires the generated images not only to be with high visual quality but also should be perceptually consistent with the corresponding inputs. Some models [11, 40] even learn the one-to-one mapping relying on pairs of corresponding training images in two domains. Nevertheless, recent advances in deep generative models [12, 18] have achieved great success by adversarially learning the one-to-one mapping in real-world applications, such as changing attributes of faces [22, 3] and transferring the style of images [5, 17].

Conditional generative adversary networks (cGANs) are first employed for pixel-level image-to-image translation. Instead of generating images from random noise, the cGANs generate images conditioned on the input images. Its generator learns a one-to-one mapping that translates the input image to the target domain, while the discriminator is trained to discriminate the generated images from those real images in the target domain. It has been shown that these frameworks, such as Pix2pix [11] and CycleGAN [39], learn an impressive one-to-one deterministic mapping function which generates high quality samples in the target domain. The StarGAN [3]

was proposed to translate face images according to multiple face attributes. It combined one additional classifier with the discriminator so as to learn the mappings in a unified model. However, the generated samples are expectable without exception. A recent popular alternative approach to cGANs is the variational autoencoder (VAE)

[14]. It learns a distribution of the encoded latent codes, and matches it to a prior explicit distribution by minimizing a variational lower bound. When combined with GAN, it adversarially learns the latent codes from the observations and generate samples in different domains by either manipulating the encoded latent codes or adding additional labels. This model is usually referred to as the cVAEGAN. In the scenario of image-to-image translation, the BicycleGAN [40]

was the first one that successfully generates diverse samples with high quality. However, it requires paired dataset for learning a random variable which contains the variation in the learned one-to-many mapping. MUNIT model


learns the mapping in an unsupervised manner. This model generates diverse samples by separately learning the content and the style codes. The diversity comes by enforcing the style codes to be in a normal distribution. Even though these cVAEGAN models achieve diversity in image translation, they are inefficient for multi-domain translation as it needs to train one model for each pair of domains. The differences between these models are demonstrated in Figure


Figure 2: The proposed network architecture. Our model consists of three modules, a discriminator , a generator , and an encoder . The discriminator is built upon the patch discriminator. It also classifies the input images to its corresponding domain; the generator takes in as input containing the image, target domain label and additional latent code ; and the encoder tries to encode the image into latent code as additional information. The lost functions are defined in the text.

To overcome the above issues, we propose the InjectionGAN, a deep conditional generative model that unifies the generative adversarial network [6] and the variational autoencoder [14]

. Rather than directly generating deterministic images, the proposed InjectionGAN is designed to diversify the generation, i.e., the large variance among the generated image in all the target (even the original) domains. As demonstrated in Figure


, we augment the input by introducing additional information combining both unspecific factors of variation and specific ones of the target domain. The unspecific factors encapsulate the ambiguous aspects of the output learned from the whole training dataset. We inject the unspecific factors into the inputs for variation in the outputs. In other words, the proposed model implicitly injects additional information with the operations in the latent space. The specific ones specify the target domain of the output. We use a label (e.g., binary or one-hot vector) to represent the domain information, and the latent codes (e.g., random Gaussian) to represent the unspecific variation. During training, we randomly select a label indicating the target domain and draw the latent codes from a prior explicit distribution. Consequently, the many-to-many mapping is learned within one unified framework


The main contributions and features of the proposed model include:

  • A novel deep generative model is proposed for image-to-image translation. This model learns a many-to-many mapping function among multiple domains with unpaired training data.

  • The proposed model unifies the generative adversarial network and variational autoencoder to explore the latent space, which is indicated by domain-specific features and unspecific random variations.

  • A novel neural network structure is developed to combine the input images with latent variables. The input of the model is a combination of the observed image, domain-specific features, and unspecific variations. Within one unified framework, the trained model generates diverse samples in multiple domains.

  • The proposed model is qualitatively and quantitatively evaluated on multiple datasets with respect to style transfer and the facial attribute transfer tasks. Its diverse generations with high quality reflect a superior performance over baseline models.

We extensively evaluate the proposed model trained on edge photo, male female and face Emoji datasets. The experimental results demonstrate that the proposed InjectionGAN generates images with superior diversity and quality compared with the state-of-the-art methods, such as CycleGAN [39], BicyleGAN [40] and StarGAN [3].

The remainder of this paper is organized as follows. We briefly review the related work and provide some background in Section 2. In Section 3, our proposed approach is elaborated in details. Then Section 4 demonstrates the experimental results and analyses. Finally, this paper is concluded in Section 5.

2 Related work

Deep Generative Networks. Deep generative models have shown great potential in dealing with various computer vision tasks, such as image generation [35, 31, 4], image translation [40, 15] and face image synthesis [28, 37]. Two types of deep generative models are distinguished among recent related researches. The first one is the generative adversarial network (GAN) [6], which takes two components to seek a Nash equilibrium within the adversarial training scheme. It minimizes the discrepancy between the distributions of generated images and the true data through penalizing the ratio of these two distributions, and thus encourages the generations to be realistic. WGAN [1] utilize the Wasserstein distance as the metric of the discrepancy, and it shows impressive improvement in terms of generation quality and training stability. The second one is the variational autoencoder (VAE) [14, 16]. It learns to match an inferred posterior distribution to one explicit prior by optimizing a variational lower bound. One extension is the adversarial autoencoder [21], which matches an integral posterior distribution to the prior through adversarial learning. WAE [27] implements the similar idea by optimizing the Wasserstein distance between the latent codes distribution and the prior. The second type of approaches solve the problem of inference within the GAN framework at the cost of generation quality. We also take the advantage of GANs to guarantee the visual quality of generations.

Conditional GAN for Image-to-Image Translation. The problem of Image-to-image translation is to change the style or texture of the image while maintain other parts largely unchanged. Multiple works [12, 2] employ GAN-based architectures to perform image-to-image translation between two paired/unpaired sets of image collections. They belong to the category of conditional GANs (cGANs), since the generated images are conditioned on the input images. CycleGAN [39] employs the cycle consistency loss to constrain the dual domain mapping and thus to train the model in an unsupervised manner; similar ideas were proposed in [12] and [33]. The study [26] sought to add constraint on the latent codes; [18] explored the latent space by integrating the VAE and GAN. These image-to-image translation methods aim to change the image style across two different domains. The quality has been attained at the expense of diversity, as the generator learns to largely ignore unnecessary variation when conditioned on a relevant context. To enhance the diversity, the BicycleGAN [40] succeeded in generating diverse samples in the target domain after a supervised training on paired dataset. The recent MUNIT [10] was trained in an unsupervised manner. It generates diverse samples in both the source and the target domains. However, this model is inefficient in the field of multi-domain translation as it needs to learn a separate mapping for each pair of domains. In contrast, we attempt to generate diverse samples across multiple domains within one unified model, while ensure a relatively high visual quality of the generations.

Latent Space Exploring with GAN and VAE. Representation learning refers to the task of learning a representation of the data that can be easily exploited [29, 32]. Deep probabilistic models parameterize the learned representation by a neural network. [30] proposed an interpretable model to learn two types of representations: content and style of the images. An encoder-decoder structure was employed in [28] to learn both the generative and discriminative representations with strong supervision. In [32], the authors show that standard deep architectures can adversarially approximate to the latent space and explicitly represent factors of variation for image generation. [40] proposed a similar framework to introduce variations to the generated images, but this approach can just learn one direction mapping with paired training dataset.

In summary, these existing frameworks are capable of learning the relations under strong supervision. However, limited scalability has been shown in generating diverse outputs in both domains. Our approach attempts to integrate two generative models in one unified framework. It injects additional information into the latent space for diversity, and is adversarially trained to learn a many-to-many mapping between multiple domains.

3 Methods

3.1 Formulation

In this work, we aim at learning a many-to-many mapping in a unified framework. Let us denote the domain label as and the latent random variation as , which is added to avoid generating a deterministic output in the target domain. As shown in Figure 3, The input of the generator is a combination of the observed image, the domain label and the injected random information . Given the observed training data in the original domain and the observed training data in the target domain, our model contains four mappings: , , and . These four mappings are learned simultaneously in one generator , but distinguished with the input image and the target domain label. In the following section, we denote as the mappings without loss of generality.

At the training stage, an encoder is introduced to learn the low-dimensional latent codes , which will be injected to another input for unspecific variants. We randomly generate the target domain label , and then learn a variational mapping to the output. To enable stochastic sampling, we desire the latent code vector to be drawn from some prior distributions

, and we utilize a standard Gaussian distribution

in this work. In addition, we introduce one adversarial discriminator , aiming to distinguish between the input images and the generated images . Figure 3 illustrates the training process of our proposed approach. Note that the employed discriminator is coupled with an classifier, which enables the generator to produce diverse and realistic results in the domain denoted by the domain label .

Figure 3: The injected information consists of one specific target domain label and one unspecific variance of a latent code . With the injected information, our model is able to generate samples with variation in both domains.

3.2 Generative Adversarial Network

The original GAN [6] has achieved great success in producing realistic natural images [23] by establishing a min-max game between the generator and the discriminator. As the discriminator learns to distinguish the increasingly accurate fake images from the real ones, the generator is regularized to yield more realistic images. The training objective is written as


where generates image conditioned on the random noise , and attempts to distinguish between the real and the fake images .

3.3 GAN with Domain Classification

The original GAN is able to tell if the image is belong to one distribution. In case of multi-domain image-to-image translation, it requires to train the generator-discriminator pairs for each domain. To this end, we extent the GAN framework for multi-domain translations. We adopt an adversarial loss conditioned on the domain labels and the encoded latent codes , which is written as


where generates an image conditioned on the input image , the target domain label and the random codes . We attempt to translate the input images to the target domains indicated by . As the target domain label is selected randomly, our model gradually learns to translate images across each domain. Moreover, adding the random code introduces variations into the model.

In addition to distinguish the real images from the fake ones, we extend the discriminator by coupling an auxiliary domain classifier. As a minimal supervision, we assume that the input image and the original domain label pairs are available from the training dataset. Our goal is to generate multiple images in the target domain , and they are different from each other. These varieties derive from the injected . According to this argument, we add the auxiliary classifier on top of and impose the domain classification loss


where the term

represents a probability distribution over domain labels computed by

. By minimizing this objective, is trained to enforce the generated images conditioned on the domain label. Note that the target domain label could be either the original domain label or a different one. As a result, the generator produces diverse images in each domain through manually assigning the domain label .

3.4 Conditional VAE-GAN with Latent Consistency

Injecting the random codes , which contain the colors and textures information, introduces variations into the model. To learn these latent semantic representations, we resort to variational autoencoder. In VAE model, generating samples can be seen as the regrouping of the latent codes

given the input image x. The joint distribution over the pair

is given by , where is the prior distribution over the latent variables and is the conditional likelihood function of the input image . Let be a random vector with a multi-variant Gaussian distribution: . The sampling operation of can be implemented via = , using the re-parameterization trick, allowing direct back-propagation [14]. Thus, we have and . The networks are trained by minimizing the upper-bound on the expected negative log-likelihood of , which is given by


where the first term in Eqn. (5) corresponds to the reconstruction error, and the second term is a regularization term that encourages the posterior distribution to approximate the prior distributions. Next, we describe the two terms in details.

Injecting random variations into the generator, on one hand, diversifies the generations; on the other hand, makes the system unstable. Since the latent codes are randomly drawn, we minimize the cyclic loss to match the reconstructed image to the input image


The encoded latent codes distribution from the , in theory, should match a random Gaussian, which will enable sampling at the inference time, when the data distribution is intractable. It is important to enforce the latent codes to learn the information for variations and it is also equally important to force the encoded latent codes distribution approximate the prior distribution . To this end, we optimize the model by penalizing the divergence between the encoded codes distribution and the prior


In our work, we directly encode the generated image as , and enforce the latent codes to match the random sample from the prior . Consequently, the latent codes are encrypted with the unspecific variations (colors or textures), and the generator taking the information containing latent codes and the domain label yields diverse outputs in the target domain. Specifically, we start from a randomly drawn latent codes and attempt to recover it by requiring , which we denote as the latent code consistency.


The above objective function shares the key idea of latent consistency, where the encoded codes should be consistent with the randomly drawn latent codes. In this work, we employ the same operation to learn the latent codes in all domains.

3.5 Overall Training Objective

The trained model translates the input images to different domains and yields realistic images with variations introduced by the latent code . During training, we combine the domain classification objectives and the conditional VAE-GAN objective, and minimize a weighted sum of the above losses:


where , , and are hyper-parameters that control the relative importance of domain classification and information injection, respectively, compared to the adversarial loss. We use , , and in all of our experiments.

4 Experimental Evaluation

Our model aims at diversifying the translated images among different domains. In this section, we discuss the implementation in details, and compare the performance with the state-of-the-art methods on multiple datasets. We first quantitatively evaluate the performance on two datasets in terms of diversity and visual quality of the generations. Then we analyze the effects of the loss and the neural network architecture on the diversity. We finally demonstrate the generality of our algorithm on applications where paired data does not exist.

4.1 Implementation

Improved GAN Training. GAN models are notoriously hard to train. To stabilize the training process for generations with higher quality, we take the advantage of Wasserstein GAN with gradient penalty (WGAN-GP) [7], which is defined as



is the linear interpolation between a real image and a synthesized one. In our experiments, We set

for all tasks.

Network Architecture. The generator is based on the U-Net [24]

, which comprises of an encoder-decoder architecture. This structure is able to explore the latent space while maintain the spatial correspondence between the input and output with skip connections. The encoder and decoder are composed of several convolutional layers with stride size of two for downsampling and upsampling, respectively. Each convolutional layer of the decoder shares the component of the corresponding part of the encoder with skip connection. For the discriminator

, we leverage on patch discriminator [11, 39], which discriminates on whether the image patches are real or fake instead of the whole image. We add one additional convolutional layer after the second latest convolutional layer of the discriminator as the domain classifier. The encoder comprises of a few convolutional and downsampling layers, which ensure the exploration of the latent space.

Datasets. To demonstrate the plausibility of the proposed method, we evaluate the model qualitatively and quantitatively on two existing open datasets, and one collected dataset. All the tasks focus on diversifying the generations while maintaining high image quality. The learned many-to-many mappings include: edge photo, male female, and face Emoji [26]. The datasets are organized as

  • Edge Photo. The dataset is downloaded from [34] and [38]. It contains paired images where the ground truth of input-output pairs are available. Here, we train the model without using the paired information, instead, we utilize the ground truth for comparison.

  • Male Female. The CelebA [19] dataset is for attribute-based translation of face images. In our experiment, each image contains a male face or female face. We perform the many-to-many translation by learning the mapping between the male and female attributes.

  • Face Emoji, inspired by [26]. Our model is trained to learn the mapping on the data from two different domains. One domain is composed of real-world frontal-face images from the CelebA dataset. As a preprocessing step, we align the faces based on the location of eyes and mouth, and remove the background. The other domain contains the Emoji and we take the same preprocessing step to align the Emoji. For each domain, the corresponding training image collection consists of 1,200 images.

Method Ours StarGAN CycleGAN BicycleGAN pix2pix pix2pix+
Paired data
Table 1: Comparison with baseline methods with respect to the training datasets and the learned mapping function. The row starts with “paired data” points out the requirement on the dataset. the one-to-one represents the one domain to one domain translation, while many-to-many represents the many domains to many domains translation.

Training details. We train the models using Adam [13] with and

, and we train all models for 100 epochs with a learning rate of 0.0001 and apply the same decaying strategy over the next 100 epochs. Following the training scheme proposed in

[1, 7], we update the generator five times then update the discriminator one time. We train all the models on images and the batch size is set to 16. For data augmentation, we first resize the image to , then random crop the image to , and flip the images horizontally with a probability of 0.5. Training is performed on a single NVIDIA Tesla K80 GPU.

Compared methods. We take multiple state-of-the-art models as baselines. Table 1 illustrates the characteristics of each approach. BicyleGAN [40] diversifies the generations by exploring latent variables, but it relies on paired training images to learn an one-directional mapping, which is an extension of Pixel2pix [11] and Pixel2pix+noise. The CycleGAN [39] learns bidirectional mapping by employing unpaired training images. This model translates the input images between two domains at one training, but it needs multiple steps to train models for multiple domain translation. A recent work of StarGAN [3] addresses this limitation by learning a unified structure that maps input images to multi-domains. However, it dose not explore the latent space and fail to generate diverse samples in each domain. While the proposed model is a unified architecture to diversify generations in multiple domains (i.e., combining the latent variables and the domain label as a vector). It does not require pairwise training data for learning multi-domain mapping.

Evaluation metrics. To quantitatively evaluate the performance in terms of the generation diversity, we report the Learned Perceptual Image Patch Similarity (LPIPS) metric proposed in [36] as the diversity score. This metric is a perceptual distance to assess diversity of the outputs. For each method, we compute the average distance between randomly generated output images.

In order to quantitatively assess the quality of the synthesized images, we employ the Frechet Inception Distance (FID) introduced in [9], which is a measure of similarity between the images of two datasets. It is shown to correlate well with human judgment of realism and faithfulness of the generations. We report the results based on random generated samples.

4.2 Quantitative Comparison against Baselines

In this subsection, we quantitatively compare the performances against baseline methods on the Edge photo and Female Male datasets. We obtain the generation with the random codes , the domain label and the input image . The codes are randomly drawn from Gaussian distribution, and the target domain label is assigned to indicate either the original or a different domain. By regrouping the random codes and target domain label at each time, the model generates different samples in the target domain.

4.2.1 Edge Photo

We learn a unified bi-direction mapping, which translate the images between four domain pairs in one framework. This model is trained without any pairing information, even though the paired images are provided in this dataset. To illuminate the learned mappings, we qualitatively show the input images and the translated images in both domains. Figure 3(a) presents the generations from two mappings: photo edge and photo photo. Figure 3(b) contains the generations from the other two mappings: edge edge and edge photo. All these four mappings are learned in one generator .

(a) Given edge images as inputs, our model generates samples in both domains. It is evident that the translated generations are able to capture different colors, while the samples generated by the CycleGAN do not have such variation.

(b) The proposed model takes the edge images as input and achieves diversity in the photo domain. Note that the BicycleGAN is trained with paired dataset and can only learn an one-direction mapping (Edge Photo).
Figure 4: Demonstration of the diverse generations from the ’edge photo’ task.
Realism Diversity
Method FID score LPIPS
Random real img 1.26 0.265
pix2pix+noise 20.67 0.012
pix2pix 14.50 0.009
CycleGAN 31.04 0.009
MUNIT 12.84 0.109
BicycleGAN 8.39 0.111
InjectionGAN 41.25 0.139
InjectionGAN 27.45 0.095
InjectionGAN 23.01 0.090
InjectionGAN (edgephoto) 20.25 0.107
InjectionGAN (photophoto) 11.49 0.088
Table 2: Realism vs diversity. We measure diversity using average LPIPS distance, and realism using a real vs. fake on the Edge Photo task. The pix2pix+noise baseline produces little diversity. The hybrid BicycleGAN method produces results which have higher realism while maintaining diversity

Diversity. For comparison, all the baseline models are trained to map the edge images to shoe images, and the InjectionGAN generates photo images in two directions: edgephoto and photophoto. We report the LPIPS score of the translated photo images as the measurement of diversity. The LPIPS scores for each method are listed in Figure 2. Random ground truth shoe images produce an average variation of

. The pix2pix and CycleGAN systems yield fixed point estimates in the photo domain, which is proved by the low LPIPS scores. Adding noise to the system pix2pix+noise slightly increase the score, confirming that adding noise without any encoded information does not produce large variations. The InjectionGAN models put explicit constraints on the latent space. This method produces higher diversity scores than the cGANs regardless of the quality. Since unnatural images containing meaningless variations may yield high diversity scores, we next compare the performances in terms of the visual realism of the generations.

Realism. The FID scores are listed in Table 2, which reflect the visual quality and faithfulness of the synthesized images. The BicycleGAN performs the best in terms of FID score. Note that it takes paired images for training. The pix2pix+noise and CycleGAN models, translating images at the pixel level, achieve high realism score. The InjectionGAN achieves competitive performance with a little lower FID score as it learns the latent space as a structure. Comparisons between these models show that the autoencoder based models explore the latent space, which introduces uncertainty to the model. They generate diverse outputs but the FID scores of the synthesized images are relatively lower, while the cGANs, translating images in pixel level, yield images with high quality at the cost of diversity.

4.2.2 Male Female

We employ our model to learn another bi-directional mapping between the male and female images. This model is trained with the same hyper parameters. Figure 5 shows the synthesized images. It is evident that our model introduces meaningful variations in the generated faces without compromising the visual quality. The quantitative results are reported in Table 3. The results demonstrate that the proposed model generates diverse faces in both domains, which highlights the importance of injecting additional information. We then quantitatively evaluate the effects of the network architecture and the on diversity and quality.

Figure 5: Giver a male or female face, we generate 7 128 x 128 faces in each domain.
Real img 1.26 0.254
CycleGAN 7.58 0.031
InjectionGAN (male female) 10.25 0.108
InjectionGAN (male male) 6.49 0.069
Table 3: Comparison to Baseline methods on the male female task.
Method Weight FID LPIPS
Real img 1.26 0.254
8.38 0.011
ResNet 9.38 0.013
10.39 0.027
7.12 0.039
Unet 10.25 0.108
34.30 0.214
Table 4: The performance with respect to different generator architectures and weights of .
(a) Resnet
(b) Unet
Figure 6: The effects of different on the the performance of Resnet and Unet.

Analysis of the loss function.

In Table 4, we compare against the latent loss with different weights . Increasing the latent loss substantially degrades the quality of results, while enhancing the diversity. We therefore conclude that this latent loss term is critical for the diversity of our results. In the other experiments, we set as a trade-off between the generations’ diversity and quality.

Resnet vs Unet. Our model learns the many-to-many mappings by employing the U-Net as the base architecture, which enables our model to generate samples partially controlled by the randomly drawn latent codes . By learning the latent space a structure, our model yields stochastic generations in both domains. By contrast, the cGANs utilizing the residual blocks for pixel level translation, such as Cyclegan [39] and StarGan [3], make fixed generations for each input image. We observe that the generated images using residual blocks are very close to the original inputs with a low LPIPS score, which is evident in Figure 6.

(a) Example results on unpaired datasets of emoji face.

(b) Given an photo as input, we generate samples in both domains.
Figure 7: Example results on unpaired datasets of emoji face.

4.3 Qualitative Evaluation on the Application of Unpaired Dataset

We qualitatively demonstrate the proposed method on three applications where paired training data dose not exist. All the generated samples are the outputs of given the randomly drawn codes , assigned target domain label and the input image . We observe that translations with diversity are often more appealing than those generations without uncertainty.

Face Emoji. This application is inspired by [26], which translates human face to Emoji in one direction. This model is trained with an additional constraint on the consistency of latent codes so as to reserve the facial characteristics. However, the generated images are fixed samples and not exactly faithful to the input images. We learn the proposed model as a bi-directional mapping. In one direction, it can be employed to translate the photos of human face to Emoji and translate the generated Emoji back to photos. In another direction, it is able to start with the Emoji as input and generate diverse images in both domains. In Figure 6(a) and Figure 6(b), we list eight randomly translated samples for each input image. Taking the Emoji as input, our model faithfully generates diverse translated human face images along the direction Emoji photo. In addition, it produces Emoji with different colors in the original domain with the mapping Emoji Emoji. Conditioned on the photo as input, our model can also introduce diverse generations in both domains.

Figure 8: Conditional generation given attributes. We sample a set of attributes from the data distribution and generate 4 faces for each attributes.

Facial attribute transfer. Facial attribute transfer is one of the challenging multi-domain transformation task as it requires the model to map the input to several domains with one unified framework. The pixel2pixel and CycleGAN are able to learn a one to one mapping at one training step, and need to train several times for each pair of domains within the multi-domain translation task. We evaluate the proposed method on the facial attribute transfer task. As a baseline method, we train the cross-domain models StarGAN [3], which learns a one-to-many mapping function in one framework. Conditioned on the inputs, the trained model generates images with the selected attributes.

(a) The face images from each domain of this dataset.

(b) Given an photo as input, we generate samples in all domains.
Figure 9: Diverse generation for face style translation task.

In Figure 8, we visualize the results where we translate several images that do not have blond hair, male, goatee, and eyeglass to the corresponding images with each of the individual attributes. We notice that our method not only provides a high visual quality of translation results in each target domain, but also outperforms the StarGAN in terms of diversity. We observe that the StarGAN successfully translates the input images into each domain but without any variations within each target domain. In other words, rather than training a model to perform a fixed translation (e.g., input blond hair), which is prone to over-fitting, we train our model to flexibly translate images conditioned on the target domain label and randomly drawn latent codes. This allows our model to learn reliable features universally applicable to multiple domains of images with different facial attribute values.

Face style translation. In this task, our model is able to change the style of input images based on the injected random codes z and domain label c across five domains. Figure 8(b) presents the synthesized results from the model trained on the dataset, which contains photos from five different sources, namely the natural human face, two Emoji-style faces , Anime face, and cat face. Different to the existing cGANs, which needs to learn a bi-directional mapping for each pair of domains, our model learns a universal mapping within one unified generator. Moreover, injecting latent codes encourages to change the color composition for diversity. For example, given one input image and the target domain label, the generator often maps the input image to the target domain with different colors, because such a many-to-many mapping is equally valid under the domain classification loss and the adversary loss.

5 Conclusion

To diversify the generation in the image-to-image translation, we have proposed the InjectionGAN, which learns a many-to-many mapping in one unified framework. This model learns the additional information, such as the colors and textures, into the latent codes and injects the information into another image for diversity. Benefiting from the domain label, we can manually select the target domain so as to inject these variations into any domain. The experimental results illustrate that injecting additional information into the input image is a promising approach for many-to-many image translation tasks which involve color and texture changes. The proposed method succeeds in diverse generations and outperforms the state-of-the-art approaches. When combining with the domain label, the model also induces changes in the original domain, which enables a great potential for a wide variety of applications. As a follow-up study, it is appealing to learn a mapping across multiple domains with large domain gap, such as the objects’ shape (cat dog). However, both the Unet and Resnet are not effective to learn this mapping. One possible way is to increase the receptive field in the discriminator. This task is very challenging in terms of diversity and faithful reconstruction. We hope to learn a unified model to enable effective and efficient translation across multiple domains with large domain gap in the future.


  • [1]

    Arjovsky, M., Chintala, S., Bottou, L.: Wasserstein generative adversarial networks. International Conference on Machine Learning (2017)

  • [2] Bousmalis, K., Silberman, N., Dohan, D., Erhan, D., Krishnan, D.: Unsupervised pixel-level domain adaptation with generative adversarial networks. The IEEE Conference on Computer Vision and Pattern Recognition (2017)
  • [3] Choi, Y., Choi, M., Kim, M., Ha, J.W., Kim, S., Choo, J.: Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (2018)
  • [4] Dumoulin, V., Belghazi, I., Poole, B., Mastropietro, O., Lamb, A., Arjovsky, M., Courville, A.: Adversarially learned inference. International Conference on Learning Representations (2017)
  • [5]

    Gatys, L.A., Ecker, A.S., Bethge, M.: Image style transfer using convolutional neural networks. Conference on Computer Vision and Pattern Recognition (2016)

  • [6] Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. Advances in neural information processing systems (2014)
  • [7] Gulrajani, I., Ahmed, F., Arjovsky, M., Dumoulin, V., Courville, A.C.: Improved training of wasserstein gans. Advances in Neural Information Processing Systems pp. 5769–5779 (2017)
  • [8] He, L., Wang, G., Hu, Z.: Learning depth from single images with deep neural network embedding focal length. IEEE Transactions on Image Processing 27(9), 4676–4689 (2018)
  • [9] Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in Neural Information Processing Systems (2017)
  • [10] Huang, X., Liu, M.Y., Belongie, S., Kautz, J.: Multimodal unsupervised image-to-image translation. European Conference on Computer Vision (2018)
  • [11]

    Isola, P., Zhu, J.Y., Zhou, T., Efros, A.A.: Image-to-image translation with conditional adversarial networks. IEEE Conference on Computer Vision and Pattern Recognition (2017)

  • [12] Kim, T., Cha, M., Kim, H., Lee, J., Kim, J.: Learning to discover cross-domain relations with generative adversarial networks. International Conference on Machine Learning (2017)
  • [13] Kingma, D., Ba, J.: Adam: A method for stochastic optimization. International Conference on Learning Representations (2015)
  • [14] Kingma, D.P., Welling, M.: Auto-encoding variational bayes. International Conference on Learning Representations (2014)
  • [15] Larsen, A.B.L., Sønderby, S.K., Larochelle, H., Winther, O.: Autoencoding beyond pixels using a learned similarity metric. International Conference on Machine Learning 48, 1558–1566 (2016)
  • [16] Li, F., Qiao, H., Zhang, B.: Discriminatively boosted image clustering with fully convolutional auto-encoders. Pattern Recognition (2018)
  • [17] Li, Y., Fang, C., Yang, J., Wang, Z., Lu, X., Yang, M.H.: Diversified texture synthesis with feed-forward networks. IEEE Conference on Computer Vision and Pattern Recognition (2017)
  • [18] Liu, M.Y., Breuel, T., Kautz, J.: Unsupervised image-to-image translation networks. Advances in Neural Information Processing Systems (2017)
  • [19]

    Liu, Z., Luo, P., Wang, X., Tang, X.: Deep learning face attributes in the wild. International Conference on Computer Vision (2015)

  • [20] Ma, W., Wu, Y., Wang, Z., Wang, G.: Mdcn: Multi-scale, deep inception convolutional neural networks for efficient object detection. In: 2018 24th International Conference on Pattern Recognition (ICPR). pp. 2510–2515. IEEE (2018)
  • [21] Makhzani, A., Shlens, J., Jaitly, N., Goodfellow, I., Frey, B.: Adversarial autoencoders. Workshop Track of International Conference on Learning Representations (2016)
  • [22]

    Peng, C., Gao, X., Wang, N., Li, J.: Face recognition from multiple stylistic sketches: Scenarios, datasets and evaluation. Pattern Recognition

    84, 262 – 272 (2018)
  • [23] Radford, A., Metz, L., Chintala, S.: Unsupervised representation learning with deep convolutional generative adversarial networks. International Conference on Learning Representations (2016)
  • [24] Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedical image segmentation. International Conference on Medical image computing and computer-assisted intervention pp. 234–241 (2015)
  • [25]

    Shiqi, Y., Haifeng, C., Qing, W., Linlin, S., Yongzhen, H.: Invariant feature extraction for gait recognition using only one uniform model. Neurocomputing

    239, 81 – 93 (2017)
  • [26] Taigman, Y., Polyak, A., Wolf, L.: Unsupervised cross-domain image generation. International Conference on Learning Representations (2017)
  • [27] Tolstikhin, I., Bousquet, O., Gelly, S., Schoelkopf, B.: Wasserstein auto-encoders. International Conference on Learning Representations (2018)
  • [28]

    Tran, L., Yin, X., Liu, X.: Disentangled representation learning gan for pose-invariant face recognition. IEEE Conference on Computer Vision and Pattern Recognition (2017)

  • [29] Wang, M., Panagakis, Y., Snape, P., Zafeiriou, S.P.: Disentangling the modes of variation in unlabelled data. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI) 40(11), 2682–2695 (2018)
  • [30] Wang, X., Gupta, A.: Generative image modeling using style and structure adversarial networks. European Conference on Computer Vision (2016)
  • [31] Xie, J., Lu, Y., Gao, R., Zhu, S.C., Wu, Y.N.: Cooperative training of descriptor and generator networks. IEEE transactions on pattern analysis and machine intelligence (PAMI) (2018)
  • [32] Xu, W., Shawn, K., Wang, G.: Adversarially approximated autoencoder for image generation and manipulation. IEEE Transactions on Multimedia (2019)
  • [33] Yi, Z., Zhang, H., Gong, P.T., et al.: Dualgan: Unsupervised dual learning for image-to-image translation. International Conference on Computer Vision (2017)
  • [34] Yu, A., Grauman, K.: Fine-grained visual comparisons with local learning. IEEE Conference on Computer Vision and Pattern Recognition (2014)
  • [35] Yu, S., Liao, R., An, W., Chen, H.: Gaitganv2: Invariant gait feature extraction using generative adversarial networks. Pattern Recognition (2019)
  • [36]

    Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. IEEE Conference on Computer Vision and Pattern Recognition (2018)

  • [37] Zhang, Z., Song, Y., Qi, H.: Age progression/regression by conditional adversarial autoencoder. IEEE Conference on Computer Vision and Pattern Recognition (2017)
  • [38] Zhu, J.Y., Krähenbühl, P., Shechtman, E., Efros, A.A.: Generative visual manipulation on the natural image manifold. European Conference on Computer Vision (2016)
  • [39] Zhu, J.Y., Park, T., Isola, P., Efros, A.A.: Unpaired image-to-image translation using cycle-consistent adversarial networks. International Conference on Computer Vision (2017)
  • [40] Zhu, J.Y., Zhang, R., Pathak, D., Darrell, T., Efros, A.A., Wang, O., Shechtman, E.: Toward multimodal image-to-image translation. Advances in Neural Information Processing Systems pp. 465–476 (2017)