Assignment #3 - Cats Generator Playground
Yu-Chen Lin
I. Description
In this homework, we try to synthesis new images based on the given images. We aim to train two models to handle two different kinds of tasks. The first one is DCGAN. It is used to generate images based on one specific domain. The other one is CycleGAN. It can transfer the style from one domain to another given the paired images from two domains.
II. DCGAN
Padding
The derivation of padding is shown as follows.
Training Loss (--data_preprocess=basic)
Training Loss (--data_preprocess=deluxe)
Samples with --data_preprocess=deluxe and DiffAugment
III. CycleGAN
Patch Discriminator with 1000 iterations on grumpifyCat dataset
Patch Discriminator with 10000 iterations on grumpifyCat dataset
We discuss the effect of the cycle consistency loss for grumpifyCat as follows.
For the positive effect, it can preserve the overall shape when transferring from the source domain to the target domain. For example, for Y to X, without the cycle consistency loss, we cannot identify the image of (row, col) = (2, 7). On the other hand, the shape of the image is preserved can the generated image with the cycle loss.
For the negative effect, it can sometimes overfit to the background. To see this on X to Y images, please look at the image of (row, col) = (1, 1). The image without the cycle loss have eyes showing, while the image with the loss seems to fit into the background so that the eyes cannot be shown completely.
Patch Discriminator with 10000 iterations on apple2orange dataset
We discuss the effect of the cycle consistency loss for apple2orange as follows.
For the positive effect, it can make the generated images more smooth and thus reasonable. For example, for the X to Y case, the image at (row, col) = (1, 3) transform to a more realistic face by using the cycle consistency loss.
For the negative effect, the smoothness effect seems to sacrifice some diversity on the image. To see this, we can focus on the image at (row, col) = (1, 7) for the Y to X case. The original image without the cycle loss can produce an apple with the green part (that the apple has not been ripe yet). On the other hand, the smoothing effect caused by the cycle loss make this realistic part disappear.
DC vs Patch Discriminator on grumpifyCat dataset
Patch discriminator can generate local pixels more effectively. For example, the eyes generation is more reasonable when using the patch discriminator; see X to Y, the images at (row, col) = (1, 7) or (2, 7) for failure examples using the DC discriminator.
DC vs Patch Discriminator on grumpifyCat dataset
The generative content using the DC discriminator seems to be more messy; see Y to X, the images at (row, col) = (1, 3) or (1, 7). On the other hand, the generative images using the patch discriminator can produce the local pixels more successfully as the results look smoother.
IV. Bells & Whistles
Diffusion Model
For diffusion model, I adapted the code from The Annotated Diffusion Model. Below are the demonstration of the generation results. The results look more realistic than the previous models.
Pre-trained Diffusion Model
I used Promptist to optimize the prompt and applied runwayml/stable-diffusion-v1-5 to do the generation.
Variational Autoencoder
Below are the results from different iterations. The results of VAE seem to be blurry, which is under expectation.
Generative Models Zoo!