Challenge - 5 Problems
Data Augmentation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of image rotation augmentation
Given the following PyTorch code applying a rotation augmentation to a 3x3 grayscale image tensor, what is the output tensor after the transformation?
PyTorch
import torch import torchvision.transforms as T image = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float32).unsqueeze(0).unsqueeze(0) transform = T.RandomRotation(degrees=(90, 90)) rotated_image = transform(image) print(rotated_image.squeeze().int())
Attempts:
2 left
💡 Hint
Think about how a 90 degree rotation affects the position of pixels in a matrix.
✗ Incorrect
A 90 degree counter-clockwise rotation moves the third column to the first row, the second column to the second row, and the first column to the third row. The tensor is rotated accordingly.
❓ Model Choice
intermediate1:30remaining
Best augmentation for small dataset with overfitting
You have a small image dataset and your model is overfitting. Which data augmentation technique is most effective to reduce overfitting?
Attempts:
2 left
💡 Hint
Think about augmentations that increase data diversity realistically.
✗ Incorrect
Random horizontal flip and random crop create new variations of images, helping the model generalize better and reduce overfitting.
❓ Hyperparameter
advanced2:00remaining
Choosing rotation degree range for augmentation
You want to augment images by rotating them randomly. Which rotation degree range is most appropriate to preserve the original image semantics for handwritten digit recognition?
Attempts:
2 left
💡 Hint
Consider how much rotation changes the digit's appearance.
✗ Incorrect
Small rotations like -10 to 10 degrees keep digits recognizable, while large rotations can make digits look like other numbers or meaningless.
❓ Metrics
advanced1:30remaining
Effect of augmentation on validation accuracy
You train two identical models on the same dataset. Model A uses data augmentation; Model B does not. After training, Model A has 85% validation accuracy, Model B has 80%. What does this difference most likely indicate?
Attempts:
2 left
💡 Hint
Think about how augmentation affects model learning on unseen data.
✗ Incorrect
Augmentation increases data variety, helping the model generalize better and improving validation accuracy.
🔧 Debug
expert2:30remaining
Debugging incorrect augmentation pipeline
You apply this PyTorch augmentation pipeline but the output images are always identical to the input. What is the bug?
Code:
import torchvision.transforms as T
transform = T.Compose([
T.RandomHorizontalFlip(p=0),
T.RandomRotation(degrees=0),
T.ColorJitter(brightness=0)
])
augmented_image = transform(input_image)
Attempts:
2 left
💡 Hint
Check the parameters controlling augmentation strength.
✗ Incorrect
All augmentations have zero effect or zero probability, so the pipeline does not modify images.