Data augmentation is a technique to create new training images by applying random transformations like rotation, flipping, or zooming to existing images. It helps models learn better by seeing more varied data.
Click to reveal answer
beginner
Name three common image transformations used in data augmentation.
Common transformations include flipping (horizontal or vertical), rotation (turning the image by some degrees), and zooming (scaling the image in or out).
Click to reveal answer
intermediate
How does data augmentation help prevent overfitting?
By showing the model many different versions of images, data augmentation makes the model less likely to memorize exact images and more likely to learn general patterns.
Click to reveal answer
intermediate
In TensorFlow, which layer can be used to apply data augmentation inside a model?
The tf.keras.layers.RandomFlip, RandomRotation, and RandomZoom layers can be used inside a model to apply data augmentation on the fly during training.
Click to reveal answer
advanced
What is the difference between offline and online data augmentation?
Offline augmentation creates and saves new images before training. Online augmentation applies random transformations during training without saving new images, saving storage and adding variety each epoch.
Click to reveal answer
Which of the following is NOT a typical image augmentation technique?
ASorting pixels by brightness
BFlipping
CAdding random noise
DRotation
✗ Incorrect
Sorting pixels by brightness is not a common augmentation technique because it changes the image structure unnaturally.
What is the main benefit of using data augmentation in training image models?
AReduce model size
BIncrease dataset size and improve model generalization
CMake training faster
DRemove noisy images
✗ Incorrect
Data augmentation increases the variety of training images, helping the model generalize better.
Which TensorFlow layer would you use to flip images randomly during training?
Atf.keras.layers.Conv2D
Btf.keras.layers.Dense
Ctf.keras.layers.Dropout
Dtf.keras.layers.RandomFlip
✗ Incorrect
RandomFlip applies random horizontal or vertical flips to images during training.
What does online data augmentation mean?
AApplying random transformations during training without saving images
BAugmenting images before training and saving them
CUsing only original images without changes
DAugmenting images after training
✗ Incorrect
Online augmentation applies random changes on the fly during training, increasing variety without extra storage.
Which of these is a valid reason to use data augmentation?
ATo reduce the number of model parameters
BTo make images smaller in file size
CTo artificially increase training data diversity
DTo convert images to grayscale
✗ Incorrect
Data augmentation creates diverse training examples to help the model learn better.
Explain how data augmentation improves image model training and name some common augmentation techniques.
Think about how showing different versions of images helps the model.
You got /5 concepts.
Describe the difference between offline and online data augmentation and why you might choose one over the other.
Consider when and how augmented images are created and used.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of data augmentation in image training with TensorFlow?
easy
A. To create new images by modifying existing ones to improve model learning
B. To reduce the size of the training dataset
C. To convert images into text format
D. To remove noise from images before training
Solution
Step 1: Understand data augmentation concept
Data augmentation means making new images by changing existing images, like flipping or rotating.
Step 2: Connect augmentation to model training
This helps the model see more variety and learn better, improving accuracy.
Final Answer:
To create new images by modifying existing ones to improve model learning -> Option A
Quick Check:
Data augmentation = create new images [OK]
Hint: Augmentation means making new images from old ones [OK]
Common Mistakes:
Thinking augmentation reduces dataset size
Confusing augmentation with noise removal
Believing augmentation converts images to text
2. Which TensorFlow layer is correctly used to flip images horizontally during training?
easy
A. tf.keras.layers.RandomFlip('horizontal')
B. tf.keras.layers.RandomFlip('vertical')
C. tf.keras.layers.RandomRotation(0.5)
D. tf.keras.layers.RandomZoom(0.2)
Solution
Step 1: Identify the correct flip direction
To flip images horizontally, use 'horizontal' as the argument in RandomFlip.
Step 2: Match the correct TensorFlow syntax
RandomFlip('horizontal') flips images left to right, which is the correct usage.
Final Answer:
tf.keras.layers.RandomFlip('horizontal') -> Option A
Quick Check:
Horizontal flip = RandomFlip('horizontal') [OK]
Hint: Use 'horizontal' string inside RandomFlip for left-right flip [OK]
Common Mistakes:
Using 'vertical' instead of 'horizontal' for horizontal flip
Confusing RandomFlip with RandomRotation
Passing numeric values instead of strings to RandomFlip
3. What will be the output shape after applying this augmentation layer to a batch of 32 images of size 64x64x3?