Guix
Guix

Reputation: 23

Mnist pixel borders

I'm currently playing with tensorflow and mnist code. The mnist dataset from Yann Lecun contain 20x20 pixel images which were centered in a 28x28 image by computing the center of mass of the pixels. The result is to have at least a 4 pixels border which improve the result analisys. I've searched and read a lot on mnist but I cannot find why 4 pixels were used. I'm computing 100x100 pixel images with 5 pixel border within, but I have no idea if this enough or not. I could try to change the border size and compare results but this would take me ages. Knowledge and applying good practices are better I think. So how to define the best border size?

Upvotes: 2

Views: 503

Answers (1)

Pete Warden
Pete Warden

Reputation: 2878

In my experience it's not common practice to use borders at all, outside of MNIST. If you're trying to recognize objects within images (rather than digits) you should just supply the whole image, possibly with some random cropping or other distortions to help the learning process. The best practices for other tasks will vary with the domain, but generally comes from fairly common-sense intuitions about the inputs the model is likely to encounter in production.

Upvotes: 3

Related Questions