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.
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.
Loss
1.2 |****
0.9 |***
0.7 |**
0.55|*
0.45|
+------------
1 2 3 4 5
Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 1.2 | 0.45 | Initial loss high, accuracy low as model starts learning |
| 2 | 0.9 | 0.60 | Loss decreases, accuracy improves with MixUp regularization |
| 3 | 0.7 | 0.72 | Model learns smoother boundaries, better generalization |
| 4 | 0.55 | 0.80 | Continued improvement, loss steadily decreases |
| 5 | 0.45 | 0.85 | Training converges with higher accuracy and lower loss |
MixUp strategy in computer vision?x_mix using MixUp with images x1, x2 and mixing coefficient lambda?mixed_labels?
import torch labels1 = torch.tensor([[1, 0, 0], [0, 1, 0]]) labels2 = torch.tensor([[0, 0, 1], [1, 0, 0]]) lambda_ = 0.7 mixed_labels = lambda_ * labels1 + (1 - lambda_) * labels2 print(mixed_labels.shape)
def mixup_data(x1, x2, y1, y2, alpha=1.0):
lam = np.random.beta(alpha, alpha)
x_mix = lam * x1 + (1 - lam) * x2
y_mix = lam * y1 + lam * y2
return x_mix, y_mixalpha very high (e.g., 100), what is the likely effect on training?Pass the test and this pattern moves unknown