神经网络输入数据,笛卡尔平面x/y坐标,与手写相关
我很好奇在网络浏览器中制作手写识别应用程序。用户画一个字母,ajax将数据发送到服务器,神经网络找到最接近的匹配,并返回结果。所以如果你画一个 a,第一个结果应该是 a,然后是 o,然后是 e,类似的东西。
我对神经网络了解不多。我需要将什么样的数据传递给神经网络。它可能是用户在键盘上绘制的 x/y 坐标的数组吗?或者神经网络期望什么类型的数据或会产生最佳的手写结果?
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 don'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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通常,用于图像/手写识别的简单神经网络采用二维布尔矩阵作为输入;即黑白位图。确保您有可用的训练集;或者让用户使用在线反向传播学习来训练算法。
@FrusteratedWithFormsDesigner 提出的同时发送订单的建议可以使 NN 变得“更智能”,但如果您只是在学习,请先尝试位图版本,看看它的工作效果如何。另外,还可以调整位图的粒度。也许首先尝试数字识别,网络上有针对该问题的标准数据集。
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.
您不仅需要发送 X/Y 坐标,还需要发送它们的绘制顺序。因此路径可能比一组点更好。神经网络应该能够处理它,并且有很多方法可以做到这一点。一种方法可能是将路径分成 n 个神经元的 n 段,并让每个神经元识别一段字母。
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.
基本过程是积累每个要识别的字母的多个示例,预处理原始数据,训练候选模型集合,并根据单独的保留数据集的测试性能选择最终模型。
预处理的性质将取决于您收集的数据。如果是“连接点”笔移动数据,那么最简单的方法可能是将图像划分为区域,并按每个区域的点数进行汇总。相反,如果您正在记录光栅图像,则其他预处理将很有用,例如简单的统计数据以及垂直和水平投影配置文件(行和列平均值)。
“多布博士的日记”几年前举办了一次手印识别比赛(使用电子墨水数据)。您可以在这里阅读:
http://www.drdobbs.com/184408743; jsessionid=IG5ALGCW1HZZVQE1GPCKH4ATMY32JVN?pgno=4
...这里:
http: //www.drdobbs.com/184408923;jsessionid=IG5ALGCW1HZZVQE1GHPCKH4ATMY32JVN?pgno=2
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