# Why do we scale down images before feeding them to the network?

I have been seeing a lot where images are generally scaled down to either $$64\times64$$, $$32\times32$$ or other lower resolutions. Can someone please help me with this and answer a few questions:

1. Don't we lose image details by doing so?
2. What would be the consequences if we scale down the image to some other higher resolution such as $$512\times512$$ or $$1024\times1024$$ or something?
3. Can we feed the network without $$1:1$$ square images?
• Because it retains enough information and reduces the number of parameters, making it easier to train. If you have images of varying size, you need some way to accommodate them; e.g., by attending to parts of it. If the scale varies, you need to account for that too with a transformation or scale-invariant representation. Welcome to the site!
– Emre
Apr 16, 2018 at 20:29

Don't we lose image details in doing so?

We do lose information by resizing the images. You have to consider an important fact about scaling down images. If you want to find an exact position of an object in the input image, you usually need the real size image, with real aspect ratio. In papers like YOLO which attempts to find exact positions, it uses a down-scale value which is near $$4$$ I guess. This is acceptable because it will introduce at least $$\pm2$$ pixel errors. In classification tasks, you can usually see images with $$224\times224$$ dimensions. It is an acceptable dimension that keeps the main structure of the images. You should be aware that it does not keep the aspect ratio but it is not a big problem due to resizing images while test time.

What would be the consequences if we scale down the image to some other higher resolution such as 512*512 or 1024*1024 or some other.

Something like the former case is already done in YOLO and other precise object localisation and annotation tasks. Its consequence is that the number of computation and training parameters increase significantly. Increasing the number of training parameters has a prominent side effect. If you have a large number of parameters, you have to increase the number of training examples, otherwise, the chance of overfitting will be high, albeit you use regularisation techniques.

Can we feed the network without 1:1 square images?

Yes, you can. As I've already mentioned, depending on your task you can preserve the aspect ratio or not. In this case, you have to be aware of your convolutional operations if you set them to VALID operations. Because the dimension with the smaller number of entries will be finished sooner. Consequently, you have to choose the windows size and the type of convolutions wisely.

Because it saves lots of computation time. Yes, we do loose image details, but it depends on your task whether the details are really important. Let's say your task is to detect and count the total number of circles in an image, So you are only concerned with the shape circle, not its dimension. Hence, reducing image resolution a bit would be more computationally efficient.

• I can always buy more computational power. But, given a dataset you need to find a balance between a model complex enough to learn the subtleties of the function, but not so complex such that the available data will not be sufficient to find a solution. Apr 18, 2018 at 6:48

We scale down the images before feeding it into the network in order to reduce the number of parameters. When the number of parameters are high, we tend to increase the requirement of computation power.

Scaling down images does decreases the detail and the scale size is purely dependent on the target of our model. The remaining details and features are automatically extracted by the kernel operations during convolutions.

We can feed the network with any dimension images though it is preferred to have a square aspect as it make the matrix operations easy.