Assignment #5 - Zilin Zhang (zilinzha)

Project Overview

This homework aims to implement a few different techniques that require to manipulate images on the manifold of natural images.

Part 1: Inverting the Generator

(1) Results for different Lp loss, Preceptual loss and regularization loss are shown below.

Different Preceptual loss (latent = z):

Sample Image
Target
Sample Image
perc_wgt = 0.01, l1_wgt = 10
Sample Image
perc_wgt = 0.1, l1_wgt = 10
Sample Image
perc_wgt = 1, l1_wgt = 10

Different Lp loss (latent = z):

Sample Image
Target
Sample Image
perc_wgt = 1, l1_wgt = 1
Sample Image
perc_wgt = 1, l1_wgt = 10
Sample Image
perc_wgt = 1, l1_wgt = 50
Sample Image
perc_wgt = 1, l1_wgt = 100

Different regularization loss (perc_wgt = 1, l1_wgt = 1, latent = z):

Sample Image
Target
Sample Image
reg_lr = 0.1
Sample Image
reg_lr = 0.01
Sample Image
reg_lr = 0.001

(2) different generative models and (3) different latent space

perc_wgt = 1, l1_wgt = 1

Sample Image
Target
Sample Image
Vanilla + z
Sample Image
Stylegan + z
Sample Image
Stylegan + w
Sample Image
Stylegan + w+

The smaller Preceptual weight gives better resultlarger which is closer to the target image. The smaller L1 Weight alsohe give better result, as the L1 loss is used to ensure that the image is a close match to the target. For different GANs, the StyleGAN results give better color than Vanilla GAN results. For different latent spaces, the w and w+ takes more time, but give results with better color and details like the eyes.

So from the results, I think the combiniation of StyleGAN, perc_wgt = 1, l1_wgt = 1 and latent w+ space has the best performance and is the closest to the target image. This takes about 10.23s to run on my laptop. The result of latent space w with the same parameters looks nice as well.

Part 2: Scribble to Image

Sample Image
Input
Sample Image
Output
Sample Image
Input
Sample Image
Output
Sample Image
Input
Sample Image
Output

These results are generated using StyleGAN. The input images which is denser has better performance in color, while image which is sparser is harder to guidanceet the information of the color correct. The third image is the input of my own drawing, but does not work well to get the color.

Part 3: Stable Diffusion

The prompt I use is "Grumpy cat reimagined with blue eyes" to change the eye color.

The result of 2 different classifier-free guidance strength values, with 500 noise steps:

Sample Image
Strength = 15
Sample Image
Strength = 35

The result of 2 different classifier-free guidance strength values, with guidance strength of 35:

Sample Image
noise steps = 500
Sample Image
noise steps = 700

Another input image and the corresponding result with strength = 15 and 200 noise steps is shown below:

Sample Image
Input image
Sample Image
Strength = 15

As we can see, with the higher the guidance strengths, the prompt has more impact on the output, and the eye color of the cat is closer to blue. And for more noises added to the image, the result image looks more different than the input. As you can see from the experiment, the color of the whole cat becomes different.