/DeepDream

Playing around with Google's DeepDream algorithm for feature visualization.

Primary LanguageJupyter Notebook

DeepDream Image Generation

Playing around with Google's DeepDream algorithm for feature visualization.

Resources

This example is based on Google's algorithms for feature visualization in their Tensorflow examples and HvassLabs's recursive image optimization algorithm.

Requirements

  • Python version 3.6 or higher (or Anaconda 3) and Jupyter Notebook.
  • Tensorflow version 1.10.0 or higher (CPU or GPU version) - Note that the GPU version requires you to have an nvidia gpu and you are required to install various nvidia drivers (CUDA and BLAS), but I still prefer it because it processes images a lot faster.
  • Pillow's PIL.Image package version 3.0 or higher (normally comes with Anaconda 3) - image processing

Idea

Testing how the Inception V5 and VGG16 models and their layers react to random noise and different input images in terms of features. The following algorithms suggested by Google were tested:

  1. Simple gradient ascent
  2. Multiscaled gradient ascent
  3. Laplacian Pyramid Gradient Normalization
  4. DeepDream
  5. HvassLabs's recursive optimization algorithm.

Examples

Input image:

Cat

Inception V5 DeepDream on the conv2d1 layer:

CatDeep

VGG16 DeepDream on the conv3_2 layer:

CatDeep2

Inception V5 DeepDream on the mixed4_b layer applied to a clean gray image:

IncGray

VGG16 DeepDream on the conv5_1 layer applied to a clean gray image:

VGGGray

Check out the test_output directory for more interesting examples.