Comment on page
Data Augmentation
Easily augment your data with SmartML advanced options
Deep learning often improves with more data available. One way to do this with a limited dataset is to manipulate existing data in various ways. Augmentation techniques can create variations of your training set images which improves the ability of the fit models to generalize what they have learned to new images.
For data augmentation, we use the Albumentations library. SmartML allows users to compose augmentations using a simple DSL in Python. For instructions on how to build your own augmentations, see the Augmentations DSL section below. As an example, the following augmentation will resize, perform contrast adjustment, horizontally flip 50% of the time, vertically flip 50% of the time, and then Blur the image 25% of the time:
[
{
"name": "Resize",
"kwargs": {
"p": 1.0,
"height": 256,
"width": 256
}
},
{
"name": "CLAHE"
"kwargs": {
"p": 1.0
}
},
{
"name": "HorizontalFlip",
"kwargs": {
"p": 0.5
}
},
{
"name": "VerticalFlip",
"kwargs": {
"p": 0.5
}
},
{
"name": "Blur",
"kwargs": {
"p": 0.25
}
}
]
Our DSL is a thin wrapper around the Albumentations library. Each augmentation is specified in the following format:
{
"name": "NameOfAugmentation",
"kwargs": {
"arg-name-1": val - 1,
"arg-name-2": val - 2
}
"children": [...]
}
Some things to note here:
- Both the
”kwargs”
and”children”
fields are optional. ”name”
is the name of the selected Albumentations object.”kwargs”
contains keyword arguments used to construct the Albumentations object.”children”
is an (optional) array of nested augmentations, which are used by this augmentation.- All augmentations in
”children”
(and any of their children) are built recursively. - As an example, the Compose augmentation accepts an array of augmentations, which are applied sequentially to the training inputs. Those augmentations should be provided via
”children”
.

To specify this augmentation with the provided default parameters, we can simply write:
{
"name": "ColorJitter"
}
Now suppose that we’d like to use a custom
brightness
parameter. We can add it to the ”kwargs”
field like this:{
"name": "ColorJitter",
"kwargs": {
"brightness": 0.4
}
}
In general, we can build any
albumentations
object by following this format.The augmentation options are configured when creating your model version. The Augmentation JSON text area can be found in the SmartML Hyperparameters section, an optional section for advanced configuration.
Enter your Augmentation JSON in this text area and click "Save and Start Training" to begin your training run.

Last modified 1yr ago