What is Deep Dream?
Deep Dream is a computer vision algorithm created by Alexander Mordvintsev from Google. The algorithm works by creating a dream-like effect. Deep Dream works by feeding an image into a trained ANN, where the neurons fire and generate activations. The Deep Dream algorithm works by trying to change the input image in a way that makes some of these neurons fire more (boost the neurons’ firing or activations). The process is continuously repeated until the input image contains all the features that a specific layer was originally looking for.
Steps of Deep Dream
- Forward an image through a trained ANN, CNN, ResNet, etc.
- Select a layer of choice (first layers capture edges, deep layers capture full shapes such as faces).
- Calculate the activations (output) coming out from the layer of interest.
- Calculate the gradient of the activations with respect to the input image.
- Modify the image to increase these activations, and thus enhance the patterns seen by the network, resulting in a trippy, hallucinated image.
- Iterate and repeat over multiple scales.