I am new to deep learning, I have made my first CNN network which accepts an input of (32,32,3) while training.

Now I want to test some random images on my trained model.
Do I have to resize my test images to (32,32,3). OR Can I leave the images as it is. OR Can I resize all of them to a higher resolution?

Plz give reasons.


Firstly let's start with the last question. It is normally not possible to increase the size of an image, that is, increasing its resolution without using AI solutions. But one famous solution to overcome this problem is padding the image to increase its size. But depending on the filter size, it may poorly perform if the original image is too small compared to the original input size, and filter dimensions are big. Also, in any case, if a model designed to accept the high resolution, would not perform similarly with small images because it will not get the same size of input or information (padding will just contain dummy data).

However, you can build a model that can accept different sizes, although the one that you have built will not. Your model is configured to receive 32x32x3, that is, 3072 input nodes. Thus, you have to resize all of your high-resolution images to 32x32x3 and pad the smaller images.

  • $\begingroup$ Thanks @Shahriyar, by "resizing them to a higher res" I meant higher than 32*32 like (128*128).I download the images through net so they are usually bigger. $\endgroup$ – Shiv Nov 3 '20 at 20:36
  • $\begingroup$ I understand that your input size is so small, and it is a bit hard to extract too much information from that, but try to resize a high-resolution image to your input size, check if it meets your expectations in terms of performance. If not, try to build a bigger mode maybe. $\endgroup$ – Shahriyar Mammadli Nov 3 '20 at 20:45

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.