I've seen a few questions on this site about Deep Dream, however none of them seem to actually speak as to what DeepDream is doing, specifically. As far as I've gathered, they seem to have changed the objective function, and also changed backpropagation so that instead of updating weights they update the input image.

I'm wondering if anyone knows exactly what Google did. They mention in one of their articles imposing Bayesian priors when they carry out their optimization, and with this I can imagine that getting the neural net to spit out an image for each label is not that difficult - we can simply set the label, and then optimize the input vector accordingly.

However, the interesting part of deep dream is that it does this per layer, and in this regard I'm not quite sure how it emphasizes the details in a per layer way.

Certainly, feeding in an image will give you values at each neuron, but then how can we use that information to exaggerate details in the original image? I've struggled to find any detailed write-ups about this.

References: Here vzn answered a similar question: https://cs.stackexchange.com/a/44857/49671

Except it doesn't offer exaggeration of features as discussed here:http://googleresearch.blogspot.com/2015/06/inceptionism-going-deeper-into-neural.html

Where they both show the visualization of particular classes, and particular layers, and say:

Instead of exactly prescribing which feature we want the network to amplify, we can also let the network make that decision. In this case we simply feed the network an arbitrary image or photo and let the network analyze the picture. We then pick a layer and ask the network to enhance whatever it detected.

• Possible duplicate of Google's Deep Dreamer Commented Nov 29, 2017 at 21:12

If you look at the code, the key part is objective_L2 function that makes this: $dx = x$ and then backpropagates.
• But what derivative we take? Suppose that we have an input 30x30. And our feature map (which detects cats is 5x5). For each of these 25 neurons we have a derivative (Jacobian) of size 30x30. Do we sum all these 25 derivatives of size 30x30? I.e., is the final image for each neuron in layer of interest: image += grad(neuron)? Commented Oct 6, 2023 at 12:04