Model Pipeline - Data augmentation with transforms
This pipeline shows how data augmentation uses image transforms to create varied training images. This helps the model learn better by seeing different versions of the same image.
Jump into concepts and practice - no test required
This pipeline shows how data augmentation uses image transforms to create varied training images. This helps the model learn better by seeing different versions of the same image.
Loss
1.2 |*
1.0 | *
0.8 | *
0.6 | *
0.4 | *
+---------
1 2 3 4 5
Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 1.2 | 0.45 | Model starts learning with high loss and low accuracy |
| 2 | 0.9 | 0.60 | Loss decreases and accuracy improves as model sees augmented data |
| 3 | 0.7 | 0.72 | Model learns better features due to varied augmented images |
| 4 | 0.55 | 0.80 | Loss continues to drop, accuracy rises steadily |
| 5 | 0.45 | 0.85 | Model converges with good accuracy on augmented data |
transforms.Compose in PyTorch data augmentation?transforms.Compose is used to chain several image transformations so they apply sequentially to the input image.transforms.Compose([]).transform = transforms.Compose([
transforms.RandomRotation(90),
transforms.ToTensor()
])
output = transform(image)transform = transforms.Compose([
transforms.RandomCrop(32),
transforms.ToTensor,
transforms.Normalize((0.5,), (0.5,))
])transforms.ToTensor is a class, but it must be called as transforms.ToTensor() to create the transform instance.