Data Augmentation
In Supervised Machine learning tasks the prediction accuracy of the model has huge effect on the data available during training. So it is better to train a supervised learning model with large amount of data. This is because if the data is more there are chances of learning the patterns in a better fashion forming more neurons in the hidden layers and with more trainable parameters which helps a model for generalizing the output well. So in this way data is directly related to the performance of the model. But including mostly similar kind of data in huge amounts may lead to overfitting and less amounts of data leads to underfitting. These concepts will be discussed in our upcoming article. Now let’s focus on data augmentation.

So, For getting a better model we need to train on large datasets and it is possible only if we have large sources of data available of that kind. But in some scenarios where the data (let’s consider for image classification training with image data) is scarce and unable to get more data for training then here comes the saviour Data Augmentation, It is a process of enlarging the available dataset to train by manipulating the existing one’s.
Data available can be multiplied by many techniques like rotating with some angle, flipping, zooming, altering the brightness,adding noise etc.., Now we’ll go through some of these techniques to increase the data count.
- Rotating:
The name itself suggests much about it, here we rotate the existing data by certain angle such that the image is same but it slightly looks like skewed one of the original image.

2. Flipping:
This is nothing but a flipped version of the original data point. It may be horizontal or vertical flip or both flip. Have a look at the below figure for better understanding of flipping.

Rotating and Flipping mostly used techniques for augmenting the data. Even after doing these the data is insufficient for training we can use some other techniques to increase further more.
3. Zooming :
It is the process of increasing the pixels by replacing those with neighbouring pixels (pixel is the digital representation of an image in RGB each having a value of R,G,B). Zooming can be done in and out as shown in the figure below.

4. Altering Brightness:
Altering Brightness is nothing but altering the intensity of the image by increasing or decreasing the pixel values of particular image. For example if we have a value of pixel as 15 and another with 30 then here 15 and 30 are intensities of it and the image with pixel value 30 is more bright. So brightness defined intensity and it is a visual perception of an image.

5. Addition of Noise:
Adding noise to images allows you to test the robustness and performance of an algorithm in the presence of known amounts of noise. So, Adding noise data in our training set makes it robust while predicting on such realtime images as they may have some noise. It helps in both ways to increase the data count as well as to make the model robust, Anyways tending towards the final result to increase the accuracy of our models prediction.

There are even more techniques like cropping, shear, shrinking etc.., but these are mostly used ones to augment the data. There are many libraries out there for manipulating the images by preprocessing it and for augmenting data but open cv is one of the mostly used one as it makes the task in more efficient and beautiful manner. All the documentation regarding image handling techniques are available in it. Wanna a have a look, here it is https://docs.opencv.org/4.5.2/d9/df8/tutorial_root.html
Thank You, Please Do Follow and Stay Tuned for more interesting articles……