Answers.Body: <p>Resizing the images will work.But if you significantly reduce the image dimensions information IS lost. Here is a simple example. Suppose you have a 500 X 500 image. That has 250,000 pixels. Assume in these images the object of interest( lets say a bird in a forest) only occupies 10% of the pixels in the image(25,000 pixels). Now assume you reduce the image to 100 X 100 and thus have 10,000 pixels. Your object of interest (the bird) now only occupies 1000 pixels. These are the pixels the neural net will learn from.
  Now a better way to do this is to first crop your original 500 X 500 images to maximize the percentage of bird pixels in the cropped image. For example assume the resulting cropped image comes out to be say a 200 X 200 image but in that image the subject of interest(the bird) occupies 50% of the pixels (20,000 pixels). Now if you reduce the cropped image down to a 100 X 100 the object of interest will occupy(5000 pixels).
  Cropping images is of course a hassle. For some types like images for example images of people, and you are just interested in the faces there are routines available that will automatically crop the image to just the face. In general you will have to crop the images yourself.
  If you want to build high accuracy classifiers you have to start with a "robust" data set.
  The larger the percentage the object of interest takes up in the images the better your classifier will perform.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-02T18:36:31.737Z
Answers.LastActivityDate: 2020-03-02T18:36:31.737Z
Answers.UserDisplayName: Gerry P
Body: <p>I've just started with AI and CNN networks.</p>
  
  <p>I have two NIFTI images dataset, one with (240, 240) dimensions and the other one with (256, 132). Each dataset is front a different hospital and machine.</p>
  
  <p>If I want to use both to train my model. What do I have to do?</p>
  
  <p>The model needs to have all the train data with the same shape. I've thought to reshape all the data to have the same shape, but I don't know if I'm going to lose information if I reshape the images.</p>
  
  <p>By the way, I have also a third dataset with (232, 256).</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T08:49:45.593Z
Comments.Text: I'm a beginner as well but I suppose you could resize all of the images to a specific dimension (e.g 200x200). As far as I know, resized images do not lose information. Again, I'm not a professional.
Comments.UserDisplayName: JingleBells
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-02T05:50:55.020Z
Comments.Text: Yes, the standard way of handling this is to simply resize the images. If you can still interpret the image yourself, it's normally safe to say your CNN will be ok as well
Comments.UserDisplayName: Recessive
Tags: <convolutional-neural-networks><datasets><data-preprocessing>
Title: Using three image datasets with different image sizes to train a CNN
UserDisplayName: VansFannel
ThreadText: # Using three image datasets with different image sizes to train a CNN
  
  (Asked by: username_0 on 2020-03-01)
  
  I've just started with AI and CNN networks.
  
  I have two NIFTI images dataset, one with (240, 240) dimensions and the other one with (256, 132). Each dataset is front a different hospital and machine.
  
  If I want to use both to train my model. What do I have to do?
  
  The model needs to have all the train data with the same shape. I've thought to reshape all the data to have the same shape, but I don't know if I'm going to lose information if I reshape the images.
  
  By the way, I have also a third dataset with (232, 256).
  
  **Tags:** convolutional-neural-networks, datasets, data-preprocessing
  
  > **Comments:**
  > **username_1**: I'm a beginner as well but I suppose you could resize all of the images to a specific dimension (e.g 200x200). As far as I know, resized images do not lose information. Again, I'm not a professional.  
  > **username_2**: Yes, the standard way of handling this is to simply resize the images. If you can still interpret the image yourself, it's normally safe to say your CNN will be ok as well  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2020-03-02. Score: 0 | Accepted answer
  
  Resizing the images will work.But if you significantly reduce the image dimensions information IS lost. Here is a simple example. Suppose you have a 500 X 500 image. That has 250,000 pixels. Assume in these images the object of interest( lets say a bird in a forest) only occupies 10% of the pixels in the image(25,000 pixels). Now assume you reduce the image to 100 X 100 and thus have 10,000 pixels. Your object of interest (the bird) now only occupies 1000 pixels. These are the pixels the neural net will learn from.
  Now a better way to do this is to first crop your original 500 X 500 images to maximize the percentage of bird pixels in the cropped image. For example assume the resulting cropped image comes out to be say a 200 X 200 image but in that image the subject of interest(the bird) occupies 50% of the pixels (20,000 pixels). Now if you reduce the cropped image down to a 100 X 100 the object of interest will occupy(5000 pixels).
  Cropping images is of course a hassle. For some types like images for example images of people, and you are just interested in the faces there are routines available that will automatically crop the image to just the face. In general you will have to crop the images yourself.
  If you want to build high accuracy classifiers you have to start with a "robust" data set.
  The larger the percentage the object of interest takes up in the images the better your classifier will perform.
  
  
  ---
  
  