0
0
Computer Visionml~20 mins

Small dataset strategies in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Small Dataset Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why use data augmentation with small image datasets?

Imagine you have only 100 images to train a computer vision model. Why is data augmentation helpful in this case?

AIt removes noisy images to improve dataset quality.
BIt artificially increases the dataset size by creating modified versions of images, helping the model learn better.
CIt compresses images to reduce storage space.
DIt converts images to grayscale to simplify the model.
Attempts:
2 left
💡 Hint

Think about how to get more training examples without collecting new images.

Predict Output
intermediate
1:30remaining
Output of image flipping augmentation code

What will be the shape of the output image after applying horizontal flip augmentation using this code?

Computer Vision
import numpy as np
image = np.random.rand(64, 64, 3)
flipped_image = np.flip(image, axis=1)
print(flipped_image.shape)
A(64, 64, 3)
B(3, 64, 64)
C(64, 3, 64)
D(128, 64, 3)
Attempts:
2 left
💡 Hint

Flipping changes pixel order but not image dimensions.

data_output
advanced
2:00remaining
Resulting dataset size after augmentation

You have 50 images. You apply 3 augmentation techniques: rotation, horizontal flip, and brightness change. Each technique creates one new image per original image. How many images will you have after augmentation?

A100
B150
C200
D250
Attempts:
2 left
💡 Hint

Count original images plus all augmented images.

🔧 Debug
advanced
2:00remaining
Identify the error in transfer learning code snippet

What error will this code produce when trying to fine-tune a pretrained model on a small dataset?

Computer Vision
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.layers import Dense, GlobalAveragePooling2D
from tensorflow.keras.models import Model

base_model = MobileNetV2(weights='imagenet', include_top=False, input_shape=(224,224,3))
for layer in base_model.layers:
    layer.trainable = False
x = base_model.output
x = GlobalAveragePooling2D()(x)
x = Dense(10, activation='softmax')(x)
model = Model(inputs=base_model.input, outputs=x)
model.compile(optimizer='adam', loss='categorical_crossentropy')
ASyntaxError from missing colon in for loop
BTypeError because base_model has no attribute 'output'
CNo error, code runs fine
DValueError due to Dense layer applied to 4D tensor without flattening
Attempts:
2 left
💡 Hint

Check the shape of the output from base_model before Dense layer.

🚀 Application
expert
2:30remaining
Best strategy to improve model accuracy on very small image dataset

You have only 30 labeled images for a classification task. You want to improve your model's accuracy. Which strategy is most effective?

AUse transfer learning with a pretrained model and freeze most layers, then fine-tune on your data.
BTrain a deep neural network from scratch with many layers and epochs.
CUse only the original images without augmentation to avoid noise.
DReduce image resolution drastically to speed up training.
Attempts:
2 left
💡 Hint

Think about leveraging existing knowledge from large datasets.