Gaussian Noise
Adds artificial noise to the training images.
This data augmentation tool adds gaussian noise to the training images such the testing becomes robust against these noises.
Gaussian noise is a statistical noise having probability density function equal to normal distribution. Normal distribution is characterized by its mean and variance.

Parameters

Variance Limit

This defines the range of variance for the gaussian distribution. The amount of noise present in the image is directly proportional to the variance.

Mean

The mean of the gaussian distribution tells us the point at which the value of the distribution is highest.
Setting the mean to 0 means that the peak of the curve will be located at the origin.
Bivariate Gaussian curves. The inner curve has low variance and the outer has a higher variance
Lena's image with gaussian noise

Code implementation

1
import albumentations as albu
2
from PIL import Image
3
import numpy as np
4
โ€‹
5
transform =albu.GaussianNoise(var_limit=(10,50),mean=0,p=0.5)
6
โ€‹
7
image = np.array(Image.open('/some/image/file/path'))
8
image = transform(image=image)['image']
9
โ€‹
10
# Now the image is transformed and ready to be accepted by the model
Copied!

Further Resources

Last modified 2mo ago