Playing around with Google's DeepDream algorithm for feature visualization.
This example is based on Google's algorithms for feature visualization in their Tensorflow examples and HvassLabs's recursive image optimization algorithm.
- 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
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:
- Simple gradient ascent
- Multiscaled gradient ascent
- Laplacian Pyramid Gradient Normalization
- DeepDream
- HvassLabs's recursive optimization algorithm.
Input image:
Inception V5 DeepDream on the conv2d1 layer:
VGG16 DeepDream on the conv3_2 layer:
Inception V5 DeepDream on the mixed4_b layer applied to a clean gray image:
VGG16 DeepDream on the conv5_1 layer applied to a clean gray image:
Check out the test_output
directory for more interesting examples.