DeepDream - a code example for visualizing Neural Networks
July 1, 2015
Posted by Alexander Mordvintsev, Software Engineer, Christopher Olah, Software Engineering Intern and Mike Tyka, Software Engineer
Two weeks ago we blogged about a visualization tool designed to help us understand how neural networks work and what each layer has learned. In addition to gaining some insight on how these networks carry out classification tasks, we found that this process also generated some beautiful art.
Top: Input image. Bottom: output image made using a network trained on places by MIT Computer Science and AI Laboratory.
We have seen a lot of interest and received some great questions, from programmers and artists alike, about the details of how these visualizations are made. We have decided to open source the code we used to generate these images in an IPython notebook, so now you can make neural network inspired images yourself! The code is based on Caffe and uses available open source packages, and is designed to have as few dependencies as possible. To get started, you will need the following (full details in the notebook):
- NumPy, SciPy, PIL, IPython, or a scientific python distribution such as Anaconda or Canopy.
- Caffe deep learning framework (Installation instructions)
Once you’re set up, you can supply an image and choose which layers in the network to enhance, how many iterations to apply and how far to zoom in. Alternatively, different pre-trained networks can be plugged in.
It'll be interesting to see what imagery people are able to generate. If you post images to Google+, Facebook, or Twitter, be sure to tag them with #deepdream so other researchers can check them out too.
Other posts of interest
-
November 13, 2025
Separating natural forests from other tree cover with AI for deforestation-free supply chains- Climate & Sustainability ·
- Global ·
- Open Source Models & Datasets ·
- Responsible AI
-
November 5, 2025
Forecasting the future of forests with AI: From counting losses to predicting risk- Climate & Sustainability ·
- Global ·
- Open Source Models & Datasets
-
October 23, 2025
Google Earth AI: Unlocking geospatial insights with foundation models and cross-modal reasoning- Climate & Sustainability ·
- Generative AI ·
- Machine Perception