If you have ever worked on a Computer Vision project, you might know that using augmentations to diversify the dataset is the best practice. On this page, we will:
Let’s jump in!
To understand what Gaussian Noise is, let’s first observe the concept of noise in digital images.
Noise usually stands for a random variation in the brightness or color of the image. In the case of digital images, noise can be produced due to different reasons:
The noise might be added or multiplied to the image. Here is the formula for the Additive Noise Model, where:
Likewise, the Multiplicative Noise Model multiplies the original signal by the noise signal.
Gaussian Noise is a statistical noise with a Gaussian (normal) distribution. It means that the noise values are distributed in a normal Gaussian way.
The Gaussian noise is added to the original image. The probability density function p of a Gaussian random variable z is calculated by the following formula:
The Gaussian Noise data augmentation tool adds Gaussian noise to the training images to make the model robust against such noises.
Hello, thank you for using the code provided by Hasty. Please note that some code blocks might not be 100% complete and ready to be run as is. This is done intentionally as we focus on implementing only the most challenging parts that might be tough to pick up from scratch. View our code block as a LEGO block - you can’t use it as a standalone solution, but you can take it and add to your system to complement it. If you have questions about using the tool, please get in touch with us to get direct help from the Hasty team.
import albumentations as albu
from PIL import Image
import numpy as np
transform =albu.GaussianNoise(var_limit=(10,50),mean=0,p=0.5)
image = np.array(Image.open('/some/image/file/path'))
image = transform(image=image)['image']
# Now the image is transformed and ready to be accepted by the model
Automate 90% of the work, reduce your time to deployment by 40%, and replace your whole ML software stack with our platform.
Start for free Check out our services