
For our car model classifier above, a simple solution would be to add pictures of cars of both classes, facing the other direction to our original dataset. How do we prevent this happening? We have to reduce the amount of irrelevant features in the dataset. Your neural network is only as good as the data you feed it. Here, the feature was that all cars of Brand A were facing left, and all cars of Brand B are facing right. It finds the most obvious features that distinguishes one class from another. Why does this happen? It happens because that’s how most machine learning algorithms work. Didn’t you just get a 95% accuracy on your dataset using your “state-of-the-art” neural network? I’m not exaggerating, similar incidents and goof-ups have occurred in the past. But your neural network outputs that it’s a Brand B car! You’re confused. Let’s say it’s done training, and you feed the image above, which is a Brand A car. Now, you feed this dataset to your “state-of-the-art” neural network, and you hope to get impressive results once it’s trained. Likewise, all cars of brand Bare aligned exactly like the picture in the right (i.e. Let’s assume that all cars of brand A are aligned exactly like the picture in the left (i.e. Imagine that you have a dataset, consisting of two brands of cars, as shown above. The one in the left represents Brand A (Ford), and the one in the right represents Brand B (Chevrolet).

The two classes in our hypothetical dataset. This is related to the way with which neural networks learn. It can help to increase the amount of relevant data in your dataset. Can augmentation help even if I have lots of data? We account for these situations by training our neural network with additional synthetically modified data.

But, our target application may exist in a variety of conditions, such as different orientation, location, scale, brightness etc. In the real world scenario, we may have a dataset of images taken in a limited set of conditions. This essentially is the premise of data augmentation. More specifically, a CNN can be invariant to translation, viewpoint, size or illumination (Or a combination of the above). Data Augmentation in playĪ convolutional neural network that can robustly classify objects even if its placed in different orientations is said to have the property called invariance. Our neural network would think these are distinct images anyway. Minor changes such as flips or translations or rotations. So, to get more data, we just need to make minor alterations to our existing dataset. For instance, a poorly trained neural network would think that these three tennis balls shown below, are distinct, unique images. Why? Because, neural networks aren’t smart to begin with. You don’t need to hunt for novel new images that can be added to your dataset. How do I get more data, if I don’t have “more data”? Also, the number of parameters you need is proportional to the complexity of the task your model has to perform. Naturally, if you have a lot of parameters, you would need to show your machine learning model a proportional amount of examples, to get good performance. State of the art neural networks typically have parameters in the order of millions! Our optimization goal is to chase that sweet spot where our model’s loss is low, which happens when your parameters are tuned in the right way.

When you train a machine learning model, what you’re really doing is tuning its parameters such that it can map a particular input (say, an image) to some output (a label). Why is there a need for a large amount of data? Number of parameters (in millions), for popular neural networks. The answer is, yes! But before we get into the magic of making that happen, we need to reflect upon some basic questions. Feeling disappointed, you wonder can my “state-of-the-art” neural network perform well with the meagre amount of data I have? You also recall someone mentioning having a large dataset is crucial for good performance. You recall that most popular datasets have images in the order of tens of thousands (or more). Chances are, you find a dataset that has around a few hundred images. Feeling ebullient, you open your web browser and search for relevant data. You have a stellar concept that can be implemented using a machine learning model.
KERAS DATA AUGMENTATION MNSIT HOW TO
This is Part 2 of How to use Deep Learning when you have Limited Data. This article is a comprehensive review of Data Augmentation techniques for Deep Learning, specific to images.
