Bird
Raised Fist0
Computer Visionml~20 mins

Why augmentation multiplies training data in Computer Vision - Challenge Your Understanding

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Augmentation Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why does data augmentation increase training data size?

Imagine you have 100 pictures of cats. You flip each picture horizontally to create new images. How does this affect the number of training images?

AIt halves the number of images because flipping removes some images.
BIt keeps the number of images the same because flipped images are not counted separately.
CIt doubles the number of training images because each original image creates one new flipped image.
DIt triples the number of images because flipping creates two new images per original.
Attempts:
2 left
💡 Hint

Think about how many images you have before and after flipping.

🧠 Conceptual
intermediate
2:00remaining
How does rotation augmentation affect training data?

If you rotate each image in your dataset by 90, 180, and 270 degrees, how many images will you have compared to the original?

AFour times the original number because each image creates three rotated versions plus the original.
BThree times the original number because only three rotations are added.
CThe same number because rotations do not add new images.
DTwice the original number because only one rotation is used.
Attempts:
2 left
💡 Hint

Count the original plus all rotated versions.

❓ Predict Output
advanced
2:00remaining
Output of augmented dataset size calculation

What is the output of this code that calculates augmented dataset size?

Computer Vision
original_size = 150
augmentations_per_image = 5
augmented_size = original_size * (augmentations_per_image + 1)
print(augmented_size)
A150
B900
C155
D750
Attempts:
2 left
💡 Hint

Remember to add the original images to the augmented ones.

❓ Metrics
advanced
2:00remaining
Effect of augmentation on training accuracy

Which statement best explains why data augmentation can improve training accuracy?

AAugmentation increases data variety, helping the model learn better and generalize well.
BAugmentation reduces the number of training samples, making training faster.
CAugmentation removes noisy data, improving accuracy.
DAugmentation duplicates data without changes, which does not affect accuracy.
Attempts:
2 left
💡 Hint

Think about how variety in data affects learning.

🔧 Debug
expert
3:00remaining
Why does this augmentation code produce fewer images than expected?

Given this code snippet, why does the augmented dataset have fewer images than expected?

Computer Vision
images = [img1, img2, img3]
augmented_images = []
for img in images:
    augmented_images.append(img)
    augmented_images.append(flip(img))
    augmented_images.append(rotate(img))
print(len(augmented_images))
AThe augmented_images list is cleared inside the loop.
BThe flip function modifies images in place, so duplicates are not added.
CThe loop skips the last image, reducing total images.
DThe rotate function returns None, so fewer images are added.
Attempts:
2 left
💡 Hint

Check what the rotate function returns.

Practice

(1/5)
1. Why does image augmentation multiply the training data in computer vision?
easy
A. Because it creates new images by changing existing ones
B. Because it deletes some images to reduce overfitting
C. Because it compresses images to save space
D. Because it labels images automatically

Solution

  1. Step 1: Understand augmentation purpose

    Augmentation creates new images by applying changes like rotation or flipping to existing images.
  2. Step 2: Connect augmentation to data size

    These new images increase the total number of training samples, effectively multiplying the dataset size.
  3. Final Answer:

    Because it creates new images by changing existing ones -> Option A
  4. Quick Check:

    Augmentation = new image versions [OK]
Hint: Augmentation makes new images from old ones [OK]
Common Mistakes:
  • Thinking augmentation deletes images
  • Confusing augmentation with compression
  • Believing augmentation automatically labels data
2. Which of the following Python code snippets correctly applies horizontal flip augmentation using torchvision transforms?
easy
A. transform = transforms.FlipHorizontal()
B. transform = transforms.HorizontalFlip()
C. transform = transforms.RandomHorizontalFlip(p=1.0)
D. transform = transforms.RandomFlip(direction='horizontal')

Solution

  1. Step 1: Recall torchvision syntax

    In torchvision, horizontal flip is done with RandomHorizontalFlip and a probability parameter.
  2. Step 2: Check options for correct class and parameters

    Only transform = transforms.RandomHorizontalFlip(p=1.0) uses the correct class name and parameter format.
  3. Final Answer:

    transform = transforms.RandomHorizontalFlip(p=1.0) -> Option C
  4. Quick Check:

    Correct torchvision flip syntax = transform = transforms.RandomHorizontalFlip(p=1.0) [OK]
Hint: Look for RandomHorizontalFlip with p parameter [OK]
Common Mistakes:
  • Using incorrect class names like HorizontalFlip
  • Missing the probability parameter p
  • Assuming FlipHorizontal exists in torchvision
3. Given this code snippet applying augmentation, what is the total number of images after augmentation if the original dataset has 100 images and each image is augmented with 3 different transformations?
medium
A. 300
B. 400
C. 100
D. 600

Solution

  1. Step 1: Calculate augmented images per original

    Each original image produces 3 new augmented images plus the original itself, totaling 4 images per original.
  2. Step 2: Multiply by original dataset size

    100 original images * 4 images each = 400 images total after augmentation.
  3. Final Answer:

    400 -> Option B
  4. Quick Check:

    (3 augmentations + 1 original) * 100 = 400 [OK]
Hint: Add original + augmentations, then multiply by dataset size [OK]
Common Mistakes:
  • Counting only augmented images, ignoring originals
  • Multiplying by 3 instead of 4
  • Adding instead of multiplying
4. Identify the error in this augmentation code snippet and select the fix:
from torchvision import transforms
transform = transforms.Compose([
    transforms.RandomRotation(30),
    transforms.RandomFlip(horizontal=true)
])
medium
A. Replace RandomFlip with RandomHorizontalFlip
B. Change RandomRotation(30) to RandomRotation(degrees=30)
C. Add p=0.5 to RandomFlip
D. No error, code is correct

Solution

  1. Step 1: Check torchvision augmentation classes

    There is no RandomFlip class in torchvision; horizontal flip uses RandomHorizontalFlip.
  2. Step 2: Identify correct fix

    Replacing RandomFlip with RandomHorizontalFlip fixes the error; other options are incorrect or unnecessary.
  3. Final Answer:

    Replace RandomFlip with RandomHorizontalFlip -> Option A
  4. Quick Check:

    Correct flip class = RandomHorizontalFlip [OK]
Hint: Use exact torchvision class names for flips [OK]
Common Mistakes:
  • Assuming RandomFlip exists
  • Changing rotation syntax unnecessarily
  • Adding parameters to non-existent classes
5. You have a small dataset of 50 images. You want to multiply your training data by 5 times using augmentation. Which combination of augmentations is best to achieve this without losing original images?
hard
A. Apply 5 augmentations but discard original images
B. Only keep original images and train longer
C. Apply 2 augmentations and duplicate images twice
D. Apply 4 different augmentations per image plus keep original images

Solution

  1. Step 1: Understand multiplication goal

    To multiply data by 5 times, total images after augmentation should be 50 * 5 = 250.
  2. Step 2: Calculate images per original

    Keeping original plus 4 augmentations per image gives 5 images per original, totaling 250 images.
  3. Step 3: Evaluate options

    Apply 4 different augmentations per image plus keep original images achieves the goal without losing original images; others either discard originals or don't reach 5x.
  4. Final Answer:

    Apply 4 different augmentations per image plus keep original images -> Option D
  5. Quick Check:

    Original + 4 augmentations = 5x data [OK]
Hint: Keep originals + 4 augmentations for 5x data [OK]
Common Mistakes:
  • Discarding original images reduces data size
  • Duplicating images without augmentation doesn't add variety
  • Training longer without augmentation doesn't multiply data
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard