I am doing some experimentation on neural networks, and for that I am trying to program a plain OCR task. I have learned CNNs are the best choice ,but for the time being and due to my inexperience, I wanna go step by step and start with feedforward nets.

So my training data is a set of roughly 400 16*16 images extracted from a script that draws every alphabet char in a tiny image for a small set of fonts registered in my computer.

Then the test data set is extracted from the same procedure, but for all fonts in my computer.

Well, results are quite bad. Get an accuracy of aprox. 45-50%, which is very poor... but that's not my question.

The point is that I can't get the MSE below 0.0049, no matter what hidden layer distribution I apply to the net. I have tried with several architectures and all comes down to this figure. Does that mean the net cannot learn any further given the data?

This MSE value however throws this poor results too.

I am using Tensorflow API directly, no keras or estimators and for a list of 62 recognizable characters these are examples of the architectures I have used: [256,1860,62] [256,130,62] [256,256, 128 ,62] [256,3600,62] ....

But never get the MSE below 0.0049, and still results are not over 50%.

Any hints are greatly appreciated.

  • $\begingroup$ actually it's not only about architecture, how about your learning rate value? have you try to tune it? how about the number of your training epoch? $\endgroup$ – malioboro Mar 4 '19 at 22:23
  • $\begingroup$ 400 training examples is quite a small number, I think, in order to solve this task. You will need thousands of pictures in order to achieve good results, I guess. $\endgroup$ – nbro Mar 5 '19 at 10:04
  • $\begingroup$ How many categories do you have? Is it 26? $\endgroup$ – DuttaA Mar 5 '19 at 10:33
  • $\begingroup$ No 62. The output of the net is a one-hot array, each position corresponding to a different character to recognize $\endgroup$ – Chal.lo Mar 6 '19 at 7:44

If you are serious about OCR systems and not just trying to learn CNN, start with a known good OSS product like tesseract. OCR some 1200 DPI grayscale documents, reverse engineer it to some degree so that you understand the design, join the development team, and pick up a ticket or two. Once you get into pull requests for a real system that is in constant use for a while, you will be an expert. Starting from scratch would make sense after you are an expert.


I would recommend using a larger dataset. The MNIST or EMNIST datasets are great for training OCRs. Also, how many generations are you training your network for.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.