Body: <p>I have been reading up on 'regular' CNN's such as Mask R-CNN, and as far as I understand it they rely on a fully connected layer in the end to classify pixels. FCN's (such as U-Net) which do not use these layers are able to effectively process images of any size. I have been wondering why it is that Mask R-CNN can still process images of larger sizes. Doesn't that mean that a lot of data in the image will be unused in the fully connected layer?</p>
  <p>For example consider a Mask R-CNN model trained on 512x512 images, that then does inference on a 2048x2048 image. I would expect that to result in an error or at least very poor performance, but according to my results this is not the case.</p>
  <p>I also noticed that for some CNN models the image dimensions have to be some power of 2, is that due to implementation or also something that has to do with the connected layers?</p>
  <hr />
  <p>Edit:
  I've now found that the answer regarding image dimensions is <a href="https://stackoverflow.com/questions/66028743/how-to-handle-odd-resolutions-in-unet-architecture-pytorch">here</a>, it is due to the downsampling and upsampling.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-02T21:50:40.780Z
Comments.Text: Your question is not about all CNNs, but about FCNs, so I would suggest that you change the title to be more specific and precise.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-02T22:00:42.923Z
Comments.Text: My question actually is about CNNs, as FCNs can process larger images by design. If there is any other term that you can suggest instead of CNNs, I am happy to change it!
Comments.UserDisplayName: Cartman123
Tags: <convolutional-neural-networks><semantic-segmentation>
Title: Why CNN inference works on larger images
UserDisplayName: Cartman123
ThreadText: # Why CNN inference works on larger images
  
  (Asked by: username_0 on 2022-02-26)
  
  I have been reading up on 'regular' CNN's such as Mask R-CNN, and as far as I understand it they rely on a fully connected layer in the end to classify pixels. FCN's (such as U-Net) which do not use these layers are able to effectively process images of any size. I have been wondering why it is that Mask R-CNN can still process images of larger sizes. Doesn't that mean that a lot of data in the image will be unused in the fully connected layer?
  
  For example consider a Mask R-CNN model trained on 512x512 images, that then does inference on a 2048x2048 image. I would expect that to result in an error or at least very poor performance, but according to my results this is not the case.
  
  I also noticed that for some CNN models the image dimensions have to be some power of 2, is that due to implementation or also something that has to do with the connected layers?
  
  ---
  
  Edit:
  I've now found that the answer regarding image dimensions is [here](https://stackoverflow.com/questions/66028743/how-to-handle-odd-resolutions-in-unet-architecture-pytorch), it is due to the downsampling and upsampling.
  
  **Tags:** convolutional-neural-networks, semantic-segmentation
  
  > **Comments:**
  > **username_1**: Your question is not about all CNNs, but about FCNs, so I would suggest that you change the title to be more specific and precise.  
  > **username_0**: My question actually is about CNNs, as FCNs can process larger images by design. If there is any other term that you can suggest instead of CNNs, I am happy to change it!  
  
  ---
  
  ## 0 answers
  
  