Neural network input data, cartesian plane x/y coordinates, correlate with Handwriting
I am very curious about making a handwriting recognition application in a web browser. Users draw a letter, ajax sends the data to the server, neural network finds the closest match, and returns results. So if you draw an a, the first result should be an a, then o, then e, something like that.
I 开发者_如何学JAVAdon't know much about neural networks. What kinda data would I need to pass to the NN. Could it be an array of the x/y coordinates where the user has drawn on a pad. Or what type of data is the neural network expecting or would produce the best results for handwriting?
Commonly, simple NNs for image/handwriting recognition take a 2-d boolean matrix as input; i.e., a black-and-white bitmap. Make sure you have a training set of these available; or let the user train the algorithm using online backprop learning.
@FrustratedWithFormsDesigner's suggestion of also sending the order could make the NN a lot "smarter", but if you're just learning, try the bitmap version first and see how well it works. Also, play with the bitmap granularity. Maybe try digit recognition first, there are standard datasets for that problem on the web.
Not only would you need to send the X/Y coordinates, but also the ORDER they were drawn in. So a path might be better than just a set of points. A neural net should be able to handle it, and there are many ways it could. One way might be to divide up the path into n segments for n neurons and have each neuron recognize a piece of the letter.
The basic process is to accumulate a number of examples of each letter to be identified, pre-process the raw data, train a collection of candidate models and choose a final model based on test performance on a separate, holdout set of data.
The nature of the pre-processing will depend on the data you collect. If it is "connect the dots" pen movement data, then it may be simplest to divide the image into regions, and summarize by the number of dots per region. If, instead, you are recording a raster image, other pre-processing would be useful, such as simple statistics and vertical and horizontal projection profiles (row and column averages).
"Dr. Dobb's Journal" ran a handprinting recognition contest some years ago (using electronic ink data). You can read about it here:
http://www.drdobbs.com/184408743;jsessionid=IG5ALGCW1HZZVQE1GHPCKH4ATMY32JVN?pgno=4
...and here:
http://www.drdobbs.com/184408923;jsessionid=IG5ALGCW1HZZVQE1GHPCKH4ATMY32JVN?pgno=2
精彩评论