Challenge - 5 Problems
Image Segmentation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput shape of a simple segmentation model
Consider this TensorFlow model for image segmentation. What is the shape of the output tensor after the final layer?
import tensorflow as tf model = tf.keras.Sequential([ tf.keras.layers.InputLayer(input_shape=(128, 128, 3)), tf.keras.layers.Conv2D(16, 3, padding='same', activation='relu'), tf.keras.layers.Conv2D(1, 1, padding='same', activation='sigmoid') ]) output = model.output
TensorFlow
import tensorflow as tf model = tf.keras.Sequential([ tf.keras.layers.InputLayer(input_shape=(128, 128, 3)), tf.keras.layers.Conv2D(16, 3, padding='same', activation='relu'), tf.keras.layers.Conv2D(1, 1, padding='same', activation='sigmoid') ]) output = model.output output_shape = output.shape
Attempts:
2 left
💡 Hint
Remember that padding='same' keeps the spatial dimensions the same.
✗ Incorrect
The model input is 128x128 with 3 channels. The first Conv2D layer with padding='same' keeps the height and width at 128, outputting 16 channels. The second Conv2D layer also uses padding='same' and outputs 1 channel. Batch size is None (unspecified). So output shape is (None, 128, 128, 1).
🧠 Conceptual
intermediatePurpose of activation function in segmentation output layer
In image segmentation models, why is the sigmoid activation function commonly used in the output layer for binary segmentation?
Attempts:
2 left
💡 Hint
Think about what the model predicts for each pixel in binary segmentation.
✗ Incorrect
Sigmoid activation outputs values between 0 and 1, which can be interpreted as probabilities for each pixel belonging to the target class or background. This is essential for binary segmentation tasks.
❓ Hyperparameter
advancedChoosing loss function for multi-class segmentation
You are training a multi-class image segmentation model with 4 classes. Which loss function is most appropriate to use?
Attempts:
2 left
💡 Hint
Consider the number of classes and the output format of the model.
✗ Incorrect
Categorical crossentropy is designed for multi-class classification problems where each pixel belongs to exactly one of multiple classes. Binary crossentropy is for two classes only.
❓ Metrics
advancedEvaluating segmentation quality with IoU
What does the Intersection over Union (IoU) metric measure in image segmentation?
Attempts:
2 left
💡 Hint
Think about how IoU compares two sets of pixels.
✗ Incorrect
IoU measures how much the predicted mask and the true mask overlap relative to their combined area. It is a common metric to evaluate segmentation accuracy.
🔧 Debug
expertIdentifying cause of poor segmentation training
You trained a segmentation model but the training loss does not decrease and predictions are random. Which of these is the most likely cause?
Attempts:
2 left
💡 Hint
Check if the activation and loss function match the problem type.
✗ Incorrect
Sigmoid activation outputs independent probabilities per pixel channel, but categorical crossentropy expects a probability distribution (softmax output). This mismatch causes training failure.
