In my model training i have image of size 1200x1200 but i trained the model on 256x256 does it effect

in my model training i have image of size 1200x1200 but i trained the model on 256x256 does it effect. If yes then whether I need to resize the image or i have to change the image size in my model. Please give me suggestions

can I know why are you specific about choosing the image size of 256*256 for an image dataset of 1200

what kind of model it is? detection model? why didn’t you think about image segmentation?

it is image classification model. image is of dimension 1200X1200. I trained the model using image size 256X256

can I know are you using any pre-trained model? like U-net?

i am using pre trained model ResNet

1 Like

Shall i need to resize the image?

The model can only handle as input images of the size and type it was trained on. In your case that is 256 x 256 images of a given type (RGB, RGBA, CMYK, grayscale etc). If you have input data that you want to feed to the model that is of a different size or type, then you need to preprocess those images to be the type that the model understands. Fortunately most image libraries have APIs that make this relatively straightforward to code. If you are doing Transfer Learning, in which case you may be doing incremental tuning and training of the pretrained model, note that it will be more efficient to do the preprocessing as a separate step that you do once, since it will add to the cost of your incremental training if you do it on every iteration.

Once you have the trained model and are running it in “inference” mode, you could write a wrapper for the “predict” function that includes the preprocessing where required, so that you could just feed in non-conforming images and get the predictions.

1 Like

hi @usmanlko

Adding to Paul’s suggestion, original resent model used the size of the input images of height x width = 224 x 224 pixels.

so, first one needs to know if your model is 3d, 4d model based color channels or other specific features which I don’t know.

Also in resnet, it is usually a random selection of image crop that one can choose from the original image, so it will depend on your filter and stride selection for your last layer.

you can also think about segmentation if your image size is too large for your model. But all it depends of your dataset size (number of images, size and depth)

2 Likes