Random transformation

You can sometimes get a significant increase in validation accuracy if you augment the data. This means that you randomly transform the input in certain ways, for example, rotating, shifting and zooming.

Random transformation adds more variation to the training dataset and if it is done right, reflects the variation in the real data and therefore helps the model to generalize better.

Random transformation is helpful for both large and small datasets.

NOTE: Random transformation only works on images and image-like data. It is mostly useful for images but may be interesting to use on any 3 axis tensor for advanced users.

Random Transformation examples
Figure 1. Random Transformation examples

Parameters

Rotate
Randomly rotate up to this many degrees in any direction.
Natural images default: 30

Rotate
Figure 2. Rotate

Vertical shift
Randomly shift the image vertically up to this proportion.
Natural images default: 0.1

Vertical shift
Figure 3. Vertical shift

Horizontal shift
Randomly shift the image horizontally up to this proportion.
Natural images default: 0.1

Horizontal shift
Figure 4. Horizontal shift

Zoom
Randomly zoom up to this proportion.
Natural images default: 0.2

Zoom
Figure 5. Zoom

Horizontal flip
Randomly flip horizontally. When enabled (Yes) this option will randomly flip images on reading them with a 50% probability.
Natural images default: Yes

Horizontal flip
Figure 6. Horizontal flip

Vertical flip
Randomly flip vertically. When enabled (Yes) this option will randomly flip images on reading them with a 50% probability.

Natural images default: No

Vertical flip
Figure 7. Vertical flip
Was this page helpful?
YesNo