Using Data Augmentation

Data augmentation performs random transformations on images given to a deep learning tool (EClassifier, EUnsupervisedSegmenter or ESupervisedSegmenter object) during the training.

Experiment different settings to choose the best parameters for your data augmentation.
Configure data augmentation according to your problem. However, flips, shifts (20 - 40 px), brightness (5%), contrast (0.95 to 1.05) or salt and pepper noise (2%) can be useful on many datasets.
Check that the transformations do not change the label of an image (for example a defect that disappears because of a rotation or a contrast change).

With EasyLocate, we do not recommend to use rotation and shear data augmentation as it is not possible to compute the minimal bounding box surrounding the object after these geometric transformations.

In Deep Learning Studio

Create and configure the data augmentation settings in the Data augmentation tab.
Display and review the data augmented images with the minimum settings (Lower limits augmentation), the maximum settings (Upper limits augmentation) or the random settings (Random augmentation).

In the API

Use EClassificationDataset::SetEnableDataAugmentation(true/false) to enable or disable these transformations or directly use an object EDataAugmentation that you give to the method EDeepLearningTool::Train.

The transformations

Geometric transformations

Horizontal and vertical flips (enabled with EClassificationDataset::SetEnableHorizontalFlip and EClassificationDataset::SetEnableVerticalFlip)
Scaling (between a minimum and maximum value defined with EClassificationDataset::SetMinScale and EClassificationDataset::SetMaxScale)
Horizontal and vertical shifts (between –maxValue and maxValue defined with EClassificationDataset::SetMaxHorizontalShift(maxValue) and EClassificationDataset::SetMaxVerticalShift(maxValue))
Rotations (between 0 and a maximum value defined with EClassificationDataset::SetMaxRotationAngle)
Horizontal and vertical shear (between –maxValue and maxValue defined with EClassificationDataset::SetMaxHorizontalShear and EClassificationDataset::SetMaxVerticalShear)

Color and luminosity transformations

Brightness offset (between –maxValue and maxValue defined with EClassificationDataset::SetMaxBrightnessOffset)
Contrast gain (between a minimum and maximum value defined with EClassificationDataset::SetMinContrastGain and EClassificationDataset::SetMaxContrastGain)
Gamma corrections (between a minimum and maximum value defined with EClassificationDataset::SetMinGamma and EClassificationDataset::SetMaxGamma)
Hue offset (between –maxValue and maxValue defined with EClassificationDataset::SetMaxHueOffset)
Saturation gain (between a minimum and maximum value defined with EClassificationDataset::SetMinSaturationGain and EClassificationDataset::SetMaxSaturationGain)

Noise transformations

The standard deviation is expressed as a percentage of the maximum pixel value.

Gaussian noise, also called additive white noise, generated with a standard deviation (between a minimum and maximum value defined with EClassificationDataset::SetGaussianNoiseMinimumStandardDeviation and EClassificationDataset::SetGaussianNoiseMaximumStandardDeviation)
Speckle noise, a multiplicative noise, generated from a Gamma distribution with a mean of 1 and a standard deviation (between a minimum and a maximum value defined with EClassificationDataset::SetSpeckleNoiseMinimumStandardDeviation and EClassificationDataset::GetSpeckleNoiseMinimumStandardDeviation).
Salt and pepper noise generated from a pixel density (between a minimum and a maximum value defined with EClassificationDataset:: SetSaltAndPepperNoiseMinimumDensity and EClassificationDataset::SetSaltAndPepperNoiseMaximumDensity).