7

I want to use GAN for data augmentation but I am confuse what are the pros. and cons. of data augmentation using GAN or why we use data augmentation using GAN compared to other data augmentation technique like standard data augmentation?

Your answer will be a great help to me. Thanks.

Noah Weber
  • 5,609
  • 1
  • 11
  • 26
Nawaf Khan
  • 83
  • 2

5 Answers5

2

GAN's and traditional augmentation techniques are fundamentally different in a way: A GAN produces (and combines) patterns previously seen in a dataset, data augmentation adds patterns to the data.

Well thought out data augmentation tries to add variations that could exist in the data. For instance: In arial photography rotation around the z-axis is very trivial and it could be smart to add that generously, on the other hand of the spectrum: In computer generated cartoons for instance, you'd reasonably do not expect much gaussian noise, and you might want to use that sparsely.

GAN's don't add information, they mostly add the same localised patterns that your (I'm assuming) ConvNet to train also has. The benefit a GAN offers is that you can use unlabelled data to train your convolutional layers with concepts you'd might expect in the domain.

Other techniques that go in that same direction, and you might want to check out, are weakly supervised learning and auto-encoding (which is imho very close to your original GAN idea).

S van Balen
  • 1,344
  • 1
  • 9
  • 28
2

Standard data augmentation techniques.

First of all, by standard data augmentation I'll be referring to techniques like flipping an image (up/down, left/right), affine transformations (rotations, translations, crops, shears, etc.), adjusting the brightness/contrast of an image, adding noise to the image (salt&pepper, gaussian, etc.) and so on.

Before describing the pros/cons of standard vs GAN augmentation, we should note on why data augmentation is effective. In short, deep neural networks have the capacity of memorizing smaller datasets leading them to overfit. They benefit from more images and a higher variety in the images. Data augmentation is a method of generating new images from the existing ones, that have the same semantic content as the originals. E.g. if I have a cat image and I flip it, it is still a cat; the network, however, thinks that this is a new image. These techniques are so effective, that they are even be used in large datasets, which don't have the aforementioned problems, to boost their performance even more.

What are the problems of standard data augmentation techniques?

The main issue is that the augmentation strategies we can use vary depending on the input images. For instance, the mnist dataset is one of the most popular datasets in machine learning, for recognizing handwritten digits. In this case, we can't flip the images or rotate them too much. Another case is medical images which adhere to strict formats. For example MRIs are centered, aligned, laterally/horizontally asymmetric and somewhat normalized regarding brightness and contrast. This severely limits what augmentations we can accomplish. This makes their application ad-hoc in most cases.

Cons of using standard data augmentation techniques

  • Might damage the semantic content of the image (e.g. rotating too much might cause a "6" to turn into a "9", or translating too much might cause the object of interest to fall out of the image).
  • Augmentation schemes are dependent on the problem .
  • Empirical/Ad-hoc application.
  • Naive method: looks at one image at a time, can't gather information from the whole dataset.

These techniques might motivate us to use a more advanced data augmentation technique, i.e. generate synthetic images with GANs. In fact, GAN-augmentation, if done properly will solve all of these problems.

However, they too have their drawbacks.

Cons of using GANs for data augmentation.

  • They require training. Training a GAN can take a lot of time and it isn't the easiest thing to do.
  • They can't be applied on-line. Instead after training, you need to generate a pool of synthetic images and add them to your original dataset.

One final remark

Even though I was comparing one technique vs the other, I'd like to point out that using one technique does not exclude the other. In fact we found that by combining both standard and GAN-based augmentation helps even more than each one individually.

If you're interested more you can read this study we did which focuses on the use of GANs for data augmentation in medical images.

Djib2011
  • 7,858
  • 5
  • 27
  • 37
1

While all the answers here are on point, I'd like to add a new perspective to this.

You can view common data augmentation techniques as rounding out your data's distribution curve. That is to say - if some feature of your data set should look like a gaussian curve, but does not just yet, data augmentation techniques would help increase the data samples and the variance to shape the curve towards its ideal, naturally occurring, or statistically expected form. So your starting point is more data samples, and you end at a better-looking more-desirable (based on your application) distribution curve.

Generative Adversarial Networks, on the other hand, start at the distribution curve that you already have and generate data samples that are in line with (or agree to) the already established distribution curve. Similar to a random number generator with a predefined distribution to conform by - uniform, gaussian, Raleigh etc.

So here is a general guideline (not always applicable) that you could use to frame this discussion. Use data augmentation techniques when you do not see the expected statistical properties within your data. This could be due to a lack of variance and/or a shortage of data. Traditional data augmentation techniques might be what you need.

Once you have the ideal (or closest to ideal) distribution within your data, OR you know what the ideal distribution of your data should be, use GANs to synthetically generate more data for semi-supervised learning, further training and improving model generalization and robustness.

For more information on data augmentation, check out our blog here.

Pedro Henrique Monforte
  • 1,606
  • 1
  • 11
  • 26
Vineet
  • 11
  • 1
0

It depend how good your GAN is.

if generator is sufficiently good trained and it produces reeally good false positive examples than that can be a good augmentation technique.

Check this out, and this one.

Noah Weber
  • 5,609
  • 1
  • 11
  • 26
  • 1
    I know brother but I want to answer this question that why to use GAN data augmentation instead of standard data augmentation? – Nawaf Khan Dec 26 '19 at 01:09
0

Standard data augmentation techniques add noise to the data.

For example in images - 1) Adding gaussian noise. 2) Taking the negative of the samples. 3) Transitioning the image vertically/horizontally

might help augment the data but may not represent the real data distribution you are trying to fit your model to.

A generative model tries to capture/fit the real data distribution rather than the samples which are picked from it. So that the discriminator gets fooled by it. Hence it is said to be generative ADVERSARIAL.

That is the thing about GANs, getting a 50/50 prob of being real on each of the generated samples and real samples tells that the discriminator cannot distinguish between them and hence the generated data distribution has completely replicated the real data distribution(ideally). That indeed is a necessary (if not exhaustive) condition required for a generator to augment data.

Hence a completely trained generative model(although very tough to train via GANs) is better to augment your data.