CNN - Image Resizing VS Padding (keeping aspect ratio or not?) - Tech It Yourself


Sunday, 9 August 2020

CNN - Image Resizing VS Padding (keeping aspect ratio or not?)

Zero padding or resize According to Jeremy Howard, padding a big piece of the image (64x160 pixels) will have the following effect: The CNN will have to learn that the black part of the image is not relevant and does not help distinguishing between the classes (in a classification setting), as there is no correlation between the pixels in the black part and belonging to a given class. As you are not hard coding this, the CNN will have to learn it by gradient descent, and this might probably take some epochs. For this reason, you can do it if you have lots of images and computational power, but if you are on a budget on any of them, resizing should work better. 

But: Let's say that you normalize all the pixels to [0,1]. So the black pixels are all 0s. So that during convolution any kernel will output 0 for those pixels. it super easy to learn, and it's kind of automatic as well.

No comments:

Post a Comment

Thường mất vài phút để quảng cáo xuất hiện trên trang nhưng thỉnh thoảng, việc này có thể mất đến 1 giờ. Hãy xem hướng dẫn triển khai mã của chúng tôi để biết thêm chi tiết. Ðã xong