When dealing with an imbalanced dataset, I have been taught to oversample on only the train samples and not the entire dataset to avoid overfitting, however this was for structured text based data in pandas using simple models from sklearn. Is this still the case for image based datasets that will be trained on a CNN? I have been trying to oversample only the train data by applying augmentations to the images. However, for some reason I get a train accuracy of 1.0 and a validation accuracy of 0.25 on the very first epoch, where the numbers dont really change as the epochs progress which doesn't make sense to me. Should the oversampling be applied to the entire dataset and should the image augmentations be applied to only the new data or all of it?
My dataset is of RGB landscape images with 7 different classes, without about 29k total images. Doing a 70-15-15 split there are about 20k train samples before oversampling