I was going over the cifar 10 tutorial in tensorflow and was trying to understand why the guys in tensorflow/google decided to crop the images. The only reason I could justify it to myself is because they wanted to possibly decrease the computation time when training the neural net, otherwise it seems rather random.

I've talked with colleges and they imply it has to do with data set augmentation, however, data set augmentation can be done, regardless the size of the original image (to my understanding).

My initial guess of why they might be cropping and then augmenting the data set (with flips, brightness changes and contrasts) is because they want to get the actual image object and ignore the surroundings and then apply the transformation. If that were the goal, then for me what would have made sense is to not apply a random crop as they are doing (otherwise how do you know you are getting the actual object?) and then do the data set augmentation. Since thats not whats happening, I have my doubts, that my guess is correct.

Can someone clarify why the cropping is being done? Maybe I am just overthinking it but it would be great to clarify whats going on. For me it seems its just some (arbitrary) preprocessing that they are doing god knows why.


The cropping is indeed performed for data augmentation (i.e., cropping is one data augmentation strategy), since if one applies two different crops to the same image, one obtains two different images. E.g., from {1}:

For data augmentation, we randomly crop input images into 24 × 24 pixels.

As a side note, the CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class. This means that 24x24 cropping keeps most of the image.


  • $\begingroup$ maybe this is a semantics issue I have with the phrase "data set augmentation" but just randomly cropping an image is not augmenting the data set in any way. $\endgroup$ – Pinocchio Jan 13 '17 at 0:32
  • 2
    $\begingroup$ @Pinocchio If you do it twice, you have two different images: for that reason it is often regarded as data augmentation. $\endgroup$ – Franck Dernoncourt Jan 13 '17 at 0:35
  • $\begingroup$ I see. However, it only really counts as data set augmentation if you add both images to the "new" data set. Otherwise, its more of a pre-processing step, right? (sorry if I am being overly pedantic but I finding a bit confusing) $\endgroup$ – Pinocchio Jan 13 '17 at 0:37
  • $\begingroup$ Also, maybe you should include in your answer more explicitly why cropping would be considered data set augmentation (since it seems to be the main issue of my question). $\endgroup$ – Pinocchio Jan 13 '17 at 0:38
  • 1
    $\begingroup$ @Pinocchio That's correct. It's ok, I like clear definitions as well. Answer edited. $\endgroup$ – Franck Dernoncourt Jan 13 '17 at 0:39

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.