Data Augmentation
Data Augmentation
https://ai.googleblog.com/2020/04/advancing-self-supervised-and-semi.html
What is Data Augmentation?
A method for regularization. It refers to manipulating your image for the purpose of making
the model robust against other possible appearance of the same image, since at test time the
same image can come in different forms (for example, a flipped dog). You also make it more
robust against noise. (You can also utilize it to increase the data) more on that later
SimCLR: https://arxiv.org/pdf/2002.05709.pdf
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
Center Crop
crops the given image at the center
Crop size=30 Crop size=50 Crop size=100 Crop size = image size
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
Five Crop
crops the given image into four corners and the central crop
Color Jitter
randomly changes the brightness, saturation, and other properties of an image
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
Gaussian Blur
performs Gaussian blur transform on an image (convolves the image with a Gaussian filter)
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
Random Rotation
rotates an image with random angle
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
Random Crop
crops an image at a random location
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
Random Equalize
randomly performs histogram equalization
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
Auto Augment
Automatically augments data based on a given auto-augmentation policy (Image-Net, CIFAR…etc)
A separate search space is first needed to find the optimal augmentations for a given dataset
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
p=0.5
Data Augmentation Techniques
Adopted from PyTorch Tutorial: ILLUSTRATION OF TRANSFORMS
Cutout
randomly masking out square regions of input during training
Mixup
Jupyter Notebook
CutMix
patches are cut and pasted among training images where the ground truth labels are also
mixed proportionally to the area of the patches
Data Augmentation Techniques
RandAugment
Solves the problem that AutoAugment has. RandAugment has a significantly reduced
search space which allows it to be trained on the target task with no need for a separate
search space.
N = 2, M = 9
See more at
https://pytorch.org/vision/stable/auto_examples/plot_transforms.
html#sphx-glr-auto-examples-plot-transforms-py
Data Augmentation in PyTorch
• https://stackoverflow.com/questions/51677788/data-augmentation-in-pytorch