0
0
Computer Visionml~12 mins

MixUp strategy in Computer Vision - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - MixUp strategy

The MixUp strategy blends pairs of images and their labels to create new training samples. This helps the model learn smoother decision boundaries and improves generalization.

Data Flow - 4 Stages
1Original Dataset
1000 images x 32x32 pixels x 3 channelsRaw images with one-hot encoded labels1000 images x 32x32 pixels x 3 channels
Image1: cat, Label1: [1,0,0]; Image2: dog, Label2: [0,1,0]
2MixUp Pairing
1000 images x 32x32 pixels x 3 channelsRandomly pair images and labels for mixing500 pairs of images and labels
Pair: (Image1, Image2), Labels: ([1,0,0], [0,1,0])
3MixUp Blending
500 pairs of images and labelsBlend images and labels using lambda from Beta distribution500 mixed images x 32x32 pixels x 3 channels
Mixed Image = 0.7*Image1 + 0.3*Image2; Mixed Label = 0.7*[1,0,0] + 0.3*[0,1,0]
4Model Training
500 mixed images x 32x32 pixels x 3 channelsTrain model on mixed images and soft labelsModel updated weights
Model learns from blended images and labels
Training Trace - Epoch by Epoch
Loss
1.2 |****
0.9 |***
0.7 |**
0.55|*
0.45| 
    +------------
     1  2  3  4  5
     Epochs
EpochLoss ↓Accuracy ↑Observation
11.20.45Initial loss high, accuracy low as model starts learning
20.90.60Loss decreases, accuracy improves with MixUp regularization
30.70.72Model learns smoother boundaries, better generalization
40.550.80Continued improvement, loss steadily decreases
50.450.85Training converges with higher accuracy and lower loss
Prediction Trace - 4 Layers
Layer 1: Input Mixed Image
Layer 2: Convolutional Layers
Layer 3: Fully Connected Layers
Layer 4: Softmax Activation
Model Quiz - 3 Questions
Test your understanding
What is the main purpose of mixing two images and their labels in MixUp?
ATo remove noisy data from the dataset
BTo increase the size of the test set
CTo create new training examples that help the model generalize better
DTo speed up the training process
Key Insight
MixUp helps the model learn from blended images and labels, encouraging smoother decision boundaries and better generalization by training on a richer set of examples.