M3D-GAN: Multi-Modal Multi-Domain Translation with Universal Attention

  • 2019-07-09 19:33:01
  • Shuang Ma, Daniel McDuff, Yale Song
  • 33


Generative adversarial networks have led to significant advances incross-modal/domain translation. However, typically these networks are designedfor a specific task (e.g., dialogue generation or image synthesis, but notboth). We present a unified model, M3D-GAN, that can translate across a widerange of modalities (e.g., text, image, and speech) and domains (e.g.,attributes in images or emotions in speech). Our model consists of modalitysubnets that convert data from different modalities into unifiedrepresentations, and a unified computing body where data from differentmodalities share the same network architecture. We introduce a universalattention module that is jointly trained with the whole network and learns toencode a large range of domain information into a highly structured latentspace. We use this to control synthesis in novel ways, such as producingdiverse realistic pictures from a sketch or varying the emotion of synthesizedspeech. We evaluate our approach on extensive benchmark tasks, includingimage-to-image, text-to-image, image captioning, text-to-speech, speechrecognition, and machine translation. Our results show state-of-the-artperformance on some of the tasks.


Quick Read (beta)

M3D-GAN: Multi-Modal Multi-Domain Translation with Universal Attention

Shuang Ma
SUNY Buffalo
Buffalo, NY
[email protected]
   Daniel McDuff
Microsoft Research
Redmond, WA
[email protected]
   Yale Song
Microsoft Cognition
Redmond, WA
[email protected]

Generative adversarial networks have led to significant advances in cross-modal/domain translation. However, typically these networks are designed for a specific task (e.g., dialogue generation or image synthesis, but not both). We present a unified model, M3D-GAN, that can translate across a wide range of modalities (e.g., text, image, and speech) and domains (e.g., attributes in images or emotions in speech). Our model consists of modality subnets that convert data from different modalities into unified representations, and a unified computing body where data from different modalities share the same network architecture. We introduce a universal attention module that is jointly trained with the whole network and learns to encode a large range of domain information into a highly structured latent space. We use this to control synthesis in novel ways, such as producing diverse realistic pictures from a sketch or varying the emotion of synthesized speech. We evaluate our approach on extensive benchmark tasks, including image-to-image, text-to-image, image captioning, text-to-speech, speech recognition, and machine translation. Our results show state-of-the-art performance on some of the tasks.

Figure 1: We present a unified model that can translate across multiple modalities (synthesize text, images or audio from text, images or audio) and multiple domains (synthesize a diverse set of examples from a single source input with different attributes) in a controllable fashion.

1 Introduction

Generative adversarial networks [9] learn a mapping from source to target distributions, and have shown great performances in data translation tasks involving different modalities such as image, text, audio. These problems are typically multi-modal (e.g., text-to-speech or text-to-image), and the mappings are inherently one-to-many (e.g., the same sentence said with different emotions should sound different). Thus, it would be ideal if a model is able to learn a mapping across multiple modalities that also allows for the domain to be explicitly controlled.

We define each modality as a set of data of the same type, and each domain as a set of data with the same attribute value. For example, in Fig 1, text would be one modality, images another and audio yet another. Images captured at night represent one domain and images captured in the daytime represent another domain. A unified architecture would make the modeling more efficient and allow representations to be shared, even if they come from different domains or modalities.

In this work, we introduce a multi-modal multi-domain generative adversarial network (M3D-GAN) – a unified model that can translate across a wide range of modalities (e.g. image, text and speech) and domains (e.g., styles and attributes). We specifically focus on the ability to explicitly control the domain aspect, rather than randomly generating results as in the previous work [39]. Creating such an architecture is non-trivial for several reasons: (1) Different models are designed for different data types; it is non-trivial to extend them across different modalities (e.g., a network designed for text-to-image translation would not work for speech-to-text translation). (2) The mode collapse issue widely observed in GANs makes it difficult to produce diverse results. (3) The alternating training process in GANs makes it difficult to explicitly control the domain aspect in the synthesized output.

Our M3D-GAN consists of modality-specific sub-networks and a unified computing body. The former converts input samples from different modalities into unified representations. The majority of computation is done in the unified computing body, where the representations from all modalities share the same network (but not the weights). We achieve the cross-modality property by letting different tasks from the same modality share their modality subnets, which avoids creating networks for every tasks. For example, all image translation tasks share the same image-modality-net, no matter which image domains they come from (e.g., shoes or scenes). This encourages generalization across tasks and makes it easy to add additional tasks.

To produce diverse results, we introduce a universal attention module that encodes multi-domain distributions in a highly structured latent space by means of information bottleneck [25]. At inference time, we synthesize diverse samples by providing a condition, or randomly sampling from the latent space induced by this module.

In summary, our contributions are: (1) We propose multi-modal multi-domain GAN (M3D-GAN) that can translate data across multiple modalities and domains. (2) We introduce a universal attention module that encodes multi-domain variations in a latent space. (3) We evaluate our approach on a broad range of tasks and achieve superior results compared to baseline models.

Figure 2: Results of our model on image-to-image translation given an input image (left). On the right we show reference images (top), reference-conditioned synthesis results (middle), and unconditional synthesis results.
Figure 3: M3D-GAN architecture. Training: We use the modality subnets 𝐌in to convert data into a universal representation. These are processed via a universal computing body to produce latent codes zs:z𝒩(0,I) and zr:zEr(R). We combine these with the source S and feed to the Modality-specific generator (𝐌out) to convert them into the desired modality for synthesis. Inference: Given a source sample S, we synthesize a new sample by either (Top) providing a reference R to explicitly control the desired domain, or (Bottom) sampling a latent code from a normal distribution.

2 Related Work

Cross-Domain Synthesis: In the image modality, conditioning GANs with labels has been used to generate higher resolution images [19]. An important aspect of synthesis is the ability to frame the task as the description of attributes or features [7]. Modeling images in layers (i.e, foreground and background) allows for explicit control over the image attributes [7]. Pix2pix [11] made the first attempt at translating across different image domains by training on paired data (e.g., sketches to photos). Since then, more image translation work has used unsupervised training [37, 24, 15, 4]. However, most GAN architectures require retraining for each specific tasks. Bridging the gaps between domains, Choi et al., proposed StarGAN [6], which is a unified model for image-to-image translation that produced compelling results for controllable image generation, enabling cross-domain image synthesis.

Cross-Modality Synthesis: GANs have had a significant impact on data synthesis cross modalities, from image-to-text to speech synthesis. Text-to-image generation is an example of cross-domain synthesis [34, 22, 15]. Image captioning can be considered as an inverse process of generating text from images [29]. Analogously, speech recognition aims to turn a segment of audio into a textual string and similarly deep networks have been successfully employed for this [36, 32]. Text-to-speech synthesis presents the challenge of modeling the style in which the speech is synthesized [16]. To this end, the recently proposed Tacotron-based approaches [23, 31] use a piece of reference speech audio to specify the expected style. This approach means a single textual string can be synthesized in numerous ways (a one to many mapping). Controlling the attributes of images [6, 7] is somewhat similar to this, ideally we would want to control the domain of the synthesized data.

3 Approach

Neuroscience has revealed that the brain forms unified abstract representations from cross-sensory modalities [21, 8]. For instance, the same mirror neurons are shown to fire when primates observe actions and hear sounds associated with them [12, 8]; visual and tactile recognition uses similar processes [21]. While there is much we do not understand about the nature of how the brain processes multi-sensory signals, we were inspired by this property in the design of our network. Considering the differences between human senses and perception, our approach consists of a set of modality sub-networks, designed to convert input data into unified representations somewhat analogous to the senses, and a unified computing body to transfer these representations, inspired by the abstracted notion of perception.

Given two data distributions, source 𝐒 and target 𝐓, we aim to learn a mapping that is robust to different data types (multi-modal) and to find diverse and plausible t𝐓 that correspond to s𝐒 (multi-domain). We denote the modality subnets as 𝐌j={𝐌in,𝐌out}j, j = {text, image, speech}. 𝐌inj are prenets, where samples from different modalities are converted to unified representations, 𝐌in(𝐒)S and 𝐌in(𝐓)T. The unified computing body learns to relate and transfer the representations from the S to T. 𝐌outj is a modality-specific generator, where the outputs from the unified computing body are fed into it and are translated to the desired data modality.

During training, we have a collection of paired samples (s𝐒,t𝐓). However, the training dataset usually contains only one such pair. Therefore, we introduce a universal attention module Eatt to encode diverse domain information from the target distribution into a latent space. At test time, M3D-GAN can produce diverse results by either explicitly providing a reference sample as a conditioning variable or randomly sampling from the latent space. For a simple notation, in this paper, we denote the domain-specific generator 𝐌outj as G.

Figure 4: An illustration of our universal attention module.

3.1 Universal Attention Module

Figure 4 shows an illustration of our universal attention module. We aim to model a variety of domain information from the target distribution; during training, rather than starting only from a source sample (e.g. pix2pix [11]), we also take samples from the target distribution as references, denoted by R, i.e. {S,R}T^. When training on paired data, e.g. {text, image}, R is the ground-truth target. For testing, R can be any sample from 𝐓 and specifies the domain we wish to synthesize. To this end, we design Eatt that consists of a reference encoder (Encr) and a universal token layer (UTL). They are jointly trained with the whole model and do not require any explicit labels.

Given a reference R, the encoder Encr compresses domain information into a fixed-length vector; we call this a reference embedding. This embedding is used as a query vector in the universal token layer UTL, which consists of a bank of token embedding and an attention layer, where the token embedding are randomly initialized. We use the attention layer to learn the similarity between the reference embedding and each of the tokens. This produces a set of weights that represent the contribution of each token. The weighted sum of these token embedding, which we call domain embedding, is used as the encoded latent code z for generation. The bank of token embedding is shared across all training sequences. Note that this whole process can be understood as information bottleneck [25], which allows our model to learn a highly structured latent space.

3.2 Training Objectives

cVAE-GAN: When taking both source S and reference R samples as input, it is natural to use conditional VAE-GANs as a learning objective: [17]:

GAN=𝔼S,Tp(S,T)[log(D(S,T))]+𝔼S,Tp(S,T),zEatt(R)[log(1-D(S,G(S,z)))] (1)

A reconstruction loss is also adopted between the output and the ground truth:

rec=𝔼S,Tp(S,T),zEatt(R)𝐓,G(S,z) (2)

Further, we encourage the latent distribution, encoded by Encr, to be close to a random Gaussian. This allows us to randomly sample a latent code as the reference embedding when there is no references R at testing time.

kl=ERp(R)𝒟klEncr(R)||𝒩(0,I) (3)

The full objective for conditional VAE-GAN is:

GANVAE=minG,EncattmaxDGAN+λrecrec+λklkl (4)

This process is shown in Figure 3 (yellow lines).

Figure 5: Diagrams of each module’s architecture in M3D-GAN.

Latent Regression: We find that, by training the model only on the conditional VAE-GAN objective, the synthesized samples tend to be very similar even with different references. In other words, the latent codes output from Encr are ignored by the model. In this way, when training jointly with the whole model but without any constraints, the universal attention module (includes Encr and UTL) is hard to optimize. This issue has been pointed out in [27], and named “posterior collapse”.

We assume that if using Encr to encode a synthesized sample T^, then the output latent code z^ should be highly correlated with the one used to synthesize itself, i.e. (S,z)T^z^, z,z^. Thus, a solution would be to directly apply regression on the latent code z that is encoded from reference R, i.e. Rz,(S,z)T^z^, zEncr(R),z^.

However, if Encr collapses, i.e., it encodes any input to the same or similar latent codes, the reconstructed code will still be the same and Encr will not be trained in an optimal fashion. Therefore, rather than using a latent code that is encoded from the reference sample, i.e. zEncr(R), we start the latent regression process via a randomly drawn latent code z𝒩(0,I) and attempt to recover it, i.e. z𝒩(0,I),(S,z)T^z^, z𝒩(0,I),z^. We denote the randomly sampled latent code as zs, and the one encoded from R as zr. The samples generated by zs as T^sam, the ones generated by zr as T^enc. Thus the latent regression loss lat is:

lat=𝔼Sp(S),zs𝒩(0,I)zs-Encr(G(S,zs))1 (5)

It is natural to also use the discriminator loss on T^sam. The full loss can be written as:

GANlat=minG,EncattmaxDGAN+λlatlat (6)

This process is shown in Figure 3 (green lines).

Distance Regularization To further enforce the model to produce effective latent codes and prevent the model from collapsing, we propose a regularization on the generator that directly penalizes the mode collapse behavior. Our regularization is inspired by [4] which showed that the distance between a pair of samples should be highly related before and after translation. Thus, we design our regularization as:

maxGdist=𝔼zs,zr[G(S,zs)-G(S,zr))zs-zr] (7)

where indicates a norm. This regularization will penalize when the generator collapses into few modes, and thus force the generator not to ignore the latent code and produce diverse outputs.

Our full objective function can be written as:

all=minG,EattmaxDλ1GANVAE+λ2GANlat+λ3dist (8)

4 Network Architecture

Reference Encoder Encr & universal token layer UTL: The input to Encr is first passed through a stack of four 2-D convolutional layers with [64, 64, 128, 128] channels. To adapt to sequential input, we make the output tensor to preserve the time resolution and feed it into a single-layer 128-unit GRU. The last GRU state serves as the reference embedding, which is then fed to the universal token layer. We use 10 tokens in our experiments, which we found sufficient to represent a small but rich variety of domain information in the training data. We use multihead attention [28] to compute the attention weights. It uses a softmax activation to output a set of combination weights over the tokens; the resulting weighted combination of these tokens is the domain embedding.

modality subnets (Prenet) 𝐌in: We process speech data via mel-spectrograms which enables our model to take both images and speech via a two-layer fully 2D-convolutional network with dimension [32, 32]. For text input, we feed a sequence of 128-D character level embeddings into two fully-connected layers with [256, 128] units. The output is fed into a CBHG unit [23] which has a Conv1D bank with 16 layers, and each layer has 128 units. After the residual connection, there are four 128 unit fully-connected layers with ReLU. The final Bidirectional GRU has 128 cells.

modality subnets (Generator) 𝐌out: As speech and text are both sequential signals, we design the same generator architecture for them. It takes combined S and z as input. To match the dimension, we first replicate the single z T times, and concatenat it with the input source sequence. The Attention RNN consists of 2-layer residual GRUs with 256 cells. The Decoder RNN has a 256 cell 1-layer GRU. When synthesizing speech, this generator directly predicts the mel-spectrogram. We use Griffin-Lim [10] as a vocoder. To process image data, six residual conv2D layers compress the input into a low dimension representation, and then six residual deconv2D layers are used for decoding. Finally, a deconv2D layer outputs 3D RGB images.

Figure 5 shows detailed diagrams for each module. We train our M3D-GAN from scratch using the Adam-optimizer. For the task of image image translation, we train our model for 30 epochs with a batch size of 1. For other tasks, we train our model with a batch size of 32. For text image, and image text, we train our model for 300 epochs. Text speech and text text are trained for 200k steps. Details can be found in the supplementary material.

5 Experiments

We test the proposed approach on six synthesis tasks and compare (quantitatively and qualitatively) to baseline methods in each case. The datasets we used, and baseline methods we compared against, are listed in Table 1.

Table 1: The datasets and baseline methods for each task.
Dataset Baseline Methods
Edgesphotos [38, 33]
Outdoor dayNight images [13] \makecell[l]Pix2Pix [11]
Bicycle-GAN [39]
cVAE-GAN [3]
CUB-200-2011 [30] \makecell[l]StackGAN [34]
DA-GAN [15]
MSCOCO [5] CNN-RNN-coco [29]
EMT-4 22,377 American
English audio-text samples. \makecell[l]Tacotron2 [23]
Tacotron-GST [31]
LibriSpeech DeepSpeech2 [1]
WMT’14 (En-Fr) JointRNN [2]

5.1 Qualitative Evaluation

Image Image: We test our model under two scenarios shown in Figure 3. The first is to provide a reference image R, i.e., (S,R)T^ and synthesize samples that exhibit the content of S and the style of the reference sample. Figure 2 shows the result: When given different references (first row), the synthesized samples preserve the content from the source image (the Eiffel Tower), and show different styles taken from references. The second scenario is to provide a random noise vector z and synthesize a new sample by taking S combined with z, i.e. (S,z)T^. Figure 2 (bottom row) shows the results: When adding randomly sampled noise vector z, we obtain images of the same content with different styles.

More results are shown in Figure 6 and Figure 7. Figure 6 shows diverse images are produced when we provide a random noise vector to our model, which suggests that our universal attention module can alleviate the mode collapse problem. Figure 7, on the other hand shows our model correctly capturing domain information from any given references. For example, when generating shoes from sketches (set (7)), we can see that the sneaker’s white stripes are correctly generated, while the shoes body colors are varied. Also, when given a reference that has a grey strip pattern (the fourth reference in this set), our model synthesizes a white body color with grey stripes. In another set (set (8)), the outside of the high heel shoes are correctly changed to the color of the reference, while the inside material remains the same. These results suggests that the model does take the reference’s domain information, while successfully preserving the content information from the source image.

Figure 6: Edges shoes generation by combining with randomly sampled noise vectors z at testing time. For each row, the first column is the source sketch image.
Figure 7: Explicit controlling for Image Image. In each set, the first row is the reference image r, and the second row is synthesized images corresponding to the references domain. Where in each set, row 1, column 1 is the ground truth image, thus the image in row2, column1 can be considered as the reconstruction results.
Figure 8: Text Images. For each sentence, we randomly sampled 6 noise vectors for generating.

Text Image: We demonstrate our model’s ability to perform cross-modal translation. We use the CUB-200-2011 dataset [30], where each image is paired with 10 sentences describing a bird in the image. We resize input images to have a 256 × 256 pixel resolution for better visual quality. During training, we randomly sample a sentence and pair it with an image. At inference, we provide a random noise vector along with the input sentence. Figure 8 shows the results. Given a sentence description, our model produces images that correctly preserve certain characteristics of a bird described by the text (e.g., bird shape) while showing diversity in other attributes (e.g., pose).

Text Speech: We test our model’s ability to generate stylized speech from text inputs. In conventional TTS systems, training on a dataset of (text, audio) pairs, the model is supposed to synthesize an audio clip from a given textual string. The audio needs to convey the correct content of the text, and possess characteristics of the human voice. For adding styles to TTS, at inference, we combine an additional reference audio with a textual string and feed them into the system, where the text provides content, and the reference audio provides the desired style. For example, when synthesizing a sentence ‘The cat is laying on the table’. Given a reference audio signal which has happy emotional tone, the synthesized sample should say the sentence in happy tone. Note that, the reference audio signal can contain any textual content. To this end, the most challenging part is in disentangling the content and style information from the reference audio. We perform experiments to validate that our model can successfully capture domain (style) information from the reference audio.

We compare our model to Tacotron-GST [31] in how well they model auditory styles. We use an in-house dataset, dubbed EMT-4, that consists of 22,377 American English audio-text samples, with a total of 24 hours. All the audio samples are read by a single speaker in four emotion categories: happy, sad, angry and neutral. For each text sample, there is only one audio sample paired with one of the four emotion styles.

We randomly select 15 sentences and 4 references from 4 emotion categories. Each sentence is paired with four reference audio samples for synthesis, producing 60 audio samples. We put the audio results on our demo page. To see whether our model can capture domain information from references, we also conduct a “content-style swap” experiment where samples are synthesized by permuting text (content) and audio (style) from four (text, audio) pairs, one from each emotion category. We put the results on our demo page; each column has the same content with different styles, each row has the same style with different content. The results suggests that our model has successfully disentangled content and style components.

Table 2: Quantitative results and comparisons with the state-of-the-arts methods for different task .
(a) Evaluation on Image Image.
Realism (acc)
svhn mnist
edges shoes
pix2pix [11] 89% .013±.000
cVAE-GAN [3] 86% .096±.001
Bicycle-GAN [39] 91% .110±.002
Ours(z) 91% .112±.001
Ours(r) .115±.002
Rand. Real Imgs. 98% .262±.007
(b) Evaluation on tasks of ImageText & TextText.
ImageText (Image Caption)
Method BLEU-1 BLEU-4
CNN+RNN-coco [29] 66.7 23.8
Ours 65.2 23.8
TextText (Machine Trans.)
JointRNN (En-Fr) [2] 28.4
Ours 22.2
(c) Evaluation Text Image synthesis task.
Method Inception #miss
StackGAN [34] 3.7±0.4 36.0
DA-GAN [15] 5.6±0.4 19.0
Ours 5.2±0.4 16.0
(d) Evaluation on TextSpeech (TTS).
Method WER Acc
Tac. [23] 10.6 68%
GST [31] 10.2 77%
Ours 10.2 80%
(e) Evaluation on Speech Recognition.
Metric WER
DeepSpeech2 [1] 5.15
Ours 7.3

5.2 Quantitative Evaluation

Image Image: We evaluate our model in terms of realism and diversity when synthesizing images from images. We train a classifier on the MNIST dataset [14] and employ it on the translated samples from SVHN [18]. Table 2(a) shows that our model achieves comparable results in realism with the state-of-the-art. To evaluate diversity, we compute the diversity-score using the LPIPS metric [35]. Taking 100 shoe sketches, we randomly generate 2000 images using each model by adding randomly sampled latent codes (z). The average distance between the 2000 samples for each method are reported in Table 2(a). Our model (Ours(z)) produces the highest diversity score. While pix2pix [11] has the lowest diversity, potentially due to the mode collapse issue in conditional GANs. We also generate samples by adding references. The diversity score is further improved (see Ours(R)), illustrating that explicitly controlling the domain variable leads to better results.

Text Image: We use two metrics: the Inception Score [improved-techniques-for-training-gan] and the number of missing modes (denoted as # miss). To compute the inception score, we finetune VGG-19 on CUB-200-2011 [30]. Table 2(c) shows the results. Comparing with DA-GAN [15] which requires labels for training, our model produces comparable results even without using any label. For a more rigorous validation, we also adopt the missing mode metric (# miss) that represents the classifier reported number of missing modes. Comparing with the other two methods, our model misses the least number of modes, which further suggests the superiority of our model in alleviating the mode collapse issue.

Image Text (image captioning): We compare our model with CNN-RNN-COCO, a state-of-the-art image caption method based on [29]. Table 2(b) shows the results on MS-COCO; our model achieves BLEU-4 in 0.238 for both. Comparing with the model that specifically designed for this task, our model produces comparable results.

Text Speech (TTS) We evaluate two factors in the TTS task, i.e. fidelity (the synthesized speech should contain the desired content in a clearly audible form) and domain transfer accuracy (when transferring across domains, the synthesized speech should correctly correspond to the reference’s domain). We compare with two state-of-the-art stylized TTS models, Tacotron and GST, where Tacotron is an RNN-CNN auto-regressive model trained only on reconstruction loss, and GST improves on Tacotron by incorporating the global style token layers.

To validate fidelity, we assess the performance of synthesized samples in a speech recognition task. We use a pre-trained ASR model based on WaveNet [26] to compute the Word Error Rate (WER) for the samples synthesized by each model. Table 2(d) shows our model performing comparably with the state-of-the-art approaches. As our domains (emotions) are all categorical, we evaluate the performance in domain transfer by means of classification. To this end, we train a classifier on EMT-4, which shows a 98% accuracy. We then select 1000 samples synthesized from the test set of EMT-4. Table 2(d) shows that our model performs the best in terms of the domain transfer accuracy.

Speech Text (speech recognition) and Text Text (machine translation) We test our model for the speech recognition task on LibriSpeech corpus constructed from audio books [20]. For text-to-text, we test our model on the WMT’14 English-French (En-Fr) dataset. We remove sentences longer than 175 words, resulting in 35.5M sentence pairs for training. The source and target vocabulary is based on 40k BPE types. We evaluate with tokenized BLEU on the corpus-level. As seen in Table 2(b) and Table 2(e), comparing with the state-of-the-art speech recognition method, i.e. DeepSpeech [1] and machine translation method, our model did not show outstanding results. We suspect this is because when translating text to text, the reference (text) will be processed as a single domain embedding, which is a global representation, and thus lose essential sequential information. Even though our generator decodes information by time step and works well for other modalities (e.g., speech), we suspect that our text encoding method could be suboptimal. Future work may focus on designing a more robust network architecture for the text modality.

5.3 Ablation Study

Table 3: Evaluation for each component of M3D-GAN.
Realism (acc)
svhn mnist
edges shoes
cVAE-GAN [3] 86% .096±.001
GANVAE 87% .098±.001
GANVAE + GANlat 90% .113±.000
all wo Att 89% .111±.001
all 91 % .115±.002
Rand. Real Imgs. 98% .262±.007

We conduct an ablation study on the image-to-image task to analyze each component in our model. We again use the classification accuracy and diversity score as the metric. The results are shown in Table 3.

  • cVAE-GAN [3] vs. GANVAE: When training our model with the conventional conditional VAE-GANs objective [3], we see improvements in terms of both the realism and diversity. It shows the contribution of our attention module in producing a highly structured latent space, which helps the model generate more realistic and diverse results.

  • GANVAE vs. GANVAE+GANlat: When we add the latent regression, the performance is further improved.

  • GANVAE+GANlat vs. all: Comparing with our model with all the proposed losses, the realism of the GANVAE+GANlat baseline is slightly impaired, and the diversity is also lower. It shows that, the distance regularization Ldist plays an important role in controlling the learned latent code.

  • all wo Att vs. all: When discarding the attention module, both realism and diversity are lower than the proposed model. It illustrates that the attention mechanism does help in producing better results.

6 Conclusion

We present M3D-GAN for cross-modal cross-domain translation, which consists of modality-specific subnets with a universal attention module that learns to encode modality/domain information in a unified way. We show how the same architecture can be applied to a wide variety of tasks including text-to-image, image-to-text, image-to-image, text-to-speech, speech-to-text and text-to-text translation. The universal attention module we propose can learn a highly structured latent space by means of information bottleneck [25], which allows for explicit control of specific attributes. Leveraging the same architecture for different problems is advantageous as it allows us to develop shared representations in the abstracted unified space. We conduct a comprehensive set of experiments, both qualitative and quantitative, to show that our model achieves strong results across most of the tasks, especially for speech and image.


  • [1] D. Amodei, S. Ananthanarayanan, R. Anubhai, J. Bai, E. Battenberg, C. Case, J. Casper, B. Catanzaro, Q. Cheng, G. Chen, J. Chen, J. Chen, Z. Chen, M. Chrzanowski, A. Coates, G. Diamos, K. Ding, N. Du, E. Elsen, J. Engel, W. Fang, L. Fan, C. Fougner, L. Gao, C. Gong, A. Hannun, T. Han, L. V. Johannes, B. Jiang, C. Ju, B. Jun, P. LeGresley, L. Lin, J. Liu, Y. Liu, W. Li, X. Li, D. Ma, S. Narang, A. Ng, S. Ozair, Y. Peng, R. Prenger, S. Qian, Z. Quan, J. Raiman, V. Rao, S. Satheesh, D. Seetapun, S. Sengupta, K. Srinet, A. Sriram, H. Tang, L. Tang, C. Wang, J. Wang, K. Wang, Y. Wang, Z. Wang, Z. Wang, S. Wu, L. Wei, B. Xiao, W. Xie, Y. Xie, D. Yogatama, B. Yuan, J. Zhan, and Z. Zhu. Deep speech 2: End-to-end speech recognition in english and mandarin. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, 2016.
  • [2] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. CoRR, abs/1409.0473, 2014.
  • [3] J. Bao, D. Chen, F. Wen, H. Li, and G. Hua. Cvae-gan: Fine-grained image generation through asymmetric training. In 2017 IEEE International Conference on Computer Vision (ICCV), 2017.
  • [4] S. Benaim and L. Wolf. One-sided unsupervised domain mapping. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, 2017.
  • [5] X. Chen, H. Fang, T. Lin, R. Vedantam, S. Gupta, P. Dollár, and C. L. Zitnick. Microsoft COCO captions: Data collection and evaluation server. CoRR, 2015.
  • [6] Y. Choi, M. Choi, M. Kim, J.-W. Ha, S. Kim, and J. Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
  • [7] A. Farhadi, I. Endres, D. Hoiem, and D. Forsyth. Describing objects by their attributes. In CVPR, 2009.
  • [8] M. H. Giard and F. Peronnet. Auditory-visual integration during multimodal object recognition in humans: a behavioral and electrophysiological study. Journal of cognitive neuroscience, 11(5):473–490, 1999.
  • [9] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS. 2014.
  • [10] D. Griffin and J. Lim. Signal estimation from modified short-time fourier transform. IEEE Transactions on Acoustics, Speech, and Signal Processing, 32(2):236–243, April 1984.
  • [11] P. Isola, J. Zhu, T. Zhou, and A. A. Efros. Image-to-image translation with conditional adversarial networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
  • [12] E. Kohler, C. Keysers, M. A. Umilta, L. Fogassi, V. Gallese, and G. Rizzolatti. Hearing sounds, understanding actions: action representation in mirror neurons. Science, 297(5582):846–848, 2002.
  • [13] P.-Y. Laffont, Z. Ren, X. Tao, C. Qian, and J. Hays. Transient attributes for high-level understanding and editing of outdoor scenes. SIGGRAPH, 33(4), 2014.
  • [14] Y. LeCun and C. Cortes. MNIST handwritten digit database. 2010.
  • [15] S. Ma, J. Fu, C. Wen Chen, and T. Mei. Da-gan: Instance-level image translation by deep attention generative adversarial networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
  • [16] S. Ma, D. Mcduff, and Y. Song. A generative adversarial network for style modeling in a text-to-speech system. In International Conference on Learning Representations, 2019.
  • [17] M. Mirza and S. Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
  • [18] Y. Netzer, T. Wang, A. Coates, A. Bissacco, B. Wu, and A. Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011.
  • [19] A. Odena, C. Olah, and J. Shlens. Conditional image synthesis with auxiliary classifier gans. In ICML, 2017.
  • [20] V. Panayotov, G. Chen, D. Povey, and S. Khudanpur. Librispeech: An ASR corpus based on public domain audio books. In ICASSP. IEEE, apr 2015.
  • [21] P. Pietrini, M. L. Furey, E. Ricciardi, M. I. Gobbini, W.-H. C. Wu, L. Cohen, M. Guazzelli, and J. V. Haxby. Beyond sensory images: Object-based representation in the human ventral pathway. Proceedings of the National Academy of Sciences, 101(15):5658–5663, 2004.
  • [22] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee. Generative adversarial text to image synthesis. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, 2016.
  • [23] R. J. Skerry-Ryan, E. Battenberg, Y. Xiao, Y. Wang, D. Stanton, J. Shor, R. J. Weiss, R. Clark, and R. A. Saurous. Towards end-to-end prosody transfer for expressive speech synthesis with tacotron. CoRR, abs/1803.09047, 2018.
  • [24] Y. Taigman, A. Polyak, and L. Wolf. Unsupervised cross-domain image generation. In ICLR, 2017.
  • [25] N. Tishby, F. C. Pereira, and W. Bialek. The information bottleneck method. arXiv preprint physics/0004057, 2000.
  • [26] A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. Wavenet: A generative model for raw audio. In Arxiv, 2016.
  • [27] A. van den Oord, O. Vinyals, and k. kavukcuoglu. Neural discrete representation learning. In Advances in Neural Information Processing Systems 30. 2017.
  • [28] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. In NIPS, 2017.
  • [29] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In CVPR, 2015.
  • [30] C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011.
  • [31] Y. Wang, D. Stanton, Y. Zhang, R. Ryan, E. Battenberg, J. Shor, Y. Xiao, Y. Jia, F. Ren, and R. A. Saurous. Style tokens: Unsupervised style modeling, control and transfer in end-to-end speech synthesis. In ICML, 2018.
  • [32] W. Xiong, L. Wu, F. Alleva, J. Droppo, X. Huang, and A. Stolcke. The microsoft 2017 conversational speech recognition system. In ICASSP, 2018.
  • [33] A. Yu and K. Grauman. Fine-grained visual comparisons with local learning. In CVPR, Jun 2014.
  • [34] H. Zhang, T. Xu, H. Li, S. Zhang, X. Wang, X. Huang, and D. Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. In 2017 IEEE International Conference on Computer Vision (ICCV), 2017.
  • [35] R. Zhang, P. Isola, A. A. Efros, E. Shechtman, and O. Wang. The unreasonable effectiveness of deep features as a perceptual metric. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
  • [36] Y. Zhang, W. Chan, and N. Jaitly. Very deep convolutional networks for end-to-end speech recognition. In ICASSP, 2017.
  • [37] J. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In 2017 IEEE International Conference on Computer Vision (ICCV), 2017.
  • [38] J.-Y. Zhu, P. Krähenbühl, E. Shechtman, and A. A. Efros. Generative visual manipulation on the natural image manifold. In ECCV, 2016.
  • [39] J.-Y. Zhu, R. Zhang, D. Pathak, T. Darrell, A. A. Efros, O. Wang, and E. Shechtman. Toward multimodal image-to-image translation. In Advances in Neural Information Processing Systems 30. 2017.


7 Implementation details for each task

The inputs and outputs for each task during the training stage and testing stage are listed in Table 4.

  • ImageImage: In this task, the source and target are images drawn from two different domains (e.g. daynight, edgesphotos, etc.). During training, the references are images drawn from a target distribution, and are paired with the input (i.e. ground truth image). While at testing time reference images, which are used for indicating the desired style, can be provided.

  • TextImage: In this task, the source and reference are paired textual strings and images. At testing time, we do not use references to change the images’ style or attribute. Because a randomly sampled image may change the content that is given by the text. For example. when synthesizing an image from a sentence ‘This is a little yellow bird’, we expect the synthesized image to correctly capture the content of this description. If we were to randomly provide an image with a little white bird, the synthesized birds will have a white appearance. This would cause obvious problems when evaluating the synthesized samples. Therefore, in this task, we only perform synthesis by adding a noise vector, which does not harm the content from the input sentence.

    For a convenient implementation, we directly use preprocessed char-CNN-RNN text embeddings [reed2016generative] for the CUB-200-2011 dataset. This is a method that was also adopted by StackGAN [34]. Note that, the preprocessed text embeddings are only used for this task.

  • ImageText: In this task, the source and reference are paired images and texts. To process text as a reference, we follow the method used in [DBLP:journals/corr/ReedASL16] that allows us to obtain a global sentence text embedding. The input to the reference encoder Encr is the average hidden unit activation over the sequence, i.e. ϕ(t)=1LLi=1hi, where hi is the hidden activation vector for the i-th frame and L is the sequence length.

  • TextSpeech: In this task, we process the speech audio signal as a mel-spectrogram, our model also predicts the mel-spectrogram directly. The predicted mel-spectrogram can be synthesized directly to speech using either the WaveNet vocoder [26] or the Griffin-Lim vocoder [10]. In our experiments, we use the Griffin-Lim for fast waveform generation. At testing time, the reference speech audio can be from any person (i.e. it does not necessarily need to be sampled from a subject in our training dataset). In our experiments, we test our model by synthesizing audio from reference audio sampled from our dataset, and audio from web (i.e., not from our dataset). It turns out that, the results synthesized by either these references are equivalent in terms of quality and style consistency. We highly recommend readers to hear some of our results on our demo page.

  • SpeechText: In this task, the speech audio is also processed as a mel-spectrograms. We use the same method as in the ImageText task to process the input reference text as a global sentence embedding. For synthesis, the generator takes a mel-spectrogram sequence combined with the domain embedding obtained from text as input. The output is the predicted text, produced as one character at each time step.

  • TextText: In this task, the source and reference are textual strings from two languages (e.g., English and French). The reference text is processed as a global sentence embedding from the prenet and then fed into a universal attention module to obtain the domain embedding. While the source text is output directly from the prenet and is not processed as a global embedding. To combine the domain embedding and the source feature, i.e. (zr,S), the domain embedding zr is first replicated with T time steps and then concatenated with S, where T is the total time step of sequence S. A detailed illustration of this process can be seen in Figure 5(b) in our paper.

Table 4: Input and output signals in both training and testing stage for each task.
Task Train Test
Input Output Input Output
Tenc Tsam
S: Image
R: Image (ground truth)
R:Image (randomly sample)
R:Image (ground truth)
R:text (ground truth)
R:Speech (mel-spectrogram)
R:Speech(randomly sample)
R:Text (ground truth)

8 Discussion

Why we use the modality subnet for multiple tasks, and why this makes it easy to add additional tasks.

To use the modality sub-net for multiple tasks aims to avoid designing different networks for each task. For example, when we conduct the task of image-to-image and image-to-text translation, the input modality for both these tasks are images. In this case, a single image-subnet could have the potential to produce effective latent code from all image data. When we want to add more tasks which start from image modal, this image-subnet can consequently be used other than grasp a new network.

Differences with Bicycle-GAN [39]

Comparing the task of image-to-image translation with Zhu et al [39]. Our key difference is that UTL allows our model to encode a large variety of domain information in a latent space. In addition, the reference encoder learns to produce representative style code from any given references. In such a way, we can explicitly control any desired style for synthesizing by our model, but not just randomly generate diverse results. Detailed descriptions can be found in the testig stage of our paper.