Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is data augmentation in the context of small datasets?
Data augmentation means creating new images by changing existing ones slightly, like flipping or rotating. This helps the model learn better from limited data.
Click to reveal answer
beginner
Why is transfer learning useful for small datasets?
Transfer learning uses a model trained on a big dataset and adapts it to a small dataset. It saves time and improves accuracy when data is limited.
Click to reveal answer
intermediate
How does cross-validation help with small datasets?
Cross-validation splits data into parts to train and test multiple times. This gives a better idea of how well the model works on unseen data.
Click to reveal answer
intermediate
What is the role of pre-trained models in small dataset strategies?
Pre-trained models have learned features from large datasets. Using them helps when you have few images, as they already know useful patterns.
Click to reveal answer
beginner
Name one challenge of working with small datasets in computer vision.
One challenge is overfitting, where the model learns the training images too well but fails to generalize to new images.
Click to reveal answer
Which technique creates new images by flipping or rotating existing ones?
ATransfer learning
BCross-validation
CData augmentation
DFeature extraction
✗ Incorrect
Data augmentation involves modifying images to increase dataset size.
What does transfer learning use to improve model training on small datasets?
APre-trained models
BRandom noise
CNew labels
DData splitting
✗ Incorrect
Transfer learning uses pre-trained models to leverage prior knowledge.
Why is cross-validation important for small datasets?
AIt increases dataset size
BIt helps estimate model performance reliably
CIt reduces image resolution
DIt removes noisy images
✗ Incorrect
Cross-validation tests the model multiple times to check performance.
What problem occurs when a model learns training data too well but fails on new data?
ANormalization
BUnderfitting
CData leakage
DOverfitting
✗ Incorrect
Overfitting means the model memorizes training data and does not generalize.
Which of these is NOT a common small dataset strategy?
AIncreasing image size
BTransfer learning
CCross-validation
DData augmentation
✗ Incorrect
Increasing image size does not help with small dataset problems.
Explain three strategies to improve model performance when you have a small image dataset.
Think about ways to create more data, reuse existing knowledge, and test model reliability.
You got /3 concepts.
Describe why overfitting is a concern with small datasets and how to reduce it.
Consider what happens when the model sees too few examples.
You got /3 concepts.
Practice
(1/5)
1. Which of the following is a common strategy to improve model performance when you have a small image dataset?
easy
A. Train a deep model from scratch without any pre-trained weights
B. Use data augmentation to create more training images
C. Ignore validation to use all data for training
D. Reduce image resolution to save memory only
Solution
Step 1: Understand small dataset challenges
Small datasets often cause models to overfit and perform poorly on new data.
Step 2: Identify effective strategies
Data augmentation creates new images by modifying existing ones, increasing data variety and helping the model generalize better.
Final Answer:
Use data augmentation to create more training images -> Option B
Quick Check:
Data augmentation = More data variety [OK]
Hint: More data variety helps small datasets [OK]
Common Mistakes:
Training from scratch causes overfitting
Ignoring validation hides model issues
Reducing resolution alone doesn't add data
2. Which code snippet correctly applies data augmentation using the Python library torchvision.transforms?
easy
A. transforms.Compose([transforms.RandomHorizontalFlip(), transforms.ToTensor()])
B. transforms.RandomCrop(32, 32)
C. transforms.ToTensor(), transforms.Normalize()
D. transforms.Resize(256)
Solution
Step 1: Recognize data augmentation syntax
Data augmentation requires combining multiple transforms, usually with Compose.
Step 2: Check which option uses Compose with augmentation
transforms.Compose([transforms.RandomHorizontalFlip(), transforms.ToTensor()]) uses Compose with RandomHorizontalFlip (augmentation) and ToTensor (conversion), which is correct.
Final Answer:
transforms.Compose([transforms.RandomHorizontalFlip(), transforms.ToTensor()]) -> Option A
3. Consider this Python code using transfer learning with PyTorch:
import torchvision.models as models
model = models.resnet18(pretrained=True)
for param in model.parameters():
param.requires_grad = False
model.fc = torch.nn.Linear(512, 2)
What does this code do?
medium
A. Trains all layers of ResNet18 from scratch
B. Unfreezes all layers for fine-tuning
C. Freezes all layers except the last fully connected layer
D. Removes the last layer without replacement
Solution
Step 1: Analyze parameter freezing
The loop sets requires_grad=False for all parameters, freezing them during training.
Step 2: Check the last layer replacement
The last fully connected layer (fc) is replaced with a new Linear layer, which by default has requires_grad=True.
Final Answer:
Freezes all layers except the last fully connected layer -> Option C
Quick Check:
Freeze all but last layer = Freezes all layers except the last fully connected layer [OK]
Hint: Freeze parameters, then replace last layer [OK]
Common Mistakes:
Assuming all layers are trainable
Not noticing last layer replacement
Confusing freezing with unfreezing
4. You wrote this code to augment images but get an error: