Answers.Body: <p>I disagree with SickerDude43, and I think the linked SO post isn't relevant in this case. Well you haven't told us what does your network's model look like, but I assume it should understand the notation and output the notes, the key and maybe even tempo (sorry my musical education is rusty).</p>
  <p>Your inputs are naturally wider than tall, and it doesn't make sense to for example pad them with white pixels or scale to a square aspect ratio. But if you use rectangular kernels, you cannot stack that many of them before your image's height becomes just one pixel while the width is still in the hundreds. That is why I suggest you to specify non-rectangular kernel shapes, so that the network's output dimension resembles more of a rectangle.</p>
  <p>On the face value, your problem seems non-trivial if the notation on the left edge of the image impacts the correct interpretation of the rest of the notes. Then again, maybe a few fully connected (dense) layers can solve without problems.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-27T16:17:50.027Z
Answers.LastActivityDate: 2023-01-27T16:17:50.027Z
Answers.UserDisplayName: NikoNyrh
Answers.Body: <p>I'd like to post this as a comment, but I don't have enough repo for that.</p>
  <p>But your question already exists. You'll find your answer there.
  <a href="https://stats.stackexchange.com/questions/240690/non-square-images-for-image-classification">https://stats.stackexchange.com/questions/240690/non-square-images-for-image-classification</a></p>
  <p>Quick summary: CNN can take non-Squared images for your model. However it's better to just stick with Squared Images. There are workarounds to ensure that property. If there's no other way, you can just try it out and evaluate your results.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-27T09:31:01.993Z
Answers.LastActivityDate: 2023-01-27T09:52:14.550Z
Answers.LastEditDate: 2023-01-27T09:52:14.550Z
Answers.UserDisplayName: SickerDude43
Body: <p>I want to create a music sheet scanner using CNN Model and the images I am using are not squared and, if I make them squared, important data will be lost and it might confuse the model.</p>
  <p>Is it ok to use longer pictures? If yes, what sizes should I use for a picture like the one below?</p>
  <p>For the CNN model I will have to use different scales for the layers, I will not be able to use the 3x3 layer anymore, right?</p>
  <p>I am still a beginner, so I am learning these things now without having previous experience in this field.</p>
  <p><a href="https://i.sstatic.net/oWBzX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oWBzX.png" alt="enter image description here" /></a></p>
  
Tags: <machine-learning><convolutional-neural-networks><data-preprocessing><convolutional-layers><optical-character-recognition>
Title: Would it be a problem to use non-squared images for a CNN model?
UserDisplayName: CelticusAndy
ThreadText: # Would it be a problem to use non-squared images for a CNN model?
  
  (Asked by: username_0 on 2023-01-26)
  
  I want to create a music sheet scanner using CNN Model and the images I am using are not squared and, if I make them squared, important data will be lost and it might confuse the model.
  
  Is it ok to use longer pictures? If yes, what sizes should I use for a picture like the one below?
  
  For the CNN model I will have to use different scales for the layers, I will not be able to use the 3x3 layer anymore, right?
  
  I am still a beginner, so I am learning these things now without having previous experience in this field.
  
  [![enter image description here](https://i.sstatic.net/oWBzX.png)](https://i.sstatic.net/oWBzX.png)
  
  **Tags:** machine-learning, convolutional-neural-networks, data-preprocessing, convolutional-layers, optical-character-recognition
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-01-27. Score: 1
  
  I disagree with SickerDude43, and I think the linked SO post isn't relevant in this case. Well you haven't told us what does your network's model look like, but I assume it should understand the notation and output the notes, the key and maybe even tempo (sorry my musical education is rusty).
  
  Your inputs are naturally wider than tall, and it doesn't make sense to for example pad them with white pixels or scale to a square aspect ratio. But if you use rectangular kernels, you cannot stack that many of them before your image's height becomes just one pixel while the width is still in the hundreds. That is why I suggest you to specify non-rectangular kernel shapes, so that the network's output dimension resembles more of a rectangle.
  
  On the face value, your problem seems non-trivial if the notation on the left edge of the image impacts the correct interpretation of the rest of the notes. Then again, maybe a few fully connected (dense) layers can solve without problems.
  
  
  ---
  
  ### Answer by username_2 on 2023-01-27. Score: 0
  
  I'd like to post this as a comment, but I don't have enough repo for that.
  
  But your question already exists. You'll find your answer there.
  <https://stats.stackexchange.com/questions/240690/non-square-images-for-image-classification>
  
  Quick summary: CNN can take non-Squared images for your model. However it's better to just stick with Squared Images. There are workarounds to ensure that property. If there's no other way, you can just try it out and evaluate your results.
  
  
  ---
  
  