December 01, 2022
Generating photos satisfying multiple constraints finds broad utility in the content creation industry. A key hurdle to accomplishing this task is the need for paired data consisting of all modalities (i.e., constraints) and their corresponding output. Moreover, existing methods need retraining using paired data across all modalities to introduce a new condition. This paper proposes a solution to this problem based on denoising diffusion probabilistic models (DDPMs). Our motivation for choosing diffusion models over other generative models comes from the flexible internal structure of diffusion models. Since each sampling step in the DDPM follows a Gaussian distribution, we show that there exists a closed-form solution for generating an image given various constraints. Our method can unite multiple diffusion models trained on multiple sub-tasks and conquer the combined task through our proposed sampling strategy. We also introduce a novel reliability parameter that allows using different off-the-shelf diffusion models trained across various datasets during sampling time alone to guide it to the desired outcome satisfying multiple constraints. We perform experiments on various standard multimodal tasks to demonstrate the effectiveness of our approach. More details can be found in Multimodal-diff.io
Today’s entertainment industry is rapidly investing in content creation tasks [1], [2]. Studios and companies working on games or animated movies find various applications of photos/videos satisfying multiple characteristics (or constraints) simultaneously. However, creating such photos is time-consuming and requires a lot of manual labor. This era of content creation has led to some exciting and valuable works like Stable Diffusion [3], Dall.E-2 [4], Imagen [5] and multiple other works that can create photorealistic images using text prompts. All of these methods belong to the broad field of conditional image generation [6], [7]. This process is equivalent to sampling a point from the multi-dimensional space \(P(z|x)\) and can be mathematically expressed as: \[\hat{z} \sim P(z|x),\] where \(\hat{z}\) denotes the image to be generated based on a condition \(x\). The task of image synthesis becomes more restricted when the number of conditions increases, but it also happens according to the user’s expectations. Several previous works have attempted to solve the conditional generation problem using generative models, such as VAEs [7], [8] and Generative Adversarial Networks (GANs) [9], [10]. However, most of these methods use only one constraint. In terms of image generation quality, the GAN-based methods outperform VAE-based counterparts. Furthermore, different strategies for conditioning GANs have been proposed in the literature. Among them, the text conditional GANs [11]–[14] embed conditional feature into the features from the initial layer through adaptive normalization scheme. For the case of image-level conditions such as a sketches or semantic labels, the conditional image is also the input to the discriminator and is embedded with an adaptive normalization scheme [1], [15]–[17]. Hence, a GAN-based method for multimodal generation has multiple architectural constraints [18]
Figure 2: No caption. a — An illustration of our proposed approach. During training, we use diffusion models trained across multiple datasets (we can either train a single model that supports multiple different conditional strategies one at a time or multiple models). During Inference, we sample using the proposed approach and condition them using different modalities at the same time.
A major challenge in training generative models for multimodal image synthesis is the need for paired data containing multiple modalities [2], [19], [20]. This is one of the main reasons why most existing models restrict themselves to one or two modalities [19], [20]. Few works use more than two domain variant modalities for multimodal generation [14], [18]. These methods can perform high-resolution image synthesis and require training with paired data across different domains to achieve good results. But to increase the number of modalities, the models need to be retrained; thus they do not scale easily. Recently, Shi [20] proposed a weakly supervised VAE-based multimodal generation method without paired data from all modalities. The model performs well when trained with sparse data. However, if we need to increase the number of modalities, the model needs to be retrained; therefore, it is not scalable. Scalable multimodal generation is an area that has not been properly explored because of the difficulty in obtaining the large amounts of data needed to train models for the generative process.
Recently diffusion models have outperformed other generative models in the task of image generation [21], [22]. This is due to the ability of diffusion models to perform exact sampling from very complex distributions [6]. A unique quality of the diffusion models compared to other generative processes is that the model performs generation through a tractable Markovian process, which happens over many time steps. The output at each timestep is easily accessible. Therefore, the model is more flexible than other generative models, and this form of generation allows manipulation of images by adjusting latents [21], [23], [24]. Various techniques have used this interesting property of diffusion models for low-level vision tasks such as image editing [23], [25], image inpainting [26], image super-resolution [27], and image restoration problems [28].
In this paper, we exploit this flexible property of the denoising diffusion probabilistic models and use it to design a solution to multimodal image generation problems without explicitly retraining the network with paired data across all modalities. Figure 1 depicts the comparison between existing methods and our proposed method. Current approaches face a major challenge: the inability to combine models trained across different datasets during inference time [22], [29]. In contrast, our work allows users flexibility during training and can also use off-the-shelf models for multi-conditioning, providing greater flexibility when using diffusion models for multimodal synthesis task. Figure [fig:introfig] visualizes some applications of our proposed approach. As shown in Figure [fig:introfig]-(a), we use two open-source models [21], [30] for generic scene creation. Using these two models, we can bring new novel categories into an image (e.g. Otterhound: the rarest breed of dog). We also illustrate the results showing multimodal face generation, where we use a model trained to utilize different modalities from different datasets. As it can be seen in [fig:introfig]-(b) and (c), our work can leverage models trained across different datasets and combine them for multi-conditional synthesis during sampling. We evaluate the performance of our method for the task of multimodal synthesis using the only existing multimodal dataset [14] for face generation where we condition based on semantic labels and text attributes. We also evaluate our method based on the quality of generic scene generation.
The main contributions of this paper are summarized as follows:
We propose a diffusion-based solution for image generation under the presence of multimodal priors.
We tackle the problem of need for paired data for multimodal synthesis by deriving upon the flexible property of diffusion models.
Unlike existing methods, our method is easily scalable and can be incorporated with off-the-shelf models to add additional constraints.
In this section, we describe the existing works on Conditional Image generation using GANs and multimodal image generation using GANs
The earliest methods for conditional image generation are based on non-parametric models[31]. However, these models often result in unrealistic images. On the other hand, deep learning-based generative models produce faster and better-quality images. Within deep learning based techniques, multiple methods have been proposed in literature for performing conditional image generation, where the images are generated conditioned on different kinds of input data. have proposed methods where images are generated based on a text prompts[12]. [1] et. al proposed a method for conditioning semantic label inputs based on a spatially-adaptive normalization scheme. [15], [17] Multiple conditional GAN-based techniques also tackle the problem where the conditioning happens from image-level semantics like thermal image [16], [32].
Recently multimodal image synthesis has gained significant attention [14], [18]–[20], [33]–[35], where these method attempts to learn the posterior distribution of an image when conditioned on the prior joint distribution of all the different modalities. The approaches [19], [20], [33]–[35] follow a variational auto-encoder-based solution, where all the input modalities are first processed through their respective encoders to obtain the mean and variance of the underlying Gaussian distributions which are combined using the product of experts in the latent space. Finally, the image is generated by sampling using the new posterior mean and variance. Some methods using GANs for multimodal image synthesis have also gained recent attention. Huang et al[18] perform multimodal image synthesis using introduces a new Local-Global Adaptive Instance normalization to combine the modalities. Huang et al [18] also use the product of experts theory to combine encoded feature vectors and use a feature decoder to obtain the final output. TediGAN[14] uses a StyleGAN [36] based framework where the different visual-linguistic modalities are combined in the feature space and decoded to obtain the final output. TediGAN allows user-defined image manipulation according to the input of other modalities.
An alternate interpretation of denoising diffusion probabilistic models is denoising score-based approach [37], where the sampling during inference is performed using stochastic gradient langevian dynamics [38]. Here a network is used to compute the score representing the gradient of likelihood of the data. The sampling during the reverse timestep can be represented by [37]: \[\begin{gather} z_{t-1} \leftarrow{} \frac{1}{\sqrt{1-\beta_t}} \left( z_t - \beta_t s_{\theta}(z_t, x, t) \right) + \sigma_t^2 \boldsymbol{\eta}, \label{eq:score} \end{gather}\tag{1}\] where \(\boldsymbol{\eta} = \mathcal{N}(\boldsymbol{0}, \boldsymbol{I})\), \(z_t\) is the sample at timestep \(t\) and \(x\) is the condition. The score value \(s_{\theta}(\cdot)\) is given by, \[s_{\theta}(z_t,t) =\nabla_x \log P(z_t|x) =\frac{\epsilon_{\theta}(z_t,x,t)}{\sqrt{1-\bar{\alpha}_t}},\] where \(\epsilon_{\theta}\) is the output from the denoising network.
In regular conditional denoising diffusion models [39], the input image (i.e., the condition) is concatenated with the sampled noise when passing through the network. When multiple modalities are present, the trivial solution of finding the conditional distribution is by concatenating all the \(N\) modalities with the noisy image. However, if we want to improve the functionality of the trained network by by adding a new modality, the whole model needs to be retrained with all \(N+1\) modalities. Instead, we propose an alternative way to achieve this goal. Let \((z, x_i)\) denote a point in the space of the images of a particular domain and \(p(z|x_i)\) denote the distribution of the predicted image \(z\) based on the modality \(x_i\). Let \({\boldsymbol{X}}=\{x_1,,x_2,..x_N\}\). Let the distribution of the image conditioned on all modalities be denoted by \(P(z|{\boldsymbol{X}})\) and the distribution of the image conditioning on the individual modalities be \(P(z|x_i)\). Assuming that all the modalities are statistically independent, \[\begin{gather} P(z|{\boldsymbol{X}})=\frac{P(z)}{P({\boldsymbol{X}})}\prod_{i=1}^{N}P(x_i|z) = KP(z) \frac{\prod_{i=1}^{N}P(z|x_i)}{\prod_{i=1}^{N}P(z)}, \label{eq:POE1} \end{gather}\tag{2}\] where \(K\) is a term which is independent from \(z_t\). Assuming the individual distributions \(P(z|x_i)\) and \(P(z)\) follow a Gaussian distribution, the distribution \(P(z|{\boldsymbol{X}})\) will also follow a Gaussian distribution. Now, let’s assume that \(N\) diffusion models are trained to generate samples from the distributions \(P(z|x_i)\) conditioned on each modality \(x_i\) separately. We have \(N\) modalities from where the unconditional distribution could be computed. However, how good each model can model the unconditional distribution is not certain, hence we utilize the generalized product of experts rule [40] to compute the effective unconditional density as \[P(z) =\prod_{i=1}^{N}P^{a_i}_{\delta_i}(z|\phi),\] where \(a_i\) is the confidence factor of each individual distribution with a null condition to modelling the overall unconditional density. To preserve the effective variance so that the reverse diffusion process still holds, we set the constraint \(\sum_{i=1}^N a_i =1\) . As mentioned in Section 3.1, we can use stochastic gradient Langvein sampling based sampling to sample from the conditional distribution \(P(z|{\boldsymbol{X}})\) . Please note that we are imposing an assumption that the diffusion process for each of the individual modalities have the same variance schedule. Hence the score-based derivations are valid and the effective diffusion process has the same variance schedule \[\begin{align} \nabla_{z_t}\log (z_t|{\boldsymbol{X}}) = \\ \nabla_{z_t}\log \biggl((\prod_{i=1}^{N}P_{\delta_i}^{a_i}(z_t|\phi))\frac{\prod_{i=1}^{N}P_{\delta_i}(z_t|x_i)}{\prod_{j=1}^{N}\prod_{i=1}^{N}P_{\delta_i}^{a_i}(z_t|\phi)} \biggr)=\\ \sum_{i=1}^N \biggl( \nabla_{z_t}\text{log} P_{\delta_i}(z_t|x_i) - \sum_{j\neq i}a_j \nabla_{z_t}\text{log} P_{\delta_j}(z_t|\phi)\biggr), \end{align}\] where \(\delta_i\) denotes the parameters of the individual distribution densities and \(\phi\) denotes the null condition. \(b_{ij}\) denotes the confidence of a paramteric model to estimate the unconditional density of another model. Hence the effective score when conditioned on all the modalities can be represented in terms of scores of the individual conditional distribution as well as the score of the unconditional model. Hence the effective score \(s_{c}\) is given by: \[\begin{align} s_{c} = \frac{\epsilon_c}{\sqrt{1-\bar{\alpha}_t}}, \end{align}\] \[\begin{gather} \epsilon_{c}= \epsilon_{\theta}(z_t,{\boldsymbol{X}} ,t) =\sum_{i=1}^N a_i \epsilon_{i}(z_t,\phi,t) +\\ \sum_{i=1}^N\biggl( \epsilon_{i}(z_t,x_i,t)- \sum_{j=i}^N a_{j}\epsilon_j (z_t,\phi,t)\biggr), \label{eq:multimodal1} \end{gather}\tag{3}\] where \(\epsilon_{\theta}(z_t,x_i,t)\) denotes the output prediction of the individual conditional networks and \(\epsilon_{\theta}(z_t,t)\) is the prediction of the unconditional network. After computing the effective score, sampling could be performed using equation by, \[\begin{gather} z_{t-1} \leftarrow{} \frac{1}{\sqrt{1-\beta_t}} \left( z_t - \frac{ \beta_t}{\sqrt{1-\bar{\alpha}_t}}\epsilon_c \right) + \sigma_t^2 \boldsymbol{\eta}, \end{gather}\] where \(\boldsymbol{\eta} \sim\mathcal{N}(\boldsymbol{0}, \boldsymbol{I})\). An additional parameter for stringer conditions can be incorporated to 3 using Generalized product of experts [40] (proof in supplementary). Hence giving importance to some modalities over the others by partial weighting to the scores estimated by each modality as follows: \[\begin{gather} \epsilon_{c}= \sum_{i=1}^N w_i \epsilon_{i}(z_t,x_i,t)- (\sum_{i=1}^N w_i-1) \sum_{j=1}^N a_j \epsilon_{j}(z_t,\phi, t).\\ , w_i\geq 1 \label{eq:multimodal} \end{gather}\tag{4}\]
Recently Ho et al.[41] proposed a method for sampling from a particular conditional distribution without the need of an explicit classifier as used by previous methods[21]. According to this method, given a model trained for modeling a conditional distribution \(p(z|c)\), and with the same model trained for an modelling an unconditional distribution \(p(z)\), The effective score for generating samples could be obtained using, \[\hat{\epsilon}(z_t,c,t)=(1+w) \cdot \epsilon(z_t,c,t)-w \cdot \epsilon(z_t,t), \label{eq:classifierfree}\tag{5}\] where \(w\) is a scalar. By comparing equations 4 and 5 , we can see that equation 5 , is the case of MCDM with all modalities being the same.
In this section we describe in detail the experiments performed and reason out the choice on experimental setup. We consider different multimodal settings for our network and evaluate the performance quantitatively for and multimodal image generation on the CelebA and FFHQ datasets. For multimodal image semantics to face generation, we choose networks that can perform semantic labels to face generation retrain them for scratch for the different scenarios considered. As detailed in earlier sections, one major challenge of multimodal image generation is the lack of paired data across all modalities. To extend existing approaches for the case of multimodal generation, two approaches could be followed. The first is to take a model trained for a particular conditioning modality and finetune it for another modality. In the second approach, the training corpus becomes the combination of the datasets with individual modalities and different iterations could model training sees a different modality and its corresponding image.
Figure 3:
.







Figure 4: Qualitative comparisons for semantic to face generation. In this case, a single model is trained by alternating different input datasets across different iterations. During Inference time all the modalities are taken from a single dataset and the proposed sampling technique is used.. b — Semantic label, d — SPADE[1], f — PIX2PIXHD[16], h — INADE[15], j — DDPM[22], l — TediGAN[14], n — OURS
To create a criteria to quantitatively evaluate the existing works and our method for multimodal generation, we follow the works [19] where complementary information comes from semantic labels of different portions of the same image. To make the problem even more generic, during training we choose the semantic labels for different regions from different datasets. For multimodal semantics to face generation, we use the CelebA-HQ dataset [42] and the FFHQ dataset [36]. We choose the semantic labels of hair from the CelebA dataset and the semantic labels of skin from the FFHQ dataset for the training process. The semantic labels for the skin and the hair are obtained using the face parser released by Zheng et al. [43]. For training our dataset, we choose 27,000 images from the CelebA-HQ dataset and 27,000 images from the FFHQ dataset, and train the corresponding individual diffusion models with these semantic labels as well as attributes. We test our method using 3,000 images chosen from the CelebA-HQ dataset and 3,000 images from the FFHQ dataset. During evaluations, we utilize the semantic labels of hair as well as skin from the same image to illustrate how well our method is able to generalize. As for the evaluations metrics we choose the FID score [44] and the LPIPS score [45] to evaluate the sample diversity and quality of facial images generated. To evaluate the structural similarity of the produced result with the actual image we use the SSIM score. Finally to see how close the input semantic labels are to the ones produced by our method, we obtain the parsed masks of the generated images and compute the mean intersection over union over all classes (mIoU) and F1 precision scores of the semantic images obtained from the reconstructed image and the input semantic image and report the mean for all testing images. We set the value of \(a_i=1/N\) and \(w_i=1\) for all the experiments. Here N denotes the number of modalities used. For training the sketch to face model, we utilized Canny egde detector[46] to extract the edges. For text to face generation, we utilize the FFHQ dataset and trained a model based on the extracted face embeddings using FARL [43]. The reader is referred to the supplementary material for more details on the implementation of the individual multimodal face generation sub-parts.
| Type | Method | FID\(\textcolor{black}{\downarrow}\) | LPIPS\(\textcolor{black}{\downarrow}\) | SSIM\(\textcolor{black}{\uparrow}\) | mIoU\(\textcolor{black}{\uparrow}\) | F1 \(\textcolor{black}{\uparrow}\) |
|---|---|---|---|---|---|---|
| Fine-Tuning | SPADE[1] | 131.91 | 0.638 | 0.316 | 0.605 | 0.694 |
| OASIS[17] | 118.67 | 0.624 | 0.318 | 0.579 | 0.663 | |
| PIX2PIXHD[16] | 153.19 | 0.611 | 0.282 | 0.716 | 0.819 | |
| INADE[15] | 125.43 | 0.632 | 0.279 | 0.881 | 0.932 | |
| SPADE[1] | 89.29 | 0.523 | 0.376 | 0.890 | 0.936 | |
| OASIS[17] | 71.20 | 0.571 | 0.323 | 0.792 | 0.870 | |
| PIX2PIXHD[16] | 73.32 | 0.512 | 0.373 | 0.872 | 0.925 | |
| INADE[15] | 54.27 | 0.552 | 0.332 | 0.887 | 0.933 | |
| TediGAN[14] | 69.51 | 0.4823 | 0.417 | 0.834 | 0.905 | |
| OURS | 26.09 | 0.519 | 0.416 | 0.911 | 0.948 |
To show that our method is generalized and could combine existing works to make their generation process more powerful, we use the text-to-image generation-based diffusion model released by GLIDE and an ImageNet class conditional generation model. We perform a combined multimodal generation task where we choose the GLIDE model to decide the background in the image and use the Imagenet model to bring specific objects to the image. During evaluations, we generate images using text prompts that contain a scene information as well as an ImageNet object using an and conditioning. We generate 500 such images for all methods and evaluate how close the images are to the text prompts using the average clip distance between the image embeddings and the embeddings of the input text prompt. We make use of nonreference quality metrics NIQE to evaluate the method. We also present the accuracy using the state-of-the-art Imagenet classifier[47] to detect whether the class is present in the image. We set \(w_i=5\) for all the experiments.
Figure 5:
.
| Type | Method | FID\(\textcolor{black}{\downarrow}\) | LPIPS\(\textcolor{black}{\downarrow}\) | SSIM\(\textcolor{black}{\uparrow}\) | MIoU\(\textcolor{black}{\uparrow}\) | F1 \(\textcolor{black}{\uparrow}\) |
|---|---|---|---|---|---|---|
| Fine-Tuning | SPADE | 91.77 | 0.624 | 0.340 | 0.649 | 0.728 |
| OASIS | 99.94 | 0.634 | 0.320 | 0.625 | 0.704 | |
| PIX2PIXHD | 223.85 | 0.670 | 0.265 | 0.666 | 0.775 | |
| INADE | 134.11 | 0.656 | 0.274 | 0.869 | 0.922 | |
| SPADE | 75.73 | 0.545 | 0.373 | 0.876 | 0.921 | |
| OASIS | 75.57 | 0.593 | 0.331 | 0.786 | 0.863 | |
| PIX2PIXHD | 138.30 | 0.560 | 0.363 | 0.840 | 0.898 | |
| INADE | 47.40 | 0.574 | 0.334 | 0.862 | 0.910 | |
| TediGAN[14] | 125.27 | 0.545 | 0.409 | 0.813 | 0.887 | |
| OURS | 33.60 | 0.542 | 0.421 | 0.919 | 0.950 |
Semantic label to face generation. The quantitative results for semantic face generation on the FFHQ and CelebA datasets can be found in Tables ¿tbl:table:ffhq95semantics? and ¿tbl:table:celeba95semantics?, respectively. As the choice of comparison methods, we use the current state-of-the-art method for semantic face generation TediGAN [14] and several recently introduced semantic to face generation methods [1], [15]–[17]. The fine-tuning-based multimodal generation and the combined unpaired training-based results are shown separately. TediGAN [14] has been trained with paired data across all modalities since it supports such a provision. From Tables ¿tbl:table:ffhq95semantics?, and ¿tbl:table:celeba95semantics? we can see that all the methods fail to produce reasonable results when trained in the finetuning-based strategies. This can be seen in the high FID scores, low SSIM, and parsed mask accuracy metrics. The alternating training strategy produces reasonably good results, and improve all the evaluation metrics improve. But training this way introduces dataset-specific bias because of which the quality of the existing semantic-to-face generation techniques deteriorates when used on an independent test set during testing.
Figure 6:
.
| Method | Modality | NIQE\((\downarrow)\) | Clip\((\uparrow)\) | Acc\((\uparrow)\) |
|---|---|---|---|---|
| GLIDE[30] | Uni | 6.64 | 0.317 | 0.3 |
| CompGen[29] | Uni | 5.71 | 0.282 | 22.4 |
| Ours | Multimodal | 5.34 | 0.286 | 87.0 |
Generic Scenes Generation. Table 1 shows the quantitative comparison for the proposed method. As we can see, the accuracy of the object being in the image is low for GLIDE [30] because it focuses on regions on the text which are more easier to generate. One could always make the case that the text model fails because of its weak robustness to doctored text prompts. Hence we perform a comparison with compositional unimodal generation [29] against a multimodal scenario where we utilize information across datasets. This analysis can be seen in Table 1. we evaluate the performances on 500 generated images using the CLIP score, NIQE score and ImageNet classification accuracy. As can be seen multimodal generation has its advantages that it can introduce new novel classes to the image hence being more accurate and can generate realistic images leading to better metrics.
How to choose a good reliability factor? When we have multiple models trained on different datasets, and conditioning needs to be applied based on both of these models. There exist two scenarios. In the case of independent attributes
like a face semantic mask and hair semantic map, the reliability factors doesn’t affect the composite image since each attribute could be added without affecting the others performance. The next possible case is of non independent attributes, where a blend
of both images is a possible solution like in 5, here the reliability factor depends on how much of each image is desired by the user. For an illustration, we refer the reader to Figure 5. Here we utilize the GLIDE model and the ImageNet generation model [21]. We utilize \(100\) steps of deterministic DDIM [48] with same random initial noise for all settings. The vertical values
to the left denotes increasing reliability factor for the text model. When reliability factor equals to zero, the top most row, the class model is used as the unconditional model and bottom row shows the case when the text model is used as the
unconditional model. Since the text model has more generation capability, we can see that it creates much better naturalistic series of images compared to the ImageNet generation model [21] which cannot to create artistic scenes.
Why is a reliable score better than a direct solution? One straightforward solution to the case of multi-modal generation is to use equation 5 and consider the most powerful model as the unconditional
model. But this scenario is a subset of our reliable mean solution. As one can imagine, this formulation puts a strict bias towards the space of data points of one of the models over the other. Whereas using a reliable mean, this specific bias can be
negated and more user defined control is possible. For example, as seen in Fig 5, one can obtain a user defined mix of how much each modality should be mixed using the reiable mean. Moreover, In Fig 6, row 2, we can see that distorted cherry blossoms are created when the ImageNet class conditional model is treated as the stronger model. The text model used is a very powerful model[30]. Hence it is able to model class specific points accurately and a mix of the unconditional densities of both the models can perform valid interpoaltions
between both modalities.



Figure 7: A visualization of generated images with combined conditional generation (uni-modal) with ours (multi-modal).. b — Label, d — Combined, f — OURS
| Semantics | Modality | FID | SSIM | mIoU | F1 |
|---|---|---|---|---|---|
| Face | Uni | 27.66 | 0.373 | 0.842 | 0.907 |
| Face+Hair | Uni | 61.62 | 0.376 | 0.872 | 0.922 |
| Ours | Multi | 26.09 | 0.416 | 0.911 | 0.948 |
To show the effectiveness of the proposed multimodal strategy over a normal method trained unimodally, we retrain a diffusion model that can take one or more conditioning simultaneously. We analyze the FID score and the SSIM scores on the images and their corresponding ground truths, and the F1 score and mIoU score between the original parsed maps vs the reconstructed parsed maps. We perform ablation over three different scenarios: with using one modality when both conditioning modality is given at a time and our proposed sampling strategy. As we can see from Table 2, there is a significant boost to the performance using the specified sampling strategy. This shows that the multimodal sampling strategy enforces stronger conditioning and produces better-quality results. Figure 7 shows the results corresponding to the combined conditioning strategy and our proposed method. As can be seen from this figure7, when regular diffusion-based inference time sampling is performed from a model trained with different modalities across different datasets, the sampling procedure generates unrealistic results. In contrast, we are able to generate much more realistic results.
One limitation of our method is that the dimension of the latent space modelled by the diffusion models is required to be the same. If the number of channels differ for the latent variable \(z_t\), then this method cannot be utilized. This is the reason why we could not utilize stable diffusion model [3] for our experiments. Another scenario when our model can fail is when one model is asked to create a sample that could be easily generated and the other model is asked for a harder class. Thirdly, if contradictory information is given as input across modalities, our method fails to produce the desired output. More visual results corresponding to this condition are given in the supplementary document. This problem can be easily alleviated by using different reliability weights to the different conditioning modalities and giving more weight to the most desired conditioning modality as can be seen from Fig. 5.
In this paper, we propose one of the first methods that can perform multimodal generation using individual models trained for multiple sub-tasks. The multimodal generation is enabled by a newly proposed formulation utilizing a generalized product of experts. We introduce a new reliability parameter that allows user-defined control while performing multimodal mixing of correlated modalities. We briefly discuss the design choices of the reliability parameter for different applications. The proposed sampling significantly boosts the performance of multimodal modal generation using diffusion models compared to the sampling using a unimodal network. We show results on various multimodal tasks with trained as well as publically available off-the-shelf models to show the effectiveness of our method.
As mentioned in section the conditional density in the presence of multiple conditioning strategies turns out to be \[\begin{gather} P(z|{\boldsymbol{X}})=\frac{P(z)}{P({\boldsymbol{X}})}\prod_{i=1}^{N}P(x_i|z) = KP(z) \frac{\prod_{i=1}^{N}P(z|x_i)}{\prod_{i=1}^{N}P(z)}, \label{eq:POE5} \end{gather}\tag{6}\]
Under Gaussian assumption where the unconditional densities and the conditional densities follow a Gaussian distribution, The above equation could be approximated using Generalized product of experts[40] to \[P(z|{\boldsymbol{X}}) = KP(z) \frac{\prod_{i=1}^{N}q(z|x_i)}{\prod_{i=1}^{N}q(z)}, \label{eq:POE2}\tag{7}\]
where \(q(.)\) is an estimate of the original density and \[q \sim N(\mu, \sigma)\] Generalized product of experts[40] further allows stringer conditions to be applied to the individual conditional densities and reweigh the individual densities to favour some over other, represented by \[P(z|{\boldsymbol{X}}) = KP(z) \frac{\prod_{i=1}^{N}q^{\beta_i}(z|x_i)}{\prod_{i=1}^{N}q(z)}, \label{eq:POE3}\tag{8}\]
Bringing the idea of reliable means in the equation, and assuming that a good estimate of the conditional densities can be made, Eq 8 changes to \[P(z|{\boldsymbol{X}}) = (\prod_{i=1}^{N}P_{\delta_i}^{a_i}(z_t|\phi))\frac{\prod_{i=1}^{N}P_{\delta_i}^{\beta_i}(z_t|x_i)}{\prod_{i=1}^{N}(\prod_{j=1}^{N}P_{\delta_i}^{a_i}(z_t|\phi))^{\beta_i}}, \label{eq:POE4}\tag{9}\] Hence the effective score becomes \[\begin{align} \nabla_{z_t}\log (z_t|{\boldsymbol{X}}) = \\ \nabla_{z_t}\log \biggl((\prod_{i=1}^{N}P_{\delta_i}^{a_i}(z_t|\phi))\frac{\prod_{i=1}^{N}P_{\delta_i}^{\beta_i}(z_t|x_i)}{\prod_{j=1}^{N}\prod_{i=1}^{N}P_{\delta_i}^{a_i\beta_i}(z_t|\phi)} \biggr)=\\ \sum_{i=1}^N a_i \nabla_{z_t}\text{log} P_{\delta_j}(z_t|\phi)+\\ \sum_{i=1}^N \biggl( \beta_i\nabla_{z_t}\text{log} P_{\delta_i}(z_t|x_i) - \beta_i\sum_{j=1}^Na_j \nabla_{z_t}\text{log} P_{\delta_j}(z_t|\phi)\biggr), \end{align}\]
The equivalent score can be represented by \[\begin{gather} \epsilon_{c}= \epsilon_{\theta}(z_t,{\boldsymbol{X}} ,t) =\sum_{i=1}^N a_i \epsilon_{i}(z_t,\phi,t) +\\ \sum_{i=1}^N\beta_i\biggl( \epsilon_{i}(z_t,x_i,t)- \sum_{j=i}^N a_{j}\epsilon_j (z_t,\phi,t)\biggr), \label{eq:multimodal2} \end{gather}\tag{10}\]
Regardless of the variance schedules, one key property in diffusion models is that adding noise equivalent to the \(T\) timesteps should always converge to a standard normal distribution, i.e \[q(x_T|x_{0}) = \mathcal{N}(x_t; \sqrt{\bar{\alpha}_t} x_0, (1-\bar{\alpha}_t) \mathcal{I}). \label{eq:q95sample0}\tag{11}\]
where \(\bar{\alpha}\) is the cumulative product of the variance schedule \(\beta\). Once the effective \(\epsilon\) at each timestep is obtained the individual scores could be calculated using the equation for score calculation mentioned in the main paper and the image at the next timestep could be obtained using the the respective variance schedule.
In all of our experiments defined in section we include text based description one of the modalities. The existing diffusion based approaches make use of millions of paired image-text pairs and train models for the task of text to Image generation. But in multimodal scenarios because of the availability of information from other modalities, we do not require such a powerful model. Hence we propose an novel lightweight text to image approach as follows. Consider a conditional diffusion model for text to image conversion defined by \(g_{\phi}(z_t,\text{emb},t)\). For our model we make use of a image-text pretraining model like CLIP with the corresponding Image and text embedders defined by \((h_{img}(.),h_{text}(.))\). During training, we condition using the low dimensional Image emdedding using adaptive group normalization at stage of our network. The Image embedding is obtained by using the image embedder of clip on the incoming training image. The loss for optimization of the parameters \(\phi\) of the network are defined by, \[L =E_{t \sim[1, T], \epsilon \sim \mathcal{N}(0, \mathbf{I})}\left[\left\|\epsilon-g_{\phi}\left(\mathbf{z}_t,h_{img}(z_0), t\right)\right\|^{2}\right]\\\]
During the inference process, we make use of the text embedder of the vision-language model and obtain the text embeddings by passing the corresponding text conditioning \(text_{in}\) sample using the process, \[\begin{align} z_{t-1} \leftarrow{} \frac{1}{\sqrt{1-\beta_t}} \left( z_t - \frac{ \beta_t}{\sqrt{1-\bar{\alpha}_t}}g_{\phi}(z_t,h_{text}(text_{in}), t) \right) \\ + \sigma_t^2 \boldsymbol{\eta}, \\ \text{ where } \boldsymbol{\eta} = \mathcal{N}(\boldsymbol{0}, \boldsymbol{I}), \label{eq:cond95samp} \end{align}\tag{12}\]
The embeddings for image and text were obtained by using [43]
For Multimodal text to Image generation, we comparing with existing works trained for text to image generation in CelebA-MM dataset. But unlike the exiting works that were trained with paired text-image prompts, our model perform zero-shot text to image generation and it has never seen any text prompts during training time. We utilize FARL[43] for obtaining the image-text embeddings of the images. For evaluating the quality of text to image generation, we follow [14].
For generating rough sketches of the faces, we utilize [46] edge detector to extract edges from the image and use this as the conditioning technique while training the network.
Figure 8:
.
Figure 9:
.
Figure 10:
.
Figure 11:
.




























Figure 26: Qualitative comparisons for semantic to face generation. In this case, a single model is trained by alternating different input datasets across different iterations. During Inference time all the modalities are taken from a single dataset and the proposed sampling technique is used.. e — Semantic label, j — SPADE[1], o — PIX2PIXHD[16], t — INADE[15], y — DDPM[22], ~ — TediGAN[14], — OURS





Figure 27: Multimodal face generation using four modalities Text used: "An old person with eyeglasses".





Figure 28: Multimodal face generation using four modalities Text used: "A person with black hair".





Figure 29: Multimodal face generation using four modalities Text used: "A person with eyeglasses".





Figure 30: Multimodal face generation using four modalities Text used: "A person with blonde hair".



Figure 31: Multimodal face generation using four modalities Text used: "This person has gray hair and wears eyeglasses".