Should I increase epochs when I use augmentation?

username: Wesley_Neill
cooked: <p>Pretty basic, question in the title. I’m practicing on the MNIST dataset on Kaggle.</p>
<p>I’ve read that augmentation is a way to artificially add “new” data to your dataset. However, that doesn’t seem quite true to me, since the augmentations happen randomly and on the fly. This means that every epoch, my network might be seeing a (almost) totally new dataset. I feel like this would lead to underfitting.</p>
<p>That made me wonder about increasing the number of epochs to overcome underfitting, but I surprisingly can’t find a topic on it.</p>
<p><strong>Edit:</strong></p>
<ul>
<li>
<p>at the same number of epochs (50), I lose 20% accuracy on the test set (Kaggle LB) with augmentation.</p>
</li>
<li>
<p>At 60 epochs, I jump back up to 97% accuracy, which is still 1.5% less accurate than without transformations.</p>
</li>
<li>
<p>At 70 Epochs, my accuracy drops down to 71% accuracy, which is about 28% worse.</p>
</li>
</ul>
<p>Augmentations I am using are:</p>
<pre><code class="lang-auto">transforms.RandomRotation(10, fill=(0,)),
transforms.RandomPerspective(),
transforms.RandomAffine(10),
</code></pre>
<p>I have also tried with and without <code>RandomHorizontalFlip</code> but having it or not does not seem to change much.</p>

username: mmisiur
cooked: <p>Do you test your model on augmented data?</p>

username: Wesley_Neill
cooked: <p>‘Test’ data is unlabelled Kaggle competition data, so I’m not augmenting it… BUT my ‘validation’ set is augmented. I was just trying to figure out if that was bad in a different thread!</p>
<p>Based on the answer in that thread, I removed augmentation from the “validation set” and this is what happened:</p>
<p><img src="https://discuss.pytorch.org/uploads/default/original/3X/4/8/48503d505d9fd453308577b6be5dbe4ead62712c.png" alt="image" data-base62-sha1="ajIhZCAP7zBoAwZZo8CIkHDQNB2" width="373" height="278"></p>
<p>This doesn’t look like overfitting… it looks like the augmentations are straight up BAD for the model.</p>

username: lfolle
cooked: <p>Whats the probability of the augmentations?<br>
I.e. do you  use <code>torchvision.transforms.RandomChoice(transforms)</code> or <code>torchvision.transforms.RandomApply(transforms, p=0.5)</code> to randomize the augmentations?</p>

username: AlexKirko
cooked: <p>Since this question was not solved, I wanted to add my two cents.</p>
<p>MNIST is formed in such a way where all the numbers are pointing straight up, they are all viewed straight-on, and there are no affine transformations.<br>
So what the OP did was apply augmentations to the training data which do not exist and cannot exist in the test data. The point of augmentations is to add properties that we do not see directly in the training data due to low training set size, but which are present in the test data.</p>
<p>In this case, augmentation just added noise to the model and decreased performance.</p>

username: Akilsurya_S
cooked: <p><strong>Yes, data augmentation increases training difficulty</strong>. You’re feeding the model increasingly varied data each epoch, making it generalize better but possibly delaying convergence. However, it doesn’t mean underfitting — rather, <strong>your model is learning a harder, more realistic problem.</strong></p>
<p><strong>Solutions to try:</strong></p>
<ol>
<li><strong>Reduce augmentation intensity</strong> - Your current transforms are quite aggressive. Try smaller rotation angles (±5°) and less dramatic affine transforms</li>
<li><strong>Use learning rate scheduling</strong> - Reduce LR as training progresses to help convergence</li>
<li><strong>Add early stopping</strong> based on validation accuracy</li>
<li><strong>Try different augmentation probabilities</strong> - Apply each transform only 50% of the time</li>
<li><strong>Experiment with fewer simultaneous augmentations</strong> - Maybe use only 1-2 transforms per image</li>
</ol>
<p>The key insight: augmentation is regularization, so you need to balance it with enough training time and proper hyperparameter tuning. Your 60-epoch result suggests augmentation can help, but you need to find the right training duration and intensity.</p>