Activation Maximization is the optimization-based approach to generating inputs that maximally activate a target neuron or output class in a neural network — using gradient ascent in input space to find (or synthesize) the input pattern that a neuron responds most strongly to.
Pick the target
Neuron, channel, layer, or class
Initialize the input
Noise, fixed image, or learned prior
Gradient ascent in input spaceRepeat until activation plateaus
Forward pass
Compute the target activation
Backprop to the input
∇ₓ a_target(x), not the weights
↻ next ascent step
Apply the prior
Total variation or GAN regularizer
Step the input
x ← x + η∇ₓ a_target
Check convergence
Activation stops increasing
Export the visualization
The neuron's preferred input
Activation Maximization Process
Target: Choose a neuron, channel, layer, or output class to maximize.
Initialize: Start with noise, a fixed image, or a learned prior (generator network).
Gradient Ascent: Compute $∇_x a_{\text{target}}(x)$ and update the input: $x \leftarrow x + \eta ∇_x a_{\text{target}}$.
Regularization: Apply image priors (total variation, frequency penalization, learned priors) to produce natural-looking results.
svg
The prior is a trade, not a free lunch. Unconstrained ascent pushes activation as high as possible but the result usually looks like psychedelic noise; adding a total-variation prior or a learned GAN prior gives up a little activation in exchange for an image a human can recognize.
Why It Matters
Neuron Identity: Reveals the "ideal stimulus" for each neuron — what it has learned to represent.
Class Visualization: Generate the "ideal" input for each output class — the network's prototype of each category.
GAN Priors: Using a GAN generator as the parameterization produces photorealistic activation maximization.
Activation Maximization is finding the neuron's favorite input — the optimization-based core technique behind feature visualization and neural network understanding.