Visual AI can do many things beyond just telling what object is in an image. Which reason best explains why?
Think about what else you might want to know about a photo besides what it shows.
Visual AI often needs to find where objects are (detection), understand their shapes (segmentation), or track movement, which goes beyond just naming the main object.
You want a model that not only tells what objects are in a photo but also where they are. Which model type should you choose?
Think about which model outputs bounding boxes around objects.
Object detection models output both the class of objects and their locations using bounding boxes, unlike classification models that only output class labels.
Given a TensorFlow segmentation model that takes input images of shape (128, 128, 3), what is the shape of its output prediction?
import tensorflow as tf input_shape = (128, 128, 3) model = tf.keras.Sequential([ tf.keras.layers.InputLayer(input_shape=input_shape), tf.keras.layers.Conv2D(16, 3, padding='same', activation='relu'), tf.keras.layers.Conv2D(1, 1, activation='sigmoid') ]) prediction = model(tf.random.uniform((1, *input_shape))) prediction_shape = prediction.shape print(prediction_shape)
Segmentation outputs a mask per pixel, so output shape matches input height and width but with 1 channel.
The model outputs a mask with one channel per pixel, so the output shape is (batch_size, height, width, 1).
You trained an object detection model. Which metric best measures how well it finds and locates objects?
Think about a metric that considers both detection and localization quality.
Mean Average Precision (mAP) measures how well the model detects objects and how accurate the bounding boxes are, making it ideal for object detection.
Here is a TensorFlow segmentation model code snippet. After training, the model predicts all zeros for any input. What is the most likely cause?
import tensorflow as tf inputs = tf.keras.Input(shape=(65, 65, 3)) x = tf.keras.layers.Conv2D(32, 3, activation='relu', padding='same')(inputs) x = tf.keras.layers.MaxPooling2D()(x) x = tf.keras.layers.Conv2D(64, 3, activation='relu', padding='same')(x) x = tf.keras.layers.UpSampling2D()(x) outputs = tf.keras.layers.Conv2D(1, 1, activation='sigmoid')(x) model = tf.keras.Model(inputs, outputs) model.compile(optimizer='adam', loss='binary_crossentropy') # Assume training data is correct and balanced model.fit(train_images, train_masks, epochs=10) preds = model.predict(test_images) print(preds.min(), preds.max())
Check if the output size matches the mask size after pooling and upsampling.
Pooling reduces spatial dimensions, and upsampling may not restore original size exactly, causing output and mask size mismatch. This leads to poor training and zero predictions.
