Conditional Diffusion on Web-Scale Image Pairs leads to Diverse Image Variations

## Abstract

Abstract Generating image variations, where a model produces variations of an input image while preserving the semantic context has gained increasing attention. Current image variation techniques involve adapting a text-to-image model to reconstruct an input image conditioned on the same image. We first demonstrate that a diffusion model trained to reconstruct an input image from frozen embeddings, can reconstruct the image with minor variations. Second, inspired by how text-to-image models learn from web-scale text-image pairs, we explore a new pretraining strategy to generate image variations using a large collection of image pairs. Our diffusion model Semantica receives a random (encoded) image from a webpage as conditional input and denoises another noisy random image from the same webpage. We carefully examine various design choices for the image encoder, given its crucial role in extracting relevant context from the input image. Once trained, Semantica can adaptively generate new images from a dataset by simply using images from that dataset as input. Finally, we identify limitations in standard image consistency metrics for evaluating image variations and propose alternative metrics based on few-shot generation.

## 1 Introduction

Machine learning initially focused on optimizing and improving models on small datasets. The field has transitioned to training general purpose models on web-scale data and then finetuning them for specific tasks on smaller datasets. This paradigm shift has lead to state-of-the-art results on a number of different domains. In this paper, we focus on the relatively underexplored task of adapting an image generative model to different datasets. One approach is to simply train a generative model on a large dataset of unlabelled images and finetune them on smaller datasets. While this approach is straight-forward in theory, it requires clever architecture or regularizer design to prevent overfitting in practice (See Sec.2.2). As models scale up, finetuning for every dataset also just becomes increasingly impractical.

Figure: Figure 1: Each grid presents a conditioning image at the top followed by $512\times 512$ image variations generated by Semantica, IP-Adapter, and SDv2 IV. Samples generated by a semantic image-variation model should maintain semantic consistency with the conditioning image while also being sufficiently diverse. Semantica demonstrates greater diversity than IP-Adapter while preserving semantic context. While SD v2 generates diverse outputs, the generated outputs are often not congruent with the context image. Additional samples are present in App. A.
Refer to caption: x1.png

Image-conditioned diffusion models are now increasingly used to adapt generative models to new datasets, also known as image variations (Ye et al., ; Pinkney, ; Xu et al., ). First, an image encoder trained on a different upstream task, such as self-supervised learning (DINO (Oquab et al., )) or contrastive-learning on web-image text pairs (CLIP (Radford et al., )) produces frozen embeddings. The frozen embeddings then condition a diffusion model usually pretrained on text-to-image, which is finetuned to reconstruct the original image. However in these models, the study of image variations often remains a secondary objective. In this paper, we take a step back and directly analyze image variations in isolation. To avoid ambiguity involved in generating multiple objects in an image, we focus our evaluation on datasets with a single dominant object. We start with a vanilla image-conditional diffusion architecture that is composed of a frozen image encoder and conditions the diffusion model with cross-attention. As done in prior works, we train the diffusion model to reconstruct images from frozen embeddings. We demonstrate that without text-to-image pretraining or co-training, this model qualitatively achieves near-perfect image reconstruction. This suggests that the capacity to generate image variations via reconstruction is due to the implicit regularization inherent in the pre-trained or co-trained text-to-image model. While empirically this may be sufficient to generate plausible image variations, the relationship between the text-to-image model, image variations and scale remains unclear.

In this paper, we explore a different pretraining strategy with the same image-conditioned diffusion architecture. We train our model Semantica using image episodes, which are image pairs that belong to the same web page. Therefore, training relies exclusively on the hypothesis that images from the same web page should have some common semantic attributes. For example, it is probable that images scraped from a Wikipedia page on dolphins, contain pictures of dolphins. To generate image variations, the model receives an image and then generates another image that preserves semantic information. Under this pre-training strategy, our experiments demonstrate that scaling both the image encoder and the diffusion decoder steadily improve image variation quality. In Fig. 1, we compare Semantica to state-of-the-art image variation models. Semantica is capable of generating high quality and diverse images, reflective of semantic information from the conditioning image.

Evaluating image variations is non-trivial. Unlike standard image generative modeling where a model generates images from scratch, a model has access to the entire test set of images via conditioning when generating image variations. This means a model could simply copy the conditioning image and achieve high scores both at distribution-level and instance-level metrics. To bridge this limitation in existing metrics, we instead propose to evaluate image-variations exclusively in the few-shot setting. Concretely, we limit the number of conditioning images available to the model and then measure its ability to model the test distribution.

Our main contributions are:

- •
Current techniques train diffusion models on image reconstruction to produce image variations. Our analysis shows that diffusion models trained to reconstruct images from frozen embeddings produce only minor low-level variations.
- •
We explore an alternative pretraining strategy for generating image variations. This involves conditioning a diffusion model with a random image from a webpage and training it to denoise a different random image from the same webpage.
- •
We rigorously compare DINOv2 and CLIP as frozen image encoders to produce image variations. While CLIP is now the standard image encoder, our experiments demonstrates that DINOv2 yields superior performance.
- •
Standard image-level metrics such as LPIPS and distribution-level metrics such as FID fail to capture diversity in image variations. To address this, we introduce few-shot metrics designed to assess the diversity in image variations.

## 2 Related Work

### 2.1 Image Variations

SD-V2 Image Variations (Pinkney, ), IP-Adapter (Ye et al., ), MultiFusion (Bellagente et al., ) and Verstatile Diffusion (Xu et al., ) generate image variations via image reconstruction. Specifically, SD-V2, IP-Adapter and MultiFusion adapt a pretrained Stable Diffusion model. SD-V2 swaps the frozen CLIP text embedding with the CLIP image embedding, first only finetunes the cross-attention layers of the SD model to attend to the image embedding and then the entire backbone. IP-Adapter trains a adapter layer to the output of the clip image embedding and additional decoupled cross-attention layers. MultiFusion finetunes a LLM to accept additional image inputs. The resultant LLM embeddings than condition a pretrained Stable-Diffusion model. Versatile Diffusion trains a single model to perform both text-to-image and image variations, with some decoupled components such as cross-attention. All these methods use the same input image as the target image, and rely on regularization for variations. Bordes et al. () analyze the reconstructions generated by diffusion models conditioned on just the global embedding from self-supervised models and show that they can reconstruct image semantics. Here we show, with cross-attention based conditioning, near perfect reconstruction can be achieved.

### 2.2 Generative Transfer

Prior to image variations, there has been research that studies the adaptation of source-pretrained generative models to a target dataset with adaptation of weights. Initial works study the transfer of discriminators and generators in GANs from a source dataset to a target dataset (Wang et al., ). Further, Grigoryev et al. () show that ImageNet pretraining on a large GAN model is beneficial for transfer to small datasets. A number of papers focus on improving generation quality by adapting only a subset of parameters. These include scale and shift parameters (Noguchi & Harada, ), updating only the higher discriminator layers (Mo et al., ), linear combinations of scale and shift parameters (Shahbazi et al., ),
modulating kernels or convolutions (Zhao et al., ; ; Cong et al., ; Alanov et al., )
and singular values (Robb et al., ), mapping networks from noise to latents (Wang et al., ; Mondal et al., ; Yang et al., ) and latent offsets (Duan et al., ). Various works apply regularization losses by enforcing constraints to samples/weights by the source generator including elastic weight regularization (Li et al., ), domain correspondence (Ojha et al., ; Gou et al., ; Hou et al., ), contrastive learning (Zhao et al., ), spatial alignment (Xiao et al., ), inversion (Wu et al., ; Kato et al., ; Thopalli et al., ), random masks on discriminators (Zhu et al., ) and alignment free spatial correlation (Moon et al., ). Given the increasing popularity of VQ-VAE and diffusion based models, recent work (Sohn et al., ) and (Zhu et al., ) explore few-shot finetuning on VQ-VAE tokens and diffusion models. We defer to Abdollahzadeh et al. () for a detailed exposition of all these methods. In contrast to these works, we explore training a generator on web-scale images and study their transfer to standard small-scale image datasets. Retrieval augmented models (Casanova et al., ; Blattmann et al., ) compute nearest neighbours for a query image across a bank of memory images. These retrieved neighbors facilitate the training or generation process.
Unlike these methods, we do not require access to a memory bank of images during train or test time.

### 2.3 Diffusion

Diffusion and score-based generative models have become increasingly successful in modelling images (Ho et al., ; Saharia et al., ; Nichol et al., ; Balaji et al., ), videos (Ho et al., ; Singer et al., ) and audio (Kong et al., ). As generation quality has steadily improved, they have been used in contexts with more and more conditioning variables. Well-known examples are text-to-image and text-to-video modelling, where the conditioning variable is text. In this case, the conditioning variable can be seen as a sequence from which cross-attention layers communicate to the feature maps of the image or video, i.e. what the diffusion model is learning to generate (Saharia et al., ; Nichol et al., ). As the desire for controllable generation increases, solutions such as ControlNet (Zhang et al., ) have been developed. ControlNet takes in conditioning images of the same size as the generations, and uses a copy of the UNet to learn an encoder for the conditioning signals. Although this encoder trains fast due to parameter initialization from a pretrained diffusion UNet, it is difficult to deal with different sized inputs. In those cases, only conditioning via cross-attention as done in (Xu et al., ) overcomes the in-place additions between the ControlNet encoder and the base UNet. Conditioning on images as context has produced impressive results, turning scribbles or edge detections into high quality image generations (Wang et al., ; Najdenkoska et al., ) and discriminative tasks (Bai et al., ; Li et al., ). In contrast with the above mentioned techniques, our framework relies on general web-based pretraining for semantic-based adaptive image generation. While (Giannone et al., ) study the transfer of few-shot diffusion models between small datasets (CIFAR-100 $\rightarrow$ miniImageNet, we see in Sec. 2 that this can lead to sub-optimal transfer. (Liu et al., ) employ test-time guidance using similarity scores with a reference image, to steer unconditional generative models. However, they still require training a separate unconditional generative model for each domain.

## 3 Model

### 3.1 Diffusion

Diffusion models learn to generate examples by gradually denoising a diffusion process. For a single datapoint, their loss can be expressed as a squared error between the original datapoint and its prediction:

$$ $\mathbb{E}_{t\sim\mathcal{U}(0,1),{\bm{{\epsilon}}}\sim\mathcal{N}(0,{\mathbf{ I}})}\big{[}w(t)||{\bm{x}}-f({\bm{z}}_{t},t,t)||^{2}\big{]}\text{ where }{\bm{ z}}_{t}=\alpha_{t}{\bm{x}}+\sigma_{t}{\bm{{\epsilon}}}_{t}$ (1) $$

It is helpful to define $\mathrm{SNR}(t)=\alpha_{t}^{2}/\sigma_{t}^{2}$. In the case of $w(t)=\mathrm{SNR}(t)$ the loss above is equivalent to a loss in ${\bm{{\epsilon}}}$-space, the simple loss from Ho et al. (). After training, the denoising model generates samples by taking small steps. Starting at $t=1$ with initial Gaussian noise and one slowly denoises for timesteps $t=1,1-1/N,\ldots$ where the number of sampling steps is $N$. Although many samplers are possible, in this paper we use the standard DDPM sampler (Ho et al., ).

### 3.2 Image Encoder

Training an image-conditioned diffusion model requires an image encoder that extracts semantic information from a conditioning image. We could train a separate ViT end-to-end as an image encoder with the diffusion model to learn useful conditioning representations. Instead, we leverage pre-trained image encoders and condition our diffusion model on their “frozen” representations. This offers two advantages. First, we can precompute representations for all images in the dataset that eliminates expensive forward passes through the encoder during training. Second, we can use different scales of readily available pre-trained encoders and just focus on scaling the diffusion model. We investigate ViT image encoders trained with two pretraining strategies, contrastive learning (SigLIP) (Zhai et al., ) and self-supervised learning (DINOv2) (Caron et al., ; Oquab et al., ).

### 3.3 Diffusion Decoder

In early days, diffusion literature typically used UNets that consisted of ResNet blocks, with optional self-attention layers. More recent architecture either use full Transformers (DiT (Peebles & Xie, ), StableDiffusion) or UNeTs with transformer backbones (UViTs) ((Hoogeboom et al., ). The transformer backbone makes it especially easy to use conditioning signals in these architecture via cross-attention layers. To be precise, the denoising neural network takes in a noised image at a certain timestep ${\bm{z}}_{t}\in\mathbb{R}^{H\times W\times 3}$, timestep $t\in\mathbb{R}$ and contextual information $c\in\mathbb{R}^{T_{c}\times D_{c}}$. In principle it does not matter which diffusion or generative model we use to generate images. In practice we use the simple diffusion framework (Hoogeboom et al., ) because it can learn to generate high resolution images end-to-end without the need of a separate autoencoder.

### 3.4 Conditioning Information

Formally, the image encoder encodes the context image $\displaystyle{\bm{X}}_{c}\in\mathbb{R}^{H\times W\times C}$ into a sequence of tokens $\displaystyle{\bm{X}}_{C}\in\mathbb{R}^{T_{c}\times D_{c}}$, We follow the encoder-decoder framework in the original Transformer (Vaswani, ) to condition the diffusion decoder with context tokens. We employ conditioning only in the lowest-resolution transformer in UViT. Every self-attention block in the transformer backbone is followed by a cross-attention block, where the diffusion decoder cross-attends to $\displaystyle{\bm{X}}_{c}$. In addition to conditioning via cross-attention, we also explore conditioning only using global features using the CLS token. Specifically, we normalize the CLS token, embed it with a dense projection and add it to the timescale embedding. The resultant embedding then conditions the diffusion model via FiLM layers (Perez et al., ).

## 4 Image Variations via Reconstruction

A common technique to generate image variations is to incorporate image-specific context into the denoising objective using frozen embeddings.

$$ $\mathbb{E}_{t\sim\mathcal{U}(0,1),{\bm{{\epsilon}}}\sim\mathcal{N}(0,{\mathbf{ I}})}\big{[}||{\bm{x}}-f({\bm{z}}_{t},t,{\bm{x}}_{c})||^{2}\big{]}$ (2) $$

where $f$ is a pre-trained model on a different objective, for example text-to-image modeling (Ye et al., ; Bellagente et al., ), ${\bm{x}}$ is an image and ${\bm{x}}_{c}$ are frozen embeddings from the same image.

The objective amounts to reconstruction where the diffusion model is trained to reconstruct the context image in pixel space from frozen embeddings. The generation of diverse image variations via reconstruction can be attributed to two primary factors.

- 1.
The frozen embeddings from the image encoder retain information only useful for the upstream task it is trained on. This in turn, leads to a lossy representation of the original image and the diffusion model has to fill in the missing details.
- 2.
The pretrained diffusion decoder provides implicit regularization that prevents the model from simply collapsing to the conditional input image.

We train a diffusion model from scratch to optimize Eq 2 with DINOv2 frozen embeddings. Qualitatively, we see that extremely early in training, less than 100K steps, the generated samples almost collapse to the conditional image. Fig. 2 displays three samples from the trained diffusion model, showing some very minor low-level variations but no high-level variations. Similar results can be seen using SigLIP frozen embeddings in App. B. This suggests that pretraining or jointly training on a text-to-image pretraining objective may be the principal source of image variations. While this may be sufficient to generate reasonable image variations, it is non-trivial to predict the relationship between $f$ and the quality of image variations. For example, does a bigger text-to-image model lead to better image variations?

Figure: Figure 2: A conditional diffusion model reconstructs images from frozen DINOv2 embeddings. Left: Input Images. Right: Three samples from the trained diffusion model with guidance 0.0 exhibiting low-level variation but lacking high-level variation.
Refer to caption: extracted/5895413/plots/reconstruct/cond0.jpg

## 5 Image Variations via Web-Scale Image Pairs

Inspired by web-scale image-text pretraining (Radford et al., ), we modify the denoising objective as follows:

$$ $\mathbb{E}_{t\sim\mathcal{U}(0,1),{\bm{{\epsilon}}}\sim\mathcal{N}(0,{\mathbf{ I}})}\big{[}||{\bm{x}}-f({\bm{z}}_{t},t,{\bm{y}}_{c})||^{2}\big{]}$ (3) $$

where ${\bm{x}}$ is an image from a webpage and ${\bm{y}}_{c}$ are frozen embeddings obtained from another random image from the same webpage.

In particular, we use Episodic WebLI (Chen et al., ), where each episode contains randomly sampled loosely related images (i.e., they are clustered according to their URL). Note that Episodic Webli is explicitly deduplicated from all standard image train and test benchmarks. While Episodic Webli was originally designed for training few-shot vision language models, we introduce a novel application by utilizing it to train image variation models. We randomly sample an image as the conditioning input ${\bm{x}}$ and another image from the same episode as the ground-truth ”target” image ${\bm{y}}_{c}$.

Each episode consists of images that are loosely related, whereas our model assumes conditioning and target images share semantic information. This mismatch may lead the model to waste capacity on modeling irrelevant noisy conditioning-target pairs. To address this we filter out pairs with low similarity as done in image-text pretraining. The pretrained encoder computes the global CLS representation from the conditioning and target image. We compute the cosine similarity between the global conditioning/target representations and filter out pairs below a lower threshold. Unlike image-text pretraining, we also filter conditioning-target pairs with similarity above a high threshold. in order to ensure generation of interesting images. This can ensure that generated images retain the semantics of the conditioning image, while being sufficiently different and interesting. App. D provide more information on how the high and low thresholds were set. After filtering, we obtain a dataset of around 50M image pairs. Notably, despite utilizing a dataset an order of magnitude smaller than standard text-to-image datasets (Schuhmann et al., ), we achieve strong results on image variations.

## 6 Experiments

### 6.1 Architecture Details

For our baseline Semantica model, we inherit all hyper-parameters from the ImageNet label conditioned diffusion model. The denoising model follows a U-ViT architecture that operates on $256\times 256$ images. The architecture consists of a initial $1\times 1$ convolution. The model has four downsampling stages, where each stage downsamples the feature maps by a factor of 2 at its output and a final transformer stage. The resolution of the lowest feature map is $16\times 16$. Transformer blocks operate at the stages with the two lowest resolutions $16\times 16$ and $32\times 32$ and convolutional blocks operate in the remaining stages. The four downsampling stages have 128, 128, 256 and 512 channels and the final transformer has 1024 channels. The first three stages have three blocks each and the last stage has sixteen blocks. The optimizer is Adam (Kingma & Ba, ) with parameters $\beta_{1}=0.9$, $\beta_{2}=0.99$, $\epsilon=1e^{-12}$, batch size of 2048 and a learning rate of $2e^{-4}$. We also use Polyak averaging with a decay factor of $0.9999$. The diffusion loss parameters include v-prediction with loss in epsilon phase and a cosine adjusted schedule with a noise resolution of 32. We use the DDPM sampler with an interpolation of 0.2 (standard deviation is $\sigma_{t\to s}^{0.2}\sigma_{st}^{0.8}$) and $0.5$ guidance for our ablations. Each ablation run utilizes 256 TPUv3 (Google, ) chips around 300K steps. However, the consistent ranking of different ablations throughout training can allow for a much shorter training schedule to identify the best model. We report the FID on 50000 ImageNet samples. Our final Semantica model that operates on $512\times 512$ has a $2\times 2$ patchification layer instead of $256\times 256$. We then use 128, 256, 1024, 2048 and 4096 channels with 2, 3, 3, 3 and 12 blocks each.

### 6.2 Choice of Image Encoder

We first compare two choices of conditioning the diffusion model on frozen image embeddings. Global feature conditioning with FiLM layers and local feature conditioning with cross-attention. Fig. 7 shows that cross-attention with local features, consistently outperforms FiLM across both SigLIP and DINO encoders. The result highlights the importance of local features for image variations.

Then, we investigate the impact of scaling pretrained encoders and diffusion models. We evaluate eight combinations of two encoders each with Base and Large scales and two scales of diffusion models (SiD B and SiD L). Table. 1 reports the FID of each of these combinations at 300K steps. Scaling the encoder while keeping the diffusion model fixed, offers improvements ranging from -0.8 for (SiD-L + DINO) to -1.5 for (SiD-B + SigLIP). Scaling the diffusion model with a fixed encoder size consistently improves FID by around -4.0 for all encoders. Finally, jointly scaling the encoder and diffusion model together results in significant improvements: DINOv2 improves from 13.0 to 9.0 and SigLIP from 17.1 to 11.2. Thus, from here on we will use DINOv2 as the frozen image encoder.

**Table 1: We report the FID on ImageNet across two encoders (DINOv2 and SigLIP), two diffusion model sizes (SiD B and SiD L) and two encoder sizes (B and L) at 300K steps. DINOv2 encoder performs better than SigLIP across all setups. Joint scaling of both the diffusion model and the image encoder works best for both setups.**
|  | SiD B | SiD L |
| --- | --- | --- |
| DINOv2 B | 13.0 | 9.8 |
| DINOv2 L | 11.7 | 9.0 |

## 7 Metrics for Image Variations

Previous methods assess image variations using the following approach. For each reference image in a test set, the model generates a new image. To quantify the quality of image variations, these methods employ LPIPS (Zhang et al., ) for individual image comparisons and FID (Heusel et al., ) or Precision/Recall (Kynkäänniemi et al., ) to compare test to generated distributions. These metrics can be sufficient to compare variations of our model on our episodic dataset since we explicitly filter out near duplicates, and in theory, the model is unlikely to repeat the same image. However, one major drawback is its inability to measure how diverse the generates samples are with respect to the input image. For instance, a model that just copies the input image or produces very minor variations will have near perfect LPIPS and FID. Thus, these metrics are not ideal for image variation baselines that rely on reconstruction.

To address this limitation, we propose a few-shot approach to assess image variations. Given a set of $\displaystyle N$ test images, we randomly select $\displaystyle K$ images and generate $N/K$ samples for each, resulting in a total of $\displaystyle N$ samples. We then evaluate FID, recall and precision between the $\displaystyle N$ test images and $\displaystyle N$ samples. Precision measures the quality of the generated samples while recall measures sample diversity.

Here we demonstrate how few-shot recall effectively captures the diversity of the generated samples. As a reminder, recall is the proportion of test images that lie within the manifold of generated samples. For each generated sample $i$, let $\displaystyle d_{i}$ be the distance to its $\displaystyle K$ th nearest neighbour. A ground-truth image has recall 1.0, if it lies within $\displaystyle d_{i}$ to any generated sample $\displaystyle i$. In the extreme case, where a model copies the same image during generation, $d_{i}=0$ for all $\displaystyle i$. Thus a new test image will have $d_{i}>0.0$ for all $i$, which leads to recall 0.0. Conversely, a sample that steers far away from the conditioning image is less likely to be represented in the real data manifold and is hence likely to have low precision. Finally, we also employ few-shot FID that provides a single score combining both quality and diversity.

## 8 Comparisons

### 8.1 Baselines

We compare Semantica to state-of-the-art image variation baselines: Versatile Diffusion (Xu et al., ), Stable Diffusion v2 Image Variations and IP-Adapter (Ye et al., ) on generating image variations of size $512\times 512$. As seen in Sec. 2.1, all baselines rely on image reconstruction to generate image variations. We sweep across a range of guidance factors for all baselines. See App. E) for detailed results of FID with respect to guidance.

### 8.2 ImageNet Oneshot

Figure: Figure 3: Comparison of Semantica against three state-of-the-art image variation baselines on one-shot ImageNet, using evaluation metrics: FID (Left Table) and Precision-Recall (Right Plot:) as evaluation metrics. Each point in Fig. 3 Right represents a different guidance factor. Semantica outperforms image-variation baselines achieving lower FID and a better precision-recall tradeoff.
Refer to caption: x17.png

#### Setup.

We compare Semantica with Versatile Diffusion, IP-Adapter and SD-v2 Image Variations on one-shot ImageNet. Remember that ImageNet has a total of thousand classes. We sample ten images randomly per-class and create a ground truth set of 10000 images. Each baseline model receives one image per-class and generates ten samples per-image with different random seeds, leading to a total of 10000 samples. We then compute FID, precision and recall between 10000 ground truth images and 10000 samples.

#### Results.

Fig. 3 left reports the one-shot FID of all four models. For each model, we tune the guidance factors. Table 6 provides detailed results on the relationship between guidance factors and FID for each model. Semantica improves over the previous image variation models achieving a FID of 17.9, 2.3 over the second-best model IP-Adapter. Fig. 3 right displays the precision-recall tradeoff of all models across different guidance factors. Since the conditioning information is present to all models, note that all models have much higher precisions than recall. IP-Adapter and Versatile Diffusion have precision greater than 0.8. SD-V2 IV has higher recall but much lower precision. At lower precisions, Semantica achieves similar recall as compared to SD-V2 IV with much higher precision. At a precision of 0.8, Semantica achieves a high recall higher than the IP-Adpater baseline. Semantica achieves the best-tradeoff between precision and recall among all the baselines.

### 8.3 Label Grouped Baseline

**Table 2: Comparison between Semantica and a Label Grouped baseline (LG) trained on ImageNet. The conditioning and target pairs have the same label for LG. LG outperforms Semantica in-distribution and performs worse on out-of-distribution datasets.**
|  | ImageNet | Bedroom | Church | SUN397 |
| --- | --- | --- | --- | --- |
| Label grouped | 4.8 | 46.2 | 27.1 | 29.7 |
| Semantica | 18.4 | 6.2 | 17.3 | 6.7 |
| Guidance $@$ 0.5 |  |  |  |  |
| Label grouped | 5.1 | 34.2 | 20.4 | 22.4 |
| Semantica | 6.2 | 2.4 | 4.0 | 2.5 |

Here we compare Semantica to a baseline that has direct label supervision (for example, ImageNet) on lower resolution images $256\times 256$. Recall that the conditioning and target image belong to the same webpage. However, in the presence of label supervision (as in ImageNet), the target and conditioning image can just belong to the same class label. So as a supervised baseline, we group images on ImageNet as per their label and train Semantica on this dataset. Table 2 compares the FID of the Label Grouped baseline (LG) to Semantica. Since LG is trained on ImageNet, it significantly outperforms Semantica (FID 4.8 vs FID 18.4). However, this trend reverses on all other datasets, where Semantica outperforms LG. Both the supervised baseline and Semantica rely on the DINOv2 encoder which was trained on a wide variety of data sources. Therefore the encoder itself may provide useful representations on a number of datasets. But training LG just on ImageNet, might limit the diffusion model’s exposure from non ImageNet images, potentially explaining its significant performance drop on all other datasets.

## 9 Conclusion and Limitations

Our paper explores a new method for training image-conditioned diffusion models to generate image variations. Instead of the typical image reconstruction approach, we condition the model on one random image from a webpage and train it to denoise another random image from the same webpage. Through rigorous evaluations, DINOv2 as the image encoder produces better image variations than the popular CLIP model. Finally, we emphasize the difficulty in measuring image variations, and propose new metrics that are applicable in the one-shot setting.

In this work, we focus on evaluating image variations on datasets consisting of mainly a single object. When multiple objects are present in an image, additional supervision in the form of bounding boxes or text can allow for fine-grained control of generations. Further, as in prior works, we focus on frozen image encoders to efficiently encode representations and filter data as opposed to training an image encoder end-to-end. Thus Semantica can inherit the biases of the frozen image encoder. We leave studying the tradeoffs between finetuning and using frozen representations to future work.

## Appendix A More Samples: ImageNet

Figure: Figure 4: We present additional samples and comparisons on ImageNet. Samples from Semantica reflect diversity while being congruent with the conditioning image.
Refer to caption: x18.png

## Appendix B CLIP: Reconstruct Images

We train a diffusion model conditioned on SigLIP embeddings to reconstruct the original image. Fig. 5 shows four samples images from the ImageNet validation set and the corresponding generations from the generative model.

Figure: Figure 5: A conditional diffusion model reconstructs images from frozen SigLIP embeddings. As seen in the case with frozen DINOv2 embeddings in Fig.2, the generated samples exhibit very minor low-level variations.
Refer to caption: x48.png

## Appendix C Data Filtering

Figure: Figure 6: FID of DINO-v2 B/14 + Cross Attention with and without data filtering
Refer to caption: x56.png

We investigate the impact of semantic data filtering. We note that DINOv2 models are more aggressive than CLIP in assigning low similarities to image pairs. So we set the lower threshold of CLIP and DINOv2 models such that, the total number of examples are roughly the same. This leads to a lower threshold of 0.65 for CLIP and 0.9 for DINOv2. We set the higher threshold to 0.9 in order to filter out near-duplicates. Fig. 7 middle shows the FID of the DINO-v2 B/14 + Cross Attention with and without data filtering. Similarity-based data filtering in DINO feature space positively impacts the generation quality and improves FID by greater than 10. In future work, we can explore tuning these thresholds for a desired quality-diversity tradeoff or even directly conditioning the diffusion model on the desired similarity with the conditioning image.

## Appendix D Film vs Cross-attention

Here, we compare Film based conditioning to cross-attention based conditioning.

Figure: Figure 7: We plot ImageNet FID as a function of number of training steps on Episodic WebLI. Left: DINO-v2 B/14 with Film and cross attention Right: SigLIP B/14 with film and cross attention.
Refer to caption: x57.png

## Appendix E ImageNet one-shot FID vs Guidance Hyperparameters

We report fine-grained FID results for different guidance values. Tab. 3 reports fine-grained FID results for SD-v2 IV and Versatile Diffusion. Tab. 5, reports results for IP-Adapter and Semantica.

**Table 3: Guidance against one-shot ImageNet FID. Left: SD-IV and Right: Versatile Diffusion**
| Guidance | FID |
| --- | --- |
| 1.0 | 46.7 |
| 4.0 | 30.8 |
| 6.0 | 34.5 |
| 8.0 | 37.6 |

**Table 4: Semantica**
| Guidance | Scale | FID |
| --- | --- | --- |
| 1.0 | 0.5 | 57.4 |
| 4.0 | 0.5 | 25.4 |
| 7.0 | 0.5 | 24.5 |
| 1.0 | 1.0 | 42.6 |
| 2.0 | 1.0 | 23.2 |
| 4.0 | 1.0 | 20.2 |
| 7.0 | 1.0 | 20.6 |
| 7.0 | 1.0 | 21.2 |

## Appendix F SUN-397 Oneshot

This experiment compares Semantica with IP-Adapter on one-shot SUN-397. SUN-397 has a total of 397 classes. We sample 25 images randomly per-class and create a ground truth set of 9925 images. Each model generates 25 samples given a randomly sampled image, leading to total of 9925 samples. Similar to ImageNet, Fig. 8 reports FID, precision and recall between the 9925 generated samples and ground-truth images. Semantica achieves a one-shot FID of 13.0, outperforming IP-Adapter. It also achieves a much more favourable precision-recall tradeoff.

Figure: Figure 8: Comparison of Semantica against IP-Adapter on one-shot SUN397, using evaluation metrics: FID (Left Table) and Precision-Recall (Right Plot:) as evaluation metrics.
Refer to caption: x59.png

Figure: Figure 9: We present additional samples and comparisons on SUN397
Refer to caption: extracted/5895413/plots/appendix/sun397/0.jpg

**Table 6: Guidance against one-shot SUN397 FID. Left: IP Adapter and Right: Semantica**
| Guidance | Scale | FID |
| --- | --- | --- |
| 1.0 | 0.5 | 24.6 |
| 4.0 | 0.5 | 14.1 |
| 7.0 | 0.5 | 16.7 |
| 1.0 | 1.0 | 20.0 |
| 4.0 | 1.0 | 17.8 |
| 7.0 | 1.0 | 27.9 |

## Appendix G Qualitative Effect of Guidance

Fig. 10, displays five conditioning images from ImageNet and the generated samples at different guidance factors. At guidance factor 0.0, the samples reflect a broad semantic category from the conditioning image. Increasing the guidance factor leads to samples that incorporate more specific details from the conditioning image. For example, with the conditioning image of the dog and the kid, Semantica stars with a sample of a dog. The specific breed of the dog and the child in the image appear as we amplify the guidance. Fig. 11 showcases samples for each small dataset across various guidance factors. In row four, the bed (main object) persists across all guidance levels, while the chair and the fence appear at high guidance levels. Row five exhibits a similar effect: the number of minarets in the generated church increases from one to two and the shape of the main dome begins to resemble the conditioning image. In row one, the sample resembles toys with zero guidance, the sample resembles toys but transforms into a crowded convention as guidance increases.

Figure: Figure 10: Left: Conditioning Image from ImageNet. Right: Generated samples with guidance factors 0.0, 0.1, 0.2, 0.5 and 1.0. At guidance factor 0.0, the samples reflect a broad semantic category from the conditioning image. Increasing the guidance factor leads to samples that incorporate more specific details from the conditioning image.
Refer to caption: extracted/5895413/plots/imagenet_guidance/cond0.jpg

Figure: Figure 11: Left: Conditioning Images from SUN397 (Top two rows), LSUN Bedrooms (Middle two rows) and LSUN churches (Last two rows). Right: Generated samples with guidance factors 0.0, 0.1, 0.2, 0.5, 1.0 and 1.5.
Refer to caption: extracted/5895413/plots/smaller_guidance/sun397_c0.jpg

Figure: Figure 12: Left: Conditioning image Right: Five samples at guidance 0.5. Semantica is trained exclusively on web-image pairs. During adaptation, it receives a conditioning image and generates samples reflective of semantic information. Semantica requires no label supervision or finetuning.
Refer to caption: extracted/5895413/plots/appendix/fig1/c2_act.jpg

## Peer Reviews

confidence: 5
contribution: 2
initial_rating: 3
presentation: 2
questions: Refer to Weakness.
soundness: 3
strengths: 1. This paper is easy to understand.
2. The proposed method achieves good results on several benchmarks.
summary: This paper focuses on the task of generating image variations and proposes the Semantica model. Unlike traditional diffusion model training, Semantica is trained on web-scale image pairs. It receives a random (encoded) image from a webpage as conditional input and denoises another noisy random image from the same webpage. Additionally, the paper explores the impact of different image encoders on the results.
weaknesses: 1. I have some doubts about the task of generating image variations. The model trained in this paper only supports image input and does not support text guidance, so it doesn’t seem to have strong practical value for real-world image editing. Additionally, many AIGC models already support various tasks such as image editing and style transfer. Therefore, I don't quite understand the value of the generating image variations task.
2. Emu2 [1] has already discovered that using CLIP image embeddings as conditional inputs for training a diffusion model can successfully reconstruct images, which is similar to the findings in this paper.
3. From the visual results, it is difficult to see any advantage of the proposed method over IP-Adapter. Moreover, IP-Adapter has broader application scenarios, as it can adapt to various text-to-image models.



[1] Generative Multimodal Models are In-Context Learners. CVPR, 2024.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 4
questions: 1. In eqn 1, why there is 2 variable t? One of them is context?
soundness: 2
strengths: * Generating diverse image variations by training on images from the same webpage is both simple and interesting.
* The paper is well-written and easy to follow. The visualizations seem to outperform the prior works listed in the paper.
* The designs and ablation studies of different model components are well explained.
summary: This paper introduces a new model, Semantica, which generates image variations given contextual input images. The model is trained on web-scale image pairs. Specifically, it is trained with pairs of images from the same webpage. Multiple design choices are discussed in the paper, such as the selection of the image encoder, diffusion decoder, etc. The model is evaluated on a few-shot version of FID, recall, and precision for the generation of image variations and outperforms prior works such as SD-v2, IP-adapter, and Versatile Diffusion.
weaknesses: * There is a missing comparison with some related work, such as RIVAL [1] which also targets the image variation task.
* Few-shot FID, precision, and recall may not be sufficient to fully quantify performance. Some metrics proposed in the table 1 of RIVAL [1] could provide more insightful for evaluations.
* There is a lack of a user study to compare different methods, which would be more convincing, as numerical metrics may not fully quantify performance.


**Reference**

[1] Real-World Image Variation by Aligning Diffusion Inversion Chain, NeurIPS 23

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 2
questions: 1. Image representation learning, e.g. self-supervised, image reconstruction based, contrastive learning and etc, are wildly studied. How the other encoders perform compared with DINO? e.g. MAE (ref 1)
2. Web-scale image is indeed Episodic WebLI in this paper. Are there any other web-scale images? Why choose Episodic WebLI in particular?
3. Please explain robustness of the method with respect to the cleanest of the web-scale images (line 306-315), e.g. what if the web-scale images are not well filtered out, how the method perform then?
4. As explained in the paper, the commonly used metrics, e.g FID, fail to evaluate variation performance. However, it's still not clear how the proposed solution (sec 7) can be effective in measure diversity, e.g. Fig. 3 should be further analysed to explain diversity superiority.

re1: Masked Autoencoders Are Scalable Vision Learners, CVPR 2022
soundness: 2
strengths: 1. With web-scale images, this paper successfully find a good application on top of it to perform Image variation generation, which is inspiring and effective as illustrated in the experiments section.
2. The final conclusion that DINOV2 produces image representation for better image variations is also interesting, explaining self-supervised representation learning is promising in achieving effective image generation/editing.
3. The proposed new way of evaluate performance of image variation techniques seems interesting and inspiring.
summary: This paper works on image variations generation based on two main observations. Firstly, conditional diffusion models with frozen condition embeddings can reconstruct the image with minor variations. Secondly, web-scale image can be used to train image variation models. This paper then examine various design choices for condition representation generation given its crucial role in the proposed method, and find DINOV2 can provide good image representation for better image variation generation.
weaknesses: 1. The analysis on image encoder part for image variation (sec 2.2) seems not informative enough, although it's one main contribution of the paper, as it's common sense that the effectiveness of conditional representation is crucial for image generation.
2. A new application of web-scale image for image variation is not well explained. It's not clear how the authors come up with this idea of using web-scale image for image variation, making it hard to evaluate the significant of the contrition.
3. Data filtering should be clearly introduced as it's one of the main contribution. However, Sec. 5 is not clear (see Questions 3).
4. The experimental results section seems weak in proving superiority of the proposed solution. (see Questions 4)

---

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: Please provide specific examples or quantitative evidence demonstrating how LPIPS and FID fail to capture diversity in image variations and should do a comparative analysis between the proposed one-shot metrics and LPIPS/FID, including specific examples where the new metrics better capture diversity.
soundness: 3
strengths: - The idea of using the semantic relations of image pairs with in the the same web page is a good contribution which can lead to even more  research direction then the focus of this paper
- The observation of image diversity issue in current SOTA , mitigate it and suggest new metric to evaluate it
summary: The paper if focus on the challenge of generating image variations, with large diversity while preserving the the conditions' semantics.
The authors suggest a new pre-training method exploiting the semantic relations of images within the same web page.   
It also discuss the challenge of measuring image diversity and suggest a few-short metrics approach
weaknesses: The claim that "Standard image-level metrics such as LPIPS and distribution-level metrics such as FID fail
to capture diversity in image variations" is not backup with number and/or examples

Meta-review: This work targets on generating image variations by training the model with web-scale image pairs. The idea of leveraging the semantic relations of image pairs and simplicity of method are appreciated. However, several main concerns raised by reviewers include the unclear motivation and lack of comparison. It received one clear reject, two borderline reject and one borderline accept. The rebuttal partly addressed some concerns but did not convince reviewers. While this work shows the capability of generating variations of a given image, it didn't present its bigger value beyond variation, which sort of limits the scope of this work. The current evaluation is still insufficient to support claims as well. Considering all the comments and discussions, AC made the decision of reject. The direction is promising but current presentation is incomplete and requires more revision before acceptance. Authors are encouraged to polish it by incorporating all the suggestions from reviewers and consider resubmission elsewhere.

Decision: Reject