[ACCEPTED]-How to input the image to the neural network?-pattern-recognition

Accepted answer
Score: 27

The easiest solution would be to normalize 27 all of your images, both for training and 26 testing, to have the same resolution. Also 25 the character in each image should be about 24 the same size. It is also a good idea to 23 use greyscale images, so each pixel would 22 give you just one number. Then you could 21 use each pixel value as one input to your 20 network. For instance, if you have images 19 of size 16x16 pixels, your network would 18 have 16*16 = 256 input neurons. The first 17 neuron would see the value of the pixel 16 at (0,0), the second at (0,1), and so on. Basically 15 you put the image values into one vector 14 and feed this vector into the network. This 13 should already work.

By first extracting 12 features (e.g., edges) from the image and 11 then using the network on those features, you 10 could perhaps increase the speed of learning 9 and also make the detection more robust. What 8 you do in that case is incorporating prior 7 knowledge. For character recognition you 6 know certain relevant features. So by extracting 5 them as a preprocessing step, the network 4 doesn't have to learn those features. However, if 3 you provide the wrong, i.e. irrelevant, features, the 2 network will not be able to learn the image 1 --> character mapping.

Score: 7

The name for the problem you're trying to 13 solve is "feature extraction". It's decidedly non-trivial 12 and a subject of active research.

The naive 11 way to go about this is simply to map each 10 pixel of the image to a corresponding input 9 neuron. Obviously, this only works for images 8 that are all the same size, and is generally 7 of limited effectiveness.

Beyond this, there 6 is a host of things you can do... Gabor 5 filters, Haar-like features, PCA and ICA, sparse 4 features, just to name a few popular examples. My 3 advice would be to pick up a textbook on 2 neural networks and pattern recognition 1 or, specifically, optical character recognition.

Score: 3

All these considerations about applying 6 NNs to images are covered in our 2002 review paper (Feature 5 based, pixel based, scale invariance, etc.)

Your 4 biggest challenge is the so-called 'curse 3 of dimensionality'.

I would compare NN-performance 2 with that of a support vector machine (tricky 1 which kernels to use).

Score: 1

You can use as input the actual pixels. This 6 is why sometimes it is preferable to use 5 smaller resolution of the input images.

The 4 nice thing about ANN is that they are somehow 3 capable of feature selection (ignoring non-important 2 pixels by assigning near-zero weights for 1 those input nodes)

Score: 0

Here are some steps: make sure your color/ grey 5 scale image is a binary image. To do this, perform 4 some thresholding operation. following that 3 some sort of feature extraction. For OCR 2 / NN stuff this example might help, although 1 in ruby : https://github.com/gbuesing/neural-net-ruby/blob/master/examples/mnist.rb

More Related questions