Activation Maximization

Finding the input that maximizes the activation of a Unit, mostly used to visualize the feature detectors in a CNN.

For a single neuron we can write an optimization problem like this

img=argmaximghn,x,y,z(img)i m g^*=\arg \max _{i m g} h_{n, x, y, z}(i m g)

where

  • hh is the Activation Function
  • x,yx,y encode the position of the Unit
  • nn is the layer
  • zz is the channel index

The mean activation for an entire channel can be achieved by averaging over all neruons in that channel

img=argmaximgx,yhn,x,y,z(img)i m g^*=\arg \max _{i m g} \sum_{x, y} h_{n, x, y, z}(i m g)

Bildschirmfoto 2023-07-23 um 19.32.29.png

Using the minimum instead of the maximum is not working. It will correspond to ...

You can start with an image from

  • the training data
  • random noise
    • need to do Regularisation like
      • jittering
      • rotation
        • linear combination of all channels leads to entangled features (makes interpretability harder)
      • scaling
      • frequency penalization to reduce variance of neighboring pixels
      • GANs
      • denoising Autoencoder