I am about to build CNN for image classification. I have a rather small dataset and have done some data augmentation to make it bigger. While doing so, I got a little confused whether what I am doing is right or not.

If I have a dataset which contains a lot of augmented data and I split it into train/validation/test later, then test and validation sets will include my previously augmented data as well. Is it OK to do so or should I split my data at first and then do the augmentation only on train set images?


1 Answer 1


By all means do data augmentation separately on training and test sets in order to avoid data snooping.

For example, assume that mean calculated using all values present in the feature vector is imputed instead of missing values in that feature. Once the dataset is divided in training and test sets, the information from the former 'leaks' into the latter -- or data snooping crime has been committed. The price to pay for this misdeed is the incorrect overestimated performance of the ML method.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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