摘 要
深度学习是传统机器学习下的一个分支,得益于近些年来计算机硬件计算能力质的飞跃,使得深度学习成为了当下热门之一。手写数字识别更是深度学习入门的经典案例,学习和理解其背后的原理对于深度学习的理解有很重要的作用。
本文将采用深度学习中的BP神经网络来训练手写数字识别模型。使用BP神经网络建立合理的模型结构,利用BP层中设定一定数目的BP核(即滤波器),通过训练数据使模型学习到能够反映出十个不同手写提数字特征的BP核权值,最后通过全连接层使用softmax函数给出预测数字图对应每种数字可能性的概率多少。
本文以学习基于深度学习的手写数字识别算法的过程为线索,由简入深,从最基础的感知器到BP神经网络,学习和理解深度学习的相关基本概念、模型建立以及训练过程。最后通过使用深度学习框架Keras以MNIST作为训练数据集训练出高识别率的模型并将其与OpenCV技术结合应用到摄像头上实现实时识别数字,使用合理的模型结构,在测试集上识别准确率达到99%以上,在与摄像头结合实际应用中的识别效果达到90%以上。
关键词:深度学习,BP神经网络,MNIST,OpenCV;手写数字识别
ABSTRACT
Deep learning is a branch of traditional machine learning. Thanks to the qualitative leap of computer hardware computing power in recent years, deep learning has become one of the current popular topics. Handwritten number recognition is a classic case of deep learning introduction. Learning and understanding the principles behind it plays a very important role in the understanding of deep learning.
In this paper, the BP neural network in deep learning will be used to train the handwritten digit recognition model. Using BP neural network to establish a reasonable model structure, using the BP layer set a certain number of BP core (i. e., filter), by training the model to reflect the ten different handwritten numerical characteristics of BP nuclear weights, finally through the full connection layer using softmax function to predict the probability of each number possibility.
This paper takes the process of learning the handwritten digit recognition algorithm based on deep learning as a clue, from simple to deep, from the most basic perceptron to BP neural network, learning and understanding the relevant basic concepts of deep learning. Finally by using deep learning framework Keras to MNIST as training data set training high recognition rate model and combined with OpenCV technology applied to the camera to realize real-time recognition number, using reasonable model structure, recognition accuracy above 99%, in combination with the practical application of camera recognition effect of more than 90%.
Key words: deep learning, BP neural network, MNIST, OpenCV; Handwritten digit recognition