MixUp is a data augmentation technique where two images and their labels are combined by taking a weighted average. This helps the model learn smoother decision boundaries and improves generalization.
Click to reveal answer
beginner
How does MixUp create new training samples?
MixUp creates new samples by mixing two images: new_image = λ * image1 + (1 - λ) * image2, and similarly mixes their labels: new_label = λ * label1 + (1 - λ) * label2, where λ is a value between 0 and 1.
Click to reveal answer
intermediate
Why does MixUp improve model robustness?
By training on mixed images and labels, the model learns to predict soft labels and becomes less sensitive to noise or small changes, leading to better robustness and less overfitting.
Click to reveal answer
intermediate
What role does the parameter λ play in MixUp?
λ controls the mixing ratio between two images and their labels. It is usually sampled from a Beta distribution, allowing random but controlled blending of samples.
Click to reveal answer
beginner
Show a simple Python code snippet to apply MixUp on two images and labels.
D. The label mixing formula should use (1 - lam) for y2, not lam
Solution
Step 1: Review label mixing formula
Labels must be mixed as y_mix = lam * y1 + (1 - lam) * y2 to match image mixing.
Step 2: Identify mismatch in code
The code incorrectly uses lam * y2 instead of (1 - lam) * y2.
Final Answer:
The label mixing formula should use (1 - lam) for y2, not lam -> Option D
Quick Check:
Label weights must sum to 1 [OK]
Hint: Label weights must add to 1 in MixUp [OK]
Common Mistakes:
Using same weight for both labels
Ignoring beta distribution for lambda
Returning incomplete outputs
5. You want to apply MixUp to a dataset with 10,000 images and 5 classes. If you set the MixUp parameter alpha very high (e.g., 100), what is the likely effect on training?
hard
A. The model will train faster due to clearer labels
B. The mixed images will be almost equal blends, possibly making labels ambiguous
C. The mixed images will be mostly original images with little blending
D. The model will ignore MixUp and train normally
Solution
Step 1: Understand beta distribution with high alpha
High alpha in beta distribution centers lambda near 0.5, causing equal blending.
Step 2: Consider impact on labels and images
Equal blending creates ambiguous images and soft labels, which may confuse the model.
Final Answer:
The mixed images will be almost equal blends, possibly making labels ambiguous -> Option B
Quick Check:
High alpha = balanced blends, ambiguous labels [OK]
Hint: High alpha means balanced mixes, can confuse model [OK]
Common Mistakes:
Thinking high alpha means less mixing
Assuming faster training with high alpha
Believing MixUp is ignored with extreme alpha
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.