When Cats meet GANs

In [2]:
from PIL import Image
import matplotlib.pyplot as plt

Part 1

The curve for generator and discriminator should converge to a similar value when the GAN managed to train

Basic augmentation curves

In [7]:
disc = Image.open('results/dgcnn_basic_discrim_loss.png')
gen = Image.open('results/dgcnn_basic_generator_loss.png')
plt.figure(figsize=(20,20))
plt.subplot(1,2,1)
plt.imshow(disc)
plt.subplot(1,2,2)
plt.imshow(gen)
Out[7]:
<matplotlib.image.AxesImage at 0x1c3d05ea910>

Deluxe augmentation curves

In [6]:
disc = Image.open('results/dgcnn_deluxe_discrim_loss.png')
gen = Image.open('results/dgcnn_deluxe_generator_loss.png')
plt.figure(figsize=(20,20))
plt.subplot(1,2,1)
plt.imshow(disc)
plt.subplot(1,2,2)
plt.imshow(gen)
Out[6]:
<matplotlib.image.AxesImage at 0x1c3d04babe0>

result at iteration 200 and iteration 6000 with deluxe augmentation

We can see that at iteration 200, the generated image looks more like noise. We can only see some vague black and white pattern. At iteration 6000, it is able to generate details of the cat like mouth, nose and eyes. The result looks much more realistic.

In [4]:
iter200 = Image.open('results/sample-000200_vanilla_deluxe.jpg')
iter6000 = Image.open('results/sample-006000_vanilla_deluxe.jpg')
plt.figure(figsize=(20,20))
plt.subplot(1,2,1)
plt.imshow(iter200)
plt.subplot(1,2,2)
plt.imshow(iter6000)
Out[4]:
<matplotlib.image.AxesImage at 0x1c3d023b3a0>

Part 2

Without Cycle Consistency, 600 iters

In [10]:
xy = Image.open('results/sample-000600-X-Y.jpg')
yx = Image.open('results/sample-000600-Y-X.jpg')
plt.figure(figsize=(20,20))
plt.subplot(1,2,1)
plt.imshow(xy)
plt.subplot(1,2,2)
plt.imshow(yx)
Out[10]:
<matplotlib.image.AxesImage at 0x1c3d08c7640>

With Cycle Consistency, 600 iters

In [11]:
xy = Image.open('results/cycle_sample-000600-X-Y.jpg')
yx = Image.open('results/cycle_sample-000600-Y-X.jpg')
plt.figure(figsize=(20,20))
plt.subplot(1,2,1)
plt.imshow(xy)
plt.subplot(1,2,2)
plt.imshow(yx)
Out[11]:
<matplotlib.image.AxesImage at 0x1c3cfeb4b80>

Without Cycle Consistency, 10000 iters

In [12]:
xy = Image.open('results/sample-010000-X-Y.jpg')
yx = Image.open('results/sample-010000-Y-X.jpg')
plt.figure(figsize=(20,20))
plt.subplot(1,2,1)
plt.imshow(xy)
plt.subplot(1,2,2)
plt.imshow(yx)
Out[12]:
<matplotlib.image.AxesImage at 0x1c3d03fbbe0>

With Cycle Consistency, 10000 iters

In [13]:
xy = Image.open('results/cycle_sample-010000-X-Y.jpg')
yx = Image.open('results/cycle_sample-010000-Y-X.jpg')
plt.figure(figsize=(20,20))
plt.subplot(1,2,1)
plt.imshow(xy)
plt.subplot(1,2,2)
plt.imshow(yx)
Out[13]:
<matplotlib.image.AxesImage at 0x1c3d0461d30>

Observation

It seems images generated without cycle consistency is a little bit darker than the images generated with cycle consistency. This is more obvious in early iterations and for grumpy cat to russian blue. I belive it is caused by the cycle consistency force the generated image to have colors that are failthful to original real images.