I am a beginner in machine learning, so I'm sorry if my question is a bit trivial.
Suppose I have a dataset of images and which I want to classify, say using a neural network. It makes sense to me to try to enhance my dataset by e.g. flipping and rotating the images, so to obtain more training observations.
At some point, I want to split my dataset in a training set and a test set, and maybe also to additionally subdivide the training set for cross-validation. My question is: when should I enhance my dataset with the flipped/rotated images? If I do it before I split my dataset in training and test sample, then the test sample will contain e.g. rotations of observations that also are in the training sample, so I have the feeling it might be "contaminated" and under-represent the test error. Same thing with the split for cross-validation. Is there a consensus on how to proceed? Also, is this a valid approach?