Possible improvements and potential applications

We have illustrated how to build an ANN, feed it training data, and use it for classification. There are a number of aspects we can improve, depending on the task at hand, and a number of potential applications of our new-found knowledge.

Improvements

There are a number of improvements that can be applied to this approach, some of which we have already discussed:

  • For example, you could enlarge your dataset and iterate more times, until a performance peak is reached
  • You could also experiment with the several activation functions (cv2.ml.ANN_MLP_SIGMOID_SYM is not the only one; there is also cv2.ml.ANN_MLP_IDENTITY and cv2.ml.ANN_MLP_GAUSSIAN)
  • You could utilize different training flags (cv2.ml.ANN_MLP_UPDATE_WEIGHTS, cv2.ml.ANN_MLP_NO_INPUT_SCALE, cv2.ml.ANN_MLP_NO_OUTPUT_SCALE), and training methods (back propagation or resilient back propagation)

Aside from that, bear in mind one of the mantras of software development: there is no single best technology, there is only the best tool for the job at hand. So, careful analysis of the application requirements will lead you to the best choices of parameters. For example, not everyone draws digits the same way. In fact, you will even find that some countries draw numbers in a slightly different way.

The MNIST database was compiled in the US, in which the number seven is drawn like the character 7. But you will find that the number 7 in Europe is often drawn with a small horizontal line half way through the diagonal portion of the number, which was introduced to distinguish it from the number 1.

Note

For a more detailed overview of regional handwriting variations, check the Wikipedia article on the subject, which is a good introduction, available at https://en.wikipedia.org/wiki/Regional_handwriting_variation.

This means the MNIST database has limited accuracy when applied to European handwriting; some numbers will be classified more accurately than others. So you may end up creating your own dataset. In almost all circumstances, it is preferable to utilize the train data that's relevant and belongs to the current application domain.

Finally, remember that once you're happy with the accuracy of your network, you can always save it and reload it later, so it can be utilized in third-party applications without having to train the ANN every time.

Potential applications

The preceding program is only the foundation of a handwriting recognition application. Straightaway, you can quickly extend the earlier approach to videos and detect handwritten digits in real-time, or you could train your ANN to recognize the entire alphabet for a full-blown OCR system.

Car registration plate detection seems like an obvious extension of the lessons learned to this point, and it should be an even easier domain to work with, as registration plates use consistent characters.

Also, for your own edification or business purposes, you may try to build a classifier with ANNs and plain SVMs (with feature detectors such as SIFT) and see how they benchmark.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.237.29