Data augmentation is popularly done online as that is how it is typically implemented and suggested in neural network frameworks like Keras and TensorFlow. I have also seen it described in e.g. the AlexNet paper.

Online data augmentation implies that the network will see a completely different dataset every epoch. Superficially this seems like a cool idea (especially because it is computationally free if you augment the next batch on the CPU and train the previous batch on the GPU) with some people saying that it improves generalization, but other than that I did not find quality literature supporting and explaining this idea.

My issue with online data augmentation is that I thought gradient-based learning algorithms were fundamentally based on repetition (i.e. seeing the same dataset every epoch) which would make sense intuitively. Is this actually the case though or did I make it up? Is there any literature covering this?


From an optimization standpoint, repetition is nice (we want to optimize the same function). From a modeling standpoint, repetition can risk memorizing the training data without learning anything generalizable. For image data, online augmentation is motivated by observing that we can translate or add noise or otherwise distort an image but retain its key semantic content (so a human can still recognize it). The hypothesis of online augmentation is that the model probably won't see the exact same image twice, so memorization is unlikely, so the model will generalize well.

| cite | improve this answer | |
  • $\begingroup$ Could you please elaborate on why repetition is nice from an optimization standpoint? Or maybe point me to optimization literature that explains this? $\endgroup$ – fabiomaia Mar 25 '19 at 19:05
  • 1
    $\begingroup$ It's pretty straightforward. Suppose you want to minimize $\| x^\top \theta - y\|_2^2$ for some data $x$ and target $y$ by incrementally updating $\theta$ and you're using gradient descent. If you augment your data online, you're changing $x$ at each iteration, and therefore you're changing the surface and the location of the minimizer $\theta^*$. $\endgroup$ – Sycorax Mar 25 '19 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.