# Why does the Ciphar 10 tutorial on TensorFlow crop the images to be 24x24?

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.

## 1 Answer

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.

References:

• 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. – Pinocchio Jan 13 '17 at 0:32
• @Pinocchio If you do it twice, you have two different images: for that reason it is often regarded as data augmentation. – Franck Dernoncourt Jan 13 '17 at 0:35
• 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) – Pinocchio Jan 13 '17 at 0:37
• 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). – Pinocchio Jan 13 '17 at 0:38
• @Pinocchio That's correct. It's ok, I like clear definitions as well. Answer edited. – Franck Dernoncourt Jan 13 '17 at 0:39