Challenge - 5 Problems
Feature Map Visualization Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output shape of feature maps after Conv2D layer
Given the following TensorFlow code snippet, what is the shape of the feature map output after the Conv2D layer?
TensorFlow
import tensorflow as tf input_tensor = tf.random.uniform([1, 64, 64, 3]) conv_layer = tf.keras.layers.Conv2D(filters=16, kernel_size=3, strides=2, padding='same') output = conv_layer(input_tensor) output_shape = output.shape print(output_shape)
Attempts:
2 left
💡 Hint
Remember that 'same' padding keeps the spatial dimensions divided by stride.
✗ Incorrect
With 'same' padding and stride 2, the height and width are halved (rounded up), so 64/2 = 32. The number of filters defines the last dimension.
🧠 Conceptual
intermediate1:30remaining
Purpose of feature map visualization in CNNs
What is the main purpose of visualizing feature maps in convolutional neural networks (CNNs)?
Attempts:
2 left
💡 Hint
Think about what feature maps represent in CNN layers.
✗ Incorrect
Feature maps show how filters respond to different parts of the input, helping us understand what the network learns.
❓ Metrics
advanced1:30remaining
Interpreting activation values in feature maps
In feature map visualization, what does a higher activation value in a specific spatial location generally indicate?
Attempts:
2 left
💡 Hint
Activation values represent how much a filter responds to input features.
✗ Incorrect
Higher activation means the filter found a pattern it was designed to detect at that location.
🔧 Debug
advanced2:00remaining
Identifying error in feature map extraction code
What error will occur when running this TensorFlow code to extract feature maps from a model?
TensorFlow
import tensorflow as tf model = tf.keras.applications.VGG16(weights=None, include_top=False) input_image = tf.random.uniform([1, 224, 224, 3]) layer_outputs = [layer.output for layer in model.layers if 'conv' in layer.name] feature_map_model = tf.keras.Model(inputs=model.input, outputs=layer_outputs) feature_maps = feature_map_model(input_image) print(len(feature_maps))
Attempts:
2 left
💡 Hint
Check if all layers have a 'name' attribute and output tensor.
✗ Incorrect
All layers in Keras models have a 'name' and 'output' attribute. Filtering by 'conv' in name works fine. Model created without weights is valid.
❓ Model Choice
expert2:30remaining
Best model type for detailed feature map visualization
Which model architecture is best suited for detailed feature map visualization to understand hierarchical feature extraction?
Attempts:
2 left
💡 Hint
Consider which model type uses convolutional layers producing feature maps.
✗ Incorrect
Deep CNNs have multiple convolutional layers producing feature maps at different levels, ideal for visualization.