Nerual Style Transfer

Introduction

In this assignment, you will implement neural style transfer which resembles specific content in a certain artistic style. For example, generate cat images in Ukiyo-e style. The algorithm takes in a content image, a style image, and another input image. The input image is optimized to match the previous two target images in content and style distance space.

Part 1: Content Reconstruction

</tr></table>

  1. We can see that reconstruction from initial convolution layers result in output closer to the content image, while reconstruction from later convolution layers result in more texture from the original noise image.

recon_1
Reconstruction from conv_1 content

recon_3
Reconstruction from conv_3 content

recon_5
Reconstruction from conv_5 content

phipps
Original botanic garden

recon_phipps
Reconstruction of botanic garden

wally
Original dog

recon_wally
Reconstruction of dog

  • Here are some of the reconstruction examples. The reconstruction has slighly different color in some patches, but overall the original image and the reconstructed one are pretty similar. My favorite one is the dog picture.
  • Part 2: Texture Synthesis

    </tr></table>

    1. Texture generated from earlier layers reflect coarser shape of texture and texture generated from later layers reflect finer details of texture.

    texture_123
    Texture from conv_1, conv2, conv3

    texture_45
    Texture from conv_4, conv_5

    texture_135
    Texture from conv_1, conv_3, conv_5

    texture_scream
    Texture from The Scream

    texture_frida
    Texture from Frida Kahlo's portrait

  • The textures here are generated from all conv layers. This means that the low level details and high level shape of the texture are all included.
  • Part 3: Style Transfer

    1. The optimization runs for 300 steps with parameters style_weight=1000000, content_weight=1. The content layer is conv_4 and style layer is all the conv layers.

      dances
      Original dancing image

      wally
      Original dog image

      pic
      Picasso style

      pic_dance
      Picasso style dancing

      pic_wally
      Picasso style dog

      star
      Starry Night style

      star_dance
      Starry Night style dancing

      star_wally
      Starry Night style dog

    2. Here are some results of style transfer.
    3. Here are some results from random noise. Compared to the previous results, the ones generated from random noise is significantly less clear and has many artifacts that doesn't belong in the content image.

      pic_dance_noise
      Generated from Picasso style, dancing content

      pic_wally_noise
      Generated from Picasso style, dog content

      frida_falling
      Frida Kahlo style Falling Waters

      jackson_phipps
      Jackson Pollock painting

      jackson_phipps
      Jackson Pollock style botanic garden

    4. Some of my favourite outputs.