Interpreting Neural Networks
- 81Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Why is relying only on trial-and-error hyperparameter search considered unsatisfactory from a scientific standpoint?
81 questions
- 1
Why is relying only on trial-and-error hyperparameter search considered unsatisfactory from a scientific standpoint?
Model answer
Trial-and-error can improve a model without explaining why the improvement occurred. Interpretability methods aim to support improvement through theory and visualization.
Explanation
Validation sets and hyperparameter searches identify methods that work, but they do not necessarily reveal the network's decision process or the reasons for its behavior.
- 2
What is the main purpose of neural-network interpretation methods?
Model answer
They explain how a network makes decisions by mapping an output back to the input or by examining internal activations and layers.
Explanation
These methods help identify which input regions were discriminative and what patterns individual neurons or layers represent.
- 3
What are the three methods used to identify which parts of an input influenced a network output?
Model answer
The three methods are saliency maps, occlusion sensitivity, and class activation maps.
Explanation
These methods map output decisions back toward the input space, although they use different procedures and provide different levels of precision.
- 4
What methods can be used to investigate intermediate layers of a neural network?
Model answer
Gradient ascent, class model visualization, dataset search, and deconvolution can be used to study intermediate activations and learned representations.
Explanation
These methods reveal what neurons, feature maps, and layers respond to, rather than focusing only on a particular input-output decision.
- 5
How do classification networks often acquire localization ability even when trained with image-level labels?
Model answer
Convolutional feature maps preserve spatial information, allowing the network to associate class evidence with specific image regions even without explicit object-location labels.
Explanation
Class activation maps demonstrate that a classifier can localize relevant objects despite being trained only to classify whole images.
- 6
Why might interpretability be important when deploying an animal classifier in a pet shop?
Model answer
Interpretability can show whether the classifier is focusing on the animal itself rather than irrelevant background features.
Explanation
Showing the decision process can increase trust and reveal whether the model is using meaningful evidence.
- 7
What does a Softmax output layer produce in a single-animal classification problem?
Model answer
It produces a probability distribution over the possible animal classes, with all class probabilities summing to one.
Explanation
The network first produces unrestricted class scores, and Softmax converts them into normalized probabilities.
- 8
What is the difference between a pre-Softmax class score and a post-Softmax probability?
Model answer
A pre-Softmax score can range from negative infinity to positive infinity, whereas a post-Softmax probability is normalized and lies between zero and one.
Explanation
Softmax computes each probability by exponentiating its class score and dividing by the sum of all exponentiated class scores.
- 9
Why are interpretability methods useful for improving neural networks, not just explaining them?
Model answer
They can reveal whether a model uses meaningful features, identify problematic behavior, and provide insight into which representations should be improved.
Explanation
Visualization can expose irrelevant cues, inactive feature maps, or useful internal patterns that are otherwise hidden.
- 10
What is a saliency map?
Model answer
A saliency map is a matrix showing how strongly each input pixel affects a selected output score, usually through the gradient of that score with respect to the input.
Explanation
The resulting matrix has the same spatial dimensions as the input, and large absolute values indicate influential pixels.
- 11
How is a saliency map computed for a selected class such as dog?
Model answer
The gradient of the dog's pre-Softmax score is backpropagated all the way to the input pixels.
Explanation
The derivative indicates how changes at each pixel would affect the selected class score.
- 12
Why does a saliency map have the same shape as the input image?
Model answer
It contains one gradient value for each input pixel or input element, so its dimensions match those of the input.
Explanation
Backpropagation produces the derivative of the selected score with respect to every element of the input matrix.
- 13
What does a large absolute value in a saliency map indicate?
Model answer
It indicates that the corresponding input pixel has a strong influence on the selected class score.
Explanation
The sign indicates the direction of influence, while the magnitude indicates its strength.
- 14
Why is the pre-Softmax score generally preferred to the post-Softmax probability when creating a saliency map?
Model answer
A probability can change because the scores of competing classes change, even when the selected class score does not. The pre-Softmax score more directly measures evidence for the selected class.
Explanation
Because Softmax normalizes all classes together, increasing a competing class can affect the selected probability without directly affecting the selected class's own score.
- 15
How can a saliency map be used for rough object segmentation?
Model answer
Pixels with sufficiently large saliency values can be selected using a threshold to estimate the object's location.
Explanation
This approach may identify the relevant object approximately, but it is generally less effective than specialized segmentation methods.
- 16
Why are saliency maps often considered less precise than occlusion sensitivity?
Model answer
Saliency maps use local gradients, which may not provide a robust or precise estimate of the full region responsible for a decision.
Explanation
Occlusion sensitivity directly tests the effect of removing image regions and can produce a clearer localization map.
- 17
What is occlusion sensitivity?
Model answer
Occlusion sensitivity measures how a class score changes when a small region of the input is covered or removed.
Explanation
The image is repeatedly evaluated with an occluding square at different positions, and the resulting scores form a spatial confidence map.
- 18
Describe the basic procedure for constructing an occlusion-sensitivity map.
Model answer
Move an occluding square across the image, forward-propagate each modified image, record the selected class score, and place each score at the square's location.
Explanation
Regions whose occlusion causes a large score decrease are likely important for the network's decision.
- 19
What does a decrease in the selected class score after occlusion indicate?
Model answer
It indicates that the covered region contained evidence supporting the selected class.
Explanation
For example, covering a dog's face may reduce the dog score because facial information is important to the classifier.
- 20
Can occluding part of an image ever increase the probability of a class? Explain why.
Model answer
Yes. Occlusion can remove distracting or competing evidence, causing the network to become more confident in the selected class.
Explanation
For example, covering a human face near a dog may reduce evidence for the human class and increase the relative confidence in the dog class.
- 21
How does the size of the occluding square affect the resulting map?
Model answer
A smaller square usually produces a more spatially precise map, while a larger square gives coarser localization.
Explanation
The map's resolution depends on how finely the input is sampled during occlusion.
- 22
What can occlusion sensitivity reveal when an object contains a distinctive secondary feature?
Model answer
It can reveal that covering the secondary feature changes the class score, showing that the network relies on that feature.
Explanation
For example, covering a tennis ball in a picture of a Pomeranian may reduce the Pomeranian score if the network associates the dog with the ball.
- 23
How do saliency maps and occlusion sensitivity differ in their computational approach?
Model answer
Saliency maps use backpropagated gradients, whereas occlusion sensitivity repeatedly performs forward passes on deliberately modified inputs.
Explanation
Occlusion is often slower but can provide a more direct test of how each region affects the output.
- 24
What is a class activation map?
Model answer
A class activation map is a spatial map showing which regions of an image contribute most strongly to a particular class.
Explanation
It is constructed from the final convolutional feature maps and the class-specific weights that combine them.
- 25
Why does flattening the final convolutional output make localization difficult?
Model answer
Flattening removes the explicit spatial arrangement of the feature map, and fully connected layers then mix information without preserving where it originated.
Explanation
Once spatial structure is discarded, it becomes difficult to map a classifier response back to a specific image region.
- 26
What architectural change enables the basic class activation map method?
Model answer
The final convolutional output is followed by global average pooling and a fully connected Softmax classifier instead of flattening followed by fully connected layers.
Explanation
Global average pooling summarizes each feature map while retaining a direct relationship between feature maps and class-specific weights.
- 27
How does global average pooling transform a convolutional volume?
Model answer
It averages each feature map over all spatial locations, converting a volume such as 4×4×6 into a vector of six values.
Explanation
Each output value summarizes the average activation of one filter across the entire feature map.
- 28
What does each value produced by global average pooling represent?
Model answer
It represents the average activation of one feature map and therefore summarizes how strongly that feature was detected across the image.
Explanation
The feature map may respond to a visual pattern, while global average pooling reduces its spatial responses to one summary value.
- 29
How is a class activation map computed from the final convolutional feature maps?
Model answer
Each feature map is multiplied by its weight for the chosen class, the weighted maps are summed, and the result is upsampled to the input-image size.
Explanation
The class-specific weights determine how much each learned visual feature contributes to the selected class.
- 30
Why is the class activation map dependent on the selected class?
Model answer
Each class has different weights connecting the pooled feature maps to its output score, so different classes produce different weighted combinations.
Explanation
A feature map that strongly supports the dog class may contribute little or negatively to the human or car class.
- 31
Why does global average pooling not completely destroy spatial information for class activation maps?
Model answer
The original spatial positions of the feature-map activations are still known, so the class-specific weighted contributions can be computed at each location before upsampling.
Explanation
The spatial map is recovered by rearranging the summation over feature maps and spatial positions rather than discarding the feature maps themselves.
- 32
What is the main difference between a saliency map and a class activation map?
Model answer
A saliency map is obtained by backpropagating a gradient to the pixels, whereas a class activation map combines final convolutional feature maps using class-specific weights and upsamples the result.
Explanation
Class activation maps do not require pixel-level gradient backpropagation for their visualization.
- 33
Why can a classification network localize an object using class activation maps despite having only image-level labels?
Model answer
The final convolutional feature maps retain spatial patterns, and class-specific weighting identifies the locations where evidence for the class is strongest.
Explanation
The network learns spatially organized features that support classification, allowing those features to be visualized as approximate object locations.
- 34
What is gradient-ascent class model visualization?
Model answer
It is an iterative method that updates an input image to maximize a chosen class score, usually while applying regularization so the image remains visually interpretable.
Explanation
The process repeatedly forward-propagates the current image, backpropagates the objective gradient, and changes the pixels in the ascent direction.
- 35
What objective is typically maximized during class model visualization?
Model answer
The objective is the selected class score minus a regularization term that encourages the image to look natural.
Explanation
The class score drives the image toward features recognized by the network, while regularization prevents meaningless extreme or noisy patterns.
- 36
Why is regularization needed during gradient-ascent visualization?
Model answer
Without regularization, gradient ascent can create unnatural images with extreme pixel values or high-frequency noise that still produce a large class score.
Explanation
Regularization constrains the optimization toward patterns that are easier for humans to interpret.
- 37
What does L2 regularization encourage in a visualized image?
Model answer
It discourages extreme pixel values and encourages pixel values to remain relatively moderate and similar in scale.
Explanation
The resulting image can then be rescaled to a display range such as 0 to 255.
- 38
Why might pixel values need to be clipped during gradient-ascent visualization?
Model answer
Optimization is not automatically restricted to the valid image range, so pixels can exceed the usual display range of 0 to 255.
Explanation
Clipping keeps the synthesized image within a meaningful range for visualization.
- 39
What problem does Gaussian blurring address in class model visualization?
Model answer
It reduces high-frequency pixel-to-pixel variations and encourages smoother transitions between neighboring pixels.
Explanation
Smooth images are generally easier to interpret than images whose adjacent pixels have sharply different values.
- 40
What can happen when a class model visualization maximizes the score for flamingo?
Model answer
The visualization may contain multiple flamingos because the network can assign a higher flamingo score to several flamingos than to a single one.
Explanation
The synthesized image reflects what maximizes the network's learned score, not necessarily what appears most natural to a human.
- 41
How can gradient ascent be used to study an intermediate activation rather than an output class?
Model answer
The chosen intermediate activation is used as the objective, and the input is optimized to maximize that activation.
Explanation
The resulting image reveals the type of pattern that causes the selected neuron or feature to fire strongly.
- 42
What is dataset search for interpreting a feature map?
Model answer
Dataset search identifies the examples in a dataset that produce the largest activation for a selected feature map or neuron.
Explanation
The top-activating examples provide concrete evidence about the visual pattern represented by that internal feature.
- 43
How can dataset search suggest that a feature map detects shirts or edges?
Model answer
If the top-activating dataset images consistently contain shirts, the feature map may detect shirts; if they contain edges, it may detect edges.
Explanation
Repeated visual similarities among the strongest activations reveal the feature's likely representation.
- 44
Why are the top-activating images in dataset search sometimes shown as crops rather than full images?
Model answer
An activation often sees only a receptive field, which is a subregion of the original image, so the corresponding crop shows the region that influenced it.
Explanation
The crop can be located using the layer's filter sizes, strides, and preceding operations.
- 45
How does the receptive field change as a network becomes deeper?
Model answer
A deeper activation generally depends on a larger portion of the original input because successive convolutions and pooling operations expand its effective receptive field.
Explanation
Early activations may respond to small edges, while later activations can represent larger objects or object parts.
- 46
Why are early-layer filters often easier to interpret than deep-layer filters?
Model answer
Early filters operate directly on pixels and commonly detect simple patterns such as edges, whereas deeper filters combine earlier features into more abstract patterns.
Explanation
Deep filters may respond to faces, clothing, text, or other complex structures that are not easily understood by inspecting the weights alone.
- 47
What kinds of representations can emerge in intermediate layers without being explicitly labeled during training?
Model answer
Networks can learn representations such as faces, wrinkles, text, edges, and object parts because these features help support the final classification task.
Explanation
Only the final class labels may be provided, yet useful intermediate concepts can emerge automatically.
- 48
What is the purpose of deconvolution in visualization?
Model answer
Deconvolution reconstructs an approximate input-space representation of what caused a selected internal activation.
Explanation
It reverses the network's operations along a backward path so that the visual evidence for an activation can be displayed in input coordinates.
- 49
What are two applications of deconvolution besides visualization?
Model answer
Deconvolution can upsample encoded representations for image segmentation and can be used in image reconstruction or generation.
Explanation
Segmentation requires returning a compressed representation to the original image resolution, while generative models use upsampling to produce images.
- 50
Why is upsampling needed in image segmentation networks?
Model answer
Convolutional encoding reduces height and width, but the final segmentation mask must match the spatial resolution of the original image.
Explanation
A deconvolutional or other upsampling network restores the encoded representation to image-sized dimensions.
- 51
How is deconvolution-based visualization different from gradient-ascent visualization?
Model answer
Gradient ascent iteratively changes an input to maximize an activation, whereas deconvolution reconstructs an activation in the input space through one backward pass.
Explanation
Deconvolution is therefore generally faster, although its reconstruction is an approximation.
- 52
Why are all but the maximum activation of a selected feature map set to zero before deconvolution?
Model answer
Keeping only the maximum isolates the strongest response and reduces interference from other activations during reconstruction.
Explanation
Reconstructing all activations at once can produce a messier image with additional noise or overlapping evidence.
- 53
What three operations must be reversed or approximated when reconstructing an activation through a convolutional network?
Model answer
The reconstruction uses unpooling, a ReLU reconstruction operation, and deconvolution to reverse max pooling, ReLU, and convolution.
Explanation
These operations are applied repeatedly in reverse order until the selected activation is represented in the input space.
- 54
How can a one-dimensional convolution be represented mathematically?
Model answer
It can be written as a matrix-vector multiplication, such as y=Wx, where each row of W contains the filter weights positioned according to the convolution's stride and padding.
Explanation
The matrix encodes which input elements contribute to each output and places zeros where an input should not contribute.
- 55
For a one-dimensional convolution with input size 12, filter size 4, stride 2, and padding 2, what is the output size?
Model answer
The output size is 5, using ny=snx−f+2p+1.
Explanation
Substituting the values gives ny=212−4+2(2)+1=5.
- 56
For the convolution described above, what is the shape of the matrix W in y=Wx?
Model answer
The matrix W has shape 5×12 because the output has five elements and the input has twelve elements.
Explanation
Each of the five rows produces one output value from the twelve-element input vector.
- 57
How do stride and padding appear in the matrix representation of a convolution?
Model answer
The filter weights shift between rows by the stride, while zeros represent padded input values or input positions that do not affect a particular output.
Explanation
This matrix structure reproduces the same local weighted sums as the original convolution.
- 58
Under what mathematical assumption can the input of a convolution be reconstructed using the inverse matrix?
Model answer
If the convolution matrix W is invertible, the input can be written as x=W−1y.
Explanation
In practice, exact invertibility is not guaranteed, so the reconstruction is treated as an approximation.
- 59
What stronger assumption is often made to simplify convolution reconstruction, and what does it imply?
Model answer
If W is assumed to be orthogonal, then W−1=WT and WTW equals the identity matrix.
Explanation
This allows reconstruction using the transpose of the convolution matrix rather than computing a general inverse.
- 60
Why is the reconstruction obtained through transposed convolution not necessarily exact?
Model answer
The convolution matrix may not actually be invertible or orthogonal, so using its transpose provides only an approximate reconstruction.
Explanation
The approximation is still useful for visualizing which input patterns contributed to an activation.
- 61
How does transposed convolution relate to the transpose of the convolution matrix?
Model answer
It applies the transpose operation associated with the convolution matrix, often implemented by flipping the filter, inserting zeros, and using a smaller stride.
Explanation
This operation increases spatial dimensions and approximates mapping the output representation back toward the input.
- 62
What is sub-pixel convolution in the context of deconvolution?
Model answer
It inserts zeros between elements of the input representation so that upsampling can be implemented as an ordinary convolution with flipped weights and a reduced stride.
Explanation
This gives an efficient implementation of the same mathematical operation as the transposed convolution.
- 63
Why are the convolutional filter weights flipped in the sub-pixel implementation?
Model answer
Flipping the weights makes the ordinary convolution reproduce the weighted sums required by the transposed operation.
Explanation
The flipped filter, inserted zeros, and adjusted stride together implement the desired reconstruction pattern.
- 64
How is a two-dimensional deconvolution performed conceptually?
Model answer
The filter is applied with a reduced stride to an upsampled representation, and overlapping contributions are added to reconstruct a larger spatial output.
Explanation
Unlike the forward convolution, neighboring filter placements in the reconstruction overlap and update shared output locations.
- 65
Why is the orthogonality assumption useful for visualization but unnecessary when training a segmentation decoder?
Model answer
Visualization reuses the already learned convolutional weights, so an approximate transpose is needed; a segmentation decoder can learn its own deconvolutional weights directly.
Explanation
When decoder weights are trained, they do not need to be the inverse or transpose of the encoder's weights.
- 66
Why is max pooling not mathematically invertible?
Model answer
Max pooling retains only the maximum value from each region and discards the other values.
Explanation
Different input regions can produce the same maximum, so the original values cannot be recovered exactly from the pooled output alone.
- 67
How do pooling switches help approximate the inverse of max pooling?
Model answer
Switches record the location of the maximum within each pooling region, allowing the pooled value to be placed back at that location while other positions are set to zero.
Explanation
The original nonmaximum values remain unknown, so this is still an approximation.
- 68
How does ReLU behave during ordinary backpropagation?
Model answer
Gradients are passed through positions that were positive during the forward pass and set to zero at positions whose forward activations were negative.
Explanation
Negative inputs produce zero ReLU outputs and therefore did not influence later loss values through that pathway.
- 69
Why can a ReLU deconvolution operation differ from ordinary ReLU backpropagation?
Model answer
ReLU deconvolution is designed to emphasize input pixels that positively support the selected activation and to reduce dependence on the original forward activation pattern.
Explanation
It is a visualization heuristic rather than a strict mathematical inverse of ReLU.
- 70
What information is passed backward in a deconvolutional reconstruction?
Model answer
The reconstruction uses the selected activation, pooling switches, and the convolutional filters or their transposed versions.
Explanation
These elements allow the method to trace the activation backward through pooling, nonlinearities, and convolutions.
- 71
What is Deep Dream's central modification to ordinary activation visualization?
Model answer
Deep Dream sets the gradient at a chosen layer equal to that layer's activation, backpropagates it to the input, and updates the pixels repeatedly.
Explanation
Strongly active patterns are thereby reinforced over successive iterations.
- 72
Why do patterns become increasingly visible during Deep Dream optimization?
Model answer
Patterns that already activate the network receive stronger gradient signals, so updating the image makes those patterns even more prominent.
Explanation
This positive feedback can cause recognizable objects or textures to emerge from existing image content.
- 73
What would Deep Dream tend to produce when applied to lower network layers?
Model answer
It would tend to amplify simple features such as edges and basic textures.
Explanation
Lower layers detect relatively simple patterns, whereas deeper layers respond to more complex objects and object parts.
- 74
Why can a Deep Dream image contain many animals or other repeated objects?
Model answer
The network may strengthen any region that partially resembles a learned object, causing repeated activations and increasingly visible copies of that object.
Explanation
The process amplifies the network's learned patterns rather than enforcing a single coherent object.
- 75
What does a gradient-ascent visualization of a dumbbell reveal about the network's learned concept?
Model answer
It may reveal that the network represents a dumbbell together with a human hand or arm because training examples commonly show dumbbells being held.
Explanation
The visualization reflects correlations in the training data, not necessarily the isolated object definition a human would use.
- 76
How can visualization reveal dead neurons or inactive feature maps?
Model answer
If a feature map remains dark or inactive for many different inputs, the corresponding feature may never be detected and the neuron may not be learning useful representations.
Explanation
Visualization tools can expose consistently inactive units that would be difficult to identify from final accuracy alone.
- 77
Which interpretability methods are most appropriate for identifying what part of an input caused a particular output?
Model answer
Occlusion sensitivity, saliency maps, and class activation maps are appropriate because they map output evidence back to the input.
Explanation
These methods focus on input attribution rather than the general meaning of intermediate neurons.
- 78
Which methods are useful for understanding the role of a particular intermediate neuron or feature layer?
Model answer
Dataset search, gradient ascent, and deconvolution-based reconstruction are useful for interpreting intermediate activations.
Explanation
They show either which real images activate a feature, what synthetic input maximizes it, or what input region produced it.
- 79
How can visualization help determine whether a model is relying on the correct evidence?
Model answer
It can show whether the model focuses on relevant object regions or instead relies on background, neighboring objects, or other misleading cues.
Explanation
This supports model validation and can reveal errors that overall classification accuracy may conceal.
- 80
What visualization approach is especially useful for understanding how a network represents the world in general rather than one particular input?
Model answer
Gradient-ascent visualizations, dataset searches, and Deep Dream can reveal the general patterns represented by classes or internal neurons.
Explanation
These methods examine learned representations independently of a single ordinary test image.
- 81
How can interpretability methods be adapted for non-image data such as language or speech?
Model answer
Attention-based methods can indicate which parts of a sequence, such as words in a sentence, were most important for an output.
Explanation
Attention can reveal relationships between input tokens and generated or predicted outputs even when the data is not an image.

Ask anything
We've read this whole study set, so questions about it get the best answers.