Answers.Body: <p>Almost always people will resize all their images to the same size before sending them to the CNN.  Unless you're up for a real challenge this is probably what you should do.</p>
  
  <p>That said, it is <em>possible</em> to build a single CNN that takes input of images as varying dimensions.  There are a number of ways you might try to do this, and I'm not aware of any published science analyzing these different choices.  The key is that the set of learned parameters needs to be shared between the different inputs sizes.  While convolutions can be applied at different images sizes, ultimately they always get converted to a single vector to make predictions with, and the size of that vector will depend on the geometries of the inputs, convolutions and pooling layers.  You'd probably want to dynamically change the pooling layers based on the input geometry and leave the convolutions the same, since the convolutional layers have parameters and pooling usually doesn't.  So on bigger images you pool more aggressively.</p>
  
  <p>Practically you'd want to group together similarly (identically) sized images together into minibatches for efficient processing.  This is common for LSTM type models.  This technique is commonly called "bucketing".  See for example <a href="http://mxnet.io/how_to/bucketing.html" rel="nofollow noreferrer">http://mxnet.io/how_to/bucketing.html</a> for a description of how to do this efficiently.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T09:38:19.743Z
Answers.Text: what are the side-effects of resizing images into a fixed size? I mean once you fix it, you are bound to lose the aspect ratio of the images.
Answers.UserDisplayName: bit_scientist
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-30T19:01:29.610Z
Answers.LastActivityDate: 2016-11-30T19:01:29.610Z
Answers.UserDisplayName: Leopd
Body: <p>I am new to deep learning. </p>
  
  <p>I have a dataset of images of varying dimensions of a certain object. A few images of the object are also in varying orientations. The objective is to learn the features of the object (using Autoencoders). </p>
  
  <p>Is it possible to create a network with layers that account for varying dimensions and orientations of the input image, or should I strictly consider a dataset containing images of uniform dimensions? What is the necessary criteria of an eligible dataset to be used for training a Deep Network in general.</p>
  
  <p>The idea is, I want to avoid pre-processing my dataset by normalizing it via scaling, re-orienting operations etc. I would like my network to account for the variability in dimensions and orientations. Please point me to resources for the same. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-29T03:48:55.857Z
Comments.Text: Can you provide example inputs?
Comments.UserDisplayName: dynrepsys
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-29T20:49:59.417Z
Comments.Text: Consider a dataset consisting of images of bananas. They are of varying sizes 265x525 px, 1200x1200 px, 165x520 px etc. 90% of the images display the banana in one orthogonal orientation and the rest display the banana in varying orientations such as isometric views.. I hope this helps
Comments.UserDisplayName: Jugesh Sundram
Tags: <deep-learning><deep-neural-networks><datasets>
Title: Dataset containing images of varying dimensions and orientations
UserDisplayName: Jugesh Sundram
ThreadText: # Dataset containing images of varying dimensions and orientations
  
  (Asked by: username_0 on 2016-11-28)
  
  I am new to deep learning.
  
  I have a dataset of images of varying dimensions of a certain object. A few images of the object are also in varying orientations. The objective is to learn the features of the object (using Autoencoders).
  
  Is it possible to create a network with layers that account for varying dimensions and orientations of the input image, or should I strictly consider a dataset containing images of uniform dimensions? What is the necessary criteria of an eligible dataset to be used for training a Deep Network in general.
  
  The idea is, I want to avoid pre-processing my dataset by normalizing it via scaling, re-orienting operations etc. I would like my network to account for the variability in dimensions and orientations. Please point me to resources for the same.
  
  **Tags:** deep-learning, deep-neural-networks, datasets
  
  > **Comments:**
  > **username_1**: Can you provide example inputs?  
  > **username_0**: Consider a dataset consisting of images of bananas. They are of varying sizes 265x525 px, 1200x1200 px, 165x520 px etc. 90% of the images display the banana in one orthogonal orientation and the rest display the banana in varying orientations such as isometric views.. I hope this helps  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-11-30. Score: 1
  
  Almost always people will resize all their images to the same size before sending them to the CNN. Unless you're up for a real challenge this is probably what you should do.
  
  That said, it is *possible* to build a single CNN that takes input of images as varying dimensions. There are a number of ways you might try to do this, and I'm not aware of any published science analyzing these different choices. The key is that the set of learned parameters needs to be shared between the different inputs sizes. While convolutions can be applied at different images sizes, ultimately they always get converted to a single vector to make predictions with, and the size of that vector will depend on the geometries of the inputs, convolutions and pooling layers. You'd probably want to dynamically change the pooling layers based on the input geometry and leave the convolutions the same, since the convolutional layers have parameters and pooling usually doesn't. So on bigger images you pool more aggressively.
  
  Practically you'd want to group together similarly (identically) sized images together into minibatches for efficient processing. This is common for LSTM type models. This technique is commonly called "bucketing". See for example <http://mxnet.io/how_to/bucketing.html> for a description of how to do this efficiently.
  
  > **Comments:**
  > **username_3**: what are the side-effects of resizing images into a fixed size? I mean once you fix it, you are bound to lose the aspect ratio of the images.  
  
  ---
  
  