Training feedforward neural network for OCR [closed]

允我心安 提交于 2019-11-28 06:03:44

For handwritten character recognition you need

  1. many training examples (maybe you should create distortions of your training set)
  2. softmax activation function in the output layer
  3. cross entropy error function
  4. training with stochastic gradient descent
  5. a bias in each layer

A good test problem is the handwritten digit data set MNIST. Here are papers that successfully applied neural networks on this data set:

Y. LeCun, L. Bottou, Y. Bengio and P. Haffner: Gradient-Based Learning Applied to Document Recognition, http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf

Dan Claudiu Ciresan, Ueli Meier, Luca Maria Gambardella, Juergen Schmidhuber: Deep Big Simple Neural Nets Excel on Handwritten Digit Recognition, http://arxiv.org/abs/1003.0358

I trained an MLP with 784-200-50-10 architecture and got >96% accuracy on the test set.

You probably want to follow Lectures 3 and 4 at http://www.ml-class.org. Professor Ng has solved this exact problem. He is classifying 10 digits (0...9). Some of the things that he did in the class that gets him to a 95% training accuracy are :

  • Input Nueron : 400 (20x20)
    • Hidden Layers : 2
    • Size of hidden layers : 25
    • Activation function : sigmoid
    • Training method : gradient descent
    • Data size : 5000

Examine this example program Handwritten Digit Recognation

Program uses a Semeion Handwritten Digit Data Set with FANN library

I had a similar problem some time ago trying to identify handwritten digits using the MNIST dataset. My feedforward neural net was giving an accuracy of about 92% on the validation set but was frequently misclassifying the images I gave it.

I fixed this problem by adding a hidden layer in my net and using RMSProp. The net now gives around 97% accuracy and correctly classifies the images that I give it.

Moreover, if your cost isn't decreasing, it probably means that your learning rate is too high or your net is probably stuck in a local minima. In such a situation, you could try decreasing your learning rate and initial weights.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!